/* ==========================================================================
   Youssef Benaouda · AI Engineer
   Graphite canvas, saffron accent, cyan "machine view". Compact, direct.
   ========================================================================== */

:root {
  --bg: #0B0C0E;
  --bg-2: #101114;
  --surface: #15171B;
  --surface-2: #1B1E23;
  --line: rgba(236, 234, 228, .10);
  --line-2: rgba(236, 234, 228, .18);
  --text: #ECEAE4;
  --text-2: rgba(236, 234, 228, .74);
  --muted: #8A8C91;
  --accent: #F2A93B;
  --accent-ink: #1A1206;
  --data: #7FD4E6;

  --f-display: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 3vw, 40px);
  --max: 1320px;
  --nav-h: 68px;
  --radius: 2px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --pad-y: clamp(72px, 9vw, 128px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) { html:not(.lenis) { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-display);
  font-size: clamp(16px, .6vw + 12px, 18px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }
[id] { scroll-margin-top: 0; }

/* ---------- Utilities ---------- */
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.6; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.display { font-family: var(--f-display); font-weight: 600; letter-spacing: -.045em; line-height: .98; }

.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; font-weight: 600; border-radius: var(--radius); transition: top .2s; }
.skip-link:focus { top: 16px; }

.tick { position: absolute; width: 14px; height: 14px; pointer-events: none; z-index: 3; }
.tick::before, .tick::after { content: ""; position: absolute; background: var(--line-2); }
.tick::before { width: 100%; height: 1px; }
.tick::after { width: 1px; height: 100%; }
.tick-tl { top: 12px; left: 12px; }
.tick-br { bottom: 12px; right: 12px; transform: rotate(180deg); }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); }
}

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 1px solid var(--text); border-radius: 50%; opacity: 0; mix-blend-mode: difference;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), opacity .3s;
}
.has-cursor .cursor { opacity: 1; }
.cursor.is-link { width: 44px; height: 44px; margin: -22px 0 0 -22px; }

/* ---------- Buttons ---------- */
.btn {
  --py: 14px; --px: 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: var(--py) var(--px);
  font-weight: 500; font-size: 15px; line-height: 1;
  border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
  transition: background .3s, color .3s, border-color .3s;
}
.btn-sm { --py: 11px; --px: 18px; font-size: 14px; }
.btn-lg { --py: 19px; --px: 30px; font-size: 17px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #F7BC5E; }
.btn-ghost { border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--text); }
.btn-arrow { display: inline-block; transition: transform .35s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: transform .5s var(--ease), background .4s, border-color .4s;
}
.nav.is-scrolled { background: rgba(11, 12, 14, .76); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.nav.is-hidden { transform: translateY(-100%); }
.nav-logo { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 15px; }
.nav-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: var(--radius); font-family: var(--f-mono); font-size: 12px; color: var(--accent); }
.nav-links { display: flex; gap: 32px; font-size: 15px; color: var(--text-2); }
.nav-links a { position: relative; padding: 6px 0; transition: color .25s; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }

