/* The Unfold Atelier · landing prototype v2. Brand: Ink & Gilt (brand/brand-kit.md). */
:root {
  --ink: #1e2a44;
  --ink-deep: #121a2d;
  --ink-soft: #2c3c60;
  --gilt: #b08d57;
  --gilt-lit: #e3c892;
  --gilt-dark: #94723f;
  --paper: #fbfaf6;
  --cream: #f4eedf;
  --cream-2: #e9e1cd;
  --muted: #5d667b;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
  --hand: "La Belle Aurore", "Segoe Script", cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; }
h1, h2, h3, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }
em { font-style: italic; }
.nb { white-space: nowrap; }

/* ---------- Header ---------- */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 56px);
  color: var(--paper);
  transition: color .4s;
}
.hdr-mark { position: relative; display: block; height: 14px; width: 178px; }
.hdr .wm { position: absolute; inset: 0; height: 100%; width: auto; transition: opacity .4s; }
.hdr .wm-ink { opacity: 0; }
.hdr.on-paper { color: var(--ink); }
.hdr.on-paper .wm-ink { opacity: 1; }
.hdr.on-paper .wm-paper { opacity: 0; }
.hdr-cta {
  font: 500 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  text-decoration: none; padding: 6px 0; border-bottom: 1px solid var(--gilt);
}
@media (max-width: 520px) { .hdr-mark { height: 11px; width: 140px; } .hdr-cta { font-size: 10px; } }

/* ---------- Shared type ---------- */
.label, .chap {
  font: 500 11px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase;
  color: var(--gilt);
}
.chap i {
  font: italic 400 26px/1 var(--serif); letter-spacing: 0; text-transform: none;
  margin-right: 14px; vertical-align: -3px; color: var(--gilt-lit);
}
.display {
  font: 300 clamp(44px, 5.5vw, 90px)/.98 var(--serif);
  letter-spacing: -.012em;
}
.display .ln { display: block; }
.display .big { font-size: 1.56em; line-height: .9; margin: .02em 0 .06em -.04em; }
.display em { font-weight: 400; color: var(--gilt-lit); }
.display.sm { font-size: clamp(42px, 5.6vw, 92px); text-wrap: balance; }
.lede { font-size: clamp(16px, 1.25vw, 19px); line-height: 1.62; max-width: 37ch; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; }
.actions.center { justify-content: center; }
.btn {
  display: inline-block; text-decoration: none;
  font: 500 12px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  padding: 18px 30px; color: var(--ink); background: var(--paper);
  outline: 1px solid rgba(227, 200, 146, .55); outline-offset: 5px;
  transition: background .3s, color .3s, outline-offset .3s var(--ease);
}
.btn:hover { background: var(--gilt-lit); outline-offset: 8px; }
.btn.dark { background: var(--ink); color: var(--paper); outline-color: rgba(176, 141, 87, .6); }
.btn.dark:hover { background: var(--ink-soft); }
.txt {
  font: 500 12px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  text-decoration: none; padding: 6px 0; border-bottom: 1px solid var(--gilt);
}
.txt.dark { letter-spacing: .08em; text-transform: none; font-size: 15px; }

