/* ==========================================================================
   components.css — reusable primitives & composites
   (buttons, frames, header, footer, cards, tiles, lightbox, chain, forms…)
   ========================================================================== */

/* ---- Ornament defaults ------------------------------------------------- */
.orn { color: var(--art); }
.orn-icon { width: 22px; height: 22px; flex: none; }
.orn-divider { width: min(320px, 70%); height: auto; margin-inline: auto; color: var(--line); }
.orn-rule { width: min(320px, 70%); height: auto; margin-inline: auto; color: var(--line); }
.orn-lotus { width: 48px; color: var(--accent); }
.orn-monogram { width: 44px; height: 44px; color: var(--line); }

.draft-tag {
  display: inline-block; vertical-align: middle;
  margin-left: 8px; padding: 1px 7px 2px;
  font: 500 10px/1.4 var(--font-utility);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--maroon-700); background: rgba(216,185,174,.35);
  border: 1px dashed var(--maroon-700); border-radius: 3px;
}
.mode-ceremonial .draft-tag, .mode-botanical .draft-tag { color: var(--gold-200); border-color: var(--gold-200); background: rgba(0,0,0,.12); }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  --btn-bg: transparent; --btn-fg: var(--btn-outline); --btn-bd: var(--btn-outline);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  font-family: var(--font-body); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bd); border-radius: var(--r-control);
  cursor: pointer; position: relative; isolation: isolate;
  transition: background-color var(--dur-standard) var(--ease-standard),
              color var(--dur-standard) var(--ease-standard),
              border-color var(--dur-standard) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard);
}
.btn::after { /* fine inner engraved border */
  content: ""; position: absolute; inset: 3px; border: 1px solid currentColor;
  border-radius: 3px; opacity: .22; pointer-events: none;
}
.btn .orn-icon { width: 18px; height: 18px; color: currentColor; transition: transform var(--dur-standard) var(--ease-standard); }
.btn:hover .orn-icon { transform: translateX(3px); }
.btn:active { transform: scale(.98); }
.btn--primary { --btn-bg: var(--btn-primary-bg); --btn-fg: var(--btn-primary-text); --btn-bd: var(--btn-primary-bg); }
.btn--primary:hover { --btn-bg: var(--btn-primary-bg-hover); --btn-bd: var(--btn-primary-bg-hover); }
.btn--outline:hover { --btn-bg: var(--btn-outline-hover-bg); }
.btn--text {
  min-height: 44px; padding: 8px 2px; border: 0; --btn-fg: var(--text);
  border-bottom: 1px solid var(--line); border-radius: 0;
}
.btn--text::after { display: none; }
.btn--small { min-height: 40px; padding: 8px 14px; font-size: .75rem; }
.btn[disabled], .btn[aria-disabled="true"] {
  --btn-bg: var(--disabled-bg); --btn-fg: var(--disabled-text); --btn-bd: var(--paper-300);
  cursor: not-allowed; transform: none;
}

.link {
  color: inherit; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size var(--dur-standard) var(--ease-standard);
  border-bottom: 1px solid var(--line-soft);
}
.link:hover { background-size: 100% 1px; }

/* ---- Frames ------------------------------------------------------------ */
.frame { position: relative; isolation: isolate; }
.frame__img { width: 100%; height: 100%; object-fit: cover; }
.frame--arch .frame__clip {
  border-radius: 999px 999px 10px 10px; overflow: hidden; height: 100%;
  border: 1px solid var(--line);
  background: var(--paper-200);
}
.frame--arch::before { /* offset engraved outline */
  content: ""; position: absolute; inset: -10px; z-index: -1;
  border: 1px solid var(--line); opacity: .55;
  border-radius: 999px 999px 14px 14px;
}
.frame--oval .frame__clip { border-radius: 50%; overflow: hidden; border: 1px solid var(--line); height: 100%; background: var(--paper-200); }
.frame--oval::before { content: ""; position: absolute; inset: -9px; border: 1px solid var(--line); border-radius: 50%; opacity: .5; z-index: -1; }
.frame--rect .frame__clip { overflow: hidden; border: 1px solid var(--line); border-radius: 4px; height: 100%; background: var(--paper-200); }
.frame--rect::before { content: ""; position: absolute; inset: -8px; border: 1px solid var(--line); opacity: .4; border-radius: 6px; z-index: -1; }
.frame .orn-corner { position: absolute; width: 44px; height: 44px; color: var(--line); pointer-events: none; }
.frame .orn-corner.tl { top: -18px; left: -18px; }
.frame .orn-corner.tr { top: -18px; right: -18px; transform: scaleX(-1); }
.frame .orn-corner.bl { bottom: -18px; left: -18px; transform: scaleY(-1); }
.frame .orn-corner.br { bottom: -18px; right: -18px; transform: scale(-1); }
img.is-placeholder { object-fit: cover; }

