/* ─────────────────────────────────────────────────────────────
   Get Lost — Storybook design system · components
   Reusable building blocks for the app surfaces.
   Depends on tokens.css. Load after tokens, before atmospheres.
   ──────────────────────────────────────────────────────────── */


/* ═════════════════════════════════════════════════════════════
   TYPE
   ═════════════════════════════════════════════════════════════ */

/* Hand-lettered eyebrow line above headings. Use sparingly. */
.t-eyebrow {
  font-family: var(--hand);
  font-size: 22px;
  color: var(--terracotta);
  letter-spacing: 0.01em;
  margin: 0 0 6px;
}
.t-eyebrow--sm { font-size: 18px; }

/* Storybook hero title. Serif, light weight, balanced wrap. */
.t-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: balance;
}
.t-title em {
  font-style: italic;
  color: var(--terracotta);
  font-family: var(--serif);
  font-weight: 400;
}
.t-title--lg { font-size: clamp(40px, 5vw, 56px); }

/* Storybook lede paragraph — italic serif, soft ink. */
.t-lede {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 24px;
  max-width: 36ch;
  text-wrap: pretty;
}

/* Hand-lettered note / caption. */
.t-hand {
  font-family: var(--hand);
  font-size: 17px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}
.t-hand--sun { color: var(--sun-deep); }
.t-hand--terra { color: var(--terracotta); }

/* Tiny UI label (uppercase tracked sans). */
.t-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.t-label--xs { font-size: 9px; letter-spacing: 0.26em; }


/* ═════════════════════════════════════════════════════════════
   CARDS
   ═════════════════════════════════════════════════════════════ */

/* Ink-bordered paper card. The default container for any group
   of fields/content. Has a dashed inner ink frame via ::after. */
.ink-card {
  position: relative;
  background: var(--paper-cream);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    2px 3px 0 rgba(28, 26, 22, 0.08);
}
.ink-card::after {
  content: ""; position: absolute; inset: 0;
  pointer-events: none;
  border-radius: var(--r-card);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' preserveAspectRatio='none'><rect x='1.5' y='1.5' width='calc(100%25 - 3px)' height='calc(100%25 - 3px)' fill='none' stroke='%231c1a16' stroke-width='0.7' stroke-dasharray='2 3' stroke-opacity='0.32'/></svg>");
}

/* Slight rotation modifier for an asymmetric, collaged feel.
   Apply to saved-moment cards, planet cards, the invite letter. */
.ink-card--tilt-l { transform: rotate(-0.6deg); }
.ink-card--tilt-r { transform: rotate(0.4deg); }

/* Letter card — a paper letter with optional wax-seal child. */
.letter-card {
  position: relative;
  padding: 48px 56px 40px;
  background: var(--paper-cream);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  box-shadow:
    0 20px 56px rgba(28, 26, 22, 0.15),
    2px 3px 0 rgba(28, 26, 22, 0.1);
  transform: rotate(-0.6deg);
}
.letter-card::after {
  content: ""; position: absolute; inset: 0;
  pointer-events: none; border-radius: var(--r-card);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' preserveAspectRatio='none'><rect x='10' y='10' width='calc(100%25 - 20px)' height='calc(100%25 - 20px)' fill='none' stroke='%231c1a16' stroke-width='0.7' stroke-opacity='0.4' stroke-dasharray='1 4'/></svg>");
}

/* Wax seal — child of .letter-card. Position with `.wax-seal` */
.wax-seal {
  position: absolute;
  top: -28px; left: -28px;
  width: 88px; height: 88px;
  transform: rotate(-8deg);
  z-index: 6;
  filter: drop-shadow(2px 3px 0 rgba(28, 26, 22, 0.2));
}


/* ═════════════════════════════════════════════════════════════
   BUTTONS
   ═════════════════════════════════════════════════════════════ */

/* Primary CTA — marigold pill with offset ink shadow ("pop" feel) */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 24px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--sun);
  border: 1px solid var(--sun-deep);
  border-radius: var(--r-pill);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  white-space: nowrap;
}
.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 3px 3px 0 var(--ink), 0 0 0 3px var(--sun-glow);
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: 2px 2px 0 var(--ink-mute);
}

/* Coral variant — secondary warm action (invite-accept, etc.) */
.btn--coral {
  background: var(--coral);
  border-color: var(--terracotta);
  color: var(--paper-cream);
}

/* Sage variant — gentle action */
.btn--sage {
  background: var(--sage);
  border-color: var(--moss);
  color: var(--paper-cream);
}

/* Ghost — outline-only secondary action */
.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--rule-strong);
  box-shadow: none;
}
.btn--ghost:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: rgba(28, 26, 22, 0.03);
  transform: none;
  box-shadow: none;
}

/* Small */
.btn--sm { padding: 10px 16px; font-size: 11px; }


/* ═════════════════════════════════════════════════════════════
   FORM FIELDS
   ═════════════════════════════════════════════════════════════ */

/* Field wrapper */
.field {
  display: flex; flex-direction: column; gap: 4px;
}
.field__label {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Hand-drawn underlined input — wavering ink line beneath */
.name-input {
  position: relative;
  padding: 6px 0 8px;
}
.name-input input {
  width: 100%;
  background: transparent;
  border: 0; outline: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 300;
  color: var(--ink);
  padding: 0;
}
.name-input input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}
.name-input::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='4'><path d='M0 2 Q 25 0 50 2 T 100 2 T 150 2 T 200 2' stroke='%231c1a16' stroke-width='1.2' fill='none' stroke-opacity='0.55'/></svg>");
  background-size: 200px 4px;
  background-repeat: repeat-x;
}
.name-input:focus-within::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='4'><path d='M0 2 Q 25 0 50 2 T 100 2 T 150 2 T 200 2' stroke='%23d8901f' stroke-width='1.4' fill='none'/></svg>");
}

