/* ==========================================================================
   Us: the together counter, countdown, timeline, song and settings.
   ========================================================================== */

/* ==========================================================================
   Us
   ========================================================================== */

.us-header { padding: 2.4rem var(--gutter) 1.5rem; animation: rise var(--page) var(--ease-out) both; }
.us-header__kicker {
  display: inline-flex; align-items: center; gap: 0.45rem;
  margin: -0.4rem 0 -0.4rem -0.5rem; padding: 0.4rem 0.5rem;
  border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); letter-spacing: 0.04em;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.us-header__kicker .icon { width: 13px; height: 13px; opacity: 0.7; }
.us-header__kicker:hover { background: var(--paper-deep); color: var(--ink); }
.us-header__kicker:hover .icon { color: var(--wax-text); opacity: 1; }
.us-header__names { font-size: 3.4rem; line-height: 0.95; margin-top: 0.5rem; }
.us-header__names em { display: inline-block; transform: translateY(0.04em); }

.counter {
  display: grid; width: 100%; text-align: left;
  grid-template-columns: auto 1fr;
  align-items: end; column-gap: 0.6rem;
  padding: 1.25rem 0 1.35rem;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  user-select: none;
}
.counter__label { grid-column: 1 / -1; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); }
.counter__number {
  font-family: var(--serif); font-style: italic; font-size: clamp(5rem, 26vw, 8.5rem);
  line-height: 0.85; letter-spacing: -0.03em; color: var(--wax-text);
  font-variant-numeric: lining-nums;
}
.counter__unit { font-family: var(--serif); font-size: 2rem; line-height: 1; padding-bottom: 0.35rem; }
.counter__breakdown {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin-top: 0.9rem;
  font-size: 0.92rem; color: var(--ink-soft);
}
.counter__breakdown b { color: var(--ink); font-weight: 600; }
.counter__next { grid-column: 1 / -1; margin-top: 0.3rem; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ink); }
.counter--pulse .counter__number { animation: thump 520ms var(--ease); }

.tally { font-family: var(--serif); font-size: 1.45rem; line-height: 1.3; color: var(--ink-soft); }
.tally__item { color: var(--ink); background-image: linear-gradient(var(--wax), var(--wax)); background-size: 100% 1px; background-position: 0 92%; background-repeat: no-repeat; transition: color var(--fast) var(--ease); }
.tally__item b { font-weight: 400; font-style: italic; color: var(--wax-text); }
.tally__item:hover { color: var(--wax-text); }

.ledger { list-style: none; margin: 0; padding: 0; }
.ledger__row {
  display: grid; grid-template-columns: 6.6rem 1fr auto; align-items: center; gap: 0.8rem;
  padding: 0.75rem 0;
  border-bottom: 1px dotted var(--rule-strong);
  animation: rise var(--page) var(--ease-out) both;
}
.ledger__date { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); white-space: nowrap; }
.ledger__label { display: flex; align-items: center; gap: 0.55rem; font-family: var(--serif); font-size: 1.3rem; line-height: 1.15; overflow-wrap: anywhere; min-width: 0; }
.ledger__icon { font-size: 0.95rem; filter: grayscale(0.3); }
.ledger__remove { opacity: 0; }
.ledger__row:hover .ledger__remove, .ledger__remove:focus-visible { opacity: 1; }
@media (hover: none) { .ledger__remove { opacity: 0.5; } }
.ledger__row--now { border-bottom: 0; }
.ledger__row--now .ledger__date { color: var(--wax-text); }
.ledger__row--now .ledger__label { font-style: italic; color: var(--wax-text); }
.ledger__now-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wax); animation: ping 2.2s var(--ease) infinite; }

