/* ==========================================================================
   GEMMYS  |  Design system v4
   Warm charcoal, soft ivory, one muted apricot accent.
   Shape: pills for buttons, arches and 28px surfaces, 12px inputs.
   Motion: time-based device scenes (WAAPI), transform/opacity only.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: dark; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }

:root {
  --bg:       #211f1c;
  --bg-2:     #292622;
  --bg-3:     #34302b;
  --line:     rgba(243, 237, 225, .10);
  --line-2:   rgba(243, 237, 225, .20);
  --text:     #f3ede1;
  --mute:     #b3a998;
  --accent:   #e2ab84;
  --accent-d: #8c4f2d;
  --ivory:    #efe7d9;
  --ink:      #1f1c18;

  --r-pill: 999px;
  --r-surface: 28px;
  --r-input: 12px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --wrap: 1240px;
  --gut: clamp(16px, 4vw, 40px);
  --nav-h: 64px;
  --font: 'Heebo', 'Segoe UI', system-ui, sans-serif;
}

body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1.0625rem; font-weight: 400; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
body.is-locked { overflow: hidden; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: 250; pointer-events: none; opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.wrap { width: min(100% - var(--gut) * 2, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 400; background: var(--ivory); color: var(--ink); padding: 10px 16px; border-radius: var(--r-pill); transform: translateY(-200%); }
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.ico { width: 1.1em; height: 1.1em; flex: none; }

.h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); line-height: 1.12; font-weight: 300; letter-spacing: -.025em; text-wrap: balance; }
.h2--xl { font-size: clamp(2rem, 4vw, 3.2rem); }
.h3 { font-size: clamp(2.2rem, 3.6vw, 3.2rem); line-height: 1.05; font-weight: 300; letter-spacing: -.02em; }
.lead { color: #514a3f; font-size: 1.125rem; }

/* ---------- Buttons ---------- */
.btn { --h: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: var(--h); padding-inline: 1.5em; border-radius: var(--r-pill); font-weight: 500; font-size: 1rem; white-space: nowrap; border: 1px solid transparent; transition: transform .35s var(--ease-out), background-color .25s, border-color .25s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn--sm { --h: 40px; font-size: .95rem; padding-inline: 1.15em; }
.btn--lg { --h: 56px; font-size: 1.0625rem; padding-inline: 1.9em; }
.btn--block { width: 100%; }
.btn--ivory { background: var(--ivory); color: var(--ink); }
.btn--ivory:hover { background: #fff8ea; }
.btn--ivory .ico { transition: transform .35s var(--ease-out); }
.btn--ivory:hover .ico { transform: translate(-3px, 3px); }
.btn--ink { background: var(--ink); color: var(--ivory); }
.btn--ink:hover { background: #000; }
.btn--ghost { border-color: var(--line-2); }
.btn--ghost:hover { border-color: rgba(243,237,225,.5); background: rgba(243,237,225,.06); }
.btn[disabled] { opacity: .65; cursor: progress; }
.link { display: inline-flex; align-items: center; gap: .5em; font-weight: 500; border-block-end: 1px solid var(--line-2); padding-block-end: 3px; transition: border-color .25s, color .25s; }
.link:hover { color: var(--accent); border-color: var(--accent); }
.link .ico { transition: transform .35s var(--ease-out); }
.link:hover .ico { transform: translate(-2px, -2px); }

/* ---------- Nav ---------- */
.brand { display: inline-flex; align-items: center; font-weight: 500; letter-spacing: .28em; font-size: 1rem; }
.nav { position: fixed; inset-inline: 0; inset-block-start: 0; z-index: 60; padding-block: 12px; }
.nav-inner { width: min(100% - var(--gut) * 2, var(--wrap)); margin-inline: auto; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-inline: 20px 8px; border-radius: var(--r-pill); border: 1px solid transparent; transition: background-color .35s, border-color .35s; }
.nav.is-stuck .nav-inner { background: rgba(33, 31, 28, .82); border-color: var(--line); -webkit-backdrop-filter: blur(16px) saturate(130%); backdrop-filter: blur(16px) saturate(130%); }
.nav-links { display: flex; gap: 28px; font-size: .95rem; color: var(--mute); }
.nav-links a { transition: color .2s; padding-block: 6px; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 720px) { .nav-links { display: none; } }
@media (prefers-reduced-transparency: reduce) { .nav.is-stuck .nav-inner { background: var(--bg-2); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* ---------- Intro: temporary gem, no text (replaced by the final logo animation later) ---------- */
.intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); pointer-events: none; transition: opacity .55s ease; }
.intro.is-leaving { opacity: 0; }
.gem { width: clamp(88px, 15vw, 124px); height: auto; overflow: visible; opacity: 0; transform: scale(.94); }
.gem-outline, .gem-facets path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.gem-fill { opacity: 0; }
.gem-sweep { transform-box: fill-box; transform: skewX(-22deg); translate: 0 0; }
.intro.is-playing .gem { animation: gem-in 1.5s var(--ease-out) forwards; }
.intro.is-playing .gem-outline { animation: gem-draw .85s cubic-bezier(.65, 0, .2, 1) .05s forwards; }
.intro.is-playing .gem-facets path:nth-child(1) { animation: gem-draw .6s cubic-bezier(.65, 0, .2, 1) .35s forwards; }
.intro.is-playing .gem-facets path:nth-child(2) { animation: gem-draw .7s cubic-bezier(.65, 0, .2, 1) .45s forwards; }
.intro.is-playing .gem-facets path:nth-child(3) { animation: gem-draw .6s cubic-bezier(.65, 0, .2, 1) .55s forwards; }
.intro.is-playing .gem-fill { animation: gem-fade .7s ease .6s forwards; }
.intro.is-playing .gem-sweep { animation: gem-sweep .6s cubic-bezier(.45, 0, .2, 1) .95s forwards; }
.intro.is-leaving .gem { transform: scale(1.06); transition: transform .6s var(--ease-out); }
/* wordmark: secondary to the gem, sits below it without moving the gem off-centre */
.intro-core { position: relative; display: grid; justify-items: center; }
.intro-word { position: absolute; top: 100%; left: 50%; margin-top: clamp(20px, 3.2vw, 28px); translate: -50% 0; white-space: nowrap; font-weight: 300; font-size: clamp(.72rem, 1.3vw, .85rem); letter-spacing: .55em; text-indent: .55em; color: rgba(243, 237, 225, .78); opacity: 0; clip-path: inset(0 50% 0 50%); }
.intro.is-playing .intro-word { animation: word-in .95s cubic-bezier(.22, 1, .36, 1) 1s forwards; }
@keyframes word-in { to { opacity: 1; clip-path: inset(0 -10% 0 -10%); } }
@keyframes gem-in { 0% { opacity: 0; transform: scale(.94); } 25% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
@keyframes gem-draw { to { stroke-dashoffset: 0; } }
@keyframes gem-fade { to { opacity: 1; } }
@keyframes gem-sweep { from { translate: 0 0; } to { translate: 200px 0; } }

/* ---------- Reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ==========================================================================
   HERO: copy plus one brand object, the arch (a doorway with rising light)
   ========================================================================== */
.hero { position: relative; min-height: 100dvh; padding-block: calc(var(--nav-h) + 24px) 40px; display: grid; align-items: center; overflow: clip; isolation: isolate; }
.hero-light { position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(50% 60% at 78% 20%, rgba(243,237,225,.07), transparent 70%),
  radial-gradient(55% 55% at 22% 82%, rgba(226,171,132,.16), transparent 70%); }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero-copy { display: grid; gap: 20px; justify-items: start; }
.hero-title { font-size: clamp(2.4rem, 4.5vw, 4.2rem); line-height: 1.08; font-weight: 300; letter-spacing: -.035em; }
.hero-title .line { display: block; overflow: hidden; padding-block: .06em; margin-block: -.06em; }
.hero-title .line > span { display: inline-block; }
.hero-title em { font-style: normal; font-weight: 500; color: var(--accent); }
.hero-sub { color: var(--mute); font-size: 1.2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 10px; }
.js [data-hero] { opacity: 0; transform: translateY(22px); }
.js .line > [data-hero] { transform: translateY(105%); opacity: 1; }
.js.is-ready [data-hero] { opacity: 1; transform: none; transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: calc(var(--n, 0) * .09s); }

.hero-arch { --aw: min(30vw, 400px); position: relative; justify-self: center; width: var(--aw); }
.hero-arch::before { content: ""; position: absolute; inset: -18% -22% -10%; background: radial-gradient(closest-side, rgba(226,171,132,.22), transparent 72%); z-index: -1; }
.arch { position: relative; aspect-ratio: 3 / 4.1; overflow: hidden; border-radius: 50% 50% 26px 26px / 37% 37% 26px 26px; border: 1px solid var(--line-2); background: linear-gradient(180deg, #3a352e 0%, #2d2924 52%, #3a2e25 100%); box-shadow: 0 50px 90px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08); }
.arch-ring { position: absolute; border: 1px solid rgba(243,237,225,.2); border-radius: 50% 50% 18px 18px / 37% 37% 18px 18px; }
.arch-ring--1 { inset: 8% 9% 8%; }
.arch-ring--2 { inset: 17% 18% 17%; border-color: rgba(243,237,225,.13); }
.arch-sun { position: absolute; left: 50%; bottom: -34%; width: 96%; aspect-ratio: 1; margin-left: -48%; border-radius: 50%; background: radial-gradient(circle, rgba(244,196,150,1) 0%, rgba(232,178,134,.55) 38%, rgba(226,171,132,0) 68%); }
.arch-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(transparent, rgba(24,21,18,.6)); }
.arch-word { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; font-weight: 300; font-size: clamp(.7rem, 1.1vw, .9rem); letter-spacing: .55em; text-indent: .55em; color: rgba(243,237,225,.9); }

.js .hero-arch { clip-path: inset(100% 0 0 0); }
.js.is-ready .hero-arch { clip-path: inset(-30% -30% -30% -30%); transition: clip-path 1.6s cubic-bezier(.7, 0, .15, 1) .1s; }
.js .arch-ring, .js .arch-word { opacity: 0; }
.js.is-ready .arch-ring--1 { opacity: 1; transition: opacity 1.4s ease 1.1s; }
.js.is-ready .arch-ring--2 { opacity: 1; transition: opacity 1.4s ease 1.3s; }
.js.is-ready .arch-word { opacity: 1; transition: opacity 1.2s ease 1.6s; }
@media (prefers-reduced-motion: no-preference) {
  .arch-sun { animation: sun-rise 12s ease-in-out infinite alternate; }
  .arch-ring--1 { animation: breathe 9s ease-in-out infinite alternate; }
  .arch-ring--2 { animation: breathe 9s ease-in-out -4s infinite alternate; }
}
@keyframes sun-rise { from { transform: translateY(6%) scale(.96); } to { transform: translateY(-12%) scale(1.06); } }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(.975); } }

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4.6fr); gap: clamp(24px, 4vw, 80px); }
}
/* Mobile hero is composed on its own: type, buttons, then the whole arch */
@media (max-width: 959px) {
  .hero { align-items: start; padding-block: calc(var(--nav-h) + 36px) 56px; }
  .hero-grid { gap: 44px; }
  .hero-title { font-size: clamp(2.35rem, 10.2vw, 3.4rem); }
  .hero-ctas { width: 100%; margin-block-start: 6px; }
  .hero-ctas .btn { flex: 1 1 100%; }
  .hero-arch { --aw: min(64vw, 300px); justify-self: center; }
}