/* ---- Header / navigation ---------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-header);
  transition: background-color var(--dur-reveal) var(--ease-standard),
              box-shadow var(--dur-reveal) var(--ease-standard),
              transform var(--dur-reveal) var(--ease-standard);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 76px;
}
.site-header.is-solid {
  background: rgba(251, 247, 239, .94);
  box-shadow: 0 1px 0 var(--paper-300);
  backdrop-filter: saturate(1.1);
}
.site-header.is-hidden { transform: translateY(-100%); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink-900); }
.brand__names { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: .04em; line-height: 1; }
.brand__names em { font-family: var(--font-script); font-style: normal; color: var(--gold-600); font-size: 1.15em; margin: 0 .15em; }
.brand:hover .orn-monogram { transform: rotate(-8deg); }
.brand .orn-monogram { transition: transform var(--dur-editorial) var(--ease-enter); color: var(--gold-700); }

.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav__list { display: flex; gap: clamp(14px, 2vw, 30px); list-style: none; padding: 0; margin: 0; }
.nav__link {
  position: relative; display: inline-block; padding: 10px 0;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-800);
}
.nav__link::after { /* engraved dot + line on hover/active */
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px;
  border: 1px solid var(--gold-700); transform: translateX(-50%) rotate(45deg) scale(0);
  transition: transform var(--dur-standard) var(--ease-standard);
}
.nav__link:hover::after, .nav__link[aria-current]::after { transform: translateX(-50%) rotate(45deg) scale(1); }
.nav__link[aria-current] { color: var(--maroon-700); }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 1px solid var(--paper-300);
  border-radius: var(--r-control); background: var(--paper-50); cursor: pointer;
  align-items: center; justify-content: center; color: var(--ink-800);
}

.drawer {
  position: fixed; inset: 0; z-index: var(--z-drawer);
  background: var(--paper-100);
  display: grid; place-items: center; text-align: center;
  clip-path: circle(0% at calc(100% - 44px) 38px);
  transition: clip-path var(--dur-scene) var(--ease-enter), visibility 0s linear var(--dur-scene);
  visibility: hidden;
}
.drawer.is-open { clip-path: circle(150% at calc(100% - 44px) 38px); visibility: visible; transition: clip-path var(--dur-scene) var(--ease-enter); }
.drawer__list { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 6px; }
.drawer__link { font-family: var(--font-display); font-size: 2.4rem; text-decoration: none; color: var(--ink-800); display: inline-block; padding: 4px 10px; }
.drawer__link[aria-current] { color: var(--maroon-700); font-style: italic; }
.drawer__close { position: absolute; top: 15px; right: var(--gutter); }
.drawer .orn-gopuram { width: 160px; opacity: .25; margin: 0 auto 16px; }

@media (max-width: 640px) {
  .nav__list, .nav .btn { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  position: relative; text-align: center;
  padding: var(--sp-9) 0 var(--sp-6);
  background: var(--paper-100);
  border-top: 1px solid var(--paper-300);
  overflow: hidden;
}
.site-footer .orn-gopuram { width: 220px; margin: 0 auto var(--sp-5); color: var(--ink-500); opacity: .5; }
.site-footer__title { font-family: var(--font-display); font-size: var(--fs-h2); color: var(--ink-800); }
.site-footer__text { max-width: 52ch; margin: 12px auto 28px; color: var(--ink-700); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 26px; justify-content: center; list-style: none; padding: 0; margin: 28px 0; }
.site-footer__links a { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--ink-700); }
.site-footer__links a:hover { color: var(--maroon-700); }
.site-footer__sig { font-family: var(--font-script); font-size: 2.4rem; color: var(--gold-700); }
.site-footer__meta { margin-top: 24px; font-size: var(--fs-caption); color: var(--ink-500); display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.site-footer__meta button { background: none; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; padding: 4px; }
.back-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--paper-50); border: 1px solid var(--gold-700); color: var(--gold-700);
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity var(--dur-reveal) var(--ease-standard), transform var(--dur-reveal) var(--ease-standard);
}
.back-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.back-top .orn-icon { transform: rotate(-90deg); }

