/* Martyna & Adrian 2027 — wedding site styles. Sections: tokens, background, envelope intro, invitation sections, controls, motion. */
/* Layout: one night-garden screen; a sealed envelope opens into a single tall card (photo, names, date, countdown). Single dark look by design. */
:root {
  color-scheme: dark;
  --night: #0f1b15;
  --forest: #17271f;
  --moss: #22382c;
  --cream: #f1e7d2;
  --cream-dim: #c4b9a2;
  --paper: #ece0c4;
  --paper-shade: #d9caa8;
  --gold: #caa65c;
  --poppy: #d65a3c;
  --sun: #e5bd48;
  --umber: #4b3a33;
  --pl-white: #f6f2ea;
  --ro-blue: #2b4a8f;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42  0 0 0 0 .33  0 0 0 0 .2  0 0 0 .16 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --liner: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'><g fill='none' stroke='%23caa65c' stroke-width='1' opacity='.55'><path d='M14 40 C14 28 22 20 28 16'/><path d='M20 30 c-6 -1 -8 -6 -8 -9 c4 0 8 3 8 9z'/><path d='M24 23 c5 -3 9 -2 11 0 c-3 3 -7 3 -11 0z'/><circle cx='44' cy='44' r='1.4' fill='%23caa65c'/><circle cx='42' cy='10' r='1' fill='%23caa65c'/></g></svg>") 0 0 / 46px 46px, radial-gradient(120% 90% at 50% 0%, #2a4535, #17271f);
  --f-script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-body: "Jost", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
html, body { min-height: 100%; }
body {
  background: var(--night);
  color: var(--cream);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- background ---------- */
.venue { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--night); }
.venue img {
  position: absolute; inset: -4%; width: 108%; height: 108%; max-width: none;
  object-fit: cover; opacity: 0;
  animation: venueFade 24s ease-in-out infinite, kenburns 24s ease-in-out infinite alternate;
}
.venue img.v1 { object-position: 50% 40%; }
.venue img.v2 { object-position: 42% 50%; animation-delay: -12s, -6s; }
.venue::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(80% 60% at 50% 40%, rgba(15,27,21,.25), rgba(15,27,21,.6) 100%),
    linear-gradient(180deg, rgba(15,27,21,.35), rgba(15,27,21,.55));
}
@keyframes venueFade { 0%, 42% { opacity: 1; } 50%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.1) translate(-2%, -1.5%); } }
.venue-note {
  position: relative; z-index: 10; text-align: center;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 40px;
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--cream);
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
#shards { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

/* ---------- intro / envelope ---------- */
.intro {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px;
  background:
    radial-gradient(70% 50% at 50% 55%, rgba(202,166,92,.10), transparent 70%),
    radial-gradient(120% 80% at 50% 0%, var(--moss), transparent 65%),
    var(--night);
  transition: opacity .9s ease, visibility .9s;
  text-align: center;
  overflow: hidden;
}
.intro.gone { opacity: 0; visibility: hidden; }
.eyebrow {
  font-family: var(--f-body); font-weight: 400; font-size: 12px;
  letter-spacing: .28em; text-transform: uppercase; color: var(--gold);
}
.intro-to { font-size: 14px; letter-spacing: .14em; color: var(--cream-dim); margin-bottom: -10px; }
.intro-to b { font-family: var(--f-script); font-weight: 400; font-size: 1.9em; letter-spacing: 0; color: var(--cream); margin-left: .25em; }
.intro-names { font-family: var(--f-script); font-size: clamp(34px, 9.5vw, 54px); line-height: 1.05; color: var(--cream); margin-top: -6px; text-wrap: balance; }

