/* ============ SINCE — every second of us, counted ============
   Two counter cards (cream: first message · maroon: first أحبچ) with a
   ghost numeral behind the days, rolling h·m·s digit slots, a milestone
   footer with a progress line, an all-day ribbon on milestone days and a
   live heartbeat line. Transform/opacity only; loops gated by .is-live. */

.since {
  --sn-ease: cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  padding: 5rem 1.2rem 7rem;
  text-align: center;
}
.since .section-head { margin-bottom: 2.6rem; }
.since .statement-sub { text-wrap: balance; }
.sn-inner { max-width: 560px; margin: 0 auto; }
.sn-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  text-align: left;
}

/* ---- Shells (the house double frame) ---- */
.sn-shell {
  background: rgba(217, 108, 138, 0.05);
  border: 1px solid rgba(217, 108, 138, 0.1);
  border-radius: var(--radius-xl);
  padding: 0.45rem;
  transition: border-color 0.6s ease, background-color 0.6s ease, box-shadow 0.6s ease;
}
.sn-shell--dark {
  background: rgba(110, 36, 54, 0.08);
  border-color: rgba(110, 36, 54, 0.16);
}
.sn-card {
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: calc(var(--radius-xl) - 0.45rem);
  padding: 1.5rem 1.4rem 1.4rem;
  background: linear-gradient(180deg, #FFFDFB, #FDF6F2);
  box-shadow: var(--shadow-ambient), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.sn-card > :not(.sn-ghost) { position: relative; }
.sn-shell--dark .sn-card {
  background: linear-gradient(160deg, var(--maroon), var(--maroon-deep));
  color: var(--maroon-paper);
  box-shadow: 0 30px 70px -30px rgba(82, 26, 40, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
/* a warm bloom in the dark card's corner */
.sn-shell--dark .sn-card::before {
  content: '';
  position: absolute;
  top: -22%;
  right: -26%;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 160, 176, 0.3), rgba(232, 160, 176, 0) 70%);
  pointer-events: none;
}

/* ---- Ghost numeral behind the days ---- */
.sn-ghost {
  position: absolute;
  right: -0.04em;
  top: 0.16em; /* glyph centre lands on the solid days numeral */
  font-size: clamp(7.5rem, 36vw, 10.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(217, 108, 138, 0.2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.sn-shell--dark .sn-ghost { -webkit-text-stroke-color: rgba(232, 160, 176, 0.24); }

/* ---- Card head ---- */
.sn-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.7rem;
}
.sn-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--ink-soft);
}
.sn-kicker svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--rose);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sn-kicker .ar { font-weight: 700; color: var(--ink); }
.sn-shell--dark .sn-kicker { color: rgba(255, 249, 244, 0.72); }
.sn-shell--dark .sn-kicker svg { stroke: var(--rose-soft); }
.sn-shell--dark .sn-kicker .ar { color: #fff; }
.sn-since {
  flex-shrink: 0;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--rose);
  background: rgba(217, 108, 138, 0.08);
  border: 1px solid rgba(217, 108, 138, 0.16);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sn-shell--dark .sn-since {
  color: #F9C9D7;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

/* ---- Days ---- */
.sn-days {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-top: 1.05rem;
}
.sn-days-num {
  font-size: clamp(4.4rem, 20vw, 5.8rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  padding-right: 0.04em;
  background: linear-gradient(135deg, var(--ink) 20%, var(--rose) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.sn-shell--dark .sn-days-num { background-image: linear-gradient(135deg, #FFF9F4 30%, #F0B6C4 90%); }
.sn-days-lbl {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.sn-shell--dark .sn-days-lbl { color: rgba(255, 249, 244, 0.7); }

/* ---- Hours · minutes · seconds ---- */
.sn-hms {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.sn-unit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.32rem;
}
.sn-digits {
  display: inline-flex;
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.sn-unit-lbl {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.8;
}
.sn-shell--dark .sn-unit-lbl { color: rgba(255, 249, 244, 0.62); opacity: 1; }
.sn-dot {
  width: 4px;
  height: 4px;
  margin-top: 0.8rem;
  border-radius: 50%;
  background: var(--rose);
  opacity: 0.8;
}
.sn-shell--dark .sn-dot { background: var(--rose-soft); }

/* Digit slot: a 1ch × 1em mask. inline-flex + clip-path (not overflow:hidden)
   so the slot keeps the text baseline; the roll is a transform only. */
.sn-slot {
  display: inline-flex;
  width: 1ch;
  height: 1em;
  clip-path: inset(0);
  vertical-align: baseline;
}
.sn-roll { display: block; flex: none; width: 100%; }
.sn-roll i {
  display: block;
  height: 1em;
  line-height: 1;
  font-style: normal;
  text-align: center;
}

/* ---- Caption ---- */
.sn-caption {
  margin-top: 1.05rem;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.sn-caption .ar { font-weight: 700; color: var(--ink); }
.sn-shell--dark .sn-caption {
  font-size: clamp(1.02rem, 4.1vw, 1.18rem);
  font-weight: 500;
  line-height: 1.6;
  color: rgba(255, 249, 244, 0.9);
  text-wrap: balance;
}
.sn-shell--dark .sn-caption .ar { color: #fff; }

/* ---- Milestones (first-message card) ---- */
.sn-mile {
  margin-top: 1.2rem;
  padding-top: 1.05rem;
  border-top: 1px solid rgba(217, 108, 138, 0.14);
}
.sn-mile-next {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.sn-mile-next strong { font-weight: 700; color: var(--ink); }
.sn-mile-k { font-weight: 700; color: var(--rose); }
.sn-mile-sep { padding: 0 0.42em; color: var(--rose-soft); }
.sn-mile-track {
  position: relative;
  height: 3px;
  margin-top: 0.75rem;
  border-radius: 999px;
  background: rgba(217, 108, 138, 0.14);
}
.sn-mile-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose-soft), var(--rose));
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  transition: transform 1.3s var(--sn-ease) 0.45s;
}
.sn-mile:not(.is-in) .sn-mile-fill { transform: scaleX(0); }
.sn-mile-dot {
  position: absolute;
  top: 50%;
  left: calc(var(--p, 0) * 100%);
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 3px #FFFDFB, 0 0 14px rgba(217, 108, 138, 0.6);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.4s ease 1.55s, transform 0.55s var(--ease-spring) 1.55s;
}
.sn-mile.is-in .sn-mile-dot { opacity: 1; transform: none; }
.sn-mile-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.sn-mile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}
.sn-mile-chips[hidden] { display: none; }
.sn-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.62rem 0.22rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--rose);
  background: var(--rose-mist);
  border: 1px solid rgba(217, 108, 138, 0.16);
  font-variant-numeric: tabular-nums;
}
.sn-chip svg {
  width: 0.7rem;
  height: 0.7rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sn-chip.is-today {
  color: #fff;
  background: linear-gradient(145deg, var(--rose), var(--rose-soft));
  border-color: transparent;
  box-shadow: 0 8px 18px -8px rgba(217, 108, 138, 0.8);
}

/* ---- Dark card footer ---- */
.sn-foot {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.2rem;
  padding-top: 1.05rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(255, 249, 244, 0.72);
}
.sn-foot svg {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: var(--rose-soft);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Celebration ribbon (milestone days) ---- */
.sn-ribbon-row { margin: -0.4rem 0 1.5rem; }
.sn-ribbon {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.58rem 1.2rem 0.58rem 1rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--rose), var(--rose-soft));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 16px 36px -14px rgba(217, 108, 138, 0.9);
  opacity: 0;
  transform: scale(0.6);
}
.sn-ribbon.is-in {
  opacity: 1;
  transform: none;
  transition: transform 0.85s var(--ease-spring), opacity 0.35s ease;
}
.sn-ribbon svg { width: 1rem; height: 1rem; fill: #fff; stroke: none; }
.sn-ribbon .ar { font-weight: 800; }
.sn-ribbon-halo {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1.5px solid rgba(217, 108, 138, 0.7);
  opacity: 0;
  pointer-events: none;
}
.sn-ribbon.is-lit .sn-ribbon-halo { animation: sn-halo 1.4s var(--sn-ease) 2; }
@keyframes sn-halo {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.9, 2.7); opacity: 0; }
}
.since.is-fete .sn-shell--cream {
  border-color: rgba(217, 108, 138, 0.32);
  background: rgba(217, 108, 138, 0.09);
  box-shadow: 0 0 0 6px rgba(217, 108, 138, 0.06), 0 30px 70px -30px rgba(217, 108, 138, 0.55);
}

/* ---- Heartbeats ---- */
.sn-beats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.3rem 0.55rem;
  max-width: 34rem;
  margin: 2rem auto 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.sn-beat-ico {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--rose-mist);
  color: var(--rose);
}
.sn-beat-ico svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
  stroke: none;
  transform-origin: center;
}
.since.is-live .sn-beat-ico svg { animation: sn-beat 857ms var(--sn-ease) infinite; }
@keyframes sn-beat {
  0% { transform: scale(1); }
  14% { transform: scale(1.24); }
  28% { transform: scale(0.98); }
  42% { transform: scale(1.12); }
  60%, 100% { transform: scale(1); }
}
.sn-beats-line {
  display: inline-block;
  max-width: 100%;
  text-wrap: balance;
}
.sn-beats-num {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.sn-comma { display: inline-block; }
.sn-beats-tail {
  flex-basis: 100%;
  font-weight: 500;
  color: var(--rose);
}

/* ---- Desktop ---- */
@media (min-width: 768px) {
  .since { padding: 8rem 1.2rem 10rem; }
  .since .section-head { margin-bottom: 3.4rem; }
  .sn-inner { max-width: 880px; }
  .sn-cards { grid-template-columns: 1fr 1fr; gap: 1.4rem; }
  .sn-card { display: flex; flex-direction: column; padding: 1.9rem 1.8rem 1.7rem; }
  .sn-caption { padding-bottom: 1.2rem; }
  .sn-mile, .sn-shell--dark .sn-caption { margin-top: auto; }
  .sn-days-num { font-size: 5.6rem; }
  .sn-ghost { font-size: 11rem; }
  .sn-digits { font-size: 2.1rem; }
  .sn-beats { margin-top: 2.5rem; font-size: 1.02rem; }
  .sn-ribbon-row { margin: -0.8rem 0 2rem; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .sn-mile-fill, .sn-mile-dot, .sn-ribbon.is-in, .sn-shell { transition: none; }
  .sn-mile:not(.is-in) .sn-mile-fill { transform: scaleX(var(--p, 0)); }
  .sn-mile-dot { opacity: 1; transform: none; }
  .since.is-live .sn-beat-ico svg,
  .sn-ribbon.is-lit .sn-ribbon-halo { animation: none; }
}
