/* Dear Future Us — Wedding Cinema
   Layout concept: quiet stationery. Linen pages, one walnut band per page,
   films shown wide in true 21:9 cinema frames, and the Our Story letter as the one bold object. */

:root {
  /* colour */
  --linen: #F2EEE6;
  --sand: #E4DCCD;
  --paper: #FDFBF6;
  --stone: #BFB5A4;
  --taupe: #766D63;          /* captions; darkened from #9F978F for legible contrast on linen */
  --olive: #6F7058;
  --caramel: #9A6A45;        /* text-weight caramel; lighter #AC7D59 used for rules */
  --caramel-line: #AC7D59;
  --walnut: #5A4434;
  --ink: #2D2E2C;
  --on-dark: #F2EEE6;
  --on-dark-soft: rgba(242, 238, 230, 0.72);

  /* type */
  --serif: "EB Garamond", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
  --cjk: "Noto Serif TC", "Songti TC", "PMingLiU", serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: 3rem;

  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --measure: 62ch;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--caramel); outline-offset: 4px; }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.wrap--narrow { max-width: 760px; }

.caps { text-transform: uppercase; letter-spacing: 0.22em; font-size: var(--step--1); }
.script { font-family: var(--script); font-weight: 400; color: var(--caramel); line-height: 1.2; }
:lang(zh-Hant), .zh { font-family: var(--serif), var(--cjk); }

/* ---------- header ---------- */
.site-header { background: var(--linen); border-bottom: 1px solid rgba(90, 68, 52, 0.12); }
.site-header__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-block: 22px 10px;
}
.brand { grid-column: 2; display: block; }
.brand img { width: clamp(170px, 22vw, 230px); height: auto; }
.social { display: flex; gap: 14px; }
.site-header__top .social { grid-column: 3; justify-self: end; }
.social a { display: grid; place-items: center; width: 32px; height: 32px; color: var(--ink); opacity: 0.75; transition: opacity 150ms; }
.social a:hover { opacity: 1; }
.social svg { width: 18px; height: 18px; }

.nav { padding-block: 6px 16px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px clamp(18px, 3vw, 40px); }
.nav a {
  text-decoration: none; text-transform: uppercase; letter-spacing: 0.24em; font-size: 0.8rem;
  padding-block: 6px; border-bottom: 1px solid transparent; transition: border-color 200ms;
}
.nav a:hover { border-color: var(--stone); }
.nav a[aria-current="page"] { border-color: var(--caramel-line); }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--walnut); color: var(--on-dark); overflow: hidden; }
.hero__media { aspect-ratio: 21 / 9; width: 100%; max-height: 82vh; position: relative; }
.hero__media video, .hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: rgba(32, 24, 18, 0.28); }
.hero__content {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px;
  padding-inline: var(--gutter) var(--gutter-r);
}
.hero__logo { width: clamp(240px, 36vw, 480px); height: auto; }
.hero__tag { font-style: italic; font-size: var(--step-1); color: var(--on-dark); }
.hero__cta { color: var(--on-dark); }
.hero__toggle {
  position: absolute; z-index: 2; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 14px;
  background: none; border: 1px solid var(--on-dark-soft); color: var(--on-dark); font: inherit; font-size: 0.75rem;
  letter-spacing: 0.18em; text-transform: uppercase; padding: 6px 12px; cursor: pointer; opacity: 0.8;
}
.hero__toggle:hover { opacity: 1; }
@media (max-width: 767px) {
  .hero__media { aspect-ratio: 4 / 5; max-height: none; }
}

/* text link with hairline underline that grows from centre */
.text-link {
  position: relative; display: inline-block; text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.24em; font-size: 0.8rem; padding-bottom: 6px;
}
.text-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; opacity: 0.55;
  transform: scaleX(0.6); transition: transform 200ms var(--ease), opacity 200ms;
}
.text-link:hover::after { transform: scaleX(1); opacity: 1; }
.text-link--accent { color: var(--caramel); }

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section--sand { background: var(--sand); }
.section--walnut { background: var(--walnut); color: var(--on-dark); }