/* ---- Cards ------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: var(--sp-6);
}
.card--interactive { transition: transform var(--dur-standard) var(--ease-standard), box-shadow var(--dur-standard) var(--ease-standard), border-color var(--dur-standard); }
.card--interactive:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line); }
.card__icon { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--line); margin-bottom: 16px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-muted); }

/* ---- Marquee (scroll-linked horizontal band) --------------------------- */
.marquee {
  overflow: hidden; position: relative;
  border-block: 1px solid var(--line-soft);
  padding-block: 18px; background: var(--surface);
}
.marquee__row { display: flex; width: max-content; will-change: transform; }
.marquee__item {
  display: inline-flex; align-items: center; gap: 28px; padding-right: 28px;
  font-family: var(--font-display); font-size: clamp(1.6rem, 1rem + 2.4vw, 3.2rem);
  color: var(--heading); white-space: nowrap; font-weight: 400;
}
.marquee__item i { font-family: var(--font-script); font-style: normal; color: var(--accent); }
.marquee__item .orn-lotus { width: 38px; }
.marquee__item .telugu { font-size: .7em; color: var(--text-muted); }
.marquee--outline .marquee__item { color: transparent; -webkit-text-stroke: 1px var(--gold-700); }

/* ---- Countdown --------------------------------------------------------- */
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 2vw, 28px); max-width: 860px; margin-inline: auto; }
.countdown__unit {
  position: relative; text-align: center; padding: clamp(16px, 3vw, 34px) 8px clamp(14px, 2vw, 22px);
  border: 1px solid var(--line); border-radius: 999px 999px 8px 8px;
  background: var(--surface-raised);
}
.countdown__unit::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--line); opacity: .35; border-radius: 999px 999px 5px 5px; }
.countdown__num {
  display: block; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.4rem, 1.2rem + 5vw, 5.4rem); line-height: 1; color: var(--heading);
  font-variant-numeric: lining-nums tabular-nums; overflow: hidden; height: 1.05em;
}
.countdown__num span { display: inline-block; }
.countdown__num span.tick { animation: tick var(--dur-reveal) var(--ease-enter); }
.countdown__label { display: block; margin-top: 10px; font-size: var(--fs-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-muted); }
@keyframes tick { from { transform: translateY(-60%); opacity: 0; } to { transform: none; opacity: 1; } }
.countdown__done { text-align: center; font-family: var(--font-display); font-size: var(--fs-h2); color: var(--heading); }
@media (max-width: 520px) { .countdown { grid-template-columns: repeat(2, 1fr); } }

/* ---- Photo tiles (hover reveals more photos) -------------------------- */
.tiles {
  display: grid; gap: clamp(14px, 2vw, 26px);
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(170px, 18vw, 250px);
  grid-auto-flow: dense;
}
.tile { position: relative; margin: 0; perspective: 1200px; }
.tile--tall { grid-row: span 2; }
.tile--wide { grid-column: span 2; }
.tile--big { grid-column: span 2; grid-row: span 2; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; gap: 12px; } .tile--big { grid-column: span 2; } .tile--wide { grid-column: span 2; } }

.tile__btn {
  all: unset; box-sizing: border-box; display: block; width: 100%; height: 100%;
  cursor: zoom-in; position: relative; border-radius: 6px;
}
.tile__btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.tile__stage { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform var(--dur-scene) var(--ease-enter); }
.tile__layer {
  position: absolute; inset: 0; overflow: hidden; border-radius: 6px;
  border: 1px solid var(--paper-300); background: var(--paper-200);
  box-shadow: var(--shadow-paper);
  transition: transform var(--dur-editorial) var(--ease-enter), opacity var(--dur-editorial) var(--ease-enter);
}
.tile__layer img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease-enter), opacity var(--dur-editorial) var(--ease-standard); }
.tile__layer::after { /* inner paper mat */
  content: ""; position: absolute; inset: 6px; border: 1px solid rgba(251,247,239,.7); border-radius: 3px; pointer-events: none;
}
.tile__label {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 5;
  display: flex; justify-content: space-between; align-items: end; gap: 8px;
  padding: 10px 14px; border-radius: 4px;
  background: rgba(251, 247, 239, .92); border: 1px solid var(--paper-300);
  transform: translateY(0); transition: transform var(--dur-editorial) var(--ease-enter), opacity var(--dur-standard);
  pointer-events: none;
}
.tile__title { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.1; color: var(--ink-900); }
.tile__cap { font-size: .75rem; color: var(--ink-700); font-style: italic; }
.tile__count { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-700); white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.tile__count .orn-icon { width: 15px; height: 15px; color: var(--gold-700); }

