:root {
  --bg: #07040d;
  --ink: #f4f0ff;
  --muted: #a99cc6;
  --line: rgba(255, 255, 255, .09);
  --glass: rgba(20, 12, 36, .3);
  --citrine: #f5b82e;
  --citrine-2: #ffd978;
  --amethyst: #9b6bff;
  --amethyst-2: #c9a8ff;
  --display: 'Unbounded', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--amethyst); color: #fff; }

.container { width: min(1200px, calc(100% - 2rem)); margin: 0 auto; }
.center { text-align: center; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); font-size: 1.08rem; max-width: 36rem; }
.center .muted { margin-inline: auto; }

/* ---------- background layers ---------- */
#gl {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}
/* Fallback when WebGL is unavailable */
body:not(.gl-ready) #gl { display: none; }
body:not(.gl-ready)::before {
  content: ''; position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(40vw 40vw at 75% 30%, rgba(245, 184, 46, .18), transparent 60%),
    radial-gradient(50vw 50vw at 20% 80%, rgba(155, 107, 255, .2), transparent 60%);
}
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); }
}
main { position: relative; z-index: 2; }

/* ---------- boot loader ---------- */
.boot { display: none; }
.js .boot {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  transition: opacity .8s var(--ease), visibility .8s;
  animation: boot-failsafe 0s 4s forwards; /* never block the page for long */
}
.boot-inner { display: grid; gap: .9rem; width: min(280px, 70vw); color: var(--muted); font-size: .78rem; }
.boot-bar { height: 2px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--amethyst), var(--citrine)); transform-origin: left; animation: boot-bar 1.4s var(--ease) forwards; }
@keyframes boot-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes boot-failsafe { to { opacity: 0; visibility: hidden; } }
.booted .boot { opacity: 0; visibility: hidden; }

/* ---------- cursor ---------- */
.cursor { display: none; }
@media (pointer: fine) {
  .cursor {
    display: block; position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none;
    width: 36px; height: 36px; margin: -18px 0 0 -18px;
    border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
    transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s, border-color .3s;
    mix-blend-mode: difference;
  }
  .cursor i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; }
  .cursor.hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(255, 255, 255, .9); border-color: transparent; }
}

/* ---------- type ---------- */
.display {
  font-family: var(--display); font-weight: 600;
  line-height: 1.02; letter-spacing: -.03em; margin: 0 0 1.4rem;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}
