/* Three fields: black, bone and Klein blue. Each section is one of them. */
:root {
  --black: #050506;
  --bone: #ebe6dc;
  --blue: #1736ff;
  --ink: #111114;
  --dim: rgba(235, 230, 220, .62);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(16px, 3vw, 40px);
  --font: "Archivo", system-ui, sans-serif;
}

*, *::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; }
body {
  margin: 0; background: var(--black); color: var(--bone);
  font: 400 1.125rem/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--blue); color: var(--bone); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
h1, h2, h3 { margin: 0; font-weight: 800; line-height: .95; letter-spacing: -.03em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--bone); color: var(--ink); padding: 8px 12px; }

/* Nav takes the colours of the section under it and slides away while you scroll down */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 40; background: var(--nav-bg); color: var(--nav-fg);
  display: flex; justify-content: space-between; align-items: center; padding: 18px var(--gutter);
  transition: transform 500ms var(--ease), background-color 400ms, color 400ms;
}
.nav[data-theme="dark"] { --nav-bg: var(--black); --nav-fg: var(--bone); }
.nav[data-theme="bone"] { --nav-bg: var(--bone); --nav-fg: var(--ink); }
.nav[data-theme="blue"] { --nav-bg: var(--blue); --nav-fg: var(--bone); }
.nav.away { transform: translateY(-100%); }
.wordmark { font-weight: 800; font-size: 1.05rem; text-decoration: none; letter-spacing: -.02em; }
.nav-links { display: flex; gap: clamp(14px, 2.4vw, 32px); }
.nav-links a { text-decoration: none; font-size: .98rem; position: relative; }
.nav-links a::after, .links a::after, .work-all::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 400ms var(--ease);
}
@media (hover: hover) {
  .nav-links a:hover::after, .links a:hover::after, .work-all:hover::after { transform: scaleX(1); transform-origin: left; }
}

/* Cursor: a dot that grows over anything clickable */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 60; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: #fff; mix-blend-mode: difference; pointer-events: none;
  opacity: 0; transition: width 300ms var(--ease), height 300ms var(--ease), margin 300ms var(--ease), opacity 200ms;
}
.cursor.on { opacity: 1; }
.cursor.big { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
@media (hover: none) { .cursor { display: none; } }

/* Hero */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 120px var(--gutter) 40px;
}
.wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.wires path { fill: none; stroke: rgba(235, 230, 220, .09); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.wires .packet {
  stroke: var(--blue); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 90 1700; animation: packet 5s linear infinite;
}
.wires .p2 { stroke: var(--bone); animation-duration: 7s; animation-delay: -2s; }
.wires .p3 { animation-duration: 6s; animation-delay: -4s; }
@keyframes packet { from { stroke-dashoffset: 1790; } to { stroke-dashoffset: 0; } }

.hero-name {
  position: relative; --w: 100;
  font-size: 12.4vw; font-weight: 850; line-height: .86; letter-spacing: -.045em;
  font-variation-settings: "wdth" var(--w);
}
.hero-name .row { display: block; }
.hero-name .row:last-child { padding-left: 0; }
.hero-foot {
  position: relative; display: grid; grid-template-columns: 1fr 1fr auto; gap: 24px 48px;
  align-items: end; margin-top: clamp(28px, 4vw, 56px);
}
.hero-role { margin: 0; font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 600; line-height: 1.25; max-width: 18em; }
.hero-sub { margin: 0; color: var(--dim); max-width: 32em; }
.scroll-cue { text-decoration: none; font-size: .95rem; display: inline-flex; align-items: center; gap: 10px; }
.scroll-cue::after { content: ""; width: 1px; height: 44px; background: currentColor; transform-origin: top; animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* Statement: words light up as you scroll */
.statement {
  min-height: 100vh; display: grid; place-items: center; padding: 120px var(--gutter);
  background: var(--bone); color: var(--ink);
}
.statement-text {
  margin: 0; max-width: 20em; font-size: clamp(1.9rem, 4.6vw, 4.4rem); font-weight: 700;
  line-height: 1.08; letter-spacing: -.03em;
}

/* About */
.about { background: var(--bone); color: var(--ink); padding: 40px var(--gutter) 200px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 36em) 1fr; gap: 64px clamp(48px, 8vw, 140px); }
.prose p { margin: 0 0 20px; }
.prose strong { font-weight: 700; }
.figures { margin: 0; display: grid; gap: 40px; align-content: start; }
.figures dd {
  margin: 0; font-size: clamp(3.4rem, 8vw, 7rem); font-weight: 850; line-height: .9; letter-spacing: -.05em;
  font-variation-settings: "wdth" 70; color: var(--blue); font-variant-numeric: tabular-nums;
}
.figures dt { margin-top: 6px; }

/* Sections that open like a curtain over the previous one */
.wipe { position: relative; z-index: 1; will-change: clip-path; }
.section-title { font-size: clamp(2.4rem, 7vw, 6.4rem); letter-spacing: -.045em; font-variation-settings: "wdth" 80; max-width: 12em; }

/* Skills */
.skills { background: var(--blue); color: var(--bone); padding: 160px var(--gutter) 180px; }
.skill-rows { list-style: none; margin: 80px 0 0; padding: 0; }
.skill {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22em); gap: 12px 48px; align-items: end;
  padding: 26px 0; border-top: 2px solid rgba(235, 230, 220, .25);
}
.skill-name { --w: 100; font-size: clamp(3rem, 11vw, 10rem); font-weight: 900; letter-spacing: -.05em; font-variation-settings: "wdth" var(--w); line-height: .85; }
.skill p { margin: 0 0 8px; }

