/* =============================================================================
   Ivan Preston: portfolio (dark)
   The page is an oscilloscope screen: near-black glass, a graticule grid and a
   glowing signal trace. Only things that emit light glow (the trace, LEDs,
   the pulse); text never does. Work types use scope channel colors.
   Type: Archivo (wide cuts for headings), Fira Code for small technical details.
   ============================================================================= */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-variable.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Code";
  src: url("../fonts/firacode-latin-variable.woff2") format("woff2-variations"),
       url("../fonts/firacode-latin-variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #060A0F;
  --bg-2: #090E14;
  --panel: #0D141C;
  --panel-2: #121A24;
  --text: #E7EEF5;
  --text-2: #AEBBC8;
  --muted: #7D8B9B;
  --line: rgba(148, 178, 208, .12);
  --line-strong: rgba(148, 178, 208, .22);

  --cyan: #3BE0F2;          /* channel 2: the signal */
  --cyan-text: #7FEAF8;
  --led: #3DF08A;
  --pin: #C9B37A;

  /* scope channel colors encode the type of work */
  --ch-cyan: #3BE0F2;
  --ch-yellow: #F5CE3A;
  --ch-magenta: #F062D2;
  --ch-green: #42D98A;
  --ch-orange: #FF8B3D;
  --ch-violet: #A38BFA;
  --ch-white: #DCE4EC;
  --ch-red: #FF5A6E;
  --ch-blue: #5D8BFF;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;

  --wrap: 1180px;
  --gutter: clamp(20px, 4.2vw, 44px);
  --header-h: 66px;
  --section-y: clamp(84px, 10vw, 140px);
  --grid: 88px;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------------------------------------------------------------- base --- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  background: var(--bg);
  scrollbar-color: #243140 var(--bg);
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1E2935; border: 3px solid var(--bg); border-radius: 10px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--cyan-text); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; font-weight: 700; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
::selection { background: rgba(59, 224, 242, .28); color: #fff; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--cyan);
  color: #031017;
  font-weight: 650;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  font-size: 15px;
  font-weight: 600;
  font-stretch: 104%;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--cyan); color: #031017; }
.btn-primary:hover { background: #6BE9F7; box-shadow: 0 0 0 4px rgba(59, 224, 242, .14), 0 0 28px rgba(59, 224, 242, .35); }
.btn-secondary { background: rgba(255, 255, 255, .03); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: rgba(59, 224, 242, .55); background: rgba(59, 224, 242, .06); box-shadow: 0 0 22px rgba(59, 224, 242, .12); }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.btn-small { min-height: 38px; padding: 7px 13px; font-size: 14px; border-radius: 10px; gap: 7px; }
.btn-small svg { width: 16px; height: 16px; }

.text-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(59, 224, 242, .45);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
}
.text-link:hover { color: var(--cyan-text); text-decoration-color: var(--cyan); }

