/* Little Hello design system: "Wrapped". Every page is a gift.
   One stylesheet for the whole site; /design shows every piece. Nunito throughout. */

/* ── Tokens ───────────────────────────────────────────── */
:root {
  color-scheme: light only;
  /* Color */
  --paper: #FAFBF7;        /* page */
  --forest: #183E35;       /* text, ribbon, primary buttons */
  --forest-deep: #0D2620;  /* button lift, ribbon shadow */
  --soft: #3D5D55;         /* secondary text */
  --butter: #F6DF8B;       /* wrapping paper, gifts */
  --butter-deep: #EACB5E;  /* paper print, folds */
  --sky: #DEEDF4;          /* message threads, morning */
  --rose: #F3DDD9;         /* gift tags, notes */
  --rose-deep: #E4B8AF;    /* tag edges */
  --line: #D6DED9;         /* borders */
  --bad: #B4381F;          /* errors */

  /* Type */
  --font: "Nunito", ui-rounded, system-ui, sans-serif;
  --t-xs: 0.8125rem; --t-sm: 0.9375rem; --t-md: 1.0625rem; --t-lg: 1.25rem;
  --t-xl: 1.625rem; --t-2xl: 2.25rem; --t-3xl: clamp(2.5rem, 10vw, 3.5rem);

  /* Shape and depth */
  --r-pill: 999px; --r-card: 28px; --r-bubble: 20px; --r-small: 12px;
  --lift: 0 6px 0 var(--forest-deep);
  --float: 0 14px 30px rgba(24, 62, 53, 0.14);
  --ease-pop: cubic-bezier(0.3, 1.6, 0.5, 1);
  --ease-out: cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--forest); font: 400 var(--t-md)/1.5 var(--font); }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; border-radius: 6px; }
/* Page width: narrow by default (gift and thank-you pages feel like a card); pages set --page to read or fill wider. */
.lh-column { max-width: var(--page, 35rem); margin-inline: auto; padding-inline: 20px; }