/* ---------- What we build ---------- */
.build { padding-block: clamp(80px, 12vw, 170px) clamp(48px, 8vw, 100px); }
.build-grid { display: grid; gap: 48px; align-items: end; }
.statement { font-size: clamp(2rem, 4.6vw, 3.9rem); line-height: 1.12; font-weight: 300; letter-spacing: -.03em; text-wrap: balance; max-width: 18em; }
.build-list li { display: grid; gap: 2px; padding-block: 18px; border-block-start: 1px solid var(--line-2); }
.build-list strong { font-size: 1.35rem; font-weight: 500; }
.build-list span { color: var(--mute); }
@media (min-width: 900px) { .build-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(40px, 7vw, 120px); } }

/* ==========================================================================
   3D DEVICE KIT
   Nothing in the 3D chain uses opacity/filter/overflow, so preserve-3d holds.
   The base is a real box: top face (keys, pad), under face, sides, front lip.
   Faces that must never be seen from behind hide their back side.
   ========================================================================== */
.stage { perspective: 3400px; perspective-origin: 50% 12%; }
.cam { position: absolute; inset: 0; display: grid; place-items: center; transform-style: preserve-3d; }
.lg { transform-style: preserve-3d; }

.laptop3d { --H: calc(var(--W) * .625); --D: calc(var(--W) * .64); --T: calc(var(--W) * .016); position: relative; width: var(--W); height: var(--H); transform-style: preserve-3d; }
.l-body { position: absolute; left: 0; top: var(--H); width: 100%; height: 0; transform-style: preserve-3d; }
.l-shadow { position: absolute; left: -8%; width: 116%; height: calc(var(--D) * 1.25); top: 0; transform-origin: 50% 0; transform: translateY(calc(var(--W) * .03)) rotateX(90deg); background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); backface-visibility: hidden; }
.l-base { position: absolute; left: 0; top: 0; width: 100%; height: var(--D); transform-origin: 50% 0; transform: rotateX(90deg); border-radius: 0 0 calc(var(--W) * .02) calc(var(--W) * .02); background: linear-gradient(180deg, #4a4740, #35322d 55%, #2c2a26); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); backface-visibility: hidden; }
.l-keys { position: absolute; left: 6%; right: 6%; top: 7%; height: 52%; border-radius: calc(var(--W) * .008); background:
  repeating-linear-gradient(90deg, rgba(0,0,0,.5) 0 1.5px, transparent 1.5px calc(var(--W) * .0628)),
  repeating-linear-gradient(0deg, rgba(0,0,0,.5) 0 1.5px, transparent 1.5px calc(var(--W) * .052)),
  #1d1b18; }
.l-pad { position: absolute; left: 34%; width: 32%; top: 66%; height: 27%; border-radius: calc(var(--W) * .01); border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); }
.l-under { position: absolute; left: 0; top: var(--T); width: 100%; height: var(--D); transform-origin: 50% 0; transform: rotateX(90deg) rotateY(180deg); background: #262420; border-radius: 0 0 calc(var(--W) * .02) calc(var(--W) * .02); backface-visibility: hidden; }
.l-side { position: absolute; top: 0; width: var(--D); height: var(--T); background: linear-gradient(#302d29, #1e1c19); transform-origin: 0 0; transform: rotateY(-90deg); }
.l-side--l { left: 0; }
.l-side--r { left: 100%; }
.l-lip { position: absolute; left: 0; top: 0; width: 100%; height: var(--T); transform: translateZ(var(--D)); background: linear-gradient(#2f2c28, #171614); border-radius: 0 0 calc(var(--W) * .02) calc(var(--W) * .02); backface-visibility: hidden; }
.l-lid { position: absolute; left: 0; bottom: 0; width: 100%; height: var(--H); transform-origin: 50% 100%; translate: 0 calc(var(--W) * -.004); transform: rotateX(12deg); transform-style: preserve-3d; }
.l-face { position: absolute; inset: 0; padding: calc(var(--W) * .013); background: #060606; border-radius: calc(var(--W) * .016) calc(var(--W) * .016) calc(var(--W) * .004) calc(var(--W) * .004); box-shadow: inset 0 0 0 1px #4d4a44, 0 0 0 1px rgba(0,0,0,.6); backface-visibility: hidden; }
.l-back { position: absolute; inset: 0; transform: rotateY(180deg); backface-visibility: hidden; background: linear-gradient(160deg, #8b867c, #4a463f 60%, #34312c); border-radius: calc(var(--W) * .016) calc(var(--W) * .016) calc(var(--W) * .004) calc(var(--W) * .004); }
.l-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: calc(var(--W) * .005); background: #000; }
.l-screen::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(118deg, rgba(255,255,255,.07), transparent 34%); }
.l-dark { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 3; }
.shot { position: absolute; left: 0; top: 0; width: 100%; }
.shot img { width: 100%; height: auto; }

.pg { position: absolute; transform: rotateY(calc(var(--dir, 1) * -8deg)); }
.phone-wrap { container-type: inline-size; width: 100%; }
.phone { position: relative; aspect-ratio: 390 / 844; background: #000; padding: 3cqw; border-radius: 15.5cqw; box-shadow: 0 0 0 1.1cqw #4a4741, 0 0 0 1.6cqw #1a1917, 0 40px 70px rgba(0,0,0,.55); }
.p-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 12.6cqw; background: #000; }
.phone::after { content: ""; position: absolute; inset-block-start: 6.6cqw; inset-inline: 0; margin-inline: auto; width: 26cqw; height: 7.2cqw; background: #000; border-radius: 99px; z-index: 4; }
.pf { will-change: transform; }
@media (prefers-reduced-motion: no-preference) { .pf { animation: idle 7s ease-in-out infinite alternate; } }
@keyframes idle { from { transform: translateY(0); } to { transform: translateY(-6px); } }

/* ---------- Scenes ---------- */
.projects { padding-block: 0 clamp(72px, 10vw, 140px); }
.projects-title { margin-block-end: clamp(24px, 4vw, 44px); }
.scene { --dir: 1; position: relative; isolation: isolate; overflow: hidden; height: clamp(600px, 88dvh, 780px); margin-block-end: clamp(16px, 2.4vw, 28px); border-radius: var(--r-surface); border: 1px solid var(--line); background: var(--bg-2); }
.scene--palgei { --dir: -1; }
.scene-bg { position: absolute; inset: 0; z-index: -1; }
.scene--voral .scene-bg { background: radial-gradient(60% 75% at 34% 52%, rgba(236,206,170,.24), transparent 70%), linear-gradient(180deg, #2f2b26, #25221e); }
.scene--palgei .scene-bg { background: radial-gradient(60% 75% at 66% 52%, rgba(160,178,196,.20), transparent 70%), linear-gradient(180deg, #2c2a27, #232120); }
.scene-stage { position: absolute; inset: 0; --W: min(45vw, 720px); --PW: clamp(170px, 16vw, 224px); }
.scene .cam { width: 66%; padding-block-end: 4%; transform: rotateX(5deg) rotateY(calc(var(--dir) * 8deg)); }
.scene--voral .cam { left: 0; right: auto; }
.scene--palgei .cam { left: auto; right: 0; }
.lg { transform: translate3d(0, 0, -150px) scale(.96); }
.pg { width: var(--PW); bottom: 9%; }
.scene--voral .pg { left: 52%; }
.scene--palgei .pg { right: 52%; }

.scene-copy { position: absolute; bottom: clamp(24px, 4vw, 48px); display: grid; gap: 10px; justify-items: start; max-width: 250px; z-index: 5; }
.scene--voral .scene-copy { right: clamp(24px, 4vw, 56px); }
.scene--palgei .scene-copy { left: clamp(24px, 4vw, 56px); }
.scene-copy .kind { color: var(--mute); font-size: .95rem; }
.scene-copy .sum { color: var(--text); opacity: .88; line-height: 1.45; }
.scene-copy .link { margin-block-start: 6px; }

@media (max-width: 899px) {
  .scene { height: auto; padding-block-start: 26px; display: grid; grid-template-rows: auto 410px; }
  .scene-copy { order: -1; position: relative; inset: auto; bottom: auto; padding-inline: 22px; max-width: none; }
  .scene--voral .scene-copy, .scene--palgei .scene-copy { left: auto; right: auto; }
  .scene-stage { position: relative; inset: auto; --W: min(88vw, 480px); --PW: clamp(118px, 32vw, 160px); }
  .scene .cam { width: 100%; left: 0; right: 0; padding-block-end: 0; align-items: start; padding-top: 6%; }
  .pg { bottom: 4%; }
  .scene--voral .pg { left: auto; right: 5%; } .scene--palgei .pg { right: auto; left: 5%; }
}

/* ---------- Services ---------- */
.services { padding-block: 0 clamp(72px, 10vw, 140px); }
.svc-list { margin-block-start: clamp(28px, 5vw, 56px); }
.svc { display: grid; gap: 6px; padding-block: 28px; border-block-start: 1px solid var(--line-2); }
.svc:last-child { border-block-end: 1px solid var(--line-2); }
.svc-title { font-size: clamp(1.7rem, 3.4vw, 2.8rem); font-weight: 300; letter-spacing: -.02em; line-height: 1.1; transition: color .3s, transform .5s var(--ease-out); }
.svc p { color: var(--mute); }
@media (min-width: 800px) {
  .svc { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: baseline; gap: 40px; padding-block: 34px; }
  .svc:hover .svc-title { transform: translateX(-10px); color: var(--accent); }
}

/* ---------- Process ---------- */
.process { padding-block: clamp(72px, 10vw, 140px); background: var(--bg-2); border-block: 1px solid var(--line); }
.flow { position: relative; display: grid; gap: 28px; margin-block-start: clamp(36px, 6vw, 72px); }
.flow-step { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px; }
.flow-step h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.3; max-width: 16ch; }
.fs-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 64px; height: 78px; border-radius: 50% 50% 14px 14px / 40% 40% 14px 14px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-size: 1.5rem; transition: background-color .6s ease, color .6s ease, border-color .6s ease; }
.fs-icon .ico { width: 1em; height: 1em; }
.flow-step--last .fs-icon { border-color: var(--accent); }
.flow::before { content: ""; position: absolute; inset-inline-start: 31px; inset-block: 10px; width: 1px; background: var(--line-2); transform-origin: top; }
.js .flow::before { transform: scaleY(0); transition: transform 1.6s cubic-bezier(.65, 0, .2, 1); }
.js .flow.in::before { transform: scaleY(1); }
.js .flow-step { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: calc(.25s + var(--i) * .28s); }
.js .flow.in .flow-step { opacity: 1; transform: none; }
.js .flow.in .flow-step--last .fs-icon { background: var(--accent); color: var(--ink); transition-delay: 1.5s; }
@media (min-width: 860px) {
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
  .flow-step { grid-template-columns: 1fr; justify-items: start; align-items: start; gap: 24px; }
  .flow::before { inset-inline: 32px 32px; inset-block: 39px auto; width: auto; height: 1px; transform-origin: right; }
  .js .flow::before { transform: scaleX(0); }
  .js .flow.in::before { transform: scaleX(1); }
}

/* ---------- Contact ---------- */
.contact { padding-block: clamp(72px, 10vw, 130px) clamp(72px, 10vw, 120px); }
.contact-panel { display: grid; gap: 40px; padding: clamp(24px, 5vw, 72px); border-radius: var(--r-surface); background: var(--ivory); color: var(--ink); }
.contact-copy { display: grid; gap: 16px; align-content: center; justify-items: start; }
.contact-lines { display: grid; gap: 4px; margin-block-start: 8px; }
.contact-panel :focus-visible { outline-color: var(--ink); }
.wa { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; margin-block-start: 8px; transition: color .2s; }
.wa .ico { width: 1.6em; height: 1.6em; color: var(--accent-d); }
.wa:hover { color: var(--accent-d); }
@media (min-width: 900px) { .contact-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center; } }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field label { font-size: .95rem; font-weight: 500; }
.req { color: var(--accent-d); }
.field input { width: 100%; background: #faf6ee; border: 1px solid #857c6a; border-radius: var(--r-input); padding: 14px 16px; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field input::placeholder { color: #6a6356; opacity: 1; }
.field input:focus { outline: 2px solid var(--ink); outline-offset: 2px; border-color: var(--ink); }
.field.has-error input { border-color: #b3261e; }
.field-error { color: #a3231b; font-size: .875rem; }
.form-note { font-size: .875rem; color: #514a3f; }
.form-note a { text-decoration: underline; text-underline-offset: 3px; }
.status { padding: 14px 16px; border-radius: var(--r-input); font-size: .95rem; }
.status--ok { background: #e3ead9; border: 1px solid #8fa37f; color: #2e4229; }
.status--err { background: #f6dcd9; border: 1px solid #d99a94; color: #7d1f19; }
[hidden] { display: none !important; }

/* ---------- Footer ---------- */
.footer { border-block-start: 1px solid var(--line); }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-block: 32px 14px; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--mute); font-size: .95rem; }
.footer-legal a { padding-block: 6px; transition: color .2s; }
.footer-legal a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.footer-copy { color: var(--mute); font-size: .875rem; padding-block: 0 28px; text-align: start; }
.footer-social { display: flex; gap: 8px; }
.footer-social a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); transition: border-color .25s, color .25s, transform .35s var(--ease-out); }
.footer-social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.footer-social .ico { width: 20px; height: 20px; }

/* ---------- Accessibility tab: attached to the physical left edge ---------- */
.a11y { position: fixed; left: 0; top: 42%; z-index: 120; }
.wa-tab { position: fixed; right: 0; top: 42%; z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 9px 12px; background: var(--ivory); color: var(--ink); border-radius: 14px 0 0 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: .8rem; font-weight: 500; transition: padding .3s var(--ease-out), background-color .2s; }
.wa-tab .ico { width: 22px; height: 22px; }
.wa-tab span:not(.sr-only) { writing-mode: vertical-rl; letter-spacing: .06em; }
.wa-tab:hover { padding-inline: 12px; background: #fff8ea; }
.wa-tab:focus-visible, .a11y-tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.a11y-tab { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 9px 12px; background: var(--ivory); color: var(--ink); border-radius: 0 14px 14px 0; box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: .8rem; font-weight: 500; transition: padding .3s var(--ease-out), background-color .2s; }
.a11y-tab .ico { width: 22px; height: 22px; }
.a11y-tab span { writing-mode: vertical-rl; letter-spacing: .06em; }
.a11y-tab:hover { padding-inline: 12px; background: #fff8ea; }
.a11y-panel { position: absolute; left: 0; top: 0; width: min(300px, calc(100vw - 24px)); padding: 18px; display: grid; gap: 12px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 0 18px 18px 0; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.a11y.is-open .a11y-tab { visibility: hidden; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; }
.a11y-head h2 { font-size: 1.1rem; font-weight: 500; }
.a11y-close { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); }
.a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 4px; }
.a11y-size { display: flex; align-items: center; gap: 8px; }
.a11y-size button { min-width: 44px; height: 44px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-weight: 500; }
.a11y-size output { min-width: 3.2em; text-align: center; font-variant-numeric: tabular-nums; }
.a11y-opt { min-height: 44px; padding: 0 16px; text-align: start; border-radius: var(--r-input); border: 1px solid var(--line-2); transition: background-color .2s, border-color .2s; }
.a11y-opt[aria-pressed="true"] { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.a11y-size button:hover, .a11y-opt:hover, .a11y-close:hover { border-color: rgba(243,237,225,.5); }
.a11y-foot { display: flex; align-items: center; justify-content: space-between; padding-block-start: 6px; font-size: .9rem; color: var(--mute); }
.a11y-foot a { text-decoration: underline; text-underline-offset: 3px; }
.a11y-reset { color: var(--text); text-decoration: underline; text-underline-offset: 3px; padding-block: 8px; }

/* user-selected accessibility modes */
html.a11y-contrast { --bg: #100e0c; --bg-2: #171512; --bg-3: #1f1c18; --text: #ffffff; --mute: #e6dfd0; --line: rgba(255,255,255,.3); --line-2: rgba(255,255,255,.55); --accent: #ffc48f; }
html.a11y-contrast .hero-light, html.a11y-contrast .scene-bg { opacity: .6; }
html.a11y-links a:not(.btn) { text-decoration: underline !important; text-underline-offset: 4px; text-decoration-thickness: 2px; }
html.a11y-links a { outline: 1px dashed rgba(226,171,132,.6); outline-offset: 2px; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-still [data-reveal], html.a11y-still [data-hero], html.a11y-still .line > [data-hero], html.a11y-still .flow-step { opacity: 1 !important; transform: none !important; }
html.a11y-still .hero-arch { clip-path: none !important; }
html.a11y-still .arch-ring, html.a11y-still .arch-word { opacity: 1 !important; }
html.a11y-still .flow::before { transform: none !important; }
html.a11y-still .flow-step--last .fs-icon { background: var(--accent); color: var(--ink); }

/* ---------- Legal pages ---------- */
.legal { padding-block: calc(var(--nav-h) + 56px) clamp(64px, 9vw, 120px); }
.legal-inner { max-width: 760px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 300; letter-spacing: -.03em; line-height: 1.1; margin-block-end: 8px; }
.legal .updated { color: var(--mute); margin-block-end: 40px; }
.legal h2 { font-size: 1.35rem; font-weight: 500; margin-block: 36px 10px; }
.legal p, .legal li { color: #d9d1c1; }
.legal p + p { margin-block-start: 12px; }
.legal ul { display: grid; gap: 8px; margin-block: 10px; padding-inline-start: 1.2em; list-style: disc; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.legal .back { display: inline-flex; margin-block-end: 28px; color: var(--mute); }

@media (max-width: 720px) { .nav-inner { padding-inline: 16px 6px; } .a11y, .wa-tab { top: 72%; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal], .js [data-hero], .js .line > [data-hero], .js .flow-step { opacity: 1 !important; transform: none !important; transition: none !important; }
  .js .hero-arch, .js.is-ready .hero-arch { clip-path: none; transition: none; }
  .js .arch-ring, .js .arch-word, .js.is-ready .arch-ring, .js.is-ready .arch-word { opacity: 1; transition: none; }
  .js .flow::before { transform: none; }
  .js .flow-step--last .fs-icon { background: var(--accent); color: var(--ink); }
}