/* ---------------------------------------------------- channel labels --- */
.type {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.type::before {
  content: "";
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--wire, var(--cyan));
  box-shadow: 0 0 8px var(--wire, var(--cyan));
}
.type-when { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
[data-wire="cyan"]    { --wire: var(--ch-cyan); }
[data-wire="yellow"]  { --wire: var(--ch-yellow); }
[data-wire="magenta"] { --wire: var(--ch-magenta); }
[data-wire="green"]   { --wire: var(--ch-green); }
[data-wire="orange"]  { --wire: var(--ch-orange); }
[data-wire="violet"]  { --wire: var(--ch-violet); }
[data-wire="white"]   { --wire: var(--ch-white); }
[data-wire="red"]     { --wire: var(--ch-red); }
[data-wire="blue"]    { --wire: var(--ch-blue); }

/* -------------------------------------------------------------- header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid transparent;
  transition: background-color .25s ease, border-color .25s ease;
}
.site-header.is-stuck {
  background: rgba(6, 10, 15, .74);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom-color: var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 680;
  font-stretch: 114%;
  letter-spacing: -0.005em;
}
.brand-mark { width: 32px; height: 32px; flex: none; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}
.nav-i { font-family: var(--mono); font-size: 11.5px; color: var(--cyan); opacity: .85; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav a[aria-current="true"] { color: var(--text); }
.nav a[aria-current="true"] .nav-i { opacity: 1; text-shadow: 0 0 10px rgba(59, 224, 242, .9); }
.header-actions { display: flex; gap: 8px; }
@media (max-width: 960px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 520px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .header-actions .btn-email { display: none; }
}

/* ------------------------------------------------- scope (graticule) --- */
.screen { position: relative; isolation: isolate; --axis: 76px; }
@media (max-width: 760px) { .screen { --axis: 55px; } }
.scope {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 224, 242, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 224, 242, .055) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  background-position: center bottom var(--axis, 76px);
  -webkit-mask-image: radial-gradient(120% 95% at 50% 35%, #000 30%, transparent 80%);
  mask-image: radial-gradient(120% 95% at 50% 35%, #000 30%, transparent 80%);
}
/* the center axis of a scope screen carries minor ticks, five per division */
.scope::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--axis, 76px) - 5px);
  height: 11px;
  background: repeating-linear-gradient(90deg, rgba(59, 224, 242, .22) 0 1px, transparent 1px calc(var(--grid) / 5));
  background-position: center;
}

.scope--plain { -webkit-mask-image: radial-gradient(100% 120% at 30% 0%, #000 20%, transparent 75%); mask-image: radial-gradient(100% 120% at 30% 0%, #000 20%, transparent 75%); }
.scope--plain::after { display: none; }

/* ---------------------------------------------------------------- hero --- */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  padding-block: clamp(48px, 7vw, 100px) 0;
}
.hero-pre {
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--cyan-text);
}
.hero-name {
  font-size: clamp(54px, 8.4vw, 118px);
  font-weight: 740;
  font-stretch: 122%;
  letter-spacing: -0.04em;
  line-height: .92;
  background: linear-gradient(180deg, #F6FAFD 25%, #9EB2C3 115%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text);
}
/* the period is a status LED */
.hero-led {
  display: inline-block;
  width: .125em;
  height: .125em;
  margin-left: .05em;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 .1em rgba(59, 224, 242, 1), 0 0 .45em rgba(59, 224, 242, .6);
}
.hero-sub {
  max-width: 40rem;
  margin-top: clamp(26px, 3vw, 36px);
  padding-left: 20px;
  border-left: 2px solid var(--cyan);
}
.hero-tagline { margin-bottom: 8px; font-size: clamp(18px, 1.7vw, 22px); font-weight: 520; line-height: 1.4; color: var(--text); }
.hero-statement { font-size: clamp(16px, 1.3vw, 18px); line-height: 1.6; color: var(--text-2); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: clamp(28px, 3vw, 38px);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
}
.led {
  width: 9px; height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 0 3px rgba(61, 240, 138, .16), 0 0 12px rgba(61, 240, 138, .85);
}

/* portrait, framed like a viewfinder */
.hero-photo { position: relative; margin: 0; width: clamp(230px, 23vw, 310px); }
.hero-photo-img {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .95);
}
.hero-photo-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -12px;
  pointer-events: none;
  --c: rgba(59, 224, 242, .75);
  background:
    linear-gradient(var(--c), var(--c)) top left / 20px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1.5px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 20px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1.5px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 20px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px 20px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 20px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px 20px no-repeat;
}
.hero-photo figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.hero-photo figcaption span { white-space: nowrap; }