/* The "chooses" verb between two name fields. */
.name-verb {
  font-family: var(--hand);
  font-size: 22px;
  color: var(--terracotta);
  padding-bottom: 10px;
  transform: rotate(-3deg);
  white-space: nowrap;
}

/* Row of [name] [verb] [name] */
.name-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: end;
}


/* ═════════════════════════════════════════════════════════════
   SEGMENTED / RADIO CONTROLS
   ═════════════════════════════════════════════════════════════ */

/* Two-up mode picker (With someone / By myself). */
.mode-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mode-btn {
  position: relative;
  text-align: left;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}
.mode-btn:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}
.mode-btn strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: inherit;
}
.mode-btn span {
  display: block;
  margin-top: 2px;
  font-family: var(--hand);
  font-size: 14px;
  color: var(--ink-mute);
}
.mode-btn[aria-pressed="true"],
.mode-btn--active {
  color: var(--ink);
  background: rgba(240, 185, 76, 0.18);
  border-color: var(--sun-deep);
  box-shadow: 0 0 0 1px var(--sun-deep) inset;
}
.mode-btn[aria-pressed="true"] span,
.mode-btn--active span {
  color: var(--sun-deep);
}

/* Duration chips — small pill-shaped radio. */
.dur-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.dur {
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-family: var(--sans);
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}
.dur:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}
.dur[aria-checked="true"],
.dur--active {
  color: var(--ink);
  background: var(--sun);
  border-color: var(--sun-deep);
  box-shadow: 1px 2px 0 rgba(28, 26, 22, 0.18);
}


/* ═════════════════════════════════════════════════════════════
   ROWS / LAYOUTS
   ═════════════════════════════════════════════════════════════ */

/* Stacked rows inside a card, separated by dashed ink rule. */
.row-stack {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 0;
}
.row-stack + .row-stack {
  border-top: 1px dashed var(--rule);
}

/* Hand-stitched divider — short dashes */
.stitch {
  width: 100%; height: 1px;
  background-image: linear-gradient(90deg, var(--ink-faint) 0 6px, transparent 6px 12px);
  background-size: 12px 1px;
  opacity: 0.6;
}


/* ═════════════════════════════════════════════════════════════
   STATUS TILES
   ═════════════════════════════════════════════════════════════ */

.tile {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px;
  background: var(--paper-cream);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
}
.tile__top { display: flex; align-items: center; gap: 8px; }
.tile__dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--ink-faint);
  transition: background 0.3s var(--ease), box-shadow 0.6s var(--ease);
}
.tile[data-active="true"] .tile__dot,
.tile--active .tile__dot {
  background: var(--sun);
  box-shadow: 0 0 10px rgba(240, 185, 76, 0.7);
}
.tile__name {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.tile__state {
  font-family: var(--hand);
  font-size: 18px;
  color: var(--ink-soft);
}
.tile[data-active="true"] .tile__state,
.tile--active .tile__state { color: var(--ink); }


/* ═════════════════════════════════════════════════════════════
   TOP BAR / NAV
   ═════════════════════════════════════════════════════════════ */

.gl-top {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 36px;
  border-bottom: 1px solid var(--rule);
}
.gl-brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--hand);
  font-size: 26px;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.gl-brand > span:last-child { white-space: nowrap; }
.gl-brand__mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--sun-deep);
}
.gl-nav { display: flex; gap: 6px; }
.gl-nav button {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: var(--r-chip);
  white-space: nowrap;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.gl-nav button:hover {
  color: var(--ink);
  background: rgba(28, 26, 22, 0.04);
}
.gl-nav__link--active { color: var(--ink); }
.gl-nav__count {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--hand);
  font-size: 14px;
  color: var(--terracotta);
  letter-spacing: 0;
  white-space: nowrap;
}

/* Footline */
.gl-foot {
  text-align: center;
  padding: 14px;
  font-family: var(--hand);
  font-size: 16px;
  color: var(--ink-mute);
}


/* ═════════════════════════════════════════════════════════════
   RITUAL CLOCK + STATUS
   ═════════════════════════════════════════════════════════════ */

.clock {
  text-align: center;
}
.clock__time {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(48px, 6vw, 72px);
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.clock__label {
  display: block;
  margin-top: 8px;
  font-family: var(--hand);
  font-size: 20px;
  color: var(--terracotta);
}

.status-line {
  text-align: center;
  font-family: var(--hand);
  font-size: 22px;
  color: var(--ink-soft);
}
.status-line--quiet { color: var(--ink-mute); }


/* ═════════════════════════════════════════════════════════════
   RECOVERED-TIME HERO + MOMENTS
   ═════════════════════════════════════════════════════════════ */

.archive-hero__num {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(72px, 10vw, 108px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.archive-hero__unit {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 28px;
  color: var(--ink-soft);
}
.archive-hero__trans {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 38ch;
}
.archive-hero__trans em {
  color: var(--terracotta);
  font-style: normal;
}

.moment-card {
  position: relative;
  padding: 22px;
  transform: rotate(-0.6deg);
}
.moment-card:nth-child(even) { transform: rotate(0.4deg); }
.moment-card:nth-child(3n)   { transform: rotate(-0.3deg); }
.moment-card__icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  margin-bottom: 14px;
}
.moment-card__line {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 8px;
  text-wrap: pretty;
}
.moment-card__when {
  font-family: var(--hand);
  font-size: 16px;
  color: var(--ink-mute);
}
.moment-card__when b {
  font-weight: 400;
  color: var(--terracotta);
}
