/* Marigold & Sons — the site is an invitation.
   Flat editorial page by default (no JS, reduced motion, missing libraries);
   html.motion adds the envelope, the lifting lid, the handwriting, the petals and the light on the rules. */

@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 300 700; font-display: swap; src: url(fonts/fraunces-italic.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/jost.woff2) format("woff2"); }

:root {
  --linen: #e8dac0; --ivory: #f7f0e2; --ivory-2: #f1e7d2;
  --red: #7a1020; --red-2: #5c0a17; --red-3: #8d1a30;
  --gold: #b8893a; --gold-2: #e3c67a;
  --ink: #2a1a14; --ink-2: #5b483d;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(20px, 4vw, 48px);
  --ew: min(78vw, 360px);
}

* { box-sizing: border-box; }
html { background: var(--linen); color: var(--ink); font: 400 17px/1.55 var(--body); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--linen) radial-gradient(120% 70% at 50% 0%, #f2e7d1 0%, var(--linen) 65%); }
a { color: inherit; }
img, video { display: block; }
h1, h2, h3 { font-family: var(--display); font-style: italic; font-weight: 400; font-optical-sizing: auto; }
h1 em, h2 em, h3 em { font-style: italic; color: var(--red); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 50; background: var(--red); color: var(--ivory); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- top ---------- */
.top { position: absolute; inset: 0 0 auto 0; z-index: 20; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 18px var(--pad); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.top__name { font: italic 400 22px/1 var(--display); text-transform: none; letter-spacing: 0; text-decoration: none; }
.top__name span { color: var(--gold); }
.top__link { text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: 2px; white-space: nowrap; }

/* ---------- the invitation (flat) ---------- */
.invite { padding: 110px var(--pad) 40px; }
.invite__pin { max-width: 1100px; margin: 0 auto; display: grid; gap: 40px; justify-items: center; }
.invite__head { text-align: center; display: grid; justify-items: center; }
.invite__h { margin: 0; max-width: 17ch; font-size: clamp(34px, 6vw, 72px); line-height: 1.05; }
.invite__pre { margin: 0 0 18px; font: 500 12px/1 var(--body); letter-spacing: .24em; text-transform: uppercase; color: var(--ink-2); }
.hint { display: none; }
.stage { position: relative; width: min(92vw, 520px); }
.envb, .envf { display: none; }

.card { position: relative; width: 100%; aspect-ratio: 5 / 7; }
.card__base { position: absolute; inset: 0; background: var(--ivory); padding: 6%; box-shadow: 0 30px 60px -30px rgba(42, 26, 20, .45), 0 0 0 1px rgba(184, 137, 58, .5); }
.card__base::after { content: ""; position: absolute; inset: 10px; border: 1px solid var(--gold); pointer-events: none; }
.card__kicker { margin: 0 0 4%; font: 500 11px/1 var(--body); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); text-align: center; }
.film { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--red-2); }
.film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.script { position: relative; margin-top: 6%; text-align: center; }
.script__svg { display: block; width: 84%; height: auto; margin: 0 auto; fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.script__svg path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.script__svg .g-cap { stroke-width: 1.8; }
.script__svg .g-amp { stroke-width: 2; }
.script__svg .g-num { stroke-width: 4.6; }
.script__line { margin: 3% 0 0; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); }
.card__cover { display: none; }

/* ---------- sheets ---------- */
.sheet-wrap { padding: clamp(36px, 7vh, 90px) var(--pad); }
.sheet { position: relative; max-width: 1040px; margin: 0 auto; background: var(--ivory); padding: clamp(28px, 5vw, 64px); box-shadow: 0 40px 80px -40px rgba(42, 26, 20, .5), 0 0 0 1px rgba(184, 137, 58, .5); }
.sheet::after { content: ""; position: absolute; inset: 12px; border: 1px solid var(--gold); pointer-events: none; }
.kicker { display: block; font: 500 12px/1 var(--body); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 16px; }
h2 { margin: 0; font-size: clamp(30px, 4.4vw, 56px); line-height: 1.05; max-width: 18ch; }
.rule { border: 0; height: 1px; margin: 28px 0; position: relative; overflow: hidden; background: linear-gradient(90deg, transparent, var(--gold) 10%, var(--gold) 90%, transparent); }

.week { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px var(--pad); grid-template-columns: 1fr; }
@media (min-width: 640px) { .week { grid-template-columns: 1fr 1fr; gap: 48px clamp(28px, 5vw, 64px); } }
.week h3 { margin: 14px 0 8px; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; }
.week p { margin: 0; color: var(--ink-2); }
.loop { margin: 0; position: relative; overflow: hidden; background: var(--red-2); box-shadow: 0 0 0 1px rgba(184, 137, 58, .5); }
.loop--land { aspect-ratio: 16 / 10; }
.loop--port { aspect-ratio: 9 / 13; }
.loop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.loop figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ivory); background: linear-gradient(180deg, transparent, rgba(42, 26, 20, .7)); }