.note { display: grid; justify-items: center; text-align: center; gap: 22px; max-width: 760px; }
.note .script { font-size: 2.2rem; }
.note__lead { font-size: var(--step-2); line-height: 1.5; }
/* each line is one complete phrase; on narrow screens lines may wrap, but only between phrase chunks */
.note__lead .ln { display: block; }
.note__lead .ln > span { white-space: nowrap; }
.note__rule { width: 60px; height: 1px; background: var(--caramel-line); }
.note__side { color: var(--taupe); font-size: 1rem; letter-spacing: 0.02em; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid rgba(90, 68, 52, 0.18); margin-bottom: 36px; }
.section-head h2 { font-size: var(--step-2); letter-spacing: 0.04em; }

.quote { text-align: center; font-style: italic; font-size: var(--step-2); line-height: 1.45; max-width: 30ch; margin-inline: auto; }

.closing { text-align: center; display: grid; justify-items: center; gap: 26px; }
.closing p { font-size: var(--step-3); font-style: italic; }
.btn-outline {
  display: inline-block; text-decoration: none; border: 1px solid currentColor; padding: 14px 30px;
  text-transform: uppercase; letter-spacing: 0.24em; font-size: 0.78rem; transition: background 200ms, color 200ms;
}
.section--walnut .btn-outline:hover { background: var(--on-dark); color: var(--walnut); }

/* ---------- films ---------- */
.films-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 900px) { .films-grid { grid-template-columns: 1fr; gap: 40px; } }
.films-list { display: grid; gap: clamp(56px, 8vw, 96px); }

.film { display: grid; gap: 14px; min-width: 0; }
.film__frame {
  position: relative; display: block; width: 100%; aspect-ratio: 21 / 9; overflow: hidden; background: var(--ink);
  border: 0; padding: 0; cursor: pointer; color: var(--on-dark);
}
/* YouTube covers of 2.35:1 films carry ~90px letterbox bars on a 1280x720 image; zoom 5% so no bar shows in the 21:9 frame */
.film__frame img, .film__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.05); transition: transform 600ms var(--ease); }
.film__frame:hover img { transform: scale(1.075); }
.film__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(242, 238, 230, 0.8);
  display: grid; place-items: center; background: rgba(45, 46, 44, 0.25); backdrop-filter: blur(2px);
}
.film__play svg { width: 16px; height: 16px; margin-left: 3px; fill: var(--on-dark); }
.film__couple { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.82rem; }
.film__venue { color: var(--taupe); font-size: 0.95rem; }
.film__line { font-style: italic; }
.film--wide .film__couple { font-size: 0.95rem; }
.film--wide .film__line { font-size: var(--step-1); }
.film__meta { display: grid; gap: 2px; }

.page-title { text-align: center; padding-block: clamp(56px, 8vw, 96px) clamp(36px, 5vw, 56px); display: grid; gap: 14px; justify-items: center; }
.page-title h1 { font-size: var(--step-4); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.1; }
.page-title p { color: var(--taupe); font-style: italic; font-size: var(--step-1); max-width: 40ch; }
.page-title .rule { width: 80px; height: 1px; background: var(--caramel-line); }
@media (max-width: 600px) { .page-title h1 { font-size: 2.1rem; } }

.more-link { text-align: center; padding-top: clamp(48px, 7vw, 80px); }

/* lightbox */
.lightbox { border: 0; padding: 0; background: transparent; width: min(1100px, 94vw); max-width: none; overflow: visible; }
.lightbox::backdrop { background: rgba(28, 22, 17, 0.88); }
.lightbox__inner { display: grid; gap: 14px; }
.lightbox__player { aspect-ratio: 16 / 9; width: 100%; background: #000; }
.lightbox__player iframe { width: 100%; height: 100%; border: 0; }
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; color: var(--on-dark); gap: 16px; flex-wrap: wrap; }
.lightbox__title { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.8rem; }
.lightbox__actions { display: flex; gap: 22px; align-items: center; }
.lightbox__close { background: none; border: 0; color: var(--on-dark); font: inherit; text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.78rem; cursor: pointer; padding: 6px 0; }