/* effect: STACK — photos fan out like a hand of prints */
.tile--stack .tile__layer:not(.is-cover) { transform: rotate(0deg) scale(.96); }
.tile--stack .tile__layer:nth-child(2) { transform: rotate(-2.5deg) scale(.97); }
.tile--stack .tile__layer:nth-child(3) { transform: rotate(2deg) scale(.97); }
.tile--stack:hover .tile__layer.is-cover, .tile--stack .tile__btn:focus-visible .tile__layer.is-cover { transform: scale(.62) translateY(-8%); z-index: 4; }
.tile--stack:hover .tile__layer:nth-child(2), .tile--stack .tile__btn:focus-visible .tile__layer:nth-child(2) { transform: translate(-17%, -5%) rotate(-8deg) scale(.56); }
.tile--stack:hover .tile__layer:nth-child(3), .tile--stack .tile__btn:focus-visible .tile__layer:nth-child(3) { transform: translate(17%, -5%) rotate(7deg) scale(.56); }
.tile--stack:hover .tile__layer:nth-child(4), .tile--stack .tile__btn:focus-visible .tile__layer:nth-child(4) { transform: translate(-10%, 8%) rotate(-4deg) scale(.52); }
.tile--stack:hover .tile__layer:nth-child(5), .tile--stack .tile__btn:focus-visible .tile__layer:nth-child(5) { transform: translate(11%, 9%) rotate(5deg) scale(.52); }
.tile--stack:hover .tile__stage { transform: none; }
.tile--stack:hover .tile__label { transform: translateY(6px); }

/* effect: FLIP — turns over to a contact sheet */
.tile--flip .tile__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.tile--flip .tile__face--back {
  transform: rotateY(180deg); display: grid; gap: 6px; padding: 6px;
  grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr;
  background: var(--paper-100); border: 1px solid var(--gold-700); border-radius: 6px;
}
.tile--flip .tile__face--back img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; border: 1px solid var(--paper-300); }
.tile--flip:hover .tile__stage, .tile--flip .tile__btn:focus-visible .tile__stage { transform: rotateY(180deg); }
.tile--flip:hover .tile__label { opacity: 0; }

/* effect: ZOOM — slow zoom and cross-fade through the album */
.tile--zoom .tile__layer img { position: absolute; inset: 0; opacity: 0; }
.tile--zoom .tile__layer img.is-active { opacity: 1; }
.tile--zoom:hover .tile__layer img { transform: scale(1.08); }

@media (hover: none) {
  .tile--flip:hover .tile__stage { transform: none; }
  .tile--stack:hover .tile__layer { transform: none !important; }
}