h1.display { font-size: clamp(2.2rem, 6vw, 5.6rem); font-weight: 800; max-width: 11ch; }
.hero-inner > * { max-width: 44rem; }
.display.huge { font-size: clamp(2.4rem, 7vw, 6rem); max-width: 16ch; margin-inline: auto; }
.chrome {
  background: linear-gradient(180deg, #ffffff 0%, #d9d6e4 30%, #6f6a80 52%, #f1eff7 64%, #a6a1b6 82%, #ffffff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.label { color: var(--citrine-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; margin: 0 0 1.4rem; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--muted); max-width: 34rem; margin: 0 0 2.2rem; }

/* split-word reveal */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.w > span { display: inline-block; transform: translateY(110%) rotate(4deg); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 45ms); }
.in .w > span { transform: none; }
.w.chrome-w > span { background: inherit; }

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

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: .6rem;
  padding: .95rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: .98rem;
  overflow: hidden; isolation: isolate; transition: color .3s, border-color .3s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn.primary { color: #1a0f00; background: linear-gradient(135deg, var(--citrine-2), var(--citrine) 55%, #e08a12); box-shadow: 0 10px 40px -10px rgba(245, 184, 46, .6), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn.primary::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn.primary:hover::after { transform: translateX(120%); }
.btn.ghost { border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .03); backdrop-filter: blur(8px); }
.btn.ghost:hover { border-color: var(--amethyst-2); }
.btn.big { padding: 1.2rem 2rem; font-size: 1.1rem; }
.magnetic { will-change: transform; transition: transform .4s var(--ease); }

/* ---------- hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 4rem 0 5rem; position: relative; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.scroll-hint { position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%); display: grid; justify-items: center; gap: .5rem; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .2em; }
.scroll-hint i { width: 1px; height: 42px; background: linear-gradient(var(--ink), transparent); animation: drip 2s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 860px) {
  .hero { align-items: flex-end; padding-bottom: 6rem; }
  .scroll-hint { display: none; }
}

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); background: rgba(7, 4, 13, .35); backdrop-filter: blur(4px); overflow: hidden; padding: 1.1rem 0; }
.marquee-track { display: flex; gap: 2rem; width: max-content; animation: marquee 40s linear infinite; font-family: var(--display); font-size: clamp(1rem, 2vw, 1.5rem); text-transform: uppercase; white-space: nowrap; }
.marquee-track b { color: var(--citrine); font-weight: 400; }
.marquee-track span:nth-of-type(odd) { -webkit-text-stroke: 1px rgba(255, 255, 255, .5); color: transparent; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(6rem, 14vw, 11rem) 0; position: relative; }
.section-head { max-width: 40rem; margin-bottom: 3.5rem; }
.section-head.right { margin-left: auto; }
@media (max-width: 860px) { .section-head.right { margin-left: 0; } }

/* cards */
.card {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative; display: flex; flex-direction: column; gap: .4rem;
  padding: 1.6rem; min-height: 300px; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s var(--ease), border-color .3s, opacity 1s var(--ease);
  transform-style: preserve-3d;
}
.js .card[data-reveal] { transform: translateY(28px) rotateX(var(--rx)) rotateY(var(--ry)); }
.js .card[data-reveal].in { transform: rotateX(var(--rx)) rotateY(var(--ry)); }
.card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(245, 184, 46, .9), rgba(155, 107, 255, .5) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s;
}
.card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(400px circle at var(--mx) var(--my), rgba(155, 107, 255, .14), transparent 60%); opacity: 0; transition: opacity .3s; }
.card:hover::before, .card:hover::after { opacity: 1; }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.2; margin: 0; letter-spacing: -.01em; transform: translateZ(20px); }
.card p { color: var(--muted); margin: 0; font-size: .95rem; }
.card-link { margin-top: .8rem; color: var(--amethyst-2); font-size: .8rem; }

/* services + pricing cards */
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; perspective: 1200px; }
.svc { padding: 1rem; gap: 0; min-height: 0; }
.svc-body { display: grid; gap: .9rem; padding: 1.2rem .6rem .5rem; }
.svc h3 { display: flex; align-items: baseline; gap: .7rem; font-size: 1.25rem; }
.svc h3 .mono { font-size: .75rem; color: var(--citrine-2); font-weight: 400; opacity: .8; }
.svc-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem 1.5rem; }
.svc-price { display: flex; gap: 1.6rem; }
.svc-price > div { display: grid; }
.svc-price strong {
  font-family: var(--display); font-weight: 800; line-height: 1; letter-spacing: -.04em; font-size: clamp(2.2rem, 3.6vw, 3rem);
  background: linear-gradient(180deg, var(--citrine-2), var(--citrine) 55%, #d98412);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.svc-price span { color: var(--muted); font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; margin-top: .35rem; }
.svc .card-link { margin: 0 0 .3rem; }
.svc .card-link:hover { color: var(--citrine-2); }
.svc-note .short { display: none; }
.svc .svc-note { font-size: .8rem; line-height: 1.5; padding: .7rem .85rem; border-radius: 10px; border: 1px solid rgba(155, 107, 255, .3); background: rgba(155, 107, 255, .08); }

.stage {
  position: relative; height: 270px; overflow: hidden; border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(155, 107, 255, .14), rgba(5, 3, 10, .5) 70%);
  border: 1px solid var(--line);
}
.stage-label { position: absolute; left: 50%; bottom: .8rem; transform: translateX(-50%); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); transition: opacity .3s; }