.record {
  display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left;
  padding: 0.6rem 0.4rem 0.6rem 0;
}
.record__disc {
  position: relative; width: 76px; height: 76px; flex-shrink: 0; border-radius: 50%;
  background:
    repeating-radial-gradient(circle, #1b1512 0 1.5px, #2a221d 1.5px 3px),
    #1b1512;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex; align-items: center; justify-content: center;
}
.record__disc::after { /* shine */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 20%, rgba(255, 255, 255, 0.1) 25%, transparent 30% 70%, rgba(255, 255, 255, 0.08) 75%, transparent 80%);
}
.record__label {
  width: 28px; height: 28px; border-radius: 50%; background: var(--wax); color: rgba(255, 245, 235, 0.85);
  display: flex; align-items: center; justify-content: center;
}
.record__label .icon { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.record__disc--spin { animation: spin 7s linear infinite; }
.record:hover .record__disc--spin { animation-duration: 3.5s; }
.record__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.record__title { font-family: var(--serif); font-size: 1.75rem; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record__artist { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-faint); margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record__action { color: var(--wax-text); padding: 0 0.6rem; }
.record--empty .record__disc { opacity: 0.35; }
.record--empty:hover .record__disc { opacity: 0.6; }

.menu { margin: 0; }
.menu__row { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.55rem 0; }
.menu__label { flex-shrink: 0; font-family: var(--mono); font-size: 0.76rem; color: var(--ink-soft); }
.menu__row::after { content: none; }
.menu__label::after {
  content: ""; display: inline-block; vertical-align: baseline;
}
.menu__value {
  margin: 0; flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 0.6rem;
  font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; text-align: right; justify-content: flex-end;
  overflow-wrap: anywhere;
}
.menu__value::before { content: ""; flex: 1; min-width: 1.5rem; border-bottom: 1.5px dotted var(--rule-strong); transform: translateY(-0.3em); }

.settings-card { border-top: 1px solid var(--rule); }
.settings-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.settings-row__icon { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); flex-shrink: 0; }
.settings-row__icon .icon { width: 20px; height: 20px; }
.settings-row__text { flex: 1; min-width: 0; }
.settings-row__label { font-weight: 500; }
.settings-row__hint { color: var(--ink-faint); font-size: 0.82rem; margin-top: 0.05rem; }

.toggle { position: relative; width: 48px; height: 28px; flex-shrink: 0; border-radius: var(--r-full); background: var(--rule-strong); transition: background var(--fast) var(--ease); }
.toggle__thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform var(--fast) var(--ease); }
.toggle--on { background: var(--wax); }
.toggle--on .toggle__thumb { transform: translateX(20px); }

.us-footer { margin-top: 2.5rem; text-align: center; font-family: var(--hand); font-size: 0.95rem; color: var(--ink-faint); }

/* ==========================================================================
   Countdown card (Us)
   ========================================================================== */

.countdown {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 1.15rem 1.25rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-paper);
}
.countdown::before { /* ticket notches */
  content: ""; position: absolute; top: 50%; left: -9px; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; background: var(--paper); border-right: 1px solid var(--rule);
}
.countdown::after {
  content: ""; position: absolute; top: 50%; right: -9px; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; background: var(--paper); border-left: 1px solid var(--rule);
}
.countdown__top { display: flex; align-items: center; justify-content: space-between; }
.countdown__label { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); }
.countdown__title { font-family: var(--serif); font-size: 1.9rem; line-height: 1.05; margin-top: 0.2rem; }
.countdown__value { display: flex; align-items: baseline; gap: 0.45rem; margin-top: 0.35rem; }
.countdown__in, .countdown__unit { font-family: var(--serif); font-size: 1.6rem; color: var(--ink-soft); }
.countdown__number { font-family: var(--serif); font-style: italic; font-size: 4.2rem; line-height: 0.9; color: var(--wax-text); letter-spacing: -0.02em; }
.countdown__meta { margin-top: 0.5rem; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); }
.countdown--empty { border-style: dashed; border-color: var(--rule-strong); box-shadow: none; display: flex; flex-direction: column; gap: 0.35rem; transition: border-color var(--fast) var(--ease); }
.countdown--empty:hover { border-color: var(--ink); }
.countdown__empty-title { font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; }
.countdown__empty-cta { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--mono); font-size: 0.76rem; color: var(--wax-text); }
.countdown__empty-cta .icon { width: 14px; height: 14px; }

