/* ═══════════════════════════════════════════════════════════
   START PAGE — one person, two portfolios, split down a live seam
   ═══════════════════════════════════════════════════════════ */
@font-face { font-family: 'Anton'; src: url('../fonts/anton-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Instrument Serif'; font-style: italic; src: url('../fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('../fonts/inter-tight-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --display: 'Anton', 'Impact', 'Arial Narrow Bold', sans-serif;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --pad: clamp(18px, 3.2vw, 48px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  /* side A follows the colours of the 3D model on show; side B is the engineering palette */
  --a-bg: #2a1206; --a-bg2: #7a3410; --a-ink: #ffd9a8; --a-glow: #ff7a2a;
  --b-bg: #050b10; --b-bg2: #0c2230; --b-ink: #d9fff3; --b-glow: #3cf2c1;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #07090c; overflow: hidden; }
body { font-family: var(--sans); color: #fff; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.split { position: fixed; inset: 0; }
.side { position: absolute; inset: 0; display: block; cursor: pointer; outline: none; transition: opacity .8s var(--ease); }
/* fallback split when JS hasn't run yet */
.side--art { clip-path: polygon(0 0, 56% 0, 44% 100%, 0 100%); }
.side--code { clip-path: polygon(56% 0, 100% 0, 100% 100%, 44% 100%); }
.side__bg { position: absolute; inset: 0; }
.side--art .side__bg { background: radial-gradient(70% 80% at 28% 52%, var(--a-bg2), var(--a-bg) 72%); transition: background 1s; }
.side--code .side__bg { background: radial-gradient(80% 90% at 75% 45%, var(--b-bg2), var(--b-bg) 70%); }
.side--code .side__bg::after { content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(60,242,193,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(60,242,193,.07) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(70% 70% at 70% 50%, #000, transparent); -webkit-mask-image: radial-gradient(70% 70% at 70% 50%, #000, transparent); }

/* giant words */
.side__word { position: absolute; top: 50%; transform: translateY(-50%); font-family: var(--display); line-height: .8; pointer-events: none; white-space: nowrap; }
.side--art .side__word { left: -2vw; font-size: clamp(260px, 44vw, 860px); color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--a-ink) 22%, transparent); }
.side--code .side__word { right: -3vw; font-size: clamp(200px, 30vw, 620px); font-family: var(--mono); font-weight: 500; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1.5px rgba(60,242,193,.16); }

/* 3D stage on side A */
.art__stage { position: absolute; inset: 0; will-change: transform; }
.art__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.art__poster { position: absolute; left: 50%; top: 50%; width: min(42vw, 560px); transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 40px 80px rgba(0,0,0,.4); }

/* network + terminal on side B */
.code__net { position: absolute; inset: 0; width: 100%; height: 100%; }
.term { position: absolute; right: var(--pad); top: clamp(90px, 17vh, 170px); width: min(440px, 34vw); border-radius: 16px; overflow: hidden;
  background: rgba(6, 16, 22, .78); border: 1px solid rgba(60,242,193,.22); box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 60px rgba(60,242,193,.08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.term__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid rgba(60,242,193,.14); font-family: var(--mono); font-size: 11px; color: rgba(217,255,243,.55); }
.term__bar i { width: 10px; height: 10px; 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: 8px; }
.term__body { margin: 0; padding: 16px 18px 18px; min-height: 200px; max-height: 32vh; overflow: hidden; font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--b-ink); white-space: pre-wrap; word-break: break-word; }
.term__body .p { color: var(--b-glow); } .term__body .c { color: rgba(217,255,243,.45); }
.term__body .cur { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; background: var(--b-glow); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* copy blocks */
.side__copy { position: absolute; bottom: clamp(26px, 5vh, 56px); max-width: min(520px, 40vw); transition: opacity .5s, transform .8s var(--ease); }
.side--art .side__copy { left: var(--pad); color: var(--a-ink); }
.side--code .side__copy { right: var(--pad); text-align: right; color: var(--b-ink); }
.kicker { margin: 0 0 10px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; display: inline-flex; gap: 10px; align-items: center; opacity: .85; }
.kicker .no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid currentColor; font-size: 11px; }
.side__title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(64px, 9.5vw, 170px); line-height: .86; letter-spacing: -.005em; }
.side--code .side__title { font-family: var(--mono); font-weight: 500; letter-spacing: -.06em; font-size: clamp(50px, 7.4vw, 132px); }
.side--code .side__title::before { content: '> '; color: var(--b-glow); }
.side__sub { margin: 14px 0 22px; font-size: clamp(14px, 1.15vw, 18px); line-height: 1.45; opacity: .82; }
.side--code .side__sub { margin-left: auto; }
.cta { display: inline-flex; align-items: center; gap: 12px; height: 52px; padding: 0 22px 0 26px; border-radius: 99px; font-weight: 600; font-size: 15px; transition: transform .5s var(--ease), background .3s, color .3s; }
.cta i { font-style: normal; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; transition: transform .5s var(--ease); }
.side--art .cta { background: var(--a-ink); color: var(--a-bg); } .side--art .cta i { background: var(--a-bg); color: var(--a-ink); }
.side--code .cta { background: transparent; color: var(--b-glow); border: 1.5px solid var(--b-glow); font-family: var(--mono); font-weight: 500; font-size: 13.5px; text-transform: uppercase; letter-spacing: .06em; }
.side--code .cta i { background: var(--b-glow); color: var(--b-bg); }
.side:hover .cta, .side:focus-visible .cta { transform: translateY(-3px); } .side:hover .cta i { transform: translateX(4px); }
.side:focus-visible .cta { outline: 2px solid currentColor; outline-offset: 4px; }

/* the seam */
.seam { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

/* name across the split */
.top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; padding: clamp(18px, 3vh, 32px) var(--pad); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.brand { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2vw, 30px); letter-spacing: .02em; line-height: 1; display: flex; gap: .35em; }
.brand__a { color: var(--a-ink); } .brand__b { color: var(--b-glow); font-family: var(--mono); font-weight: 500; font-size: .78em; letter-spacing: -.02em; align-self: center; }
.hint { margin: 6px 0 0; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.62); }
.hint .k { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: 0 6px; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; }

/* "About me" pill at the top centre */
.aboutbtn { position: absolute; left: 50%; top: clamp(16px, 2.6vh, 28px); transform: translateX(-50%); pointer-events: auto; display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 8px 0 18px; border-radius: 99px; font-weight: 600; font-size: 14px; color: #fff; isolation: isolate;
  background: rgba(10, 10, 12, .55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .5s var(--ease), box-shadow .5s; }
.aboutbtn::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1;
  background: linear-gradient(90deg, var(--a-glow), #fff 50%, var(--b-glow)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.aboutbtn__dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--a-glow), var(--b-glow)); box-shadow: 0 0 10px var(--b-glow); }
.aboutbtn i { font-style: normal; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #0a0a0c; transition: transform .45s var(--ease); }
.aboutbtn:hover, .aboutbtn:focus-visible { transform: translateX(-50%) translateY(-2px); box-shadow: 0 10px 40px color-mix(in srgb, var(--a-glow) 35%, transparent), 0 10px 40px rgba(60, 242, 193, .25); outline: none; }
.aboutbtn:hover i { transform: translateX(3px); }
body.is-intro .aboutbtn { opacity: 0; } .aboutbtn { transition: opacity .8s .3s, transform .5s var(--ease), box-shadow .5s; }

/* intro + exit */
body.is-intro .side__copy { opacity: 0; transform: translateY(30px); }
body.is-intro .term { opacity: 0; }
.term { transition: opacity 1s .2s; }
body.is-leaving .side__copy, body.is-leaving .term, body.is-leaving .top { opacity: 0 !important; transition: opacity .35s; }

/* portrait phones: the seam runs across, 3D on top, code below */
@media (max-aspect-ratio: 1/1) {
  .side--art { clip-path: polygon(0 0, 100% 0, 100% 44%, 0 56%); }
  .side--code { clip-path: polygon(0 56%, 100% 44%, 100% 100%, 0 100%); }
  .side__copy { max-width: none; }
  .side--art .side__copy { top: clamp(78px, 11vh, 110px); bottom: auto; left: var(--pad); right: var(--pad); }
  .side--code .side__copy { left: var(--pad); right: var(--pad); }
  .side__title { font-size: clamp(48px, 15vw, 96px); }
  .side--code .side__title { font-size: clamp(38px, 11.5vw, 76px); }
  .side__sub { font-size: 14px; margin: 8px 0 14px; max-width: 34ch; }
  .side--code .side__sub { margin-left: auto; }
  .cta { height: 44px; font-size: 14px; }
  .term { display: none; }
  .side--art .side__word { top: 26%; font-size: 58vw; }
  .side--code .side__word { top: 76%; font-size: 40vw; }
  .hint { display: none; }
  .aboutbtn { left: auto; right: var(--pad); transform: none; height: 38px; font-size: 13px; padding-left: 14px; }
  .aboutbtn:hover, .aboutbtn:focus-visible { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) { .term__body .cur { animation: none; } }