/* Type roles */
.lh-display { font-size: var(--t-3xl); font-weight: 900; line-height: 1.02; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
.lh-title { font-size: var(--t-xl); font-weight: 900; line-height: 1.15; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.lh-lede { font-size: var(--t-lg); color: var(--soft); margin: 0; }
.lh-body { font-size: var(--t-md); margin: 0; }
.lh-small { font-size: var(--t-sm); color: var(--soft); margin: 0; }

/* ── Surfaces ─────────────────────────────────────────── */

/* Wrapping paper: butter, printed with small hellos in many languages. */
.lh-paper {
  background-color: var(--butter);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='170' viewBox='0 0 260 170'%3E%3Cg fill='%23E2C04F' font-family='Nunito,Arial Rounded MT Bold,sans-serif' font-weight='800' font-size='15'%3E%3Ctext x='8' y='26' transform='rotate(-8 8 26)'%3Ehola%3C/text%3E%3Ctext x='120' y='30' transform='rotate(6 120 30)'%3Enamaste%3C/text%3E%3Ctext x='60' y='78' transform='rotate(4 60 78)'%3Ebonjour%3C/text%3E%3Ctext x='186' y='86' transform='rotate(-6 186 86)'%3Ehei%3C/text%3E%3Ctext x='14' y='130' transform='rotate(7 14 130)'%3Eciao%3C/text%3E%3Ctext x='112' y='136' transform='rotate(-5 112 136)'%3Esalaam%3C/text%3E%3Ctext x='200' y='160' transform='rotate(5 200 160)'%3Ehallo%3C/text%3E%3C/g%3E%3Cg fill='%23F0D272'%3E%3Ccircle cx='100' cy='54' r='3'/%3E%3Ccircle cx='236' cy='40' r='2.5'/%3E%3Ccircle cx='46' cy='104' r='2.5'/%3E%3Ccircle cx='170' cy='118' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 260px 170px;
}

/* Ribbon: a forest band, vertical by default; .lh-ribbon--across for horizontal. */
.lh-ribbon { position: absolute; top: 0; bottom: 0; left: 50%; width: 28px; translate: -50% 0;
  background: linear-gradient(90deg, var(--forest-deep) 0 3px, var(--forest) 3px calc(100% - 3px), var(--forest-deep) calc(100% - 3px)); }
.lh-ribbon--across { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: 28px; translate: 0 -50%;
  background: linear-gradient(180deg, var(--forest-deep) 0 3px, var(--forest) 3px calc(100% - 3px), var(--forest-deep) calc(100% - 3px)); }
.lh-bow { position: absolute; width: 132px; height: 86px; translate: -50% -50%;
  filter: drop-shadow(0 0 0 var(--paper)) drop-shadow(0 4px 0 rgba(13, 38, 32, 0.25)); }
.lh-bow path:first-child, .lh-bow path:nth-child(2) { stroke: var(--butter); stroke-width: 2.5; }

/* Gift tag: butter card on a string, slightly turned; holds the giver's note. White on wrapping paper, so it shows. */
.lh-tag { position: relative; background: var(--butter); border-radius: 10px 22px 22px 10px; padding: 18px 20px 18px 34px;
  box-shadow: var(--float); rotate: -2deg; max-width: 22rem; }
.lh-tag::before { /* punched hole */ content: ""; position: absolute; left: 12px; top: 50%; width: 10px; height: 10px;
  translate: 0 -50%; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--butter-deep); }
.lh-paper .lh-tag, .lh-gift-wrap .lh-tag { background: var(--paper); }
.lh-tag p { margin: 0; font-size: var(--t-lg); font-weight: 700; line-height: 1.35; }
.lh-tag .lh-tag-from { margin-top: 8px; font-size: var(--t-sm); font-weight: 800; color: var(--soft); }

/* Card: plain white content surface. Use sparingly; most content sits on the page. */
.lh-card { background: #fff; border: 2px solid var(--line); border-radius: var(--r-card); padding: 20px; }

/* Morning sky: the background for previews of what arrives. */
.lh-sky { background: radial-gradient(120% 70% at 85% 0%, #FFF6D6 0 18%, transparent 46%), linear-gradient(180deg, var(--sky), var(--paper)); }

/* ── Previews ─────────────────────────────────────────── */
.lh-phone { width: min(300px, 100%); margin-inline: auto; background: var(--forest); border-radius: 44px; padding: 10px;
  box-shadow: var(--float); }
.lh-phone-screen { background: var(--sky); border-radius: 36px; padding: 34px 12px 18px; min-height: 380px; position: relative; overflow: hidden; }
.lh-phone-screen::before { /* the notch */ content: ""; position: absolute; top: 10px; left: 50%; width: 84px; height: 20px;
  translate: -50% 0; border-radius: 12px; background: var(--forest); }
.lh-thread { display: grid; gap: 8px; }
.lh-stamp { text-align: center; font-size: var(--t-xs); font-weight: 800; color: var(--soft); margin: 0 0 4px; }
.lh-bubble { max-width: 86%; border-radius: var(--r-bubble) var(--r-bubble) var(--r-bubble) 6px; background: var(--paper);
  font-size: 15px; line-height: 1.42; white-space: pre-line; overflow: hidden; }
.lh-bubble > div { padding: 10px 13px 12px; }
.lh-bubble img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.lh-bubble--me { justify-self: end; background: var(--forest); color: var(--paper); font-weight: 800;
  border-radius: var(--r-bubble) var(--r-bubble) 6px var(--r-bubble); padding: 9px 16px; }
.lh-typing { display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--paper); border-radius: var(--r-bubble) var(--r-bubble) var(--r-bubble) 6px; width: max-content; }
.lh-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--soft); opacity: 0.5; animation: lh-dot 1s infinite; }
.lh-typing i:nth-child(2) { animation-delay: 0.15s; } .lh-typing i:nth-child(3) { animation-delay: 0.3s; }

/* Hello chips: the floating greetings. */
.lh-hello { display: inline-block; font-weight: 900; font-size: 15px; padding: 7px 13px; background: var(--paper);
  border-radius: 18px 18px 18px 4px; box-shadow: 0 2px 0 rgba(24, 62, 53, 0.12); }
.lh-hello:nth-child(2n) { background: var(--sky); border-radius: 18px 18px 4px 18px; }
.lh-hello:nth-child(3n) { background: var(--rose); }

/* ── Affordances ──────────────────────────────────────── */
.lh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer;
  font: 900 var(--t-lg)/1 var(--font); text-decoration: none; padding: 18px 28px; border-radius: var(--r-pill);
  background: var(--forest); color: var(--paper); box-shadow: var(--lift); transition: translate 0.08s, box-shadow 0.08s; }
