/* ---------- home: the Nodo base, re-tokenised so it reads in both themes ---------- */
html.is-hero-scroll-lock { overflow: hidden; }
.sec-head { display: grid; gap: 10px; margin-bottom: 36px; }
.sec-head h2 { font: 600 clamp(36px, 4.6vw, 64px)/1 var(--sans); letter-spacing: -.04em; }
.sec-head p { max-width: 44ch; color: var(--ink-muted); }
.sec-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }

/* ---------- shared: dashed cell grid (lines are CSS backgrounds, lit cells come from a pool) ---------- */
.grid-cells { --cell-w: 60px; --cell-h: 60px; --dash: 1px; --gap: 1px; position: absolute; inset: 0; overflow: hidden; }
.grid-cells::before, .grid-cells::after { content: ""; position: absolute; inset: 0; z-index: 2; background: var(--line); pointer-events: none; }
.grid-cells::before {
  -webkit-mask: repeating-linear-gradient(to bottom, #000 0 var(--dash), transparent 0 calc(var(--dash) + var(--gap))), repeating-linear-gradient(to right, #000 0 1px, transparent 0 var(--cell-w));
  -webkit-mask-composite: source-in; mask: repeating-linear-gradient(to bottom, #000 0 var(--dash), transparent 0 calc(var(--dash) + var(--gap))) intersect, repeating-linear-gradient(to right, #000 0 1px, transparent 0 var(--cell-w)); }
.grid-cells::after {
  -webkit-mask: repeating-linear-gradient(to right, #000 0 var(--dash), transparent 0 calc(var(--dash) + var(--gap))), repeating-linear-gradient(to bottom, #000 0 1px, transparent 0 var(--cell-h));
  -webkit-mask-composite: source-in; mask: repeating-linear-gradient(to right, #000 0 var(--dash), transparent 0 calc(var(--dash) + var(--gap))) intersect, repeating-linear-gradient(to bottom, #000 0 1px, transparent 0 var(--cell-h)); }
.lit { position: absolute; left: 0; top: 0; width: var(--cell-w); height: var(--cell-h); background: var(--fill); opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.lit.on { opacity: 1; transition-duration: .08s; }

/* ---------- shared: dot pattern (two repeated radial-gradient layers + a mask that follows the cursor) ---------- */
.dots { --step: 14px; --r: .4px; --soft-edge: .5px; --dot: rgba(0, 0, 0, .2); --dot-lit: rgba(0, 0, 0, .44);
  position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(350px circle at var(--dot-x, 50%) var(--dot-y, 50%), #fff, rgba(255, 255, 255, .3));
  mask-image: radial-gradient(350px circle at var(--dot-x, 50%) var(--dot-y, 50%), #fff, rgba(255, 255, 255, .3)); }
[data-theme="dark"] .dots, .is-dark-zone .dots { --dot: rgba(255, 255, 255, .18); --dot-lit: rgba(255, 255, 255, .44); }
.dots::before, .dots::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, var(--dot) var(--r), transparent calc(var(--r) + var(--soft-edge))); background-size: var(--step) var(--step); background-position: center; }
.dots::after { background-image: radial-gradient(circle, var(--dot-lit) var(--r), transparent calc(var(--r) + var(--soft-edge)));
  -webkit-mask-image: radial-gradient(50px circle at var(--dot-x, -999px) var(--dot-y, -999px), #000 65%, transparent);
  mask-image: radial-gradient(50px circle at var(--dot-x, -999px) var(--dot-y, -999px), #000 65%, transparent); opacity: 0; transition: opacity .6s; }
.dots.active::after { opacity: 1; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100svh; min-height: 640px; overflow: hidden; background: #1a1a1a url(../images/hero/bg.jpg?v=4) center 35% / cover no-repeat; }
.hero-grid { opacity: 0; transition: opacity 1.2s ease; top: 72px; }
.hero.started .hero-grid { opacity: 1; }
.hero-inner { position: absolute; inset: 72px 0 0; }
.hero-title { position: absolute; left: 50%; top: 50%; translate: -50% -50%; font: 700 clamp(84px, 15vw, 210px)/1 var(--sans); letter-spacing: -.045em; white-space: nowrap; z-index: 3; color: #fff; mix-blend-mode: difference; transition: top 1.1s var(--ease); }
.hero:not(.started) .hero-title { top: 42%; }
.hero-inner > .hpanel, .hero-inner > .switch, .hero-inner > .comment, .hero-inner > .app, .hero-inner > .hcur { position: absolute; left: var(--x); top: var(--y); }
.float { opacity: 0; transition: opacity .9s var(--ease); will-change: translate; }
.float.in { opacity: 1; }
.selection { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(78vw, 980px); height: clamp(110px, 18vw, 230px); border: 1px solid var(--divider); opacity: 0; transition: opacity .6s; z-index: 2; pointer-events: none; }
.selection i { position: absolute; width: 8px; height: 8px; background: var(--paper); border: 1px solid var(--ink-muted); }
.selection i:nth-child(1) { left: -4px; top: -4px; } .selection i:nth-child(2) { right: -4px; top: -4px; } .selection i:nth-child(3) { left: -4px; bottom: -4px; } .selection i:nth-child(4) { right: -4px; bottom: -4px; }
.selection.on { opacity: 1; }
.hero-foot { position: absolute; z-index: 4; left: var(--gut); right: var(--gut); bottom: 22px; display: flex; gap: 22px; font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: rgba(255, 255, 255, .72); }
.hero-scroll { margin-left: auto; }

.hpanel { z-index: 1; background: var(--popover); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .35); overflow: hidden; }
.win { display: flex; gap: 5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.win i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--fill-strong); }
.wire { width: 200px; }
.wire-body { padding: 12px; display: grid; gap: 6px; }
.wire-body .av { width: 28px; height: 28px; border-radius: 50%; background: var(--fill-strong); }
.wire-body span { height: 6px; border-radius: 3px; background: var(--fill-strong); } .w60 { width: 60%; }
.wire-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 6px; margin-top: 4px; } .wire-grid i { height: 34px; border-radius: 4px; background: var(--fill); } .wire-grid i:last-child { grid-column: span 2; }
.code { width: 230px; height: 200px; }
.code pre { font: 10px/1.55 var(--mono); color: var(--ink-muted); padding: 10px 12px; white-space: pre; }
.code pre::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--spot-2); }
@keyframes blink { 50% { opacity: 0; } }
.phone { width: 120px; height: 236px; border-radius: 22px; padding: 6px; background: var(--surface); }
.phone-screen { height: 100%; border-radius: 17px; background: var(--paper); display: flex; flex-direction: column; gap: 8px; padding: 22px 10px 10px; position: relative; }
.ph-card { display: grid; gap: 5px; padding: 8px; border-radius: 8px; background: var(--fill); } .ph-card b { height: 8px; width: 50%; border-radius: 4px; background: #22b45e; } .ph-card.two b { background: #e8503a; } .ph-card i { height: 5px; border-radius: 3px; background: var(--fill-strong); }
.ph-mic { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; width: 30px; height: 30px; border-radius: 50%; background: var(--spot); box-shadow: 0 0 0 6px var(--spot-wash); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px transparent; } }
.laptop { width: 280px; background: none; border: 0; box-shadow: none; overflow: visible; }
.lap-screen { aspect-ratio: 16 / 10; border: 6px solid #2b2b2e; border-radius: 10px 10px 0 0; overflow: hidden; background: #000; }
.lap-screen canvas { width: 100%; height: 100%; display: block; }
.lap-base { height: 10px; margin: 0 -18px; border-radius: 0 0 10px 10px; background: linear-gradient(#d8d8dc, #a5a5aa); }
.billboard { width: 260px; height: 170px; padding: 22px; display: flex; align-items: center; background: radial-gradient(120% 90% at 80% 20%, #5fd3a9, #0e6b52 60%, #062b21); border: 0; color: #effbf6; }
.billboard b { font: 600 24px/1.1 var(--sans); letter-spacing: -.03em; }
.switch { z-index: 2; display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--popover) 85%, transparent); backdrop-filter: blur(10px); box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .35); font-size: 13px; }
.toggle { width: 34px; height: 20px; border-radius: 99px; background: var(--fill-strong); position: relative; transition: background .4s; }
.toggle::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: translate .4s var(--ease); }
.switch.on .toggle { background: var(--spot-2); } .switch.on .toggle::after { translate: 14px 0; }
.comment { z-index: 2; display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px 12px 12px; border-radius: 16px 16px 16px 4px; background: color-mix(in srgb, var(--popover) 88%, transparent); backdrop-filter: blur(10px); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .3); font-size: 12px; min-width: 230px; }
.comment small { color: var(--ink-muted); } .comment p { margin-top: 2px; }
.cm-av { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 700 12px var(--sans); font-style: normal; }
.app { z-index: 2; width: 48px; height: 48px; border-radius: 12px; background: var(--popover); box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .35), 0 0 0 1px var(--line); display: grid; place-items: center; scale: 0; transition: scale .6s cubic-bezier(.34, 1.56, .64, 1); }
.app svg { width: 24px; height: 24px; } .app.in { scale: 1; }
.hcur { z-index: 4; display: inline-block; padding: 2px 7px; margin: 16px 0 0 12px; border-radius: 4px; background: var(--c); color: #fff; font: 500 11px/1.5 var(--sans); white-space: nowrap; opacity: 0; transition: opacity .5s; pointer-events: none; will-change: translate; }
.hcur::before { content: ""; position: absolute; left: -13px; top: -15px; width: 14px; height: 15px; background: var(--c); clip-path: polygon(0 0, 100% 62%, 52% 64%, 34% 100%); }
.hcur.in { opacity: 1; }

/* ---------- statement: pinned, word by word ---------- */
.wq { position: relative; height: calc(100vh + 160vh); }
.wq-sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; text-align: center; padding: 0 6vw; }
.wq-title { position: relative; max-width: 17ch; font: 700 clamp(40px, 6.2vw, 92px)/1.04 var(--sans); letter-spacing: -.04em; }
.wq-sub { position: relative; max-width: 30ch; font: 600 clamp(20px, 2.4vw, 30px)/1.2 var(--sans); }
.word { opacity: .1; transition: opacity .25s linear; }
.word.on { opacity: 1; }

/* ---------- services: halftone cards ---------- */
.services { padding: 12vh var(--gut) 10vh; }
.svc-grid { display: grid; border-top: 1px solid var(--line); }
/* each service is a full-width row; on hover the row fills with ink and the text inverts */
.svc-row { position: relative; isolation: isolate; display: grid; grid-template-columns: 70px minmax(0, 1.15fr) minmax(0, 1.25fr) minmax(0, 1fr) 40px; gap: 36px; align-items: start; padding: 44px 24px; border-bottom: 1px solid var(--line); transition: color .45s var(--ease); }
.svc-row::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: scaleY(0); transform-origin: bottom; transition: transform .55s var(--ease); }
.svc-row:hover { color: var(--paper); } .svc-row:hover::before { transform: scaleY(1); }
.svc-n { font-size: .8rem; padding-top: 10px; opacity: .6; }
.svc-row h3 { font: 600 clamp(28px, 3.2vw, 46px)/1.02 var(--sans); letter-spacing: -.035em; }
.svc-desc { font-size: 15px; line-height: 1.6; opacity: .78; padding-top: 6px; }
.svc-for { display: grid; gap: 6px; font-size: 13.5px; line-height: 1.55; opacity: .7; padding-top: 6px; }
.svc-for .eyebrow { color: inherit; }
.svc-go { font-size: 26px; justify-self: end; padding-top: 4px; transition: translate .45s var(--ease), rotate .45s var(--ease); }
.svc-row:hover .svc-go { translate: 4px 0; rotate: -45deg; }
@media (max-width: 1023px) {
  .svc-row { grid-template-columns: 40px minmax(0, 1fr) 30px; gap: 14px 18px; padding: 32px 8px; }
  .svc-row h3 { grid-column: 2; } .svc-go { grid-column: 3; grid-row: 1; }
  .svc-desc, .svc-for { grid-column: 2 / 4; padding-top: 0; }
}
.dline { display: block; position: relative; padding-bottom: 6px; }
.dline::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: repeating-linear-gradient(to right, rgba(255, 255, 255, .7) 0 2px, transparent 2px 5px); }

/* ---------- stack: skills network over stars ---------- */
.stack { position: relative; padding: 14vh var(--gut) 10vh; overflow: hidden; }
.stack .sec-head { position: relative; z-index: 1; text-align: center; justify-items: center; margin-bottom: 0; }
.stack-stars, .hq-stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.net { position: relative; height: min(700px, 95vw); min-height: 440px; max-width: 1200px; margin: 0 auto; }
.net canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.net-legend { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.net-legend button { display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 99px; background: color-mix(in srgb, var(--paper) 70%, transparent); backdrop-filter: blur(8px); font: 500 13px var(--sans); color: var(--ink); transition: border-color .3s, background .3s; }
.net-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.net-legend sup { font: 500 10px var(--mono); color: var(--ink-muted); }
.net-legend button[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }

/* ---------- selected work ---------- */
.portfolio { display: grid; grid-template-columns: minmax(280px, 1fr) 1.7fr; gap: 40px; align-items: center; padding: 12vh 0 6vh var(--gut); overflow: hidden; }
.pf-copy { display: grid; gap: 18px; justify-items: start; }
.pf-copy h2 { font: 600 clamp(40px, 5vw, 68px)/1 var(--sans); letter-spacing: -.04em; }
.pf-copy p { max-width: 36ch; color: var(--ink-muted); }
.pf-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px var(--gut) 20px 0; scrollbar-width: none; cursor: grab; }
.pf-track::-webkit-scrollbar { display: none; }
.pf-card { flex: 0 0 min(300px, 72vw); aspect-ratio: 3 / 4.3; border-radius: 22px; scroll-snap-align: start; overflow: hidden; position: relative; color: #fff; transition: transform .5s var(--ease); }
.pf-card:hover { transform: translateY(-6px); }
.pf-card canvas { width: 100%; height: 100%; display: block; }
.pf-card .chip { position: absolute; left: 18px; top: 18px; background: #ffffff26; backdrop-filter: blur(6px); }
.pf-card b { position: absolute; left: 18px; bottom: 40px; font: 700 26px/1.1 var(--sans); letter-spacing: -.03em; }
.pf-card small { position: absolute; left: 18px; bottom: 18px; font: 500 .66rem var(--mono); text-transform: uppercase; opacity: .8; }
.logos { overflow: hidden; padding: 30px 0 60px; -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.logo-row { display: flex; gap: 60px; width: max-content; animation: marquee 30s linear infinite; }
.logo-row span { font: 700 22px var(--sans); letter-spacing: -.03em; opacity: .5; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- writing teaser ---------- */
.news { padding: 8vh var(--gut) 12vh; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.nw-card { display: grid; gap: 8px; }
.nw-cover { aspect-ratio: 4 / 3; border-radius: 14px; margin-bottom: 6px; padding: 26px 26px 26px 34px; display: flex; flex-direction: column; justify-content: space-between; color: #f2f1ee; background: radial-gradient(120% 100% at 85% 0%, #2a2a2a, #111 70%); box-shadow: inset 8px 0 0 #0007, inset 9px 0 0 #ffffff12; transition: transform .6s var(--ease); }
.nw-cover .mono { font-size: .66rem; letter-spacing: .06em; opacity: .7; }
.nw-cover b { font: 600 clamp(26px, 2.6vw, 36px)/1.05 var(--sans); letter-spacing: -.03em; max-width: 14ch; }
.nw-cover span:last-child { font-size: .8rem; opacity: .6; }
.nw-card:hover .nw-cover { transform: scale(.98); }
.nw-card h3 { font: 600 22px/1.15 var(--sans); letter-spacing: -.02em; }
.nw-card:first-child h3 { color: var(--spot-2); }
.nw-card p { font-size: 14px; color: var(--ink-muted); }

/* ---------- handwritten quote + ASCII ---------- */
.hq { position: relative; padding-top: 22vh; display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.hand { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 0 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font: 34px/34px var(--hand); }
.hand .nw { white-space: nowrap; }
.hw { position: relative; display: inline-block; }
.hw-ink { display: inline-block; clip-path: inset(-.3em 100% -.3em 0); }
.hw-tip { position: absolute; top: 55%; left: 0; width: 4px; height: 4px; border-radius: 50%; background: currentColor; filter: blur(.5px); opacity: 0; pointer-events: none; }
.hand figcaption { display: flex; align-items: center; gap: 8px; }
.hw-rule { width: 14px; height: 1.5px; background: currentColor; transform-origin: left; scale: 0 1; }
.hw-by { opacity: 0; }
.hand.static .hw-ink { clip-path: none; } .hand.static .hw-rule { scale: 1; } .hand.static .hw-by { opacity: 1; }
@keyframes hw-wipe { 0% { clip-path: inset(-.3em 100% -.3em 0); transform: translateY(2px); } 100% { clip-path: inset(-.3em -.2em); transform: translateY(0); } }
@keyframes hw-tip { 0% { opacity: 0; left: 0; } 10%, 90% { opacity: .7; } 100% { opacity: 0; left: 100%; } }
@keyframes hw-rule { to { scale: 1; } }
@keyframes hw-fade { to { opacity: 1; } }
.ascii { width: 100%; height: max(240px, 28vw); margin-top: 12vh; }
.ascii canvas { width: 100%; height: 100%; display: block; }

/* ---------- contact ---------- */
.ct { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 14vh var(--gut); min-height: 90vh; overflow: hidden; }
.ct-anim { position: relative; height: 520px; }
.ct-card, .ct-anim .app { position: absolute; left: var(--x); top: var(--y); }
.ct-card { border-radius: 12px; background: var(--popover); border: 1px solid var(--line); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .35); overflow: hidden; opacity: 0; translate: 0 20px; transition: opacity .7s, translate .7s var(--ease); }
.ct-card.in { opacity: 1; translate: 0 0; }
.chart { width: 42%; height: 150px; padding: 14px; } .chart svg { width: 100%; height: 100%; stroke: var(--spot-2); stroke-width: 1.4; }
.photo { width: 25%; aspect-ratio: 3 / 4; } .photo.two { width: 22%; z-index: 1; }
.photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: scale .8s var(--ease); }
.photo.two img { object-position: 45% 35%; }
.photo:hover img { scale: 1.05; }
.form { width: 40%; padding: 18px; display: grid; gap: 10px; } .form i { height: 10px; border-radius: 5px; background: var(--fill-strong); } .form b { height: 26px; width: 40%; border-radius: 6px; background: var(--spot); }
.ct-anim .app { scale: 0; transition: scale .6s cubic-bezier(.34, 1.8, .64, 1); }
.ct-anim .app.in { scale: 1; }
.hcur.tour { position: absolute; left: 0; top: 0; z-index: 5; }
.hcur.tour.click::after { content: ""; position: absolute; left: -18px; top: -20px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c); animation: ripple .5s ease-out forwards; }
@keyframes ripple { from { scale: .4; opacity: 1; } to { scale: 2.6; opacity: 0; } }
.ct-copy { position: relative; z-index: 2; }
.ct-title { display: flex; flex-direction: column; font: 700 clamp(48px, 6.2vw, 92px)/1.02 var(--sans); letter-spacing: -.045em; margin-bottom: 22px; }
.ct-title span { position: relative; width: fit-content; padding-bottom: 6px; }
.ct-title span::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: repeating-linear-gradient(to right, var(--ink) 0 3px, transparent 3px 7px); clip-path: inset(0 100% 0 0); transition: clip-path 1s var(--ease) var(--d, 0s); }
.ct-title.drawn span::after { clip-path: inset(0 0 0 0); }
.ct-copy p { max-width: 40ch; margin-bottom: 26px; color: var(--ink-muted); }
.ct-row { display: flex; gap: 10px; align-items: center; }

@media (max-width: 1023px) {
  .svc-grid, .news-grid { grid-template-columns: 1fr; }
  .portfolio, .ct { grid-template-columns: 1fr; }
  .portfolio { padding-right: 0; }
  .hero-inner .hpanel.laptop, .hero-inner .billboard, .hero-inner .wire { display: none; }
  .ct-anim { height: 380px; }
  .hero-foot span:nth-child(2) { display: none; }
}
@media (max-width: 640px) {
  .hero-inner .hpanel.code, .hero-inner .comment:nth-of-type(2) { display: none; }
  .sec-head.row { flex-direction: column; align-items: flex-start; }
}