/* ---------- our story letter ---------- */
.story { padding-block: 0 clamp(80px, 10vw, 140px); }
.story__stage { position: relative; max-width: 760px; margin-inline: auto; }
.letter {
  position: relative; z-index: 1;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(90, 68, 52, 0.028) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(90, 68, 52, 0.02) 0 1px, transparent 1px 120px),
    radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(90, 68, 52, 0.05) 100%);
  border: 1px solid rgba(90, 68, 52, 0.09);
  box-shadow: 0 1px 2px rgba(60, 45, 30, 0.06), 0 26px 50px -16px rgba(60, 45, 30, 0.22);
  padding: clamp(40px, 7vw, 76px) clamp(26px, 7vw, 84px) clamp(120px, 14vw, 150px);
}
.letter__fold {
  position: absolute; left: 0; right: 0; top: 50%; height: 1px; pointer-events: none;
  background: rgba(90, 68, 52, 0.07); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); opacity: 0;
}
.lang-toggle { display: flex; justify-content: center; gap: 14px; align-items: center; margin-bottom: clamp(28px, 4vw, 44px); color: var(--taupe); font-size: 0.85rem; }
.lang-toggle button {
  background: none; border: 0; padding: 4px 2px; font: inherit; color: var(--taupe); cursor: pointer; letter-spacing: 0.12em;
  border-bottom: 1px solid transparent;
}
.lang-toggle button[aria-pressed="true"] { color: var(--ink); border-color: var(--caramel-line); }
.letter__body { transition: opacity 200ms ease; }
.letter__body.is-swapping { opacity: 0; }
.letter__salutation { font-family: var(--script); color: var(--caramel); font-size: 2.2rem; line-height: 1.2; margin-bottom: 26px; }
.letter__body[lang="zh-Hant"] .letter__salutation { font-family: var(--serif), var(--cjk); font-size: 1.5rem; letter-spacing: 0.08em; color: var(--caramel); }
.letter__text { display: grid; gap: 1.15em; font-size: 1.1875rem; line-height: 1.78; max-width: var(--measure); }
.letter__body[lang="zh-Hant"] .letter__text { font-size: 1.125rem; line-height: 2; letter-spacing: 0.04em; }
.letter__signoff { margin-top: 38px; display: grid; gap: 2px; }
.letter__signoff em { font-size: 1.1rem; }
.letter__signature { font-family: var(--script); color: var(--caramel); font-size: 3rem; line-height: 1.1; display: inline-block; }
.letter__ps { margin-top: 52px; padding-top: 30px; border-top: 1px solid rgba(90, 68, 52, 0.1); display: grid; gap: 0.75em; font-size: 1.0625rem; max-width: var(--measure); }
.letter__ps .ps-mark { font-family: var(--script); color: var(--caramel); font-size: 1.7rem; line-height: 1; margin-right: 6px; }
.letter__ps b { font-weight: 600; font-variant: small-caps; letter-spacing: 0.06em; font-size: 1.12em; }
.letter__body[lang="zh-Hant"] .letter__ps b { font-variant: normal; letter-spacing: 0.1em; }
.emboss { position: absolute; right: clamp(22px, 5vw, 48px); bottom: clamp(20px, 4vw, 36px); width: clamp(110px, 18vw, 150px); pointer-events: none; }
.emboss img { width: 100%; height: auto; display: block; }
.emboss img + img { position: absolute; inset: 0; }
.emboss .emboss__shade { opacity: 0.08; transform: translate(0.6px, 0.6px); }
.emboss .emboss__light { opacity: 0.85; filter: brightness(0) invert(1); transform: translate(-0.6px, -0.6px); mix-blend-mode: screen; }

.print {
  position: absolute; z-index: 2; right: -175px; top: 56px; width: 230px;
  background: #fff; padding: 12px 12px 44px; transform: rotate(4deg);
  box-shadow: 0 2px 4px rgba(60, 45, 30, 0.08), 0 16px 30px -10px rgba(60, 45, 30, 0.28);
}
.print__img { aspect-ratio: 1 / 1; width: 100%; height: auto; object-fit: cover; background: var(--sand); }
.print figcaption { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-family: var(--script); color: var(--caramel); font-size: 1.15rem; }
@media (max-width: 1180px) {
  .print { position: relative; right: auto; top: auto; margin: 0 auto 28px; width: 210px; transform: rotate(-2deg); }
}