/* ==========================================================================
   Phase 3: Us as home
   A hero (your cover photo, or a warm wax gradient) with the together
   counter set on it, then what's next, recent moments and your story.
   ========================================================================== */

.us-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 440px;
  padding: max(1rem, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 3.6rem max(var(--gutter), env(safe-area-inset-left));
  color: #fff;
  background: radial-gradient(120% 80% at 80% 10%, #d9906d 0%, transparent 55%), linear-gradient(165deg, #b4524a 0%, #8e2a2e 48%, #4a1a1f 100%);
  border-radius: 0 0 var(--r-sheet) var(--r-sheet);
  animation: fade var(--med) var(--ease) both;
}
.us-hero__photo { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; }
.us-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 10, 8, 0.38) 0%, rgba(20, 10, 8, 0) 26%, rgba(20, 10, 8, 0) 40%, rgba(20, 10, 8, 0.66) 100%);
}

.us-hero__bar { display: flex; align-items: center; justify-content: space-between; }
.us-hero__brand { font-family: var(--serif); font-size: 1.6rem; line-height: 1; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2); }
.us-hero__brand em { font-style: italic; }
.us-hero__btn, .us-hero__cover {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  color: #fff; background: rgba(20, 10, 8, 0.28);
  -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  transition: background var(--fast) var(--ease), transform var(--press) var(--ease);
}
.us-hero__btn { width: var(--tap); height: var(--tap); border-radius: 50%; }
.us-hero__btn .icon { width: 21px; height: 21px; }
.us-hero__btn:active, .us-hero__cover:active { transform: scale(0.94); }
@media (hover: hover) { .us-hero__btn:hover, .us-hero__cover:hover { background: rgba(20, 10, 8, 0.45); } }
.us-hero__cover {
  position: absolute; right: max(var(--gutter), env(safe-area-inset-right)); bottom: 1rem;
  min-height: 34px; padding: 0 0.85rem 0 0.7rem; border-radius: var(--r-full);
  font-size: var(--text-foot); font-weight: 600;
}
.us-hero__cover .icon { width: 15px; height: 15px; }