.where { display: grid; gap: var(--pad); grid-template-columns: 1.2fr .8fr .8fr; align-items: end; }
.where__text { grid-column: 1 / -1; }
.where__text p { margin: 0; max-width: 60ch; color: var(--ink-2); }
.where__fig.loop--land { grid-column: 1 / 2; }
@media (max-width: 760px) {
  .where { grid-template-columns: 1fr 1fr; }
  .where__fig.loop--land { grid-column: 1 / -1; }
}

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 22px; padding: 26px 0; border-top: 1px solid rgba(184, 137, 58, .45); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps__n { font: italic 300 clamp(40px, 5vw, 64px)/.9 var(--display); color: var(--gold); min-width: 1.2ch; }
.steps h3 { margin: 0 0 6px; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; }
.steps p { margin: 0; color: var(--ink-2); max-width: 56ch; }

.write__mail { display: inline-block; margin: 6px 0 22px; font: italic 400 clamp(19px, 5.4vw, 44px)/1.15 var(--display); color: var(--red); text-decoration: none; border-bottom: 1px solid var(--gold); overflow-wrap: anywhere; }
.write__lines { margin: 0; padding: 0; list-style: none; color: var(--ink-2); display: grid; gap: 4px; }

.foot { padding: 30px var(--pad) 130px; text-align: center; font-size: 13px; color: var(--ink-2); }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--red); }
.foot__small { font-size: 12px; }

.pocket, .petals { display: none; }

/* ---------- motion ---------- */
.motion body { overflow-x: hidden; overscroll-behavior-y: none; }
.motion .top { position: absolute; }

.motion .invite { padding: 0; }
.motion .invite__pin { height: 100vh; height: 100svh; max-width: none; display: block; position: relative; overflow: hidden; }
.motion .invite__head { position: absolute; left: var(--pad); top: max(86px, 11vh); text-align: left; justify-items: start; will-change: transform, opacity; }
.motion .invite__h { max-width: 12ch; font-size: clamp(28px, 4.2vw, 54px); }
.motion .hint { display: block; position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0; font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-2); }
.motion .stage { position: absolute; left: 50%; top: 55%; width: var(--ew); aspect-ratio: 1 / 1.36; transform: translate(-50%, -50%); }