/* Work: horizontal track on wide screens */
.work { background: var(--black); padding: 160px 0 160px; overflow: hidden; }
.work-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; padding: 0 var(--gutter); }
.work-all { position: relative; text-decoration: none; }
.track { display: flex; flex-wrap: wrap; gap: clamp(16px, 2vw, 28px); padding: 72px var(--gutter) 0; }
.track .panel { flex: 1 1 320px; }
/* Single row only when the pinned horizontal scroll is running */
@media (min-width: 901px) { .js .track { flex-wrap: nowrap; width: max-content; } .js .track .panel { flex: none; } }
.panel {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
  width: min(560px, 78vw); min-height: min(520px, 62vh); padding: clamp(24px, 3vw, 40px);
  background: #121216; text-decoration: none; transition: transform 160ms var(--ease);
}
.panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--blue);
  clip-path: inset(100% 0 0 0); transition: clip-path 500ms var(--ease);
}
.panel:active { transform: scale(.98); }
@media (hover: hover) { .panel:hover::before { clip-path: inset(0 0 0 0); } }
.panel:focus-visible::before { clip-path: inset(0 0 0 0); }
.panel-lang { font-size: .95rem; color: var(--dim); }
.panel h3 { margin-top: auto; font-size: clamp(2.2rem, 4vw, 3.6rem); font-variation-settings: "wdth" 75; overflow-wrap: anywhere; }
.panel p { margin: 18px 0 28px; max-width: 30em; overflow-wrap: anywhere; }
.panel-cta { font-weight: 700; }
.panel-cta::after { content: ""; display: inline-block; width: 28px; height: 2px; margin-left: 10px; vertical-align: middle; background: currentColor; transition: width 400ms var(--ease); }
@media (hover: hover) { .panel:hover .panel-cta::after { width: 56px; } }

/* Journey */
.journey { background: var(--bone); color: var(--ink); padding: 160px var(--gutter) 200px; }
.journey-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 64px; margin-top: 88px; align-items: start; }
.timeline-wrap { position: relative; padding-left: 36px; }
.timeline-line { position: absolute; left: 0; top: 8px; bottom: 0; width: 3px; background: var(--blue); transform-origin: top; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 5.5em 1fr; gap: 24px; padding-bottom: 64px; }
.timeline time { font-size: 1.6rem; font-weight: 850; font-variation-settings: "wdth" 70; color: var(--blue); line-height: 1.1; }
.timeline h3 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); letter-spacing: -.03em; line-height: 1.05; }
.place { margin: 8px 0 14px; opacity: .7; }
.timeline ul { margin: 0; padding-left: 20px; }
.timeline ul li { margin-bottom: 6px; }
.side { display: grid; gap: 56px; }
.side h3 { font-size: 1.5rem; margin-bottom: 18px; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.plain small { display: block; opacity: .65; font-size: .85rem; }
.pairs li { display: flex; justify-content: space-between; gap: 12px; }
.pairs span { opacity: .65; }

/* Contact */
.contact { background: var(--blue); color: var(--bone); padding: 180px var(--gutter) 32px; min-height: 100vh; display: flex; flex-direction: column; }
.contact-title { font-size: clamp(3rem, 10vw, 9.5rem); letter-spacing: -.05em; font-variation-settings: "wdth" 78; max-width: 9em; line-height: .88; }
.contact > p { max-width: 30em; margin: 40px 0 0; font-size: 1.25rem; }
.email {
  display: inline-block; align-self: flex-start; margin-top: 28px; font-size: clamp(1.2rem, 3.6vw, 3rem); font-weight: 700;
  letter-spacing: -.02em; text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat; transition: background-size 500ms var(--ease);
}
@media (hover: hover) { .email:hover { background-size: 100% 3px; } }
.links { display: flex; gap: 28px; margin-top: 32px; font-size: 1.1rem; }
.links a { position: relative; text-decoration: none; font-weight: 600; }
.footer { margin-top: auto; padding-top: 120px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .95rem; opacity: .8; }
.footer p { margin: 0; }

/* Before the intro runs (only when JS + motion are on) */
.js .hero-name, .js .hero-foot > *, .js .nav { visibility: hidden; }

/* Phones and small tablets */
@media (max-width: 900px) {
  .hero-foot { grid-template-columns: 1fr; }
  .scroll-cue { display: none; }
  .about-grid, .journey-grid { grid-template-columns: 1fr; }
  .figures { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .figures dd { font-size: clamp(2.2rem, 10vw, 4rem); }
  .skill { grid-template-columns: 1fr; }
  .panel { width: 100%; min-height: 360px; }
}
@media (max-width: 640px) {
  .nav-links a:not([href="#contact"]) { display: none; }
  .figures { grid-template-columns: 1fr; }
  .timeline > li { grid-template-columns: 1fr; gap: 6px; }
  .skills, .work, .journey { padding-top: 120px; padding-bottom: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wires .packet { display: none; }
}