/* ---------- Stage ---------- */
.stage { height: 520svh; position: relative; background: var(--ink-deep); }
.pin {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  color: var(--paper);
  --px: 70%; --py: 56%;
  background:
    radial-gradient(80% 70% at var(--px) var(--py), #2d3e66 0%, rgba(45, 62, 102, 0) 62%),
    linear-gradient(180deg, #131c31 0%, #1a2540 55%, #111929 100%);
}
.pin::before {               /* paper-like grain over the dark */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: var(--grain); opacity: .5; mix-blend-mode: soft-light;
}
.pin::after {                /* vignette */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(8, 12, 22, .55) 100%);
}
.dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

.copy {
  position: absolute; z-index: 4;
  left: clamp(24px, 6.5vw, 110px); top: 0; bottom: 0; width: min(47vw, 660px);
  pointer-events: none;
}
.block {
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(calc(-50% + var(--dy, 0px)));
  opacity: 0; will-change: opacity, transform;
}
.block.live { pointer-events: auto; }
.block .label, .block .chap { margin-bottom: clamp(18px, 2.6vh, 30px); }
.block .lede { margin-top: clamp(18px, 3vh, 34px); color: rgba(251, 250, 246, .78); }
.block .actions { margin-top: clamp(22px, 3.6vh, 40px); }

/* hero entrance */
.hero .label, .hero .ln, .hero .lede, .hero .actions { opacity: 0; transform: translateY(26px); animation: rise 1.1s var(--ease) forwards; }
.hero .label { animation-delay: .15s; }
.hero .ln:nth-child(1) { animation-delay: .3s; }
.hero .ln:nth-child(2) { animation-delay: .45s; }
.hero .ln:nth-child(3) { animation-delay: .6s; }
.hero .lede { animation-delay: .85s; }
.hero .actions { animation-delay: 1s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.scene {
  position: absolute; z-index: 3;
  right: 0; top: 0; bottom: 0; width: 60vw;
  perspective: 1500px;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
  animation: scene-in 1.6s .2s var(--ease) both;
}
.scene.dragging { cursor: grabbing; }
@keyframes scene-in { from { opacity: 0; transform: translateY(40px); } }
.pool {
  position: absolute; left: 50%; top: 56%; width: 120%; aspect-ratio: 1; max-height: 130%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(232, 198, 140, .20), rgba(232, 198, 140, .07) 50%, transparent 72%);
  pointer-events: none;
}
.world { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }

.fig {
  position: absolute; z-index: 4; bottom: 26px; right: 0; width: 60vw; text-align: center;
  font: 500 10px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase;
  color: rgba(251, 250, 246, .5);
}
.fig-hint { margin-left: 18px; padding-left: 18px; border-left: 1px solid rgba(227, 200, 146, .5); color: var(--gilt-lit); opacity: 0; transition: opacity .6s; }
.fig-hint.on { opacity: 1; }

.rail {
  position: absolute; z-index: 4; right: clamp(18px, 2.4vw, 40px); top: 50%; transform: translateY(-50%);
  display: grid; gap: 22px; justify-items: end;
  font: italic 400 15px/1 var(--serif); color: rgba(251, 250, 246, .4);
}
.rail li { display: flex; align-items: center; gap: 10px; transition: color .4s; }
.rail li::after { content: ""; display: block; height: 1px; width: 10px; background: currentColor; transition: width .5s var(--ease); }
.rail li.on { color: var(--gilt-lit); }
.rail li.on::after { width: 30px; }

.cue {
  position: absolute; z-index: 4; left: clamp(24px, 6.5vw, 110px); bottom: 26px;
  font: 500 10px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase;
  color: rgba(251, 250, 246, .55); display: flex; align-items: center; gap: 14px;
  transition: opacity .5s;
}
.cue span { display: block; width: 54px; height: 1px; background: rgba(227, 200, 146, .35); position: relative; overflow: hidden; }
.cue span::after { content: ""; position: absolute; inset: 0; background: var(--gilt-lit); transform: translateX(-100%); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 60%, 100% { transform: translateX(100%); } }
.cue.off { opacity: 0; }

@media (max-width: 860px) {
  .pin { --px: 50%; --py: 72%; }
  .copy { left: 22px; right: 22px; width: auto; top: 78px; bottom: auto; height: 44svh; }
  .block { top: 0; transform: translateY(var(--dy, 0px)); }
  .display { font-size: min(11.4vw, 6.3svh); }
  .display.sm { font-size: min(12.6vw, 7svh); }
  .block .label, .block .chap { margin-bottom: 14px; }
  .block .lede { margin-top: 14px; font-size: 15.5px; line-height: 1.5; max-width: 34ch; }
  .block .actions { margin-top: 20px; }
  .btn { padding: 15px 24px; }
  .scene { left: 0; right: 0; width: auto; top: auto; bottom: 0; height: 54svh; }
  .fig { width: 100%; bottom: 16px; font-size: 9px; letter-spacing: .24em; }
  .rail, .cue { display: none; }
}

/* ---------- 3D objects ---------- */
.world div, .world svg { position: absolute; }
.p3d { transform-style: preserve-3d; left: 0; top: 0; }
.face { inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.paperface { background: linear-gradient(170deg, #f8f3e6, var(--cream) 45%, #ece4d1); }
.paperface::after, .layer::after { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .16; mix-blend-mode: multiply; pointer-events: none; }
.layer::after { display: none; }

/* envelope: 410 x 292, centred on the world origin */
.env { will-change: transform; }
.env-back, .env-front { left: -205px; top: -146px; width: 410px; height: 292px; }
.env-back {
  transform: translateZ(-2px); border-radius: 3px;
  background:
    repeating-linear-gradient(45deg, rgba(227, 200, 146, .20) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(-45deg, rgba(227, 200, 146, .20) 0 1px, transparent 1px 13px),
    linear-gradient(180deg, #1b2640, #24345a);
  box-shadow: 0 40px 70px -20px rgba(4, 7, 15, .75);
}
.env-front { transform: translateZ(6px); }
.env-front svg, .flap svg { inset: 0; width: 100%; height: 100%; overflow: visible; }
.flap { left: -205px; top: -146px; width: 410px; height: 180px; transform-origin: 50% 0; }
.flap .face { backface-visibility: hidden; }
.flap-in { transform: rotateY(180deg); }
.wax {
  left: 168px; top: 136px; width: 74px; height: 74px;
  transform: translateZ(2px); backface-visibility: hidden;
  border-radius: 48% 52% 50% 50% / 53% 47% 54% 46%;
  background: radial-gradient(circle at 34% 28%, #46598a 0%, #253559 38%, #17213a 72%, #0f1729 100%);
  box-shadow:
    0 7px 14px rgba(4, 7, 15, .55),
    inset 0 2px 3px rgba(255, 255, 255, .22),
    inset 0 -4px 7px rgba(0, 0, 0, .45);
  display: grid; place-items: center;
}
.wax::before {
  content: ""; position: absolute; inset: 9px; border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .55), 0 1px 1px rgba(255, 255, 255, .14);
}
.wax img { position: relative; width: 60%; height: 60%; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .5)); }

/* card: 380 x 270 panels hinged on the rig's x axis */
.rig { will-change: transform; }
.panel { left: -190px; width: 380px; height: 270px; }
.panel.base { top: 0; transform-origin: 50% 0; transform: rotateX(90deg); }
.panel.back { top: -270px; transform-origin: 50% 100%; }
.panel .out { transform: rotateX(180deg); }
.panel .face { border-radius: 2px; overflow: hidden; }
.panel svg { inset: 0; width: 100%; height: 100%; }
.crease { left: 0; right: 0; height: 26px; pointer-events: none; }
.base .crease { top: 0; background: linear-gradient(180deg, rgba(30, 42, 68, .30), transparent); }
.back .crease { bottom: 0; background: linear-gradient(0deg, rgba(30, 42, 68, .22), transparent); }
.cast { left: 14px; right: 14px; height: 46px; background: linear-gradient(180deg, rgba(20, 28, 48, .42), transparent); filter: blur(3px); pointer-events: none; }
.note {
  left: 30px; right: 26px; top: 190px;
  font: 400 17.5px/1.28 var(--hand); color: #24315a;
  transform: rotate(-1.2deg);
}
.note span { display: block; position: static; white-space: nowrap; }
.layer { left: -190px; width: 380px; transform-origin: 50% 100%; }
.layer svg { inset: 0; width: 100%; height: 100%; overflow: visible; }
.ground {
  left: -330px; top: -330px; width: 660px; height: 660px;
  background: radial-gradient(closest-side, rgba(5, 8, 16, .62), rgba(5, 8, 16, .28) 48%, transparent 72%);
  pointer-events: none;
}

/* ---------- Sections ---------- */
.sec { position: relative; padding: clamp(96px, 14vw, 190px) 0; }
.sec.paper { background: var(--paper); }
.sec.paper::before { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .10; pointer-events: none; }
.sec.ink {
  color: var(--paper); text-align: center;
  background: radial-gradient(70% 90% at 50% 0%, #2b3c63, transparent 70%), var(--ink);
}
.sec.ink::before { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .45; mix-blend-mode: soft-light; pointer-events: none; }
.wrap { position: relative; max-width: 1240px; margin: 0 auto; padding: 0 clamp(22px, 6vw, 96px); }
.wrap.narrow { max-width: 900px; text-align: center; }
.wrap.narrow .lede { margin: 30px auto 0; max-width: 46ch; }
.title { font: 400 clamp(36px, 4.9vw, 72px)/1.04 var(--serif); font-variant-numeric: lining-nums; letter-spacing: -.012em; margin-top: 26px; max-width: 17ch; text-wrap: balance; }
.wrap.narrow .title { margin-left: auto; margin-right: auto; }
.title em { color: var(--gilt-dark); }
.sec.ink .title em { color: var(--gilt-lit); }
.title.xl { font-size: clamp(48px, 8vw, 124px); font-weight: 300; line-height: .98; max-width: 12ch; }
.sec.paper .lede { color: var(--muted); }
.sec.ink .lede { color: rgba(251, 250, 246, .78); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(28px, 4vw, 64px); margin-top: clamp(56px, 8vw, 110px); }
.steps li { border-top: 1px solid rgba(176, 141, 87, .55); padding-top: 26px; }
.steps .num { display: block; font: italic 300 64px/1 var(--serif); color: var(--gilt-dark); }
.steps h3 { font: 500 27px/1.15 var(--serif); margin: 22px 0 12px; }
.steps p { color: var(--muted); max-width: 30ch; }

.ways-sec { padding-top: 0; }
.ways { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 7vw, 120px); margin-top: 44px; }
.way { border-top: 1px solid rgba(30, 42, 68, .9); padding-top: 34px; }
.way svg { width: 190px; height: auto; margin-bottom: 26px; }
.way h3 { font: 400 clamp(32px, 3.6vw, 50px)/1.05 var(--serif); margin-bottom: 16px; }
.way h3 em { color: var(--gilt-dark); }
.way p { color: var(--muted); max-width: 36ch; }
.way .eg { margin-top: 22px; font: 500 10.5px/1.9 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3.4vw, 56px); margin-top: clamp(50px, 7vw, 96px); }
.tile { perspective: 900px; }
.tile-card {
  aspect-ratio: 7 / 5; position: relative; border-radius: 2px;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease);
  box-shadow: 0 30px 50px -26px rgba(18, 26, 45, .55), 0 2px 4px rgba(18, 26, 45, .12);
  overflow: hidden;
}
.tile-card svg { width: 100%; height: 100%; }
.tile-card::after { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .14; mix-blend-mode: multiply; }
.tile h3 { font: 500 25px/1.2 var(--serif); margin-top: 26px; }
.tile p { color: var(--muted); font-size: 15.5px; margin-top: 4px; }
.tile .kind { font: 500 10px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--gilt-dark); margin-top: 22px; }
.tile .kind + h3 { margin-top: 10px; }
.fine { margin-top: 44px; font-size: 13px; color: var(--muted); }

.seal { width: 76px; height: 76px; margin: 0 auto 34px; }
.terms { display: flex; justify-content: center; gap: clamp(40px, 9vw, 130px); margin-top: clamp(48px, 6vw, 80px); }
.terms b { display: block; font-variant-numeric: lining-nums; font: 300 clamp(84px, 11vw, 150px)/.9 var(--serif); color: var(--gilt-lit); }
.terms span { display: block; margin-top: 14px; font: 500 10.5px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: rgba(251, 250, 246, .7); }

.contact .actions { margin-top: 46px; }

.foot { background: var(--paper); border-top: 1px solid rgba(176, 141, 87, .5); padding: 44px 22px 54px; text-align: center; color: var(--muted); font-size: 13px; }
.foot img { height: 13px; margin: 0 auto 18px; }
.foot .proto { margin-top: 8px; font: 500 10px/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--gilt-dark); }

@media (max-width: 860px) {
  .steps, .ways, .tiles { grid-template-columns: 1fr; }
  .steps li + li, .tiles .tile + .tile { margin-top: 44px; }
  .steps .num { font-size: 52px; }
  .tiles { max-width: 440px; }
}

/* reveal on scroll (only when JS runs) */
.js .rv { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

/* reduced motion: no pinning, no entrance animation; the card is shown open */
@media (prefers-reduced-motion: reduce) {
  .stage { height: 100svh; }
  .hero .label, .hero .ln, .hero .lede, .hero .actions, .scene { animation: none; opacity: 1; transform: none; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  .cue { display: none; }
}