.lh-btn:active { translate: 0 4px; box-shadow: 0 2px 0 var(--forest-deep); }
.lh-btn--block { display: flex; width: 100%; }
.lh-btn--paper { background: var(--paper); color: var(--forest); box-shadow: 0 5px 0 var(--forest); border: 2px solid var(--forest); }
.lh-btn--quiet { background: transparent; color: var(--forest); box-shadow: none; padding: 12px 6px; font-size: var(--t-md);
  text-decoration: underline; text-decoration-thickness: 2px; }

/* Choice: pick between objects (a wrapped box or a phone), not a checkbox. */
.lh-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lh-choice { position: relative; display: grid; justify-items: center; gap: 8px; padding: 18px 12px 16px; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--r-card); background: #fff; text-align: center; transition: border-color 0.15s, translate 0.15s; }
.lh-choice input { position: absolute; opacity: 0; pointer-events: none; }
.lh-choice svg { width: 76px; height: 76px; }
.lh-choice b { font-size: var(--t-md); font-weight: 900; }
.lh-choice small { font-size: var(--t-sm); color: var(--soft); }
.lh-choice:hover { translate: 0 -2px; }
.lh-choice:has(input:checked) { border-color: var(--forest); background: var(--butter); box-shadow: 0 5px 0 var(--forest); }
.lh-choice:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: 3px; }
.lh-choice .lh-choice-bow { position: absolute; top: -14px; right: 14px; width: 40px; scale: 0; transition: scale 0.35s var(--ease-pop); }
.lh-choice:has(input:checked) .lh-choice-bow { scale: 1; }

/* Add-on chip: an extra that's off until chosen. */
.lh-addon { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 2px dashed var(--line); border-radius: var(--r-card);
  cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.lh-addon input { width: 24px; height: 24px; accent-color: var(--forest); flex: none; }
.lh-addon:has(input:checked) { border-style: solid; border-color: var(--forest); background: var(--butter); }
.lh-addon b { display: block; font-weight: 900; }
.lh-addon span { color: var(--soft); font-size: var(--t-sm); }
.lh-addon.gift-check svg { width: 52px; height: 52px; flex: none; margin-left: auto; } /* the gift box: a big choice as an object */
.lh-addon .lh-price { margin-left: auto; font-weight: 900; color: var(--forest); font-size: var(--t-lg); }

/* Fields */
.lh-field { display: grid; gap: 6px; }
.lh-field label { font-weight: 800; font-size: var(--t-sm); }
.lh-input { width: 100%; font: inherit; color: inherit; background: #fff; border: 2px solid var(--line); border-radius: 14px;
  padding: 13px 14px; min-height: 52px; transition: border-color 0.15s; }
.lh-input:focus { outline: none; border-color: var(--forest); }
.lh-input[aria-invalid="true"] { border-color: var(--bad); }
/* An empty date field: hide the date Safari draws in it, and show the hint until it's focused (lh.js marks .is-empty). */
.lh-date { position: relative; }
.lh-date .lh-input.is-empty:not(:focus) { color: transparent; }
.lh-date-hint { display: none; position: absolute; left: 16px; top: 50%; translate: 0 -50%; color: var(--soft); pointer-events: none; }
.lh-date:has(.is-empty:not(:focus)) .lh-date-hint { display: block; }
/* A dialog: one question, said back, with the answer as big buttons. */
.lh-dialog { width: min(100% - 32px, 26rem); border: 0; border-radius: var(--r-card); padding: 24px 20px 20px; background: var(--paper);
  color: var(--forest); box-shadow: 0 24px 48px rgba(24, 62, 53, 0.25); }
.lh-dialog::backdrop { background: rgba(24, 62, 53, 0.45); }
.lh-dialog[open] { display: grid; gap: 12px; animation: lh-rise 0.3s var(--ease-out) both; }
.lh-dialog .lh-title, .lh-dialog .lh-body { margin: 0; }
.lh-dialog-item { display: grid; justify-items: start; gap: 2px; padding-top: 12px; border-top: 2px dashed var(--line); }
.lh-dialog-item .lh-btn--quiet { padding-block: 6px; }
.lh-dialog-actions { display: grid; gap: 12px; margin-top: 8px; }
.lh-help { font-size: var(--t-sm); color: var(--soft); margin: 0; }
.lh-error { font-size: var(--t-sm); color: var(--bad); font-weight: 700; margin: 0; }
.lh-pair { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; align-items: start; }
@media (max-width: 560px) { .lh-pair { grid-template-columns: 1fr; gap: 14px; } } /* stack on phones: room for errors */

/* People: who gets the texts, as small name tags. */
.lh-person { display: flex; align-items: center; gap: 10px; }
.lh-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--sky); flex: none; }
.lh-person:nth-child(2) .lh-avatar { background: var(--rose); } .lh-person:nth-child(3) .lh-avatar { background: var(--butter); }