.write-back { text-align: center; padding-top: clamp(64px, 8vw, 96px); }
.write-back a {
  font-style: italic; font-size: 1.45rem; color: var(--caramel); text-decoration: none; position: relative; padding-bottom: 4px;
}
.write-back a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--caramel-line); transform: scaleX(0.4); transition: transform 200ms var(--ease); }
.write-back a:hover::after { transform: scaleX(1); }

/* opening-the-letter moment (classes only ever added by JS) */
.story.will-open .letter { clip-path: inset(50% 0 50% 0); }
.story.will-open .letter__fold { opacity: 1; }
.story.will-open .print { opacity: 0; translate: -60px 40px; }
.story.will-open .letter__signature { clip-path: inset(0 100% 0 0); }
.story.is-open .letter { clip-path: inset(0 0 0 0); transition: clip-path 750ms var(--ease); }
.story.is-open .letter__fold { opacity: 0; transition: opacity 700ms ease 650ms; }
.story.is-open .print { opacity: 1; translate: 0 0; transition: opacity 400ms ease 700ms, translate 500ms var(--ease) 700ms; }
.story.is-open .letter__signature { clip-path: inset(0 0 0 0); transition: clip-path 700ms ease-out 1000ms; }

/* ---------- collections ---------- */
.collections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
@media (max-width: 800px) { .collections { grid-template-columns: 1fr; } }
.collection { border: 1px solid rgba(90, 68, 52, 0.22); padding: clamp(30px, 4vw, 48px); display: grid; gap: 18px; align-content: start; background: rgba(253, 251, 246, 0.5); }
.collection h2 { font-size: var(--step-3); font-style: italic; }
.collection > p { color: var(--taupe); }
.collection ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.collection li { padding-left: 22px; position: relative; }
.collection li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 10px; height: 1px; background: var(--caramel-line); }
.pricing-note { text-align: center; color: var(--taupe); font-style: italic; margin-top: 40px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; border-top: 1px solid rgba(90, 68, 52, 0.22); padding-top: 18px; }
.steps li::before { content: counter(step); font-family: var(--script); color: var(--caramel); font-size: 2rem; line-height: 1; }
.steps h3 { font-size: var(--step-1); }
.steps p { color: var(--taupe); font-size: 0.98rem; }
.h-section { font-size: var(--step-2); text-align: center; margin-bottom: 40px; font-style: italic; }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(36px, 6vw, 80px); align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.contact__aside { display: grid; gap: 22px; }
.contact__aside .script { font-size: 2rem; }
.contact__aside dl { margin: 0; display: grid; gap: 14px; }
.contact__aside dt { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.75rem; color: var(--taupe); }
.contact__aside dd { margin: 2px 0 0; }
.contact__form { background: var(--paper); border: 1px solid rgba(90, 68, 52, 0.12); padding: clamp(20px, 3vw, 36px); min-height: 400px; }
.contact__form iframe { width: 100%; border: 0; display: block; }
.contact__fallback { display: grid; gap: 14px; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--on-dark); padding-block: 64px 34px; text-align: center; }
.site-footer .wrap { display: grid; justify-items: center; gap: 22px; }
.site-footer img { width: 200px; height: auto; }
.site-footer .social { justify-self: center; }
.site-footer .social a { color: var(--on-dark); }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; }
.footer-nav a { text-decoration: none; text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.75rem; opacity: 0.85; }
.footer-nav a:hover { opacity: 1; }
.footer-meta { color: var(--on-dark-soft); font-size: 0.85rem; letter-spacing: 0.08em; }
.footer-copy { width: 100%; border-top: 1px solid rgba(242, 238, 230, 0.15); padding-top: 22px; color: var(--on-dark-soft); font-size: 0.8rem; }

@media (max-width: 600px) {
  .site-header__top { grid-template-columns: 1fr; justify-items: center; gap: 8px; }
  .brand, .site-header__top .social { grid-column: 1; justify-self: center; }
  .site-header__top .social { order: 2; }
  .nav ul { gap: 4px 12px; }
  .nav a { font-size: 0.66rem; letter-spacing: 0.1em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