/* ---- Lightbox ---------------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: var(--z-lightbox);
  background: rgba(30, 22, 18, .97);
  display: grid; grid-template-rows: auto 1fr auto; color: var(--paper-100);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-reveal) var(--ease-standard), visibility 0s linear var(--dur-reveal);
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity var(--dur-reveal) var(--ease-standard); }
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter); gap: 16px; }
.lightbox__title { font-family: var(--font-display); font-size: 1.5rem; }
.lightbox__count { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-200); }
.lightbox__stage { position: relative; display: grid; place-items: center; padding: 0 clamp(56px, 8vw, 120px); min-height: 0; }
.lightbox__figure { margin: 0; max-height: 100%; display: grid; place-items: center; min-height: 0; height: 100%; }
.lightbox__img {
  max-width: 100%; max-height: calc(100vh - 220px); object-fit: contain;
  border: 1px solid var(--gold-600); padding: 8px; background: var(--paper-100);
  border-radius: 3px; transition: opacity var(--dur-standard), transform var(--dur-reveal) var(--ease-enter);
}
.lightbox__img.is-swapping { opacity: 0; transform: scale(.985); }
.lightbox__btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: transparent; border: 1px solid rgba(226,209,174,.5); color: var(--gold-200); cursor: pointer;
  transition: background var(--dur-standard), border-color var(--dur-standard);
}
.lightbox__btn:hover { background: rgba(226,209,174,.12); border-color: var(--gold-200); }
.lightbox__btn .orn-icon { color: currentColor; }
.lightbox__prev, .lightbox__next { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: clamp(8px, 2vw, 32px); }
.lightbox__next { right: clamp(8px, 2vw, 32px); }
.lightbox__thumbs { display: flex; gap: 8px; justify-content: center; padding: 14px var(--gutter) 20px; overflow-x: auto; }
.lightbox__thumb { all: unset; cursor: pointer; width: 54px; height: 54px; flex: none; border-radius: 3px; overflow: hidden; border: 1px solid transparent; opacity: .5; transition: opacity var(--dur-standard), border-color var(--dur-standard); }
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb[aria-current="true"] { opacity: 1; border-color: var(--gold-400); }
.lightbox__thumb:focus-visible { outline: 2px solid var(--gold-200); outline-offset: 2px; }

/* ---- Journey chain (milestones lit one by one) ------------------------ */
.chain { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; padding-top: 8px; }
.chain__line, .chain__progress { position: absolute; top: 40px; left: calc(100% / var(--n) / 2); height: 2px; }
.chain__line { right: calc(100% / var(--n) / 2); background: repeating-linear-gradient(90deg, var(--line-soft) 0 6px, transparent 6px 10px); }
.chain__progress { width: 0; background: var(--accent); transition: width 1.6s var(--ease-enter); }
.chain.is-in .chain__progress { width: var(--progress-w, 0); }
.chain__node { position: relative; text-align: center; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 0 4px; text-decoration: none; color: inherit; }
.chain__medal {
  position: relative; z-index: 1; width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface);
  border: 1px solid var(--line-soft); color: var(--text-soft);
  transition: background-color var(--dur-editorial) var(--ease-enter), color var(--dur-editorial), border-color var(--dur-editorial), transform var(--dur-editorial) var(--ease-enter);
  transition-delay: calc(var(--i) * 140ms);
}
.chain__medal::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--line-soft); opacity: 0; transition: opacity var(--dur-editorial); transition-delay: calc(var(--i) * 140ms); }
.chain__medal .orn-icon { width: 28px; height: 28px; color: currentColor; }
.chain.is-in .chain__node.is-past .chain__medal { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.chain.is-in .chain__node.is-next .chain__medal { border-color: var(--btn-primary-bg); color: var(--btn-primary-bg); transform: scale(1.08); }
.chain.is-in .chain__node.is-next .chain__medal::before { opacity: 1; border-color: var(--btn-primary-bg); }
.chain.is-in .chain__node.is-final .chain__medal { border-color: var(--line); color: var(--line); }
.chain__date { font-size: var(--fs-eyebrow); letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); margin-top: 8px; }
.chain__title { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.15; color: var(--heading); }
.chain__note { font-size: .82rem; color: var(--text-soft); line-height: 1.45; max-width: 18ch; }
.chain__flag {
  position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap;
  color: var(--btn-primary-text); background: var(--btn-primary-bg); padding: 3px 8px; border-radius: 3px;
  opacity: 0; transition: opacity var(--dur-reveal) 1.4s;
}
.chain.is-in .chain__flag { opacity: 1; }
a.chain__node:hover .chain__medal { transform: translateY(-3px); }
.chain-wrap { overflow-x: auto; padding: 36px 4px 12px; scrollbar-width: thin; }
.chain-wrap .chain { min-width: 980px; }
@media (max-width: 760px) {
  .chain-wrap { overflow: visible; padding-top: 8px; }
  .chain-wrap .chain { min-width: 0; grid-auto-flow: row; grid-auto-columns: auto; gap: 26px; padding-left: 0; }
  .chain__line, .chain__progress { top: 33px; bottom: 33px; left: 32px; right: auto; width: 2px; height: auto; }
  .chain__line { background: repeating-linear-gradient(180deg, var(--line-soft) 0 6px, transparent 6px 10px); }
  .chain__progress { height: 0; transition: height 1.6s var(--ease-enter); }
  .chain.is-in .chain__progress { width: 2px; height: var(--progress-h, 0); }
  .chain__node { grid-template-columns: 66px 1fr; text-align: left; justify-items: start; column-gap: 18px; align-items: center; }
  .chain__medal { grid-row: span 3; }
  .chain__date { margin-top: 0; }
  .chain__note { max-width: none; }
  .chain__flag { top: 0; left: auto; right: 0; transform: none; }
}