.motion .envb, .motion .envf { display: block; position: absolute; inset: 0; perspective: 1100px; will-change: transform, opacity; }
.motion .envb { z-index: 1; background: var(--red-2); }
.motion .envb::after { content: ""; position: absolute; inset: 9%; border: 1px solid rgba(227, 198, 122, .3); }
.envb__flap { position: absolute; left: 0; right: 0; top: 0; height: 52%; background: linear-gradient(0deg, #6a0d1b, var(--red) 70%); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: 50% 0; visibility: hidden; }
.motion .envf { z-index: 3; pointer-events: none; }
.envf__pocket { position: absolute; inset: 0; background: linear-gradient(180deg, #6e0d1c, var(--red) 55%, #640c1a); clip-path: polygon(0 0, 50% 46%, 100% 0, 100% 100%, 0 100%); }
.envf__pocket::after { content: ""; position: absolute; left: 0; right: 0; top: 46%; bottom: 0; }
.envf__flap { position: absolute; left: 0; right: 0; top: 0; height: 52%; background: linear-gradient(180deg, #9a2440, #85182f 70%, #7a1020); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: 50% 0; will-change: transform; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .35)); }
.envf__seal { position: absolute; left: 50%; top: 100%; transform: translate(-50%, -62%); width: 18%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f3dc98, var(--gold) 55%, #8f6520); color: var(--red-2); display: grid; place-items: center; font: italic 500 clamp(11px, 2.4vw, 16px)/1 var(--display); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }

.motion .card { position: absolute; left: 50%; top: 50%; width: var(--cw, 320px); z-index: 2; perspective: 1400px; will-change: transform; visibility: hidden; }
.motion.ready .card { visibility: visible; }
.motion .card__cover { display: block; position: absolute; inset: 0; z-index: 2; transform-origin: 50% 0; transform-style: preserve-3d; will-change: transform; }
.card__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card__face--front { background: var(--ivory); display: grid; place-items: center; align-content: center; gap: 16px; padding: 10%; text-align: center; box-shadow: 0 0 0 1px rgba(184, 137, 58, .5); }
.card__face--front::after { content: ""; position: absolute; inset: 10px; border: 1px solid var(--gold); pointer-events: none; }
.card__face--back { background: var(--ivory-2); transform: rotateX(180deg); box-shadow: 0 0 0 1px rgba(184, 137, 58, .5); }
.card__face--back::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(184, 137, 58, .5); }
.card__face .card__kicker { margin: 0; }
.card__orn { width: 36px; height: 36px; color: var(--gold); }
.card__title { font: italic 400 clamp(26px, 5vw, 48px)/1 var(--display); color: var(--red); max-width: 9ch; }
.card__sub { font: 500 11px/1 var(--body); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); margin-top: 6px; }

/* the pocket the later cards come out of */
.motion .pocket { display: block; position: fixed; left: 50%; bottom: -2px; z-index: 5; width: min(70vw, 360px); height: 74px; transform: translate(-50%, 115%); transition: transform .7s cubic-bezier(.2, .7, .2, 1); pointer-events: none; filter: drop-shadow(0 -8px 16px rgba(42, 26, 20, .22)); }
.motion .pocket.is-on { transform: translate(-50%, 0); }
.pocket__b { position: absolute; left: 4%; right: 4%; top: 0; bottom: 0; background: var(--red-2); }
.pocket__f { position: absolute; inset: 0; background: linear-gradient(180deg, var(--red-3), var(--red) 70%); clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); }

/* petals */
.motion .petals { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; }

/* a slow light along every gold rule */
.motion .rule::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 28%; background: linear-gradient(90deg, transparent, #fff6d6 50%, transparent); transform: translateX(-120%); animation: glint 7s cubic-bezier(.45, 0, .2, 1) infinite; animation-delay: var(--d, 0s); }
#where .rule { --d: 2.1s; }
#how .rule { --d: 3.9s; }
#write .rule { --d: 5.4s; }
@keyframes glint { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(430%); } }

.motion .sheet { will-change: transform; visibility: hidden; }
.motion.ready .sheet { visibility: visible; }

/* phone: headline above the envelope, not behind it */
@media (max-width: 768px) {
  :root { --ew: min(66vw, 360px); }
  .motion .invite__head { top: 82px; }
  .motion .invite__h { font-size: clamp(22px, 6.4vw, 28px); max-width: 15ch; }
  .motion .stage { top: 59%; }
  .motion .pocket { width: min(56vw, 300px); height: 60px; }
}