/* ── Motion ───────────────────────────────────────────── */
@keyframes lh-pop { from { opacity: 0; scale: 0.4; translate: 0 12px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes lh-rise { from { opacity: 0; translate: 0 22px; rotate: -4deg; } to { opacity: 1; translate: 0 0; } }
@keyframes lh-arrive { from { opacity: 0; translate: -10px 8px; scale: 0.96; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes lh-dot { 0%, 100% { opacity: 0.35; translate: 0 0; } 50% { opacity: 1; translate: 0 -3px; } }
.lh-pop { animation: lh-pop 0.5s var(--ease-pop) both; }
.lh-rise { animation: lh-rise 0.6s var(--ease-out) both; }
.lh-arrive { animation: lh-arrive 0.45s var(--ease-out) both; }

/* The unwrap: a wrapped box whose ribbon slides off and whose paper parts to reveal what's inside. */
.lh-gift { position: relative; border-radius: var(--r-card); overflow: hidden; isolation: isolate; min-height: 420px; }
.lh-gift-inside { position: relative; z-index: 0; padding: 28px 18px; min-height: inherit; }
.lh-gift-wrap { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
/* Both halves are full width and clipped, so the paper's print lines up across the seam. */
.lh-gift-half { position: absolute; inset: 0; transition: translate 0.9s var(--ease-out) 0.35s, rotate 0.9s var(--ease-out) 0.35s, opacity 0.4s 0.85s; }
.lh-gift-half--left { clip-path: inset(0 50% 0 0); transform-origin: left center; }
.lh-gift-half--right { clip-path: inset(0 0 0 50%); transform-origin: right center; }
.lh-gift-wrap .lh-ribbon, .lh-gift-wrap .lh-ribbon--across { transition: translate 0.45s var(--ease-out), opacity 0.45s; }
.lh-gift-wrap .lh-bow { left: 50%; top: 50%; transition: scale 0.35s ease-in, opacity 0.35s; }
.lh-gift-wrap .lh-gift-cta { position: relative; z-index: 2; margin-top: 190px; transition: opacity 0.25s; }
.lh-gift.is-open .lh-gift-wrap .lh-bow { scale: 0.2; opacity: 0; }
.lh-gift.is-open .lh-gift-wrap .lh-ribbon { translate: -50% -110%; opacity: 0; }
.lh-gift.is-open .lh-gift-wrap .lh-ribbon--across { translate: 110% -50%; opacity: 0; }
.lh-gift.is-open .lh-gift-half--left { translate: -56% 0; rotate: -6deg; opacity: 0; }
.lh-gift.is-open .lh-gift-half--right { translate: 56% 0; rotate: 6deg; opacity: 0; }
.lh-gift.is-open .lh-gift-cta { opacity: 0; pointer-events: none; }
.lh-gift.is-open .lh-gift-wrap { pointer-events: none; }
.lh-gift .lh-gift-inside > * { opacity: 0; }
.lh-gift.is-open .lh-gift-inside > * { animation: lh-rise 0.6s var(--ease-out) both; animation-delay: calc(0.9s + var(--i, 0) * 0.15s); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