/* the signal trace */
.trace { position: relative; height: 152px; margin-top: 8px; }
.trace svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trace-line { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(59, 224, 242, .85)); }
.trace-ghost { fill: none; stroke: var(--cyan); stroke-width: 1.25; opacity: 0; transition: opacity 1.2s ease; }
.trace.is-done .trace-ghost { opacity: var(--o, .12); }
.trace-head { fill: #fff; filter: drop-shadow(0 0 6px rgba(59, 224, 242, 1)) drop-shadow(0 0 14px rgba(59, 224, 242, .8)); }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 36px; }
  .hero-photo { order: -1; width: 112px; }
  .hero-photo::before { inset: -8px; background-size: 12px 1.5px, 1.5px 12px, 12px 1.5px, 1.5px 12px, 12px 1.5px, 1.5px 12px, 12px 1.5px, 1.5px 12px; }
  .hero-photo-img { border-radius: 14px; }
  .hero-photo figcaption { display: none; }
  .status { margin-left: 2px; flex-basis: 100%; margin-top: 6px; }
  .trace { height: 110px; }
}
@media (max-width: 520px) {
  .hero-actions .btn-primary { flex: 1 1 100%; }
  .hero-actions .btn-secondary { flex: 1 1 0; }
}

/* ------------------------------------------------- the signal chain --- */
.chain-wrap { padding-block: clamp(16px, 2vw, 28px) clamp(20px, 3vw, 32px); }
.chain-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 22px;
}
.chain-label { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.chain-label b { font-weight: 500; color: var(--cyan-text); }
/* the chain lays itself out by its own width: a row of modules when there's
   room, a vertical stack when there isn't (phones, the article column) */
.chain { position: relative; container-type: inline-size; }
.chain-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr));
  gap: clamp(26px, 3.6vw, 56px);
  padding-bottom: 76px; /* room for the wires to hang */
  position: relative;
  z-index: 1;
}
.chain-wires { position: absolute; left: 0; top: 0; z-index: 2; overflow: visible; pointer-events: none; }
.module {
  position: relative;
  min-height: 142px;
  padding: 16px 16px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01) 60%), var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 40px -28px rgba(0, 0, 0, .9);
  transition: border-color .35s ease;
}
.module.is-on { border-color: rgba(59, 224, 242, .26); }
.module-led {
  position: absolute;
  top: 15px; right: 15px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #27323E;
  transition: background-color .25s ease, box-shadow .25s ease;
}
.module.is-on .module-led { background: var(--led); box-shadow: 0 0 0 3px rgba(61, 240, 138, .14), 0 0 12px rgba(61, 240, 138, .9); }
.module-icon { display: block; width: 28px; height: 28px; margin-bottom: 12px; color: var(--cyan); }
.module-icon svg { width: 100%; height: 100%; }
.module-title { margin-bottom: 5px; font-size: 16px; font-weight: 680; font-stretch: 110%; line-height: 1.2; color: var(--text); }
.module-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.module-quote {
  margin: 10px 0 0;
  padding: 8px 11px;
  border: 1px solid rgba(59, 224, 242, .25);
  border-radius: 10px 10px 10px 3px;
  background: rgba(59, 224, 242, .08);
  color: var(--cyan-text);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .35s ease, transform .35s ease;
}
.module.is-on .module-quote { opacity: 1; transform: none; }
.pins { position: absolute; left: 50%; display: flex; gap: 5px; transform: translateX(-50%); }
.pins-bottom { bottom: -6px; }
.pins-top { top: -6px; display: none; }
.pin { width: 6px; height: 11px; border-radius: 1.5px; background: linear-gradient(90deg, #8E7B47, var(--pin) 45%, #E9DDB5 60%, #8E7B47); }
.wire-shadow { fill: none; stroke: rgba(0, 0, 0, .55); stroke-width: 8; stroke-linecap: round; transform: translate(0, 2px); }
.wire-core { fill: none; stroke: var(--wire); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--wire) 70%, transparent)); }
.wire-shine { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 1.4; stroke-linecap: round; transform: translate(-1px, -1.2px); }
.wire-plug { fill: #1A1F27; stroke: #313A46; stroke-width: 1; }
.pulse { fill: #fff; stroke: var(--cyan); stroke-width: 3; filter: drop-shadow(0 0 7px rgba(59, 224, 242, 1)); }
.chain-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--muted);
}
.chain-caption p { margin: 0; }
.replay {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.replay:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.replay svg { width: 15px; height: 15px; }

@container (max-width: 760px) {
  .chain-list { grid-template-columns: minmax(0, 1fr); gap: 56px; padding: 0 0 26px 30px; }
  .module {
    min-height: 0;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
    padding: 16px 40px 18px 16px;
  }
  .module-icon { grid-row: 1 / span 3; margin: 1px 0 0; }
  .module-title, .module-text, .module-quote { grid-column: 2; }
  .pins { left: 30px; transform: none; }
  .pins-top { display: flex; }
  .module:first-child .pins-top, .module:last-child .pins-bottom { display: none; }
}

/* ------------------------------------------------------------ sections --- */
.section { padding-block: var(--section-y); }
.section + .section { padding-top: 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin-bottom: clamp(36px, 4.6vw, 60px);
}
.section-title {
  display: inline-flex;
  align-items: baseline;
  gap: 16px;
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 720;
  font-stretch: 118%;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--text);
}
.section-i { font-family: var(--mono); font-size: .42em; font-weight: 500; letter-spacing: 0; color: var(--cyan); }
.section-rule { flex: 1 1 60px; height: 1px; min-width: 40px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.section-note { margin: 0; color: var(--muted); font-size: 14.5px; }

/* --------------------------------------------------------------- about --- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.about-copy { max-width: 64ch; font-size: 17.5px; line-height: 1.75; color: var(--text-2); }
.about-copy a { color: var(--text); text-decoration-color: rgba(59, 224, 242, .45); text-decoration-thickness: 1.5px; }
.about-copy a:hover { color: var(--cyan-text); text-decoration-color: var(--cyan); }
.facts {
  margin: 0;
  padding: 6px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent), var(--bg-2);
}
.fact {
  display: grid;
  grid-template-columns: 7.4em minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.fact:last-child { border-bottom: 0; }
.fact dt { padding-top: 2px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.fact dd { margin: 0; font-size: 15.5px; font-weight: 520; line-height: 1.45; color: var(--text); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- work --- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4.6vw, 64px);
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.cover img, .cover svg { width: 100%; height: 100%; object-fit: cover; }
.cover img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
a:hover .cover, a:focus-visible .cover { border-color: rgba(59, 224, 242, .4); box-shadow: 0 0 0 1px rgba(59, 224, 242, .15), 0 30px 60px -30px rgba(59, 224, 242, .25); }
a:hover .cover img, a:focus-visible .cover img { transform: scale(1.025); }
.work-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 14px; }
.work-title {
  margin-bottom: 14px;
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 720;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--text);
}
.work-summary { max-width: 46ch; margin-bottom: 18px; font-size: 16.5px; color: var(--text-2); }
.stack { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin-bottom: 24px; }
.stack li {
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}
.feature:hover .work-title, .feature:focus-visible .work-title,
.tile:hover .tile-title, .tile:focus-visible .tile-title { color: #fff; }
.read-more { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px);
  margin-top: clamp(56px, 7vw, 88px);
}
.tile { display: block; color: inherit; text-decoration: none; }
.tile .cover { aspect-ratio: 16 / 9; margin-bottom: 20px; }
.tile-title { margin-bottom: 10px; font-size: clamp(21px, 2.1vw, 26px); font-weight: 700; font-stretch: 110%; letter-spacing: -0.015em; line-height: 1.12; color: var(--text); }
.tile-summary { max-width: 52ch; margin: 0; font-size: 15.5px; color: var(--text-2); }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------- skills --- */
.skills-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 32px); }
.skill-group {
  padding: 22px 22px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%), var(--bg-2);
}
.skill-group h3 { margin-bottom: 8px; font-size: 16px; font-weight: 680; font-stretch: 112%; color: var(--text); }
.skill-list { list-style: none; }
.skill {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.skill:first-child { border-top: 0; }
.skill-hole { width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1.5px #3A4756; }
.skill.is-used .skill-hole { background: var(--wire, var(--cyan)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wire, var(--cyan)) 18%, transparent), 0 0 10px var(--wire, var(--cyan)); }
.skill-name { font-size: 15.5px; font-weight: 520; line-height: 1.4; color: var(--text); }
.skill-proof { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.skill-proof a { color: var(--text-2); text-decoration-color: var(--line-strong); }
.skill-proof a:hover { color: var(--cyan-text); text-decoration-color: var(--cyan); }
.legend { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; color: var(--muted); }
.legend .skill-hole { margin: 0; --wire: var(--cyan); background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
@media (max-width: 1040px) { .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .skills-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------- experience --- */
.xp-group + .xp-group { margin-top: clamp(48px, 6vw, 72px); }
.xp-group-title { margin-bottom: 8px; padding-left: calc(11rem + 52px); font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--muted); }
.timeline { list-style: none; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  top: 10px; bottom: 10px;
  left: calc(11rem + 13px);
  width: 1px;
  background: linear-gradient(rgba(59, 224, 242, .5), rgba(59, 224, 242, .06));
}
.xp { display: grid; grid-template-columns: 11rem 20px minmax(0, 1fr); column-gap: 8px; padding: 22px 0; }
.xp-when { padding-top: 4px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.xp-node {
  position: relative;
  z-index: 1;
  width: 11px; height: 11px;
  margin: 8px 0 0 3px;
  border-radius: 50%;
  background: var(--wire, var(--cyan));
  box-shadow: 0 0 0 4px var(--bg), 0 0 12px var(--wire, var(--cyan));
}
.xp-body { max-width: 70ch; padding-left: 16px; }
.xp-role { font-size: 19px; font-weight: 680; font-stretch: 108%; line-height: 1.25; color: var(--text); }
.xp-org { margin: 3px 0 10px; color: var(--text-2); font-weight: 500; }
.xp-points { list-style: disc; padding-left: 1.1em; color: var(--text-2); font-size: 15.5px; }
.xp-points li { margin-bottom: 4px; }
.xp-points li::marker { color: #3A4756; }
.xp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; }
.honors-wrap { margin-top: clamp(48px, 6vw, 72px); padding-top: 28px; border-top: 1px solid var(--line); }
.honors-title { margin-bottom: 14px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--muted); }
.honors { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; }
.honor {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
  font-size: 14.5px;
  font-weight: 520;
  color: var(--text);
}
@media (max-width: 760px) {
  .xp-group-title { padding-left: 44px; }
  .timeline::before { left: 8px; }
  .xp { grid-template-columns: 20px minmax(0, 1fr); row-gap: 2px; }
  .xp-node { grid-row: 1 / span 2; grid-column: 1; }
  .xp-when { grid-column: 2; padding: 0 0 0 16px; }
  .xp-body { grid-column: 2; }
}

/* ------------------------------------------------------------- contact --- */
.contact { padding-bottom: clamp(80px, 10vw, 128px); }
.contact-lead { max-width: 46ch; margin-bottom: 22px; font-size: clamp(18px, 1.7vw, 21px); color: var(--text-2); }
.email-big {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: clamp(24px, 4.4vw, 56px);
  font-weight: 700;
  font-stretch: 110%;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(59, 224, 242, .55);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.email-big:hover { color: var(--cyan-text); text-decoration-color: var(--cyan); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

/* -------------------------------------------------------------- footer --- */
.site-footer { padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; justify-content: space-between; }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--text-2); }
.footer-inner .mono { font-size: 12.5px; }

/* --------------------------------------------------- mobile quick dock --- */
.dock {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(13, 20, 28, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .9);
  transform: translateY(140%);
  transition: transform .28s cubic-bezier(.2, .7, .2, 1);
}
.dock.is-visible { transform: none; }
.dock a, .dock button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 7px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.dock svg { width: 20px; height: 20px; color: var(--cyan); }
.dock a:hover, .dock button:hover { background: rgba(255, 255, 255, .06); }
@media (max-width: 760px) {
  .dock { display: grid; }
  body { padding-bottom: 84px; }
}

/* --------------------------------------------------------------- toast --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 300;
  padding: 11px 16px;
  border: 1px solid rgba(59, 224, 242, .35);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 560;
  box-shadow: 0 0 24px rgba(59, 224, 242, .15);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) { .toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); } }

/* ------------------------------------------------------------- dialogs --- */
dialog { max-width: calc(100vw - 24px); padding: 0; border: 0; color: var(--text); background: var(--panel); }
dialog::backdrop { background: rgba(2, 4, 7, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.dialog-close:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.dialog-close svg { width: 20px; height: 20px; }

.sheet {
  width: 520px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(59, 224, 242, .06);
}
.sheet-head { padding: 24px 64px 18px 24px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.sheet-title { font-size: 23px; font-weight: 720; font-stretch: 114%; letter-spacing: -0.02em; }
.sheet-sub { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.sheet-body { padding: 8px 24px 24px; }
.sheet-row {
  display: grid;
  grid-template-columns: 5.4em minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.sheet-row:last-child { border-bottom: 0; }
.sheet-label { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.sheet-value { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.sheet-value a { color: var(--text); }
.sheet-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.sheet-mailers { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
@media (max-width: 520px) {
  .sheet { width: 100%; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .sheet-row { grid-template-columns: 1fr auto; }
  .sheet-label { grid-column: 1 / -1; margin-bottom: -6px; }
}

.lightbox, .docviewer {
  width: min(1200px, calc(100vw - 24px));
  height: min(860px, calc(100vh - 24px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #04070B;
  color: #fff;
}
.lightbox-figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; margin: 0; }
.lightbox-figure img { width: 100%; height: 100%; object-fit: contain; padding: 56px 64px 8px; }
.lightbox-figure figcaption { padding: 12px 24px 20px; text-align: center; color: var(--text-2); font-size: 14.5px; }
.lightbox-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-top: -22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(13, 20, 28, .8);
  color: #fff;
  cursor: pointer;
}
.lightbox-nav:hover { border-color: rgba(59, 224, 242, .6); }
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.docviewer { display: none; grid-template-rows: auto minmax(0, 1fr); }
.docviewer[open] { display: grid; }
.docviewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 64px 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.docviewer-title { margin-right: auto; font-weight: 620; }
.docviewer iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* -------------------------------------------------------- project page --- */
.project-hero { padding-block: clamp(28px, 4vw, 44px) clamp(44px, 5vw, 64px); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(28px, 4vw, 44px);
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 18px; height: 18px; color: var(--cyan); }
.project-title {
  max-width: 20ch;
  margin: 16px 0 22px;
  font-size: clamp(36px, 5.2vw, 68px);
  font-weight: 760;
  font-stretch: 116%;
  letter-spacing: -0.035em;
  line-height: .98;
  background: linear-gradient(180deg, #F6FAFD 30%, #A7BACA 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text);
}
.project-lead { max-width: 54ch; font-size: clamp(18px, 1.7vw, 21px); line-height: 1.55; color: var(--text-2); }
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.project-cover .cover { aspect-ratio: 16 / 9; }

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: start;
  padding-block: clamp(56px, 7vw, 96px);
}
.prose { max-width: 68ch; }
.prose > * + * { margin-top: clamp(48px, 5vw, 68px); }
.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  font-size: clamp(23px, 2.4vw, 29px);
  font-weight: 720;
  font-stretch: 114%;
  letter-spacing: -0.02em;
  color: var(--text);
}
.prose h2::before { content: "//"; font-family: var(--mono); font-size: .6em; font-weight: 500; color: var(--cyan); }
.prose p, .prose li { font-size: 17px; line-height: 1.75; color: var(--text-2); }
.prose ul { list-style: disc; padding-left: 1.15em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: #3A4756; }

.aside {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  padding: 6px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent), var(--bg-2);
}
.aside-block { padding: 15px 0; border-bottom: 1px solid var(--line); }
.aside-label { margin-bottom: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.aside-value { font-size: 15.5px; font-weight: 560; line-height: 1.45; color: var(--text); }
.aside .stack { margin: 4px 0 0; }
.aside-cta { display: grid; gap: 8px; margin-top: 20px; }
.aside-cta .btn { width: 100%; }
@media (max-width: 960px) {
  .project-body { grid-template-columns: 1fr; }
  .aside { position: static; order: -1; }
}

.chain-figure { margin: 0; }
.chain-figure .chain-wrap {
  padding: 30px clamp(16px, 2.4vw, 28px) 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--bg-2);
}
.chain-figure .module-text { font-size: 14.5px; }
.chain-figure figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* media */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gallery figure { margin: 0; }
.gallery .is-wide { grid-column: 1 / -1; }
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--panel);
  cursor: zoom-in;
}
.media-frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .45s ease; }
.gallery .is-wide .media-frame img { aspect-ratio: 16 / 9; }
.media-frame:hover { border-color: rgba(59, 224, 242, .4); }
.media-frame:hover img { transform: scale(1.02); }
.gallery figcaption, .video-figure figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.video-figure { grid-column: 1 / -1; margin: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-m); background: #000; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-facade {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background-color: #000;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.yt-facade span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border: 1px solid rgba(59, 224, 242, .5);
  border-radius: 999px;
  background: rgba(6, 10, 15, .82);
  color: #fff;
  font-weight: 650;
}
.yt-facade svg { width: 22px; height: 22px; color: var(--cyan); }
.yt-facade:hover span { box-shadow: 0 0 24px rgba(59, 224, 242, .45); }

.docs { list-style: none; display: grid; gap: 10px; }
.doc {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-2);
}
.doc-badge {
  display: grid;
  place-items: center;
  width: 44px; height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan-text);
}
.doc-title { font-weight: 620; line-height: 1.3; color: var(--text); }
.doc-caption { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.doc-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
  .doc { grid-template-columns: 44px minmax(0, 1fr); }
  .doc-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.next-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(160px, 26vw, 320px);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.next-label { margin-bottom: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.next-title { font-size: clamp(28px, 4vw, 50px); font-weight: 740; font-stretch: 116%; letter-spacing: -0.03em; line-height: 1.02; color: var(--text); transition: color .2s ease; }
.next-project:hover .next-title { color: var(--cyan-text); }
.next-project .cover { aspect-ratio: 16 / 10; }
@media (max-width: 560px) { .next-project { grid-template-columns: 1fr; } }

.contact-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  margin-bottom: clamp(56px, 7vw, 96px);
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(59, 224, 242, .08), transparent 55%),
    var(--bg-2);
}
.contact-strip h2 { font-size: clamp(21px, 2.3vw, 27px); font-weight: 720; font-stretch: 112%; letter-spacing: -0.015em; }
.contact-strip p { margin: 6px 0 0; color: var(--text-2); }
.contact-strip .contact-actions { margin: 0; }

.empty-state { padding-block: 120px; }
.empty-state h1 { margin-bottom: 14px; font-size: clamp(34px, 5vw, 56px); font-weight: 760; font-stretch: 116%; letter-spacing: -0.03em; }
.empty-state p { max-width: 48ch; font-size: 18px; color: var(--text-2); }

/* -------------------------------------------------------- motion + print --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --bg-2: #fff; --panel: #fff; --panel-2: #fff; --text: #000; --text-2: #222; --muted: #555; --line: #ccc; --line-strong: #bbb; }
  html, body { background: #fff; color: #000; }
  body { font-size: 11pt; padding: 0; }
  .site-header, .dock, .toast, dialog, .chain-wires, .replay, .skip-link, .hero-actions .btn, .contact-actions, .next-project, .aside-cta, .project-actions, .scope, .trace { display: none !important; }
  .hero-name, .project-title { background: none; -webkit-text-fill-color: #000; color: #000; }
  .section { padding-block: 16pt; break-inside: avoid-page; }
  .module, .facts, .skill-group, .aside, .cover { box-shadow: none; border-color: #ccc; background: #fff; }
  .module-quote { opacity: 1; transform: none; }
  a { color: inherit; }
  .email-big { font-size: 20pt; }
}