.env-stage {
  --tip: 54%; --side: 55%; --bot: 46%;
  position: relative;
  width: min(100%, 700px, 92vh);
  animation: bob 5s ease-in-out infinite;
}
.env-stage::after {
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -7%; height: 14%; z-index: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.6), transparent 70%);
  filter: blur(8px);
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.env {
  position: relative; z-index: 1;
  width: 100%; aspect-ratio: 7 / 5; max-width: 100%;
  perspective: 1800px;
  transform: rotate(-1.2deg);
  cursor: pointer;
}
.env .layer { position: absolute; inset: 0; }
.grain { background-image: var(--grain); }
.env-back {
  z-index: 1; border-radius: 3px;
  background: var(--liner);
  box-shadow: 0 34px 60px -26px rgba(0,0,0,.8), 0 12px 24px -12px rgba(0,0,0,.55);
}
.letter {
  position: absolute; z-index: 2;
  inset: 5% 6% 6% 6%;
  background: var(--grain), linear-gradient(180deg, #faf4e6, #f1e7d2);
  border-radius: 2px;
  padding: 4%;
  display: flex; flex-direction: column; align-items: center; gap: 3%;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  transition: transform 1.3s cubic-bezier(.2,.8,.2,1);
}
.letter img { width: 100%; height: 74%; object-fit: cover; object-position: 50% 60%; border-radius: 1px; }
.letter span { font-family: var(--f-script); color: var(--forest); font-size: clamp(20px, 5vw, 34px); line-height: 1; }
.fl-wrap { position: absolute; inset: 0; filter: drop-shadow(0 0 1px rgba(90,62,20,.45)) drop-shadow(0 3px 4px rgba(70,48,12,.22)); }
.fl-wrap.sides { z-index: 3; }
.fl-wrap.bottom { z-index: 4; }
.fl { position: absolute; inset: 0; border-radius: 3px; }
.fl.left { clip-path: polygon(0 0, 0 100%, 53% var(--side)); background: var(--grain), linear-gradient(96deg, #efe3c8 10%, #dfcda8 90%); }
.fl.right { clip-path: polygon(100% 0, 100% 100%, 47% var(--side)); background: var(--grain), linear-gradient(264deg, #ece0c3 10%, #dccaa4 90%); }
.fl.bot { clip-path: polygon(0 100%, 47% var(--bot), 53% var(--bot), 100% 100%); background: var(--grain), linear-gradient(0deg, #f2e7cf 30%, #e2d1ad 100%); }
.foil {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: 9%;
  font-family: var(--f-display); font-weight: 400; letter-spacing: .34em; padding-left: .34em;
  font-size: clamp(11px, 2.4vw, 17px); text-align: center;
  background: linear-gradient(100deg, #6f5220 0%, #c9a24f 35%, #7e5f24 55%, #d2ae5c 75%, #735522 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255,250,235,.6));
}
.stamp {
  /* two flag stamps glued on the envelope, cancelled by the postmark */
  position: absolute; z-index: 5; right: 5%; bottom: 13%; width: 25%;
  display: flex; gap: 5%; align-items: flex-start;
  filter: drop-shadow(0 1px 1.2px rgba(60,40,10,.4));
}
.stamp > div {
  --p: 6px;
  flex: 1; aspect-ratio: 5 / 4;
  -webkit-mask: radial-gradient(circle, transparent 36%, #000 42%) calc(var(--p) / -2) calc(var(--p) / -2) / var(--p) var(--p), linear-gradient(#000 0 0) center / calc(100% - var(--p)) calc(100% - var(--p)) no-repeat;
  mask: radial-gradient(circle, transparent 36%, #000 42%) calc(var(--p) / -2) calc(var(--p) / -2) / var(--p) var(--p), linear-gradient(#000 0 0) center / calc(100% - var(--p)) calc(100% - var(--p)) no-repeat;
}
.stamp .pl { background: var(--grain), linear-gradient(#f8f4ea 50%, var(--poppy) 50%); transform: rotate(-5deg); }
.stamp .ro { background: var(--grain), linear-gradient(90deg, var(--ro-blue) 33.3%, var(--sun) 33.3% 66.6%, var(--poppy) 66.6%); transform: rotate(4deg) translateY(8%); }
.postmark { position: absolute; z-index: 6; left: 63.3%; bottom: 0; width: 32%; color: rgba(36,38,62,.5); mix-blend-mode: multiply; transform: rotate(-7deg); pointer-events: none; }
.flap {
  position: absolute; inset: 0; z-index: 6;
  transform-origin: 50% 0; transform-style: preserve-3d;
  transition: transform 1.05s cubic-bezier(.45,.05,.3,1);
}
.flap-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; clip-path: polygon(0 0, 100% 0, 53% var(--tip), 47% var(--tip)); border-radius: 3px; }
.flap-face.out { background: var(--grain), linear-gradient(180deg, #ddcaa3 0%, #ebdec0 55%, #f0e5cb 100%); }
.flap-face.in { transform: rotateY(180deg); background: var(--liner); }
.flap-shadow { position: absolute; inset: 0; z-index: 5; filter: blur(2.5px); transition: opacity .3s; }
.flap-shadow::before { content: ""; position: absolute; inset: 0; transform: translateY(4px); background: rgba(60,40,10,.35); clip-path: polygon(0 0, 100% 0, 53% var(--tip), 47% var(--tip)); }
.twine { position: absolute; top: calc(var(--tip) - 6px); height: 12px; z-index: 7; }
.twine.tw-l { left: -1.5%; right: 50%; transform-origin: 100% 50%; }
.twine.tw-r { left: 50%; right: -1.5%; transform-origin: 0 50%; }
.twine::before, .twine::after {
  content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px;
  background: repeating-linear-gradient(115deg, #d8c399 0 2px, #ab9062 2px 4px, #c8b083 4px 6px);
  box-shadow: 0 1.5px 2px rgba(0,0,0,.35);
}
.twine::before { top: 1px; transform: rotate(-.6deg); }
.twine::after { top: 6px; transform: rotate(.5deg); }
.wheat { position: absolute; z-index: 8; left: 50%; top: var(--tip); width: 34%; transform: translate(-50%, -78%); filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); transition: transform .9s cubic-bezier(.5,0,.75,.3), opacity .9s; pointer-events: none; }
.seal {
  position: absolute; z-index: 9; left: 50%; top: var(--tip);
  width: 25%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 0; padding: 0; background: none; cursor: pointer;
  container-type: inline-size;
}
.seal::before {
  content: ""; position: absolute; inset: 14%; border-radius: 50%;
  animation: halo 2.6s ease-out infinite;
}
@keyframes halo { 0% { box-shadow: 0 0 0 0 rgba(229,189,72,.45); } 100% { box-shadow: 0 0 0 18px rgba(229,189,72,0); } }
.seal-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(40,10,0,.35)) drop-shadow(0 1px 1px rgba(40,10,0,.4)); }
.sh { position: absolute; inset: -8%; opacity: 0; }
.sh .seal-img { inset: auto; left: 6.9%; top: 6.9%; width: 86.2%; height: 86.2%; }
.seal-img.whole { z-index: 1; }
.sh.l { clip-path: polygon(0 0, 54% 0, 47% 28%, 55% 52%, 45% 76%, 52% 100%, 0 100%); }
.sh.r { clip-path: polygon(54% 0, 100% 0, 100% 100%, 52% 100%, 45% 76%, 55% 52%, 47% 28%); }
.wax {
  position: absolute; inset: 0;
  border-radius: 49% 51% 47% 53% / 52% 47% 53% 48%;
  background: radial-gradient(circle at 36% 30%, #ea7a5f 0%, #c84d31 34%, #a13721 70%, #7e2615 100%);
  box-shadow: 0 5px 8px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.5), inset 0 -3px 6px rgba(70,15,5,.55), inset 0 3px 5px rgba(255,170,140,.35);
}
.wax::before, .wax::after { content: ""; position: absolute; background: inherit; border-radius: 50%; box-shadow: 0 2px 3px rgba(0,0,0,.35); }
.wax::before { width: 13%; height: 10%; right: -3%; top: 60%; box-shadow: 0 1px 1px rgba(0,0,0,.3); }
.wax::after { width: 11%; height: 8%; left: 8%; bottom: -1%; box-shadow: 0 1px 1px rgba(0,0,0,.3); }
.ring {
  position: absolute; inset: 15%; border-radius: 50%;
  box-shadow: inset 0 3px 4px rgba(60,10,2,.55), inset 0 -1px 1px rgba(255,190,160,.35), 0 1px 0 rgba(255,180,150,.4);
  background: radial-gradient(circle at 50% 40%, #bd4529, #a33a22 70%);
}
.mono {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--f-script); font-size: 34cqw; line-height: 1; padding-top: 4%;
  color: #8a2c19;
  text-shadow: 0 1px 0 rgba(255,175,145,.45), 0 -1px 0 rgba(60,8,0,.55);
}
.gloss { position: absolute; left: 17%; top: 10%; width: 34%; height: 22%; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(255,235,225,.55), transparent 70%); transform: rotate(-24deg); }
.hint { display: grid; gap: 4px; font-size: 14px; color: var(--cream-dim); max-width: 34ch; }
.hint strong { font-weight: 400; color: var(--cream); }
.hint .sound { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); display: inline-flex; gap: 6px; align-items: center; justify-content: center; }

/* opening */
.env-stage.open { animation: none; }
.open .seal::before { animation: none; }
.open .seal-img.whole { visibility: hidden; }
.open .sh.l { animation: fallL 1.05s cubic-bezier(.5,0,.75,.4) forwards; }
.open .sh.r { animation: fallR 1.05s cubic-bezier(.5,0,.75,.4) forwards; }
/* seal half + its piece of twine fall together as one object (same pivot, same motion) */
.open .twine.tw-l { animation: fallL 1.05s cubic-bezier(.5,0,.75,.4) forwards; }
.open .twine.tw-r { animation: fallR 1.05s cubic-bezier(.5,0,.75,.4) forwards; }
@keyframes fallL { 0% { opacity: 1; transform: none; } 14% { opacity: 1; transform: rotate(-5deg); } 100% { opacity: 0; transform: translate(-3vw, 30vh) rotate(-38deg); } }
@keyframes fallR { 0% { opacity: 1; transform: none; } 14% { opacity: 1; transform: rotate(5deg); } 100% { opacity: 0; transform: translate(3vw, 32vh) rotate(34deg); } }
.open .wheat { transform: translate(-30%, 40%) rotate(25deg); opacity: 0; }
.open .flap-shadow { opacity: 0; }
.flapped .flap { transform: rotateX(180deg); }
.flap-down .flap { z-index: 1; }
.rise .letter { transform: translateY(-64%); }

@media (max-width: 600px) and (orientation: portrait) {
  .env-stage { --tip: 42%; --side: 44%; --bot: 43%; width: min(100%, 46vh); }
  .env { aspect-ratio: 5 / 7; transform: rotate(-.8deg); }
  .letter { inset: 4% 6% 5% 6%; }
  .letter img { height: 80%; }
  .rise .letter { transform: translateY(-52%); }
  .wheat { width: 46%; }
  .seal { width: 34%; }
  .stamp { width: 56%; right: auto; left: 22%; bottom: 21%; }
  .stamp > div { --p: 7px; }
  .postmark { width: 56%; left: 8%; bottom: 8%; }
  .foil { bottom: 40%; font-size: 15px; }
}

/* ---------- invitation: phone = full-screen story sections, desktop = sticky photo + flowing column ---------- */
html:not([data-lang="pl"]) .t-pl, html:not([data-lang="ro"]) .t-ro, html:not([data-lang="en"]) .t-en { display: none !important; }
html, body { overflow-x: clip; }
main#card { position: relative; z-index: 10; }
.sec {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 76px 64px;
  scroll-snap-align: start;
  text-align: center;
}
.panel {
  width: 100%; max-width: 440px;
  background: rgba(15,27,21,.58);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-radius: 22px;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(202,166,92,.2);
  padding: 30px 22px 28px;
  display: grid; gap: 16px; justify-items: center;
  text-shadow: 0 1px 10px rgba(10,20,15,.5);
}
.kicker { font-size: 12px; font-weight: 400; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.h2 { margin: 0; font-family: var(--f-display); font-weight: 300; font-size: clamp(30px, 9vw, 40px); line-height: 1.1; font-variation-settings: "opsz" 96; text-wrap: balance; }
.h2 em { font-style: italic; color: var(--sun); }
.copy { margin: 0; font-size: 17px; line-height: 1.6; color: var(--cream); max-width: 34ch; text-wrap: pretty; }
.copy.dim { color: var(--cream-dim); font-size: 15px; }
.copy em { font-family: var(--f-display); font-style: italic; color: var(--sun); }

/* hero */
.hero { justify-content: flex-start; padding-top: max(64px, calc(env(safe-area-inset-top, 0px) + 60px)); gap: 6px; }
.hero-card { width: 100%; max-width: 440px; display: grid; justify-items: center; }
.photo { position: relative; width: 100%; aspect-ratio: 4 / 5; max-width: 100%; border-radius: 22px; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 96%); mask-image: linear-gradient(180deg, #000 55%, transparent 96%); }
.photo .tag { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 1; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.names { width: 100%; height: auto; display: block; margin-top: -10px; overflow: visible; }
.names text { font-family: var(--f-script); font-size: 80px; fill: var(--cream); stroke: var(--gold); stroke-width: 0; }
.hero-meta { font-size: 13px; letter-spacing: .26em; text-transform: uppercase; color: var(--cream-dim); text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.cue { margin-top: 18px; background: none; border: 0; cursor: pointer; display: grid; justify-items: center; gap: 4px; color: var(--gold); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; }
.cue svg { width: 22px; height: 22px; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(6px); opacity: 1; } }

/* date */
.weekday { font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--cream-dim); }
.odo { font-family: var(--f-display); font-weight: 400; font-size: clamp(44px, 14vw, 66px); line-height: 1; letter-spacing: .02em; font-variation-settings: "opsz" 144; font-variant-numeric: tabular-nums lining-nums; display: inline-flex; }
.odo .sep { color: var(--gold); font-weight: 300; padding: 0 .06em; }
.odo .dg { display: inline-block; height: 1em; overflow: hidden; }
.odo .reel { display: flex; flex-direction: column; transition: transform 1.6s cubic-bezier(.2,.9,.25,1); }
.odo .reel span { height: 1em; display: block; }
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.count div { background: rgba(15,27,21,.5); border: 1px solid rgba(202,166,92,.2); border-radius: 12px; padding: 12px 4px 10px; display: grid; gap: 2px; min-width: 0; }
.count b { font-family: var(--f-display); font-weight: 400; font-size: clamp(22px, 7vw, 30px); line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.count small { font-size: 10px; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; color: var(--cream-dim); }

/* place */
.vwin { width: 100%; aspect-ratio: 16 / 11; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px rgba(202,166,92,.25); }
.vwin img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 55%; display: block; transition: clip-path 1.4s cubic-bezier(.3,.7,.2,1), transform 2s cubic-bezier(.2,.7,.2,1); clip-path: circle(75% at 50% 50%); }
.place-name { font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1.1; font-variation-settings: "opsz" 72; }
.region { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--cream-dim); margin-top: -10px; }
.link { font-size: 15px; color: var(--sun); text-decoration: none; border-bottom: 1px solid rgba(229,189,72,.45); padding-bottom: 1px; }
.link:hover { border-color: var(--sun); }

/* weekend timeline */
.tl { list-style: none; margin: 4px 0 0; padding: 0 0 0 30px; display: grid; gap: 22px; text-align: left; position: relative; width: 100%; max-width: 340px; }
.tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1.5px; background: linear-gradient(var(--gold), rgba(202,166,92,.25)); transform-origin: top; transition: transform 1.6s cubic-bezier(.3,.7,.2,1); }
.tl li { position: relative; display: grid; gap: 2px; }
.tl li::before { content: ""; position: absolute; left: -29px; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 1.5px var(--gold); }
.tl li.main::before { background: var(--gold); box-shadow: 0 0 0 4px rgba(202,166,92,.25); }
.tl .d { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.tl .w { font-family: var(--f-display); font-size: 20px; font-weight: 400; line-height: 1.3; font-variation-settings: "opsz" 36; }
.tl .n { font-size: 14px; color: var(--cream-dim); line-height: 1.45; }

/* finale */
.bye { font-family: var(--f-script); font-size: clamp(46px, 14vw, 64px); line-height: 1.05; color: var(--cream); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 400; background: var(--gold); color: var(--night); text-shadow: none; transition: transform .2s ease; }
.btn.ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1px rgba(202,166,92,.6); }
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 16px; height: 16px; }
.replay { background: none; border: 0; cursor: pointer; font-size: 13px; color: var(--cream-dim); text-decoration: underline; text-underline-offset: 3px; }
.venue-note { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--cream); opacity: .75; text-shadow: 0 1px 8px rgba(0,0,0,.7); }

/* fixed controls */
.sound-btn, .lang-sw { position: fixed; z-index: 40; top: calc(14px + env(safe-area-inset-top, 0px)); }
.sound-btn {
  right: calc(14px + env(safe-area-inset-right, 0px));
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(23,39,31,.85); box-shadow: 0 0 0 1px rgba(202,166,92,.5), 0 8px 20px rgba(0,0,0,.4);
  color: var(--gold); display: grid; place-items: center; backdrop-filter: blur(6px);
}
.sound-btn svg { width: 20px; height: 20px; }
.sound-btn .off { display: none; }
.sound-btn.muted .on { display: none; }
.sound-btn.muted .off { display: block; }
.lang-sw {
  left: calc(14px + env(safe-area-inset-left, 0px));
  display: flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: rgba(23,39,31,.85); box-shadow: 0 0 0 1px rgba(202,166,92,.5), 0 8px 20px rgba(0,0,0,.4); backdrop-filter: blur(6px);
}
.lang-sw button { border: 0; background: none; cursor: pointer; padding: 8px 13px; border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: .14em; color: var(--cream-dim); }
.lang-sw button[aria-pressed="true"] { background: var(--gold); color: var(--night); }
.dots { position: fixed; z-index: 35; right: calc(8px + env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); display: grid; gap: 10px; }
.dots button { width: 18px; height: 18px; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.dots button::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(241,231,210,.45); transition: all .3s ease; }
.dots button[aria-current="true"]::before { height: 18px; border-radius: 3px; background: var(--gold); }

/* reveal on scroll (content is visible without JS; .rv-wait is only added by script for sections still below the fold) */
.rv { transition: opacity .8s ease, transform .9s cubic-bezier(.2,.7,.2,1), filter .8s ease; transition-delay: calc(var(--i, 0) * 120ms); }
.rv-wait { opacity: 0; transform: translateY(30px); filter: blur(6px); }
.panel.rv-wait { transform: translateY(46px) scale(.95); }
.tl.rv-wait, .vwin.rv-wait { opacity: 1; transform: none; filter: none; }
.tl.rv-wait::before { transform: scaleY(0); }
.vwin.rv-wait img { clip-path: circle(6% at 50% 50%); transform: scale(1.3); }
.venue::after { transition: opacity 1.2s ease; }
[data-sec="place"] .venue::after { opacity: .45; }

/* hero choreography after the envelope opens */
.play .photo img { animation: unveil 1.6s cubic-bezier(.2,.7,.2,1) both; }
.play .r { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d, 0s); }
.play .names text { animation: write 3s ease-in-out both .9s; }
@keyframes unveil { from { clip-path: circle(0% at 50% 45%); transform: scale(1.12); } to { clip-path: circle(80% at 50% 45%); transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes write {
  0% { stroke-width: 1.2; stroke-dasharray: 1400; stroke-dashoffset: 1400; fill-opacity: 0; }
  70% { stroke-width: 1.2; stroke-dashoffset: 0; fill-opacity: 0; }
  100% { stroke-width: 0; stroke-dasharray: 1400; stroke-dashoffset: 0; fill-opacity: 1; }
}

@media (max-width: 899px) {
  html { scroll-snap-type: y proximity; }
}
@media (min-width: 900px) {
  main#card {
    display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 500px);
    column-gap: 56px; justify-content: center; align-items: start;
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
    padding-block: 80px 80px;
  }
  .sec { min-height: 0; padding: 0; grid-column: 2; margin-bottom: 28px; }
  .sec.hero { grid-column: 1; grid-row: 1 / span 6; position: sticky; top: 72px; align-self: start; padding: 0; margin: 0; }
  .panel { max-width: none; padding: 36px 40px 34px; }
  .cue, .dots { display: none; }
  .sec.finale { margin-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-snap-type: none; }
  .venue img.v1 { opacity: 1 !important; animation: none !important; }
  .venue img.v2 { display: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
