@property --accent {
    syntax: "<color>";
    inherits: true;
    initial-value: #ff6a3d;
}

:root {
    color-scheme: dark;
    --bg: #06070a;
    --ink: #f4f2ee;
    --soft: #c9ccd3;
    --muted: #9198a5;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #ff6a3d;
    --display: "Geist", "Segoe UI", system-ui, sans-serif;
    --body: "Geist", "Segoe UI", system-ui, sans-serif;
    --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
    --mono: "Geist Mono", ui-monospace, Consolas, monospace;
    --ease: cubic-bezier(0.2, 0.75, 0.2, 1);
    transition: --accent 0.9s ease;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 17px/1.65 var(--body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #06070a; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }

.skip {
    position: absolute; left: 16px; top: -60px; z-index: 30;
    background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* Particle field + grain sit behind everything */
#field {
    position: fixed; inset: 0; z-index: 0;
    width: 100vw; height: 100vh; height: 100lvh;
    pointer-events: none;
}
.grain {
    position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .site-footer { position: relative; z-index: 1; }

/* Header */
.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 20;
    border-bottom: 1px solid transparent;
    transition: background 0.4s ease, border-color 0.4s ease;
}
.site-header.scrolled {
    background: rgba(6, 7, 10, 0.72);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
}
.bar { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand {
    display: inline-flex; align-items: center; gap: 11px; margin-right: auto;
    font: 600 21px/1 var(--display); letter-spacing: -0.035em;
}
.brand-mark {
    width: 13px; height: 13px; border-radius: 3px;
    background: var(--accent); transform: rotate(45deg);
    box-shadow: 0 0 18px var(--accent);
}
.main-nav { display: flex; gap: 30px; font-size: 15px; font-weight: 500; }
.main-nav a { color: var(--muted); padding: 8px 0; position: relative; transition: color 0.2s; }
.main-nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform 0.35s var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { transform: scaleX(1); }

/* Mobile menu (button + full-screen sheet); shown under 900px */
.menu-btn {
    display: none; position: relative; width: 44px; height: 44px; flex: none;
    border: 1px solid var(--line); border-radius: 50%;
    background: rgba(255, 255, 255, 0.03); color: var(--ink); cursor: pointer; padding: 0;
}
.menu-btn span {
    position: absolute; left: 13px; right: 13px; top: 50%; height: 1.5px; margin-top: -0.75px;
    background: currentColor; border-radius: 2px;
    transition: transform 0.4s var(--ease);
}
.menu-btn span:first-child { transform: translateY(-4px); }
.menu-btn span:last-child { transform: translateY(4px); }
.menu-open .menu-btn span:first-child { transform: rotate(45deg); }
.menu-open .menu-btn span:last-child { transform: rotate(-45deg); }

.menu {
    position: fixed; inset: 0; z-index: 18;
    display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
    padding: 96px 20px max(28px, env(safe-area-inset-bottom));
    background: rgba(6, 7, 10, 0.94);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    overflow-y: auto; visibility: hidden;
    clip-path: circle(0 at calc(100% - 42px) 30px);
    transition: clip-path 0.55s var(--ease), visibility 0s 0.55s;
}
.menu-open .menu {
    visibility: visible; clip-path: circle(150% at calc(100% - 42px) 30px);
    transition: clip-path 0.75s var(--ease), visibility 0s;
}
.menu nav a {
    display: flex; align-items: baseline; gap: 16px;
    padding: 18px 0; border-bottom: 1px solid var(--line);
    font: 600 clamp(34px, 11vw, 52px)/1.05 var(--display); letter-spacing: -0.045em;
    opacity: 0; transform: translateY(26px);
    transition: opacity 0.3s, transform 0.3s;
}
.menu nav a span { font: 400 12px/1 var(--mono); letter-spacing: 0.1em; color: var(--accent); }
.menu-open .menu nav a {
    opacity: 1; transform: none;
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.menu-open .menu nav a:nth-child(1) { transition-delay: 0.12s; }
.menu-open .menu nav a:nth-child(2) { transition-delay: 0.18s; }
.menu-open .menu nav a:nth-child(3) { transition-delay: 0.24s; }
.menu-open .menu nav a:nth-child(4) { transition-delay: 0.3s; }
.menu-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-foot .btn { justify-content: center; padding: 0 12px; }
html.menu-open, .menu-open body { overflow: hidden; }
.menu-open .site-header { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 52px;
    padding: 0 26px; border-radius: 999px;
    border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
    font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
    transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06070a; font-weight: 600; }
.btn-primary:hover { border-color: var(--accent); box-shadow: 0 14px 40px -12px var(--accent); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Section rail (desktop only) */
.rail {
    position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 15;
    display: none; flex-direction: column; gap: 14px; align-items: flex-end;
}
.rail a { display: flex; align-items: center; gap: 10px; }
.rail a::after {
    content: ""; width: 14px; height: 2px; border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    transition: width 0.4s var(--ease), background 0.4s;
}
.rail span {
    font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted); opacity: 0; transform: translateX(6px);
    transition: opacity 0.3s, transform 0.3s;
}
.rail:hover span, .rail a.on span { opacity: 1; transform: none; }
.rail a.on::after { width: 34px; background: var(--accent); }
.rail a.on span { color: var(--ink); }
@media (min-width: 1380px) { .rail { display: flex; } }

/* Type */
.eyebrow {
    font: 500 12px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 24px;
}
h1 {
    font: 600 clamp(44px, 6.6vw, 92px)/0.98 var(--display);
    letter-spacing: -0.05em;
}
h2 {
    font: 600 clamp(32px, 5vw, 66px)/1.04 var(--display);
    letter-spacing: -0.045em; text-wrap: balance;
}
/* Serif italic accent inside headlines */
h1 em, h2 em {
    font-family: var(--serif); font-style: italic; font-weight: 400;
    font-size: 1.07em; letter-spacing: -0.02em; color: var(--accent);
}
.lead {
    color: var(--soft); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6;
    max-width: 50ch; margin-top: 26px; text-wrap: pretty;
}

/* Stage: the box the particles assemble inside */
.stage { position: relative; width: 100%; aspect-ratio: 1; max-height: 72vh; }
.stage::before {
    content: ""; position: absolute; inset: 14%; border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent);
    filter: blur(34px);
}
.stage-caption {
    position: absolute; left: 0; right: 0; bottom: 6%; text-align: center;
    font: 400 12px/1 var(--mono); letter-spacing: 0.14em; color: var(--muted);
}

/* Hero */
.hero {
    min-height: 100vh; min-height: 100svh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 110px 0 36px;
}
.hero-grid {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center; gap: 40px; flex: 1;
}
.line { display: block; overflow: hidden; padding: 0 0.08em 0.14em 0; margin-bottom: -0.14em; white-space: nowrap; }
.line > span { display: block; }

.facts {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
    border-top: 1px solid var(--line); padding-top: 22px; margin-top: 40px;
}
.facts > div { display: flex; align-items: baseline; gap: 14px; }
.facts dt { font: 600 30px/1 var(--display); letter-spacing: -0.04em; }
.facts dd { color: var(--muted); font-size: 14px; }

/* Marquee */
.marquee {
    position: relative; z-index: 1; overflow: hidden;
    border-block: 1px solid var(--line); padding: 20px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: slide 38s linear infinite; }
.marquee span {
    font: 500 clamp(18px, 2.1vw, 25px)/1 var(--display); letter-spacing: -0.03em;
    color: var(--muted); padding: 0 26px; white-space: nowrap; position: relative;
}
.marquee span::after {
    content: ""; position: absolute; right: -4px; top: 50%; width: 7px; height: 7px;
    background: var(--accent); transform: translateY(-50%) rotate(45deg); border-radius: 1px;
}
@keyframes slide { to { transform: translateX(-50%); } }

/* Work */
.work-head { padding: clamp(80px, 13vw, 170px) 0 0; scroll-margin-top: 40px; }

.project { min-height: 100vh; display: grid; align-items: center; padding: 9vh 0; }
.project-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center; gap: clamp(28px, 6vw, 96px);
}
.flip .stage { order: 2; }

.proj-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.logo-tile {
    flex: none; width: 60px; height: 60px; border-radius: 16px; padding: 8px;
    background: #fff; display: grid; place-items: center; overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 14px 34px -14px var(--accent);
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.logo-tile-empty {
    background: transparent; border: 1px dashed rgba(255, 255, 255, 0.3); box-shadow: none;
    font: 500 15px/1 var(--mono); color: var(--muted); letter-spacing: 0.04em;
}
.kicker {
    font: 400 12px/1.5 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
}
.kicker b {
    font-weight: 500; color: #06070a; background: var(--accent);
    padding: 3px 8px; border-radius: 6px; letter-spacing: 0.06em;
}
.project h3 {
    font: 600 clamp(34px, 5vw, 68px)/1 var(--display);
    letter-spacing: -0.05em; text-wrap: balance;
}
.desc {
    color: var(--soft); font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6;
    max-width: 44ch; margin-top: 22px; text-wrap: pretty;
}
.points { margin-top: 24px; display: grid; gap: 11px; max-width: 46ch; }
.points li {
    position: relative; padding-left: 24px;
    color: var(--muted); font-size: 15.5px; line-height: 1.5;
}
.points li::before {
    content: ""; position: absolute; left: 3px; top: 0.56em; width: 7px; height: 7px;
    background: var(--accent); transform: rotate(45deg); border-radius: 1px;
}
.links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.visit {
    display: inline-flex; align-items: center; gap: 14px;
    min-height: 52px; padding: 0 24px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
    font: 500 14px/1.2 var(--mono); overflow-wrap: anywhere;
    transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.visit span { transition: transform 0.3s var(--ease); }
a.visit:hover { background: var(--accent); color: #06070a; transform: translateY(-2px); box-shadow: 0 16px 44px -14px var(--accent); }
a.visit:hover span { transform: translate(3px, -3px); }
.visit-quiet { border-color: var(--line); color: var(--soft); }
.visit-soon { border-style: dashed; color: var(--muted); }

/* Services */
.services { padding: 0 0 clamp(70px, 10vw, 130px); }
.stage-wide { aspect-ratio: auto; height: 46vh; max-height: none; }
.stage-wide::before { display: none; }

.rows { margin-top: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.rows li {
    display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr); align-items: baseline; gap: 20px;
    padding: 30px 0; border-top: 1px solid var(--line); position: relative;
}
.rows li::before {
    content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform 0.6s var(--ease);
}
.rows li:hover::before { transform: scaleX(1); }
.rows .idx { font: 400 13px/1 var(--mono); color: var(--accent); }
.rows h3 {
    font: 600 clamp(24px, 3vw, 38px)/1.1 var(--display); letter-spacing: -0.04em;
    transition: transform 0.45s var(--ease);
}
.rows li:hover h3 { transform: translateX(12px); }
.rows p { color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 46ch; }

.sub-head {
    font: 500 12px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--muted); margin-top: clamp(56px, 8vw, 100px);
}
.pipeline {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(16px, 3vw, 40px); margin-top: 22px; align-items: stretch;
}

/* Terminal window */
.term {
    border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
    background: rgba(9, 11, 15, 0.86);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: 0 50px 90px -50px #000, 0 30px 80px -50px var(--accent);
}
.term-bar {
    display: flex; align-items: center; gap: 7px; padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; font: 400 12px/1 var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.term-body {
    margin: 0; padding: 22px 20px 26px; min-height: 292px;
    font: 400 13.5px/2 var(--mono); color: var(--soft);
    white-space: pre; overflow: hidden;
}
.term-body code { font: inherit; }
.term-body .p { color: var(--accent); }
.term-body .a { color: var(--muted); }
.term-body .d { color: rgba(255, 255, 255, 0.2); }
.term-body .ok { color: #3ddc97; }
.term-body .hi { color: var(--ink); }
.caret {
    display: inline-block; width: 8px; height: 1.15em; margin-left: 2px;
    background: var(--accent); vertical-align: text-bottom;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Steps: light up in sync with the terminal */
.process { display: grid; gap: 12px; }
.process li {
    display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: start; gap: 14px;
    padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px;
    background: rgba(255, 255, 255, 0.025); color: var(--muted); font-size: 15px; line-height: 1.55;
    transition: border-color 0.45s, background 0.45s, opacity 0.45s, transform 0.45s var(--ease);
}
.process span {
    font: 400 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--accent); padding-top: 7px; white-space: nowrap;
}
.process b { display: block; font: 600 20px/1.25 var(--display); letter-spacing: -0.035em; color: var(--ink); margin-bottom: 4px; }
.pipeline.live .process li { opacity: 0.5; }
.pipeline.live .process li.on,
.pipeline.live .process li.done { opacity: 1; }
.pipeline.live .process li.on {
    border-color: var(--accent); transform: translateX(6px);
    background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.process li.done span::after { content: " \2713"; color: #3ddc97; }

/* Approach */
.approach { padding: clamp(60px, 9vw, 120px) 0 clamp(70px, 10vw, 130px); border-top: 1px solid var(--line); scroll-margin-top: 40px; }
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: clamp(40px, 6vw, 72px); }
.why li { border-top: 1px solid var(--accent); padding-top: 22px; }
.why h3 { font: 600 22px/1.2 var(--display); letter-spacing: -0.035em; margin-bottom: 10px; }
.why p { color: var(--muted); font-size: 16px; line-height: 1.6; }

/* Contact */
.contact { min-height: 100vh; display: grid; align-items: center; padding: 9vh 0; border-top: 1px solid var(--line); }
.contact .btn { overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); overflow: hidden; }
.wordmark {
    font: 700 clamp(64px, 20vw, 310px)/0.9 var(--display); letter-spacing: -0.07em;
    text-align: center; white-space: nowrap; padding-top: 0.12em; margin-bottom: -0.05em;
    color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    user-select: none;
}
.foot-row {
    display: flex; justify-content: space-between; align-items: center; gap: 16px 28px; flex-wrap: wrap;
    padding: 26px 0 34px; color: var(--muted); font-size: 14px;
    border-top: 1px solid var(--line);
}
.foot-row nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-row a { transition: color 0.2s; }
.foot-row a:hover { color: var(--ink); }

/* Scroll reveals (only when JS is running) */
.js [data-reveal] {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: var(--d, 0s);
}
.js [data-reveal].in { opacity: 1; transform: none; }
.js .line > span {
    transform: translateY(116%);
    transition: transform 1.1s var(--ease);
    transition-delay: calc(var(--i) * 0.09s + 0.12s);
}
.js .ready .line > span { transform: none; }

/* Tablet / mobile */
@media (max-width: 900px) {
    .main-nav { display: none; }
    .menu-btn { display: block; }
    .bar { height: 60px; gap: 10px; }
    .brand { padding: 12px 0; font-size: 20px; }

    h1 { font-size: clamp(34px, 11vw, 64px); }
    .lead { font-size: 16px; margin-top: 18px; }
    .eyebrow { margin-bottom: 18px; }

    /* Hero: shape, headline and both buttons fit on the first screen */
    .hero { padding: 64px 0 24px; justify-content: flex-start; }
    .hero-grid, .project-grid { grid-template-columns: 1fr; gap: 12px; }
    .hero-grid { flex: none; }
    .hero .stage { order: -1; height: 30vh; height: 30svh; min-height: 190px; }
    .hero .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
    .hero .actions .btn { width: auto; justify-content: center; padding: 0 12px; font-size: 14.5px; }
    .facts { grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; padding-top: 18px; }
    .facts > div { flex-direction: column; gap: 6px; }
    .facts dt { font-size: 26px; }
    .facts dd { font-size: 12.5px; line-height: 1.4; }

    .flip .stage { order: 0; }
    .stage { aspect-ratio: auto; height: 36vh; height: 36svh; min-height: 230px; max-height: none; }
    .stage-wide { height: 30vh; min-height: 0; }
    .work-head { padding-top: 72px; }
    .project, .contact { min-height: 0; padding: 20px 0 68px; }
    .proj-head { gap: 14px; margin-bottom: 20px; }
    .kicker { font-size: 11px; letter-spacing: 0.06em; gap: 6px 10px; }
    .logo-tile { width: 52px; height: 52px; border-radius: 14px; padding: 7px; }
    .desc { margin-top: 16px; }
    .links { margin-top: 28px; }
    .foot-row a { padding: 10px 0; }
    .rows li { grid-template-columns: 44px minmax(0, 1fr); gap: 6px 12px; padding: 24px 0; }
    .rows p { grid-column: 2; }
    .pipeline { grid-template-columns: 1fr; }
    .why { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .term-body { font-size: 12px; padding: 18px 16px 22px; min-height: 250px; }
    .process li { grid-template-columns: 1fr; gap: 6px; }
    .process span { padding-top: 0; }
    .actions .btn { width: 100%; justify-content: center; }
    .links .visit { width: 100%; justify-content: space-between; }
    .links .visit-soon { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    :root { transition: none; }
    .marquee-track, .caret { animation: none; }
    .js [data-reveal], .js .line > span { opacity: 1; transform: none; transition: none; }
    * { transition-duration: 0.01ms !important; }
}