/* ---- Horizontal scroll (pinned) --------------------------------------- */
.hs { position: relative; }
.hs__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.hs__track { display: flex; gap: clamp(28px, 4vw, 64px); padding-inline: var(--gutter); will-change: transform; align-items: stretch; width: max-content; }
.hs__progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 34px; height: 1px; background: var(--line-soft); }
.hs__progress span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--line); }
.hs__progress span::after { content: ""; position: absolute; right: -5px; top: -4px; width: 9px; height: 9px; border: 1px solid var(--line); background: var(--surface); transform: rotate(45deg); }
.hs.is-native .hs__sticky { position: relative; height: auto; padding-block: 16px 40px; }
.hs.is-native .hs__viewport { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
.hs.is-native .hs__track > * { scroll-snap-align: center; }
.hs.is-native .hs__progress { display: none; }

/* ---- Story card (used in horizontal story + story page) -------------- */
.story-card { width: min(400px, 78vw); flex: none; display: grid; gap: 18px; align-content: start; position: relative; }
.story-card__stack { position: relative; aspect-ratio: 4 / 5; }
.story-card__stack .print {
  position: absolute; inset: 0; border-radius: 4px; overflow: hidden;
  background: var(--paper-50); padding: 10px 10px 34px; border: 1px solid var(--paper-300);
  box-shadow: var(--shadow-paper);
  transition: transform var(--dur-editorial) var(--ease-enter);
}
.story-card__stack .print img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.story-card__stack .print:nth-child(1) { transform: rotate(-4deg) translate(-3%, 1%); }
.story-card__stack .print:nth-child(2) { transform: rotate(3deg) translate(3%, 0); }
.story-card__stack .print:nth-child(3) { transform: rotate(-.5deg); }
.story-card:hover .print:nth-child(1), .story-card:focus-within .print:nth-child(1) { transform: rotate(-8deg) translate(-8%, 2%); }
.story-card:hover .print:nth-child(2), .story-card:focus-within .print:nth-child(2) { transform: rotate(7deg) translate(8%, 1%); }
.story-card:hover .print:nth-child(3), .story-card:focus-within .print:nth-child(3) { transform: rotate(0) translateY(-3%) scale(1.015); }
.story-card__pin { /* knot on the thread */
  position: absolute; left: 50%; top: -18px; width: 14px; height: 14px; z-index: 2;
  background: var(--maroon-700); border-radius: 50%; transform: translateX(-50%);
  box-shadow: 0 0 0 4px var(--paper-50), 0 0 0 5px var(--gold-600);
}
.story-card__meta { display: flex; gap: 12px; align-items: baseline; }
.story-card__chapter { font-size: var(--fs-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--gold-700); }
.story-card__date { font-family: var(--font-display); font-style: italic; font-size: 1.15rem; color: var(--ink-700); }
.story-card__title { font-family: var(--font-display); font-size: var(--fs-h3); color: var(--heading); }
.story-card__text { color: var(--text-muted); font-size: .98rem; }

/* ---- Forms ------------------------------------------------------------- */
.form { display: grid; gap: 26px; }
.field { display: grid; gap: 8px; }
.field__label { font-size: var(--fs-eyebrow); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-700); font-weight: 500; }
.field__label .req { color: var(--maroon-700); }
.field__hint { font-size: var(--fs-caption); color: var(--ink-500); }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--paper-50); color: var(--ink-900);
  border: 1px solid var(--paper-300); border-radius: var(--r-control);
  transition: border-color var(--dur-standard), box-shadow var(--dur-standard), background var(--dur-standard);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:hover, .textarea:hover { border-color: var(--ink-500); }
.input:focus, .textarea:focus { outline: none; border-color: var(--gold-700); box-shadow: 0 0 0 3px rgba(161,123,69,.18); background: #fff; }
.field.has-error .input, .field.has-error .textarea { border-color: var(--error); }
.field__error { font-size: .85rem; color: var(--error); display: none; }
.field.has-error .field__error { display: block; }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice__box {
  display: flex; gap: 12px; align-items: center; min-height: 58px; padding: 14px 16px;
  border: 1px solid var(--paper-300); border-radius: var(--r-control); background: var(--paper-50);
  transition: border-color var(--dur-standard), background var(--dur-standard), transform var(--dur-fast);
}
.choice__box .orn-icon { color: var(--gold-700); }
.choice__mark { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--ink-500); flex: none; display: grid; place-items: center; }
.choice--check .choice__mark { border-radius: 3px; }
.choice__mark::after { content: ""; width: 8px; height: 8px; border-radius: inherit; background: var(--maroon-700); transform: scale(0); transition: transform var(--dur-standard) var(--ease-enter); }
.choice input:checked + .choice__box { border-color: var(--maroon-700); background: #fff; }
.choice input:checked + .choice__box .choice__mark { border-color: var(--maroon-700); }
.choice input:checked + .choice__box .choice__mark::after { transform: scale(1); }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.choice:hover .choice__box { border-color: var(--ink-500); }
.choice__title { font-weight: 500; color: var(--ink-900); line-height: 1.3; }
.choice__sub { font-size: .8rem; color: var(--ink-500); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--paper-300); border-radius: var(--r-control); background: var(--paper-50); }
.stepper button { width: 48px; height: 48px; border: 0; background: none; cursor: pointer; color: var(--ink-800); display: grid; place-items: center; }
.stepper button:hover { background: var(--paper-200); }
.stepper output { min-width: 54px; text-align: center; font-family: var(--font-display); font-size: 1.6rem; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1px dashed var(--maroon-700); border-radius: var(--r-control);
  background: rgba(216,185,174,.18); color: var(--ink-800); font-size: .92rem;
}
.notice .orn-icon { color: var(--maroon-700); margin-top: 2px; }