.us-hero__body { margin-top: 2.5rem; }
.us-hero__couple { display: flex; align-items: center; gap: 0.6rem; }
.us-hero__faces { display: inline-flex; }
.us-hero__face { display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9); }
.us-hero__face + .us-hero__face { margin-left: -8px; }
.us-hero__names { font-size: 1.4rem; line-height: 1.1; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25); }
.us-hero__names em { color: #fff; opacity: 0.85; }

.us-hero .counter { border: 0; padding: 0.9rem 0 0; color: #fff; }
.us-hero .counter__label { font-family: var(--sans); font-size: var(--text-cap); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.82); }
.us-hero .counter__number { color: #fff; font-size: clamp(5.5rem, 30vw, 8rem); margin-top: 0.15rem; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.22); }
.us-hero .counter__unit { color: #fff; font-style: italic; }
.us-hero .counter__breakdown { margin-top: 0.7rem; color: rgba(255, 255, 255, 0.85); }
.us-hero .counter__breakdown b { color: #fff; }
.us-hero .counter__next { color: #fff; font-size: 1.1rem; opacity: 0.92; }
.us-hero__since {
  display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.55rem; min-height: 32px;
  font-size: var(--text-foot); color: rgba(255, 255, 255, 0.82);
}
.us-hero__since .icon { width: 13px; height: 13px; }

/* What's next: the countdown and your song as two quiet cards */
.us-next { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; padding: 1.25rem var(--gutter) 2rem; }
.us-next > * { min-width: 0; }
.us-next .countdown { border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-paper); }
.us-next .countdown::before, .us-next .countdown::after { border: 0; background: var(--paper); }
.us-next .countdown--empty { border: 0; box-shadow: var(--shadow-paper); }
#song-host .record {
  padding: 0.8rem 0.6rem 0.8rem 0.8rem; gap: 0.9rem;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-paper);
}
#song-host .record__disc { width: 56px; height: 56px; }
#song-host .record__label { width: 22px; height: 22px; }
#song-host .record__title { font-size: 1.4rem; }

.section-block__head--quiet { border-bottom: 0; padding-bottom: 0; margin-bottom: 0.75rem; }

/* Little moments: recent photos you can flick through */
.moments {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.moments::-webkit-scrollbar { display: none; }
.moments__item {
  flex: 0 0 104px; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; scroll-snap-align: start;
  transition: transform var(--press) var(--ease);
}
.moments__item:active { transform: scale(0.96); }
.moments__photo { display: block; width: 100%; height: 100%; background-size: cover; background-position: center; }

/* Our story: a line of milestones, newest at the bottom */
.ledger { position: relative; padding-left: 24px; }
.ledger::before { content: ""; position: absolute; left: 5px; top: 1.1rem; bottom: 1.4rem; width: 1.5px; background: var(--rule-strong); }
.ledger__row {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date remove" "label remove";
  row-gap: 2px; padding: 0.55rem 0; border-bottom: 0;
}
.ledger__row::before {
  content: ""; position: absolute; left: -24px; top: 0.85rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--wax-text);
}
.ledger__date { grid-area: date; }
.ledger__label { grid-area: label; font-size: 1.25rem; }
.ledger__remove { grid-area: remove; align-self: center; }
.ledger__row--now::before { background: var(--wax); border-color: var(--wax); box-shadow: 0 0 0 4px var(--wax-tint); }
.ledger__now-dot { display: none; }
.ledger--folded .ledger__row--older { display: none; }
.ledger__more {
  display: inline-flex; align-items: center; min-height: 36px; margin: -0.25rem 0 0.25rem 24px;
  font-size: var(--text-foot); font-weight: 600; color: var(--wax-text);
}

/* Cover picker */
.cover-picker__hint { margin-bottom: 1rem; }
.cover-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 1rem; }
.cover-picker__item { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; transition: transform var(--press) var(--ease); }
.cover-picker__item:active { transform: scale(0.96); }
.cover-picker__item.is-on { outline: 3px solid var(--wax-text); outline-offset: 2px; }
.cover-picker__photo { display: block; width: 100%; height: 100%; background-size: cover; background-position: center; }

/* Settings sheet */
.modal__panel--settings .settings-card { margin-top: 0.25rem; }
.modal__panel--settings .us-footer { margin-top: 1.75rem; }

/* Desktop: the hero becomes a rounded card at the top of the column */
@media (min-width: 980px) {
  .us-hero { margin: 2rem var(--gutter) 0; border-radius: var(--r-lg); min-height: 420px; padding-top: 1.25rem; }
  .us-next { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* ==========================================================================
   Hairlines and soft cards (moved unchanged from refined.css in Phase 6)
   ========================================================================== */

.counter { border-top: 0.5px solid var(--hairline); border-bottom: 0.5px solid var(--hairline); }
.settings-row { border-bottom: 0.5px solid var(--hairline); }
.countdown--empty {
  border: 0.5px solid var(--rule-strong); border-style: solid; background: var(--card); box-shadow: var(--shadow-paper);
}
.countdown--empty:hover { border-color: color-mix(in srgb, var(--wax) 40%, var(--rule-strong)); }
.countdown { border-radius: var(--r-md); border: 0.5px solid var(--rule-strong); }
.countdown::before, .countdown::after { border-color: var(--rule-strong); }