/* ---------- Media layers (Envato slots + placeholders) ---------- */
.media { position: absolute; inset: 0; overflow: hidden; background-color: var(--bg); background-size: cover; background-position: center; }
.media--documents {
  background-image:
    url("assets/scene-documents.webp"),
    radial-gradient(60% 55% at 70% 40%, rgba(242,169,59,.10), transparent 70%),
    radial-gradient(50% 60% at 20% 75%, rgba(127,212,230,.07), transparent 70%),
    linear-gradient(180deg, #0B0C0E 0%, #111317 100%);
}
.media--cad {
  background-image:
    radial-gradient(70% 70% at 50% 50%, rgba(127,212,230,.08), transparent 70%),
    linear-gradient(180deg, #0D0F12 0%, #0B0C0E 100%);
}
.media--drone {
  background-image:
    radial-gradient(80% 60% at 80% 10%, rgba(242,169,59,.18), transparent 70%),
    linear-gradient(160deg, #1A1610 0%, #0F0E0C 55%, #0B0C0E 100%);
}
.media--medical {
  background-image:
    radial-gradient(70% 80% at 30% 30%, rgba(242,169,59,.10), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(236,234,228,.04) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(236,234,228,.04) 39px 40px),
    linear-gradient(180deg, #111317, #0B0C0E);
}
.media--sweep { background-image: radial-gradient(40% 60% at 50% 100%, rgba(242,169,59,.12), transparent 70%), linear-gradient(180deg, var(--bg), #0E0F12); }
.media-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s var(--ease); }
.media.has-video .media-video { opacity: 1; }
.ph-canvas, .ph-svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 1s; }
.media.has-video .ph-canvas, .media.has-video .ph-svg { opacity: 0; }
.fx-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.media-shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11,12,14,.5) 0%, rgba(11,12,14,0) 30%, rgba(11,12,14,0) 50%, rgba(11,12,14,.94) 100%),
    radial-gradient(120% 90% at 50% 50%, transparent 50%, rgba(11,12,14,.55) 100%);
}
.media-shade--card { background: linear-gradient(180deg, rgba(11,12,14,0) 45%, rgba(11,12,14,.88) 100%); }

/* portfolio visuals: CAD plan */
.g-min { stroke: rgba(236,234,228,.035); stroke-width: 1; }
.g-maj { stroke: rgba(236,234,228,.075); stroke-width: 1; }
.lay.is-hot :not(g):not(text) { stroke: var(--data) !important; }
.lay.is-hot text { fill: var(--data) !important; }
.axis { stroke: rgba(236,234,228,.12); stroke-width: 1.2; stroke-dasharray: 40 8 4 8; fill: none; }
.bubble { fill: #0D0F12; stroke: rgba(236,234,228,.35); stroke-width: 1.5; }
.bubble-t { fill: rgba(236,234,228,.55); font: 500 20px var(--f-mono); }
.room-fill { opacity: 0; fill: rgba(127,212,230,.10); transition: opacity .5s; }
.room-fill--meeting { fill: rgba(127,212,230,.17); }
.room-fill--lab { fill: rgba(127,212,230,.13); }
.room-fill--storage, .room-fill--wc { fill: rgba(127,212,230,.06); }
.room-fill--plant { fill: rgba(242,169,59,.10); }
.room-fill--stair, .room-fill--lift { fill: rgba(242,169,59,.20); }
.f { fill: none; stroke: rgba(236,234,228,.17); stroke-width: 1.2; }
.f.arrow { stroke: rgba(236,234,228,.32); }
.p-wall { fill: none; stroke: rgba(236,234,228,.42); stroke-width: 3; }
.door-gap { fill: #0D0F12; }
.plan-door { fill: none; stroke: rgba(236,234,228,.32); stroke-width: 1.3; }
.w-edge { fill: none; stroke: rgba(236,234,228,.55); stroke-width: 24; }
.w-core { fill: none; stroke: #0D0F12; stroke-width: 20; }
.w-hatch { fill: none; stroke: url(#cad-hatch); stroke-width: 20; }
.core-wall { fill: none; stroke: url(#cad-hatch); stroke-width: 9; }
.hatch-line { stroke: rgba(236,234,228,.42); stroke-width: 2; }
.win { fill: #0D0F12; stroke: rgba(236,234,228,.45); stroke-width: 1.2; }
.win-l { stroke: rgba(127,212,230,.5); stroke-width: 1.2; }
.col { fill: rgba(236,234,228,.6); }
.dim { stroke: rgba(236,234,228,.3); stroke-width: 1.2; }
.dim-txt { fill: rgba(236,234,228,.42); font: 18px var(--f-mono); }
.tag-bg { fill: rgba(13,15,18,.88); stroke: rgba(236,234,228,.18); stroke-width: 1; transition: stroke .4s; }
.tag-id { fill: rgba(236,234,228,.62); font: 600 19px var(--f-mono); transition: fill .4s; }
.tag-sub { fill: rgba(236,234,228,.36); font: 14px var(--f-mono); }
.tag.is-read .tag-bg { stroke: var(--data); }
.tag.is-read .tag-id { fill: var(--data); }
.pave { stroke: rgba(236,234,228,.06); stroke-width: 1; stroke-dasharray: 6 6; }
.walk { fill: none; stroke: rgba(236,234,228,.06); stroke-width: 44; stroke-linecap: round; }
.tree { fill: rgba(127,180,120,.06); stroke: rgba(150,190,140,.32); stroke-width: 1.2; }
.label-court { fill: rgba(236,234,228,.25); font: 500 22px var(--f-mono); letter-spacing: .3em; }
.seg-wall { fill: none; stroke: rgba(127,212,230,.6); stroke-width: 4; }
.seg-wall--out { stroke-width: 26; stroke: rgba(127,212,230,.22); }
.scan-glow { fill: url(#cad-scan); }
.scan-line { stroke: var(--data); stroke-width: 3; }
.det-box rect { fill: rgba(127,212,230,.06); stroke: var(--data); stroke-width: 2.5; }
.det-box text { fill: var(--data); font: 500 24px var(--f-mono); letter-spacing: .04em; }
.det-box--warn rect { fill: rgba(242,169,59,.08); stroke: var(--accent); }
.det-box--warn text { fill: var(--accent); }
.qa-ring, .qa-pulse { fill: none; stroke: var(--accent); stroke-width: 3; }
.qa-dot { fill: var(--accent); }
.qa-lead { fill: none; stroke: var(--accent); stroke-width: 2; }
.qa-tag { fill: rgba(11,12,14,.92); stroke: var(--accent); stroke-width: 2; }
.qa-t { fill: var(--accent); font: 600 22px var(--f-mono); letter-spacing: .04em; }

/* portfolio visuals: clinical flow */
.cl-panel { fill: rgba(21,23,27,.9); stroke: rgba(236,234,228,.14); stroke-width: 1.5; }
.cl-h { fill: var(--muted); font: 500 22px var(--f-mono); letter-spacing: .12em; }
.cl-sep { stroke: rgba(236,234,228,.12); }
.cl-word { fill: rgba(236,234,228,.16); transition: fill .4s; }
.cl-word.is-ent { fill: var(--data); }
.cl-word.is-ent--a { fill: var(--accent); }
.cl-cursor { fill: rgba(127,212,230,.07); stroke: rgba(127,212,230,.35); stroke-width: 1; transition: y .25s var(--ease); }
.cl-ring { fill: none; stroke: rgba(242,169,59,.5); stroke-width: 2; stroke-dasharray: 10 14; }
.cl-ring2 { fill: none; stroke: rgba(236,234,228,.14); stroke-width: 1.5; }
.cl-core { fill: rgba(242,169,59,.10); stroke: var(--accent); stroke-width: 2; transition: fill .4s; }
.cl-core.is-busy { fill: rgba(242,169,59,.28); }
.cl-core-t { fill: var(--accent); font: 600 28px var(--f-mono); }
.cl-model { fill: rgba(236,234,228,.28); font: 500 20px var(--f-mono); letter-spacing: .08em; transition: fill .3s; }
.cl-model.is-on { fill: var(--text); }
.cl-link { fill: none; stroke: rgba(236,234,228,.08); stroke-width: 1.5; transition: stroke .4s; }
.cl-link.is-on { stroke: rgba(127,212,230,.5); }
.cl-row-bg { fill: rgba(21,23,27,.85); stroke: rgba(236,234,228,.1); stroke-width: 1.5; transition: stroke .4s, fill .4s; }
.cl-row-t { fill: rgba(236,234,228,.75); font: 500 24px var(--f-mono); letter-spacing: .04em; }
.cl-track { fill: rgba(236,234,228,.07); }
.cl-fill { fill: rgba(127,212,230,.6); }
.cl-rec { fill: var(--accent); font: 600 17px var(--f-mono); letter-spacing: .12em; opacity: 0; transition: opacity .4s; }
.cl-row.is-win .cl-row-bg { stroke: var(--accent); fill: rgba(242,169,59,.08); }
.cl-row.is-win .cl-fill { fill: var(--accent); }
.cl-row.is-win .cl-rec { opacity: 1; }
.cl-dot { fill: var(--data); }
.cl-dot--a { fill: var(--accent); }

/* pipeline HUD on portfolio cards */
.hud { position: absolute; z-index: 3; top: 14px; left: 14px; padding: 10px 12px; background: rgba(11,12,14,.66); border: 1px solid var(--line-2); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); pointer-events: none; max-width: 72%; }
.hud ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hud li { display: flex; align-items: center; gap: 8px; transition: color .3s; }
.hud li::before { content: ""; width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; flex: none; transition: background .3s, border-color .3s; }
.hud li.is-done { color: rgba(236,234,228,.75); }
.hud li.is-done::before { background: var(--data); border-color: var(--data); }
.hud li.is-on { color: var(--text); }
.hud li.is-on::before { background: var(--accent); border-color: var(--accent); animation: hud-pulse 1.2s ease-out infinite; }
.hud p { margin: 8px 0 0; padding-top: 7px; border-top: 1px solid var(--line); color: var(--data); font-variant-numeric: tabular-nums; min-height: 1.3em; }
@keyframes hud-pulse { from { box-shadow: 0 0 0 0 rgba(242,169,59,.55); } to { box-shadow: 0 0 0 7px rgba(242,169,59,0); } }
@media (max-width: 600px) { .hud li:not(.is-on) { display: none; } .hud { font-size: 9px; padding: 7px 9px; } }
.media-badge.media-badge--br { top: auto; left: auto; right: 14px; bottom: 18px; }
.case-media > .ph-svg, .case-media > .ph-canvas { transition: transform 1.4s var(--ease), opacity 1s; }
.case:hover .case-media > .ph-svg, .case:hover .case-media > .ph-canvas { transform: scale(1.03); }

/* ---------- Layout ---------- */
.section { position: relative; max-width: var(--max); margin: 0 auto; padding: var(--pad-y) var(--gutter); }
.section + .section { border-top: 1px solid var(--line); }
.section-label { color: var(--accent); margin-bottom: 18px; display: flex; gap: 10px; align-items: center; }
.section-label::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.section-head { margin-bottom: clamp(36px, 5vw, 64px); display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 5vw, 80px); align-items: end; }
.section-head .section-label { grid-column: 1 / -1; }
.section-title { font-size: clamp(2.3rem, 5vw, 4.6rem); }
.section-intro { color: var(--text-2); max-width: 46ch; font-size: clamp(16px, .6vw + 13px, 19px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--nav-h) + 40px) var(--gutter) clamp(56px, 10vh, 112px);
  overflow: hidden; isolation: isolate;
}
.hero-media { z-index: -1; }
.hero-inner { position: relative; z-index: 3; max-width: var(--max); width: 100%; margin: 0 auto; }
.hero-label { color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: clamp(18px, 3vh, 32px); }
.hero-label .sep { color: var(--accent); }
.hero-title { font-size: clamp(3rem, 9vw, 9rem); max-width: 12ch; }
.hero-sub { margin-top: clamp(20px, 3vh, 32px); max-width: 54ch; color: rgba(236,234,228,.8); font-size: clamp(17px, .9vw + 11px, 21px); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(26px, 4vh, 40px); }
.hero .tick-tl { top: calc(var(--nav-h) + 12px); }

/* ---------- Stats ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-list { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: clamp(24px, 3vw, 40px) var(--gutter); border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-value { font-size: clamp(2.2rem, 3.6vw, 3.8rem); font-weight: 600; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-value--word { font-size: clamp(1.9rem, 2.9vw, 3rem); }
.stat-pre { color: var(--muted); font-weight: 500; }
.stat-suf { color: var(--accent); }
.stat-label { margin-top: 12px; font-size: 11px; }

/* ---------- Services ---------- */
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.service { position: relative; background: var(--bg); padding: clamp(24px, 2.6vw, 36px); transition: background .4s; }
.service::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--accent); opacity: 0; transition: opacity .4s; pointer-events: none; }
.service:hover { background: var(--surface); }
.service:hover::after { opacity: .6; }
.service-num { color: var(--accent); }
.service-title { font-size: clamp(1.3rem, 1.7vw, 1.65rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin: 28px 0 12px; }
.service-text { color: var(--text-2); font-size: .95em; }

.service-more {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  margin-top: 16px; padding: clamp(20px, 2.4vw, 28px) clamp(20px, 2.6vw, 36px);
  border: 1px solid var(--line-2); background: var(--surface);
}
.service-more p { font-size: clamp(17px, .8vw + 12px, 20px); color: var(--text-2); }
.service-more strong { color: var(--text); font-weight: 600; }

.process { margin-top: clamp(40px, 5vw, 64px); }
.process-label { color: var(--muted); margin-bottom: 16px; }
.process-list { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.process-list li { display: grid; gap: 6px; padding: 20px 20px 0 0; }
.process-list strong { font-size: 1.15em; font-weight: 600; letter-spacing: -.02em; }
.process-list span:not(.mono) { color: var(--text-2); font-size: .93em; }

/* ---------- Portfolio ---------- */
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2vw, 24px); align-items: start; }
.case { background: var(--bg-2); border: 1px solid var(--line); transition: border-color .4s; }
.case:hover { border-color: var(--line-2); }
.case:target, .case.is-target { border-color: var(--accent); }
.case-media { position: relative; inset: auto; aspect-ratio: 16 / 9; }
.media-badge { position: absolute; z-index: 3; top: 14px; left: 14px; padding: 6px 10px; background: rgba(11,12,14,.72); border: 1px solid var(--line-2); color: var(--text); font-size: 10.5px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.media-badge::before { content: "● "; color: var(--data); }
.case-metric { position: absolute; z-index: 3; left: 20px; bottom: 16px; font-size: clamp(1.1rem, 1.6vw, 1.5rem); font-weight: 600; letter-spacing: -.03em; }
.case-info { padding: clamp(20px, 2.4vw, 32px); }
.case-tag { color: var(--muted); font-size: 11px; }
.case-title { font-size: clamp(1.35rem, 1.9vw, 1.85rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; margin: 10px 0 12px; }
.case-summary { color: var(--text-2); font-size: .97em; }


.case-details { margin-top: 18px; border-top: 1px solid var(--line); }
.case-details summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.case-details summary::-webkit-details-marker { display: none; }
.case-details summary:hover { color: var(--accent); }
.plus { position: relative; width: 12px; height: 12px; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 50%; width: 12px; height: 1px; background: currentColor; transition: transform .35s var(--ease); }
.plus::after { transform: rotate(90deg); }
.case-details[open] .plus::after { transform: rotate(0); }
.details-body { padding-bottom: 8px; display: grid; gap: 18px; }
.details-meta { color: var(--muted); font-size: 11px; }
.details-note { color: var(--text-2); font-size: .93em; }
.details-note strong { color: var(--text); }

.built-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.built-list dt { font-weight: 600; font-size: .93em; }
.built-list dd { color: var(--text-2); font-size: .93em; }

.result-bars { background: var(--surface); border: 1px solid var(--line); padding: 20px; }
.result-bars figcaption { color: var(--muted); font-size: 11px; margin-bottom: 16px; }
.bars { display: grid; gap: 14px; }
.bars li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label value" "bar bar"; gap: 6px 12px; align-items: end; }
.bar-label { grid-area: label; color: var(--text-2); font-size: 14px; }
.bar-value { grid-area: value; font-size: 22px; font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.bar-value small { font-size: 12px; color: var(--muted); font-weight: 400; }
.bar { grid-area: bar; height: 8px; background: rgba(236,234,228,.06); position: relative; overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) / 20 * 100%); background: rgba(236,234,228,.35); transform-origin: left; }
.bars .is-best .bar-fill { background: var(--accent); }
.bars .is-best .bar-value { color: var(--accent); }

.pipeline { border-left: 1px solid var(--line-2); margin-left: 4px; }
.pipeline li { position: relative; padding: 8px 0 8px 22px; color: var(--text-2); font-size: .93em; }
.pipeline li::before { content: ""; position: absolute; left: -4px; top: 16px; width: 7px; height: 7px; background: var(--bg-2); border: 1px solid var(--data); }
.pipeline li .mono { color: var(--data); margin-right: 10px; font-size: 11px; }
.pipeline li.is-out { color: var(--text); font-weight: 600; }
.pipeline li.is-out::before { background: var(--accent); border-color: var(--accent); }
.pipeline li.is-out .mono { color: var(--accent); }
.patent-line { padding: 14px 16px; border: 1px solid var(--line-2); border-left: 2px solid var(--accent); font-size: .93em; }

.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.stack li, .tags li { padding: 6px 10px; border: 1px solid var(--line); color: var(--text-2); font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }

.more { margin-top: clamp(36px, 5vw, 56px); }
.more-label { color: var(--muted); margin-bottom: 8px; }
.more-list li {
  display: grid; grid-template-columns: minmax(200px, 3fr) 6fr minmax(160px, 2fr); gap: 8px 24px; align-items: baseline;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.more-list li:last-child { border-bottom: 1px solid var(--line); }
.more-list strong { font-weight: 600; letter-spacing: -.01em; }
.more-list span { color: var(--text-2); font-size: .95em; }
.more-list em { font-style: normal; color: var(--muted); font-size: 10.5px; text-align: right; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.about-copy { order: 1; }

/* Portrait: fades into the page, then gets "scanned" like a CV model output */
.portrait {
  order: 2; position: relative; margin: 0; aspect-ratio: 1360 / 768;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24%), linear-gradient(0deg, transparent 0%, #000 22%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 24%), linear-gradient(0deg, transparent 0%, #000 22%);
  mask-composite: intersect;
}
.portrait-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portrait-scan { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--data); box-shadow: 0 0 22px 6px rgba(127,212,230,.35); opacity: 0; pointer-events: none; }
.portrait-box { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.portrait-box rect { fill: rgba(127,212,230,.035); stroke: var(--data); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.portrait-label { position: absolute; left: 37.5%; top: 3%; padding: 4px 9px; background: var(--data); color: #06161A; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.portrait-tags { position: absolute; left: 65%; top: 20%; display: grid; gap: 8px; }
.portrait-tags li { padding: 5px 9px; border: 1px solid rgba(127,212,230,.45); background: rgba(11,12,14,.62); color: var(--data); font-size: 10.5px; white-space: nowrap; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* initial state only when JS runs; without JS the final state shows */
.js .portrait-img { filter: grayscale(1) brightness(.42) contrast(1.15); transition: filter 1.8s var(--ease) .35s; }
.js .portrait-box rect { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.3s var(--ease) 1.2s; }
.js .portrait-label { opacity: 0; transition: opacity .5s ease 2.2s; }
.js .portrait-tags li { opacity: 0; transform: translateX(-10px); transition: opacity .6s ease, transform .6s var(--ease); }
.js .portrait-tags li:nth-child(1) { transition-delay: 2.4s; }
.js .portrait-tags li:nth-child(2) { transition-delay: 2.6s; }
.js .portrait-tags li:nth-child(3) { transition-delay: 2.8s; }
.portrait.is-on .portrait-img { filter: none; }
.portrait.is-on .portrait-box rect { stroke-dashoffset: 0; }
.portrait.is-on .portrait-label { opacity: 1; }
.portrait.is-on .portrait-tags li { opacity: 1; transform: none; }
.portrait.is-on .portrait-scan { animation: portrait-scan 1.9s var(--ease) forwards; }
@keyframes portrait-scan { 0% { top: 0; opacity: 1; } 85% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.portrait:hover .portrait-box rect { stroke: var(--accent); }

.about-copy .section-title { margin-bottom: 24px; }
.about-copy > p:not(.section-label):not(.credentials) { color: var(--text-2); max-width: 62ch; margin-bottom: 14px; }
.skills { margin-top: 24px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.credentials { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

/* ---------- Book a call ---------- */
.contact { position: relative; isolation: isolate; overflow: hidden; border-top: 1px solid var(--line); }
.contact-media { z-index: -1; }
.contact-inner { max-width: var(--max); margin: 0 auto; padding: var(--pad-y) var(--gutter); }
.contact-title { font-size: clamp(2.6rem, 7vw, 7rem); max-width: 14ch; }
.contact-sub { margin-top: 22px; max-width: 52ch; color: rgba(236,234,228,.8); font-size: clamp(17px, .8vw + 12px, 20px); }
.contact-alt { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: clamp(32px, 4vw, 48px); }
.contact-item { padding-top: 16px; border-top: 1px solid var(--line); }
.contact-item p + p { margin-top: 6px; font-size: clamp(16px, .9vw + 11px, 20px); }
.contact-item a { border-bottom: 1px solid var(--line-2); transition: border-color .25s; word-break: break-all; }
.contact-item a:hover { border-color: var(--accent); }
.contact-email { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.copy-btn { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 11px; color: var(--muted); transition: color .25s, border-color .25s, background .25s; }
.copy-btn:hover { color: var(--text); border-color: var(--text); }
.copy-btn.is-copied { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 40px; display: flex; flex-wrap: wrap; gap: 14px 40px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.footer-name { font-weight: 500; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--muted); transition: color .25s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { width: 100%; font-size: 11px; }

/* ---------- Split text ---------- */
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.split-inner { display: inline-block; will-change: transform; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .stats-list { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .process-list { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .portrait { order: 0; -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 25%); mask-image: linear-gradient(0deg, transparent 0%, #000 25%); }
  .more-list li { grid-template-columns: 1fr; }
  .more-list em { text-align: left; }
}
@media (max-width: 860px) {
  .case-grid { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; row-gap: 16px; }
}
@media (max-width: 640px) {
  :root { --nav-h: 62px; }
  .nav-links, .nav-name { display: none; }
  .hero-ctas .btn-primary { flex: 1 1 100%; }
  .hero-ctas .btn-ghost { flex: 1 1 0; }
  .stats-list { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:last-child { grid-column: 1 / -1; border-left: 0; }
  .service-grid { grid-template-columns: 1fr; }
  .service-title { margin-top: 16px; }
  .process-list { grid-template-columns: 1fr; }
  .process-list li { padding-right: 0; }
  .built-list > div { grid-template-columns: 1fr; gap: 4px; }
  .contact-alt { grid-template-columns: 1fr; }
  .portrait { margin: 0 calc(var(--gutter) * -1); }
  .portrait-tags { left: auto; right: 10px; top: auto; bottom: 26%; }
  .portrait-tags li { font-size: 9px; padding: 4px 7px; }
  .portrait-tags li:nth-child(3) { display: none; }
  .portrait-label { font-size: 9px; }
  }

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .portrait-scan { display: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* nav without brand: links centred, CTA right */
.nav { display: grid; grid-template-columns: 1fr auto 1fr; }
.nav-links { grid-column: 2; }
.nav > .btn { grid-column: 3; justify-self: end; }

/* hero: keep the text readable over the bright end frame */
.hero .media-video { filter: brightness(.78) saturate(.9); }
.hero .media-shade {
  background:
    linear-gradient(90deg, rgba(11,12,14,.9) 0%, rgba(11,12,14,.66) 42%, rgba(11,12,14,.18) 78%, rgba(11,12,14,.05) 100%),
    linear-gradient(180deg, rgba(11,12,14,.55) 0%, rgba(11,12,14,0) 22%, rgba(11,12,14,0) 62%, rgba(11,12,14,.95) 100%);
}
.hero-label { color: rgba(236,234,228,.88); text-shadow: 0 1px 14px rgba(0,0,0,.9); }
.hero-title, .hero-sub { text-shadow: 0 2px 24px rgba(0,0,0,.55); }

/* flagship case spans the grid */
.case--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1.35fr 1fr; align-items: start; }
@media (max-width: 860px) { .case--wide { display: block; } }

/* lead generation visual */
.ld-panel { fill: rgba(21,23,27,.92); stroke: rgba(236,234,228,.14); stroke-width: 1.5; transition: stroke .4s; }
.ld-node.is-on .ld-panel { stroke: var(--accent); }
.ld-h { fill: var(--muted); font: 600 22px var(--f-mono); letter-spacing: .14em; }
.ld-node.is-on .ld-h { fill: var(--accent); }
.ld-edge { stroke: rgba(127,212,230,.35); stroke-width: 2; stroke-dasharray: 8 10; animation: ld-flow 1s linear infinite; }
@keyframes ld-flow { to { stroke-dashoffset: -18; } }
.ld-row-bg { fill: transparent; transition: fill .3s; }
.ld-row.is-hot .ld-row-bg { fill: rgba(127,212,230,.12); }
.ld-ava { fill: rgba(236,234,228,.18); }
.ld-bar { fill: rgba(236,234,228,.22); }
.ld-bar--dim { fill: rgba(236,234,228,.1); }
.ld-chip { fill: rgba(236,234,228,.04); stroke: rgba(236,234,228,.16); stroke-width: 1.2; }
.ld-chip-t { fill: rgba(236,234,228,.55); font: 500 18px var(--f-mono); letter-spacing: .1em; }
.ld-agent-edge { fill: none; stroke: rgba(236,234,228,.2); stroke-width: 1.5; }
.ld-agent { fill: rgba(21,23,27,1); stroke: rgba(236,234,228,.3); stroke-width: 2; transition: fill .3s, stroke .3s; }
.ld-agent.is-on { fill: rgba(242,169,59,.25); stroke: var(--accent); }
.ld-agent-t { fill: rgba(236,234,228,.5); font: 500 16px var(--f-mono); letter-spacing: .08em; }
.ld-ring { fill: none; stroke: rgba(236,234,228,.2); stroke-width: 1.5; }
.ld-core { fill: var(--text); transition: fill .3s; }
.ld-sat { fill: var(--data); transition: opacity .3s; }
.ld-lead.is-ok .ld-core { fill: var(--accent); }
.ld-lead.is-ok .ld-ring { stroke: var(--accent); }
.ld-lead.is-no .ld-core { fill: rgba(236,234,228,.25); }
.ld-lead.is-no .ld-sat { opacity: 0 !important; }
.ld-out-bg { fill: rgba(242,169,59,.07); stroke: rgba(242,169,59,.6); stroke-width: 1.5; }
.ld-out-dot { fill: var(--accent); }
.ld-mail { fill: none; stroke: rgba(236,234,228,.6); stroke-width: 1.5; }
.ld-out { transition: opacity .4s; }

/* "Something else?" panel */
.idea {
  position: relative; overflow: hidden; margin-top: clamp(16px, 2vw, 24px);
  min-height: clamp(340px, 34vw, 440px); display: flex; align-items: center;
  border: 1px solid var(--line-2); background:
    radial-gradient(500px circle at var(--mx, 78%) var(--my, 50%), rgba(242,169,59,.10), transparent 60%),
    linear-gradient(120deg, #111317, #0B0C0E 60%);
}
.idea::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(236,234,228,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(236,234,228,.035) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(70% 90% at 70% 50%, #000, transparent); -webkit-mask-image: radial-gradient(70% 90% at 70% 50%, #000, transparent); }
.idea-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.idea-inner { position: relative; z-index: 2; padding: clamp(28px, 4vw, 56px); max-width: 720px; }
.idea-label { color: var(--accent); }
.idea-title { font-size: clamp(1.9rem, 3.4vw, 3.2rem); line-height: 1.02; letter-spacing: -.04em; margin: 14px 0 22px; }
.idea-type { min-height: 1.6em; font-size: clamp(13px, .5vw + 10px, 16px); color: var(--data); }
.idea-prompt { color: var(--accent); }
.idea-caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 2px; vertical-align: -.2em; background: var(--data); animation: idea-blink 1s steps(2) infinite; }
@keyframes idea-blink { 50% { opacity: 0; } }
.idea-sub { color: var(--text-2); margin: 18px 0 28px; max-width: 52ch; }
@media (max-width: 1100px) { .service-grid { grid-template-columns: repeat(2, 1fr); } .stats-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .service-grid { grid-template-columns: 1fr; } }

/* copy round 2 */
.hero-proof { margin-top: clamp(22px, 3vh, 32px); color: rgba(236,234,228,.7); font-size: 12px; letter-spacing: .04em; display: flex; flex-wrap: wrap; gap: 6px 10px; text-shadow: 0 1px 12px rgba(0,0,0,.9); }
.hero-proof .sep { color: var(--accent); }
.service-note { margin-top: 18px; color: var(--muted); font-size: 12px; letter-spacing: .03em; max-width: 90ch; }
.about-copy strong { color: var(--text); font-weight: 600; }

/* ---------- Book a call: closing CTA (calendar lives on book.html) ---------- */
.contact { background: radial-gradient(60% 70% at 80% 40%, rgba(242,169,59,.07), transparent 70%), var(--bg); }
.contact-glow { position: absolute; z-index: -1; right: -10%; top: 10%; width: 60vw; height: 60vw; max-width: 900px; max-height: 900px; border-radius: 50%; background: radial-gradient(closest-side, rgba(242,169,59,.10), rgba(127,212,230,.03) 60%, transparent); filter: blur(20px); pointer-events: none; }
.contact-cta { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: end; }
.contact-actions { margin-top: clamp(28px, 3vw, 40px); display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.contact-meta { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.contact-dot { width: 7px; height: 7px; border-radius: 50%; background: #5BD69A; box-shadow: 0 0 0 0 rgba(91,214,154,.6); animation: contact-pulse 2s ease-out infinite; }
@keyframes contact-pulse { to { box-shadow: 0 0 0 9px rgba(91,214,154,0); } }
.contact-cta .contact-alt { grid-template-columns: 1fr; gap: 18px; margin-top: 0; }
@media (max-width: 900px) { .contact-cta { grid-template-columns: 1fr; align-items: start; } }
@media (prefers-reduced-motion: reduce) { .contact-dot { animation: none; } }