/* 01 devices: one frame that morphs between device shapes */
.device {
  --w: 230px; --h: 140px; --r: 10px; --logo: 64px;
  position: absolute; left: 50%; top: 46%; width: var(--w); height: var(--h);
  transform: translate(-50%, -50%);
  transition: width .8s var(--ease), height .8s var(--ease);
}
.device[data-device="phone"] { --w: 82px; --h: 158px; --r: 18px; --logo: 42px; }
.device[data-device="watch"] { --w: 76px; --h: 86px; --r: 24px; --logo: 38px; }
.device[data-device="tv"] { --w: 250px; --h: 142px; --r: 6px; --logo: 78px; }
.d-screen {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  border-radius: var(--r); border: 2px solid rgba(255, 255, 255, .28);
  background: radial-gradient(circle at 50% 45%, #2a1650, #0b0714 75%);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .8), 0 0 40px -10px rgba(155, 107, 255, .5);
  transition: border-radius .8s var(--ease);
}
.d-screen img { width: var(--logo); height: auto; transition: width .8s var(--ease); animation: clover-spin 6s ease-in-out infinite; filter: drop-shadow(0 6px 14px rgba(155, 107, 255, .55)); }
@keyframes clover-spin { 0%, 100% { transform: rotateY(-18deg) rotate(-4deg); } 50% { transform: rotateY(18deg) rotate(4deg); } }
.d-bar, .d-notch, .d-strap, .d-stand { position: absolute; opacity: 0; transition: opacity .4s; }
.d-bar { top: 0; left: 0; right: 0; height: 16px; display: flex; gap: 4px; align-items: center; padding-left: 7px; background: rgba(255, 255, 255, .07); border-bottom: 1px solid var(--line); }
.d-bar i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.d-notch { top: 6px; left: 50%; width: 22px; height: 5px; margin-left: -11px; border-radius: 3px; background: rgba(255, 255, 255, .25); }
.d-strap { left: 50%; width: 46px; height: 36px; margin-left: -23px; background: linear-gradient(90deg, #2a1f3d, #3b2c55, #2a1f3d); }
.d-strap.top { bottom: 100%; border-radius: 8px 8px 0 0; }
.d-strap.bottom { top: 100%; border-radius: 0 0 8px 8px; }
.d-stand { top: 100%; left: 50%; width: 70px; height: 14px; margin-left: -35px; background: linear-gradient(rgba(255, 255, 255, .25), rgba(255, 255, 255, .08)); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.device[data-device="web"] .d-bar, .device[data-device="phone"] .d-notch,
.device[data-device="watch"] .d-strap, .device[data-device="tv"] .d-stand { opacity: 1; transition-delay: .45s; }

/* 02 docs: paper invoice shatters to reveal a spreadsheet */
.xl { position: absolute; inset: 18px 22px; border-radius: 8px; overflow: hidden; background: #fbfbfd; color: #1d1d24; box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .8); opacity: 0; transform: scale(.97); transition: opacity .5s, transform .5s var(--ease); }
.xl.show { opacity: 1; transform: none; }
.xl-bar { display: flex; gap: .6rem; align-items: center; height: 24px; padding: 0 .6rem; font-size: .66rem; background: #eef0f3; border-bottom: 1px solid #d5d8de; color: #555; }
.xl-bar b { color: #1f7a45; font-style: italic; }
.xl-grid { display: grid; grid-template-columns: 26px 1fr 1.6fr 1fr; font-size: .68rem; }
.xl-grid > span { padding: .26rem .45rem; border-right: 1px solid #e1e3e8; border-bottom: 1px solid #e1e3e8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xl-grid > .h { background: #eef0f3; color: #6b6f78; text-align: center; font-size: .62rem; }
.xl-grid > .n { background: #eef0f3; color: #6b6f78; text-align: center; padding-inline: 0; text-overflow: clip; }
.xl-grid > .th { font-weight: 600; background: #e3f1e8; color: #1f5f39; }
.xl-grid > .num { text-align: right; }
.xl-grid > .c { opacity: 0; transition: opacity .25s, background .6s; }
.xl-grid > .c.in { opacity: 1; background: rgba(245, 184, 46, .0); }
.xl-grid > .c.flash { background: rgba(245, 184, 46, .3); }
.xl-grid > .sel { outline: 2px solid #1f7a45; outline-offset: -2px; }
.paper-wrap { position: absolute; left: 50%; top: 50%; width: 250px; height: 200px; margin: -100px 0 0 -125px; }
.paper-wrap.drop { animation: paper-drop .7s var(--ease); }
@keyframes paper-drop { from { transform: translateY(-40px) rotate(-6deg); opacity: 0; } }
.paper-wrap.shake { animation: crumple .35s ease-in-out; }
@keyframes crumple { 25% { transform: rotate(-2deg) scale(.97); } 50% { transform: rotate(2deg) scale(.95); } 75% { transform: rotate(-1deg) scale(.96); } }
.shard { position: absolute; inset: 0; transition: transform 1.3s cubic-bezier(.3, .1, .6, 1), opacity 1.3s ease-in; will-change: transform; }
.inv {
  position: absolute; inset: 0; padding: .8rem .9rem; border-radius: 4px;
  background: linear-gradient(#f6efdd, #e7dcc0); color: #3a3226;
  font: 600 .98rem/1.25 'Caveat', cursive; white-space: nowrap; box-shadow: inset 0 0 30px rgba(120, 90, 40, .25);
}
.inv h4 { margin: 0 0 .35rem; font: inherit; font-size: 1.2rem; border-bottom: 1.5px solid #a8987a; display: flex; justify-content: space-between; }
.inv div { display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px dashed #c6b794; padding: .12rem 0; }
.inv div b { font-weight: 600; color: #6a1d1d; }
.inv div span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* 03 errors: terminal cycling through failures */
.term { position: absolute; inset: 18px; border-radius: 10px; overflow: hidden; background: rgba(10, 7, 16, .72); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .9); }
.term-bar { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 .7rem; background: rgba(255, 255, 255, .04); border-bottom: 1px solid var(--line); }
.term-bar i { width: 8px; height: 8px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-lang { margin-left: auto; font-size: .66rem; padding: .1rem .5rem; border-radius: 5px; color: var(--citrine-2); background: rgba(245, 184, 46, .12); text-transform: lowercase; }
.term-body { margin: 0; padding: .9rem 1rem; font-size: .74rem; line-height: 1.6; color: #b9aed3; white-space: pre-wrap; word-break: break-word; }
.term-body .err { color: #ff6b7a; font-weight: 600; }
.term-body .dim { color: #6f6590; }
.term-body .caret { display: inline-block; width: .55em; height: 1.05em; vertical-align: text-bottom; background: var(--citrine); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term.glitch { animation: glitch .3s steps(3); }
@keyframes glitch { 33% { transform: translate(3px, -2px); filter: hue-rotate(90deg); } 66% { transform: translate(-3px, 2px); filter: saturate(3); } }

/* 04 agent: chat + tool log */
.chat { position: absolute; inset: 14px 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: .45rem; font-size: .8rem; transition: opacity .5s; }
.chat.fade { opacity: 0; }
.msg { max-width: 78%; padding: .5rem .8rem; border-radius: 16px; line-height: 1.35; animation: pop .35s var(--ease); }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, var(--citrine-2), var(--citrine)); color: #1a0f00; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: linear-gradient(135deg, #8a5cff, #6b3fe0); color: #fff; border-bottom-left-radius: 5px; }
.msg.typing { display: flex; gap: 4px; padding: .65rem .8rem; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; animation: dots 1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.tool { align-self: flex-start; width: 88%; padding: .5rem .7rem; border-radius: 10px; background: rgba(10, 7, 16, .8); border: 1px solid rgba(155, 107, 255, .3); font-family: var(--mono); font-size: .68rem; animation: pop .35s var(--ease); }
.tool-head { display: flex; align-items: center; gap: .4rem; color: var(--amethyst-2); margin-bottom: .25rem; }
.tool-head img { width: 14px; height: auto; }
.step { display: flex; justify-content: space-between; gap: .6rem; color: var(--muted); padding: .1rem 0; animation: pop .3s var(--ease); }
.step .r { white-space: nowrap; }
.step .r.bad { color: #ff6b7a; } .step .r.ok { color: #5cf29a; }
.spin { display: inline-block; width: 9px; height: 9px; border: 1.5px solid var(--amethyst-2); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* contact */
.contact { min-height: 90vh; display: flex; align-items: center; }
.contact .container { position: relative; }
.contact .container::before { content: ''; position: absolute; inset: -12% -5%; z-index: -1; background: radial-gradient(closest-side, rgba(7, 4, 13, .62), transparent); pointer-events: none; }
.copyright { margin: 2.6rem 0 0; font-size: .74rem; letter-spacing: .12em; color: var(--muted); opacity: .75; }
.contact { padding-bottom: 3rem; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2.2rem; }


/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .marquee-track { animation: none; }
}
@media (max-width: 520px) {
  .stage-agent { height: 310px; }
  .tool { width: 100%; }
  .msg { max-width: 88%; }
}

/* phones: 2x2 grid so all four service cards fit on one screen */
@media (max-width: 600px) {
  #services .section-head { margin-bottom: 2rem; }
  .svc-grid { gap: .6rem; }
  .svc { padding: .45rem; border-radius: 16px; }
  .svc .stage, .svc .stage-agent { height: 250px; zoom: .55; border-radius: 18px; }
  .svc-body { gap: .45rem; padding: .6rem .25rem .2rem; }
  .svc h3 { font-size: .74rem; gap: .35rem; letter-spacing: -.02em; }
  .svc h3 .mono { font-size: .58rem; }
  .svc-foot { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .svc-price { gap: .8rem; }
  .svc-price strong { font-size: 1.45rem; }
  .svc-price span { font-size: .52rem; letter-spacing: .08em; margin-top: .25rem; }
  .svc .card-link { font-size: .66rem; margin: 0; }
  .svc .svc-note { font-size: .6rem; line-height: 1.35; padding: .35rem .45rem; border-radius: 8px; }
  .svc-note .full { display: none; }
  .svc-note .short { display: inline; }
}

/* ---------- top navigation ---------- */
.topnav {
  position: fixed; top: 1rem; left: 50%; z-index: 50; transform: translateX(-50%);
  display: flex; align-items: center; gap: .3rem; padding: .35rem .4rem .35rem .9rem; max-width: calc(100% - 2rem);
  border-radius: 999px; border: 1px solid var(--line); background: rgba(12, 7, 22, .45);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topnav .brand { display: flex; align-items: center; flex-shrink: 0; margin-right: .5rem; }
.topnav .brand img { height: 20px; width: auto; max-width: none; }
.topnav a:not(.brand) { padding: .45rem .8rem; border-radius: 999px; font-size: .78rem; color: var(--muted); white-space: nowrap; transition: color .3s, background .3s; }
.topnav a:not(.brand):hover, .topnav a[aria-current] { color: var(--ink); background: rgba(255, 255, 255, .06); }
.topnav a.go[aria-current] { color: #1a0f00; background: linear-gradient(135deg, #fff1c2, var(--citrine-2)); }
.topnav a.go { color: #1a0f00; background: linear-gradient(135deg, var(--citrine-2), var(--citrine)); font-weight: 600; }
@media (max-width: 600px) {
  .topnav { gap: 0; padding-left: .7rem; }
  .topnav .brand { margin-right: .2rem; }
  .topnav .brand img { height: 16px; }
  .topnav a:not(.brand) { padding: .4rem .55rem; font-size: .68rem; }
}

.svc-more { font-size: .7rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.svc-more:hover { color: var(--ink); }

.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .muted { margin-inline: auto; }
.section-head .muted { margin-top: -.4rem; }

/* ---------- service details: animation | text | clover ---------- */
.details .section-head { margin-bottom: clamp(3rem, 8vw, 6rem); }
.detail {
  display: grid; align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .85fr);
  grid-template-areas: "stage copy orbit";
  min-height: 78vh; padding: 3rem 0; scroll-margin-top: 5rem;
}
.detail.stage-right { grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr) minmax(0, 1fr); grid-template-areas: "orbit copy stage"; }
.detail-stage { grid-area: stage; }
.detail-copy { grid-area: copy; }
.detail-orbit { grid-area: orbit; min-height: 1px; }
.detail .stage { height: 290px; background: radial-gradient(120% 90% at 50% 0%, rgba(155, 107, 255, .16), rgba(5, 3, 10, .55) 70%); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.detail-num { display: block; font-size: .72rem; letter-spacing: .14em; color: var(--muted); margin-bottom: .8rem; }
.detail-title { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 .9rem; }
.detail-lede { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--ink); margin: 0 0 .8rem; font-weight: 500; }
.detail-text { color: var(--muted); margin: 0 0 1.4rem; font-size: .98rem; }
.detail .svc-note { font-size: .8rem; line-height: 1.5; padding: .7rem .85rem; border-radius: 10px; border: 1px solid rgba(155, 107, 255, .3); background: rgba(155, 107, 255, .08); color: var(--muted); margin: 0 0 1.2rem; }
.detail-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem 1.5rem; }
.detail-foot .card-link { color: var(--amethyst-2); font-size: .82rem; margin: 0 0 .3rem; }
.detail-foot .card-link:hover { color: var(--citrine-2); }
@media (max-width: 900px) {
  /* phones/tablets: animation and clover share a row, text underneath */
  .detail, .detail.stage-right { grid-template-columns: 1.35fr 1fr; grid-template-areas: "stage orbit" "copy copy"; min-height: 0; gap: 1.2rem 1rem; padding: 2rem 0; }
  .detail.stage-right { grid-template-columns: 1fr 1.35fr; grid-template-areas: "orbit stage" "copy copy"; }
  .detail .stage { height: 260px; zoom: .62; border-radius: 20px; }
  .detail-orbit { align-self: stretch; }
}

/* 404 */
.lost { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.lost .code { font-family: var(--display); font-weight: 800; font-size: clamp(6rem, 24vw, 16rem); line-height: .9; letter-spacing: -.06em; margin: 0 0 1rem; }
.lost .hero-actions { justify-content: center; margin-top: 2rem; }

/* ---------- experimental fx (fx.js, opt-in via ?fx=) ---------- */
.fx-roll { display: flex; flex-direction: column; width: 100%; will-change: transform, opacity; backface-visibility: hidden; }
.fx-roll > .card { flex: 1; }
html[data-fx="wheel"] .w > span { transform: none; transition: none; } /* decode replaces the word slide */
/* fly-through: the flight replaces the reveal animations */
html[data-fx="fly"] .w > span { transform: none; transition: none; }
html.js[data-fx="fly"] [data-reveal]:not(.card) { opacity: 1; transform: none; transition: none; }
html.js[data-fx="fly"] .card[data-reveal] { opacity: 1; transform: rotateX(var(--rx)) rotateY(var(--ry)); }
html[data-fx="fly"] .fx-roll { transform-origin: 50% 50%; }
.fx-dust { position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; }
html[data-fx="wheel"] .w { overflow: visible; white-space: nowrap; }
/* the drum is the reveal */
html[data-fx="wheel"] .fx-roll [data-reveal]:not(.card) { opacity: 1; transform: none; }
html[data-fx="wheel"] .fx-roll .card[data-reveal] { opacity: 1; transform: rotateX(var(--rx)) rotateY(var(--ry)); }
html[data-fx] { overflow-x: clip; }
.fx-badge {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 60; display: flex; gap: .6rem; align-items: center;
  padding: .45rem .8rem; border-radius: 999px; font-size: .7rem; color: var(--citrine-2);
  background: rgba(12, 7, 22, .6); border: 1px solid rgba(245, 184, 46, .35); backdrop-filter: blur(10px);
}
.fx-badge span { color: var(--muted); }