/* ---- Accordion --------------------------------------------------------- */
.accordion { border-top: 1px solid var(--paper-300); }
.accordion details { border-bottom: 1px solid var(--paper-300); }
.accordion summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 4px; font-family: var(--font-display); font-size: 1.35rem; color: var(--ink-800);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .orn-icon { color: var(--gold-700); transition: transform var(--dur-reveal) var(--ease-enter); }
.accordion details[open] summary .orn-icon { transform: rotate(45deg); }
.accordion__body { padding: 0 4px 22px; color: var(--ink-700); max-width: 64ch; animation: accIn var(--dur-reveal) var(--ease-enter); }
@keyframes accIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---- Petal canvas (celebration) --------------------------------------- */
.petal-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 95; }

.marquee--bare { border: 0; padding: 0; background: transparent; }



/* ==========================================================================
   v2 — responsive & interaction fixes
   ========================================================================== */

/* Tiles: hover effects stay inside their own frame (no overlap with neighbours) */
.tile { isolation: isolate; }
.tile:hover, .tile:focus-within { z-index: 2; }
.tile--stack .tile__stage, .tile--zoom .tile__stage { overflow: hidden; border-radius: 6px; background: var(--paper-100); border: 1px solid var(--paper-300); }
.tile--stack .tile__layer { box-shadow: 0 6px 16px -10px rgba(48,37,31,.45); }
.tile--stack:hover .tile__layer.is-cover, .tile--stack .tile__btn:focus-visible .tile__layer.is-cover { transform: scale(.6) translateY(-10%); }
.tile--stack:hover .tile__layer:nth-child(2), .tile--stack .tile__btn:focus-visible .tile__layer:nth-child(2) { transform: translate(-21%, -9%) rotate(-6deg) scale(.5); }
.tile--stack:hover .tile__layer:nth-child(3), .tile--stack .tile__btn:focus-visible .tile__layer:nth-child(3) { transform: translate(21%, -9%) rotate(6deg) scale(.5); }
.tile--stack:hover .tile__layer:nth-child(4), .tile--stack .tile__btn:focus-visible .tile__layer:nth-child(4) { transform: translate(-21%, 14%) rotate(-3deg) scale(.42); }
.tile--stack:hover .tile__layer:nth-child(5), .tile--stack .tile__btn:focus-visible .tile__layer:nth-child(5) { transform: translate(21%, 14%) rotate(3deg) scale(.42); }
.tile--stack:hover .tile__label { transform: none; }
.tile--flip .tile__stage { border-radius: 6px; }
.tile__label { max-width: calc(100% - 24px); }
.tile__title, .tile__cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; }
@media (hover: none) {
  .tile--stack:hover .tile__layer, .tile--stack:hover .tile__layer.is-cover { transform: none !important; }
  .tile--zoom:hover .tile__layer img { transform: none; }
}
@media (max-width: 520px) {
  .tile__label { left: 8px; right: 8px; bottom: 8px; padding: 7px 10px; max-width: calc(100% - 16px); }
  .tile__title { font-size: 1.05rem; }
  .tile__cap { display: none; }
}

/* Anchor targets clear the fixed header */
[id] { scroll-margin-top: 72px; }


/* Drawer: scrollable on short phones, close button clears notch */
.drawer { overflow-y: auto; padding: 72px 20px 40px; }
.drawer__close { position: absolute; top: calc(15px + env(safe-area-inset-top, 0px)); right: var(--gutter); display: inline-flex; }
.drawer__inner { margin: auto; }
@media (max-height: 640px) { .drawer .orn-gopuram { display: none; } .drawer__link { font-size: 1.9rem; } }

/* Tablet: header nav needs room — collapse a bit earlier */
@media (max-width: 1100px) { .nav__list { gap: 16px; } .nav__link { letter-spacing: .12em; font-size: .72rem; } }


/* ==========================================================================
   v4 — photo stacks: hover/click on desktop, tap-to-spread on touch screens
   ========================================================================== */
.story-card__stack {
  display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: zoom-in; -webkit-tap-highlight-color: transparent;
}
.story-card__stack:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 6px; border-radius: 6px; }
.story-card__stack .print { display: block; }

/* the spread — same pose for hover, keyboard focus and a first tap */
.story-card.is-peek .print:nth-child(1) { transform: rotate(-8deg) translate(-8%, 2%); }
.story-card.is-peek .print:nth-child(2) { transform: rotate(7deg) translate(8%, 1%); }
.story-card.is-peek .print:nth-child(3) { transform: rotate(0) translateY(-3%) scale(1.015); }
@media (hover: none) { /* no sticky hover on touch — only the tap state spreads */
  .story-card:hover:not(.is-peek) .print:nth-child(1) { transform: rotate(-4deg) translate(-3%, 1%); }
  .story-card:hover:not(.is-peek) .print:nth-child(2) { transform: rotate(3deg) translate(3%, 0); }
  .story-card:hover:not(.is-peek) .print:nth-child(3) { transform: rotate(-.5deg); }
}

/* small hint chip on each stack */
.stack-hint {
  position: absolute; left: 50%; bottom: 10px; z-index: 4; transform: translate(-50%, 6px);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 10px; border-radius: 999px; background: rgba(251,247,239,.94); border: 1px solid var(--gold-700);
  font: 500 .62rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-800);
  opacity: 0; transition: opacity var(--dur-standard), transform var(--dur-standard) var(--ease-standard); pointer-events: none;
}
.stack-hint .orn-icon { width: 13px; height: 13px; color: var(--gold-700); }
.story-card:hover .stack-hint, .story-card__stack:focus-visible .stack-hint { opacity: 1; transform: translate(-50%, 0); }
.only-touch { display: none; }
@media (hover: none) {
  .only-hover { display: none; } .only-touch { display: inline; }
  .stack-hint { opacity: .92; transform: translate(-50%, 0); }
  .story-card.is-peek .stack-hint .only-touch { font-size: 0; }
  .story-card.is-peek .stack-hint .only-touch::after { content: "Tap again to open"; font-size: .62rem; }
}

/* gallery tiles: a first tap on touch screens shows the same effect as hover */
.tile.is-peek { z-index: 2; }
.tile--stack.is-peek .tile__layer.is-cover { transform: scale(.6) translateY(-10%) !important; }
.tile--stack.is-peek .tile__layer:nth-child(2) { transform: translate(-21%, -9%) rotate(-6deg) scale(.5) !important; }
.tile--stack.is-peek .tile__layer:nth-child(3) { transform: translate(21%, -9%) rotate(6deg) scale(.5) !important; }
.tile--stack.is-peek .tile__layer:nth-child(4) { transform: translate(-21%, 14%) rotate(-3deg) scale(.42) !important; }
.tile--stack.is-peek .tile__layer:nth-child(5) { transform: translate(21%, 14%) rotate(3deg) scale(.42) !important; }
.tile--flip.is-peek .tile__stage { transform: rotateY(180deg) !important; }
.tile--flip.is-peek .tile__label { opacity: 0; }
.tile--zoom.is-peek .tile__layer img { transform: scale(1.08) !important; }
.tile__count .only-touch { display: none; }
@media (hover: none) {
  .tile.is-peek .tile__label { opacity: 1; }
  .tile--flip.is-peek .tile__label { opacity: 0; }
  .tile__btn::after {
    content: "Tap to spread"; position: absolute; top: 10px; right: 10px; z-index: 6;
    padding: 4px 8px; border-radius: 999px; background: rgba(251,247,239,.92); border: 1px solid var(--paper-300);
    font: 500 .58rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-700);
    pointer-events: none;
  }
  .tile.is-peek .tile__btn::after { content: "Tap again to open"; border-color: var(--gold-700); color: var(--maroon-700); }
}

/* framing: keep faces in view when a photo is cropped into a frame */
.tile__layer img, .tile__face--back img, .story-card__stack .print img, .film img,
.frame__img, .lightbox__thumb img, .film-card__poster img { object-position: 50% 28%; }
