/* ==========================================================================
   Kristijan Angelovski · portfolio
   Clean editorial layout with infra accents. Light + dark, orange accent.
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable: one file covers every weight) ---------- */
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.3626eba547.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.5d93ee6268.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #F7F6F3;
  --bg-2: #EFEDE8;
  --surface: #FFFFFF;
  --ink: #16171A;
  --ink-2: #464950;
  --muted: #73767E;
  --line: #E2DFD9;
  --line-2: #D2CEC6;
  --accent: #F38020;          /* fills, lines, dots */
  --accent-ink: #B4500A;      /* accent text on light backgrounds (AA) */
  --accent-soft: rgba(243, 128, 32, 0.12);
  --ok: #1E9A55;
  --ok-soft: rgba(30, 154, 85, 0.16);
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 28px rgba(20, 20, 20, 0.06);
  --grid-dot: rgba(22, 23, 26, 0.09);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 14px;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0F11;
    --bg-2: #131518;
    --surface: #16181C;
    --ink: #ECEDEF;
    --ink-2: #B4B7BE;
    --muted: #82868F;
    --line: #25282E;
    --line-2: #33373E;
    --accent: #FF8A3D;
    --accent-ink: #FF9C5A;
    --accent-soft: rgba(255, 138, 61, 0.14);
    --ok: #3DD68C;
    --ok-soft: rgba(61, 214, 140, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    --grid-dot: rgba(236, 237, 239, 0.08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0F11;
  --bg-2: #131518;
  --surface: #16181C;
  --ink: #ECEDEF;
  --ink-2: #B4B7BE;
  --muted: #82868F;
  --line: #25282E;
  --line-2: #33373E;
  --accent: #FF8A3D;
  --accent-ink: #FF9C5A;
  --accent-soft: rgba(255, 138, 61, 0.14);
  --ok: #3DD68C;
  --ok-soft: rgba(61, 214, 140, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  --grid-dot: rgba(236, 237, 239, 0.08);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.08; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: #111; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 32px; } }

.dim { color: var(--muted); }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* Status dots */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 0 var(--ok-soft); }
.motion .dot-ok { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--ok-soft); }
  70% { box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.45em;
  height: 44px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  transition: transform 0.25s var(--ease), border-color 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #14110E; }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; }
.btn-small { height: 36px; padding: 0 14px; font-size: 0.875rem; }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: var(--accent);
  transform: scaleX(var(--scroll, 0)); transform-origin: 0 50%;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--mono); font-size: 0.9rem; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: #14110E; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.02em;
}
.brand-name { display: none; }
@media (min-width: 560px) { .brand-name { display: inline; } }
.nav nav { margin-left: auto; }
.nav-links { display: none; gap: 4px; }
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-links a {
  display: block; padding: 6px 12px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-size: 0.92rem;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); background: var(--bg-2); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 900px) { .nav-actions { margin-left: 8px; } }
.theme-toggle {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line-2); border-radius: 50%; background: transparent; cursor: pointer;
  transition: border-color 0.2s, transform 0.4s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle:active { transform: rotate(40deg); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
.i-sun { display: block; } .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 48px 0 72px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, #000 20%, transparent 75%);
}
@media (min-width: 900px) { .hero { padding: 72px 0 112px; } }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr); gap: 64px; } }

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 10px; border: 1px solid var(--line-2); border-radius: 999px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); background: var(--surface);
}
.status-role { display: none; }
@media (min-width: 520px) { .status-role { display: inline; } }
.hero h1 {
  margin-top: 28px;
  font-size: clamp(3rem, 7.4vw + 0.5rem, 6.25rem);
  font-weight: 650; letter-spacing: -0.045em; line-height: 0.95;
}
.hero-lead {
  margin-top: 28px; max-width: 30ch;
  font-size: clamp(1.3rem, 1.2vw + 1rem, 1.7rem); line-height: 1.3; letter-spacing: -0.015em; color: var(--ink);
}
.hero-lead em { font-style: normal; color: var(--accent-ink); }
.hero-sub { margin-top: 16px; max-width: 58ch; color: var(--ink-2); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  margin: 44px 0 0; border-top: 1px solid var(--line);
}
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats div { padding: 16px 16px 0 0; }
.stats dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }

/* Portrait with viewfinder corners */
.portrait { position: relative; margin: 0; max-width: 420px; justify-self: center; width: 100%; }
@media (min-width: 900px) { .portrait { justify-self: end; } }
.portrait-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-2); aspect-ratio: 4 / 5; box-shadow: var(--shadow);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait::before, .portrait::after {
  content: ""; position: absolute; width: 28px; height: 28px; z-index: 2; pointer-events: none;
  border: 2px solid var(--accent);
}
.portrait::before { top: -10px; left: -10px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.portrait::after { bottom: 22px; right: -10px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.portrait figcaption {
  display: flex; justify-content: space-between; margin-top: 12px;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; border-top: 1px solid var(--line); }
.section-tight { padding: 72px 0; }
@media (min-width: 900px) { .section { padding: 120px 0; } .section-tight { padding: 96px 0; } }
.section-head { margin-bottom: 48px; max-width: 760px; }
.section-head h2 { margin-top: 14px; font-size: clamp(2rem, 3.2vw + 1rem, 3.4rem); letter-spacing: -0.035em; }
.section-note { margin-top: 16px; color: var(--ink-2); max-width: 60ch; }

/* About */
.about-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 72px; } }
.about-copy p { font-size: 1.15rem; line-height: 1.65; color: var(--ink-2); max-width: 60ch; }
.about-copy p + p { margin-top: 18px; }
.spec { margin: 0; border-top: 1px solid var(--line); }
.spec div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.spec dd { margin: 0; }

/* ---------- Timeline ---------- */
.timeline { --rail-x: 7px; position: relative; padding-left: 36px; }
@media (min-width: 900px) { .timeline { --rail-x: 179px; padding-left: 0; } }
.timeline::before, .timeline::after {
  content: ""; position: absolute; top: 8px; bottom: 8px; left: var(--rail-x); width: 2px; border-radius: 2px;
}
.timeline::before { background: var(--line); }
.timeline::after {
  background: linear-gradient(var(--accent), var(--accent));
  transform: scaleY(var(--p, 1)); transform-origin: top;
}
.job { position: relative; display: grid; gap: 6px; padding-bottom: 56px; }
.job:last-child { padding-bottom: 0; }
@media (min-width: 900px) { .job { grid-template-columns: 150px minmax(0, 1fr); gap: 60px; } }
.job::before {
  content: ""; position: absolute; top: 6px; z-index: 1;
  left: calc(var(--rail-x) - 36px - 5px); width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-2);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.6s var(--ease);
}
@media (min-width: 900px) { .job::before { left: calc(var(--rail-x) - 5px); } }
.job.is-lit::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.job-date { display: flex; gap: 8px; flex-wrap: wrap; font-family: var(--mono); font-size: 0.82rem; color: var(--ink-2); padding-top: 1px; }
@media (min-width: 900px) { .job-date { flex-direction: column; gap: 2px; text-align: right; } }
.job-body { max-width: 720px; }
.job-company { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.job h3 { margin-top: 8px; font-size: clamp(1.35rem, 1vw + 1rem, 1.75rem); }
.job-points { margin-top: 16px; display: grid; gap: 8px; }
.job-points li { position: relative; padding-left: 20px; color: var(--ink-2); }
.job-points li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 8px; height: 1.5px; background: var(--line-2); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; letter-spacing: 0.06em; }
.badge-live { background: var(--ok-soft); color: var(--ok); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.tags li {
  padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 6px;
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2); background: var(--surface);
  transition: border-color 0.4s, color 0.4s, background 0.4s, opacity 0.5s, transform 0.5s var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms + 150ms);
}
.job.is-lit .tags li { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-2)); color: var(--ink); }
.motion .job:not(.is-lit) .tags li { opacity: 0.35; transform: translateY(4px); }

/* ---------- Skills map ---------- */
.skillmap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.skillmap > * { min-width: 0; }
@media (min-width: 900px) { .skillmap { grid-template-columns: minmax(0, 1fr) 240px; gap: 72px; align-items: start; } }
/* Wires run *behind* the segment cards, like cables behind rack panels. */
.skillmap-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.skillmap-wires path { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.8; }
.motion .skillmap-wires path.is-new { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 0.6s var(--ease) forwards; }
.segment { position: relative; z-index: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.skillmap-wires circle { fill: var(--accent); }

.segments { display: grid; gap: 14px; order: 2; }
@media (min-width: 640px) { .segments { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .segments { order: 0; } }
.segment {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.3s, opacity 0.3s;
}
.seg-id { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.segment h3 { margin-top: 6px; font-size: 1.1rem; letter-spacing: -0.015em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip {
  padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent;
  font-size: 0.86rem; cursor: pointer; color: var(--ink);
  transition: border-color 0.2s, background 0.2s, color 0.2s, opacity 0.25s;
}
.chip:hover { border-color: var(--accent); }
.skillmap.has-focus .chip { opacity: 0.38; }
.skillmap.has-focus .chip.is-on { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.chip[aria-pressed="true"] { background: var(--accent) !important; color: #14110E; border-color: var(--accent); }

.rail {
  order: 1; position: sticky; top: var(--nav-h); z-index: 3; align-self: start;
  margin-inline: -16px; padding: 8px 16px 0; background: var(--bg);
}
@media (min-width: 720px) { .rail { margin-inline: -32px; padding-inline: 32px; } }
@media (min-width: 900px) { .rail { order: 0; top: calc(var(--nav-h) + 32px); z-index: 1; margin: 0; padding: 0; background: transparent; } }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rail-readout { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-align: right; }
.rail-nodes { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: thin; }
@media (min-width: 900px) { .rail-nodes { flex-direction: column; gap: 2px; overflow: visible; } }
.rail-sep { flex: none; width: 1px; margin: 4px 6px; background: var(--line); }
@media (min-width: 900px) { .rail-sep { width: auto; height: 1px; margin: 8px 0; } }
.node {
  display: flex; align-items: center; gap: 10px; width: 100%; white-space: nowrap;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  cursor: pointer; text-align: left; transition: background 0.25s, border-color 0.25s, opacity 0.25s;
}
@media (min-width: 900px) { .node { border-color: transparent; background: transparent; border-radius: 10px; padding: 9px 10px; } }
.node:hover { border-color: var(--line-2); }
.node-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--bg); flex: none; transition: all 0.3s var(--ease); }
.node-name { font-weight: 500; font-size: 0.92rem; }
.node-meta { margin-left: auto; padding-left: 8px; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.skillmap.has-focus .node { opacity: 0.45; }
.skillmap.has-focus .node.is-on { opacity: 1; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.skillmap.has-focus .node.is-on .node-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.node[aria-pressed="true"] { opacity: 1 !important; outline: 1.5px solid var(--accent); outline-offset: -1.5px; }

/* ---------- Projects ---------- */
.project {
  display: grid; gap: 32px; padding: 28px; margin-bottom: 20px;
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--surface);
}
@media (min-width: 900px) { .project { padding: 44px; } .project-lab { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; } }
.project-kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.project h3 { margin-top: 10px; font-size: clamp(1.6rem, 1.4vw + 1rem, 2.2rem); letter-spacing: -0.03em; }
.project-copy > p:not(.project-kicker) { margin-top: 14px; color: var(--ink-2); max-width: 56ch; }
.project-copy a { color: var(--accent-ink); text-underline-offset: 3px; }
.checklist { margin-top: 20px; display: grid; gap: 8px; }
.checklist li { position: relative; padding-left: 26px; color: var(--ink-2); font-size: 0.98rem; }
.checklist li::before {
  content: ""; position: absolute; left: 2px; top: 0.42em; width: 12px; height: 7px;
  border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg);
}
.tags-static li { transition: none; }

/* Topology figure (static, generic, no addresses) */
.topo { margin: 0; font-size: 0.86rem; display: grid; gap: 0; align-content: start; }
.topo-edge { display: flex; flex-direction: column; align-items: center; }
@media (min-width: 560px) { .topo-edge { flex-direction: row; justify-content: center; } }
.topo-box {
  padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg);
  font-weight: 500; line-height: 1.25; text-align: center;
}
.topo-label { display: block; margin-bottom: 2px; font-family: var(--mono); font-size: 0.64rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.topo-accent { border-color: var(--accent); background: var(--accent-soft); }
.topo-link { display: block; flex: none; width: 2px; height: 22px; background: repeating-linear-gradient(var(--accent) 0 4px, transparent 4px 8px); background-size: 100% 8px; }
@media (min-width: 560px) {
  .topo-edge .topo-link { width: 32px; height: 2px; background: repeating-linear-gradient(90deg, var(--accent) 0 4px, transparent 4px 8px); background-size: 8px 100%; }
}
.topo-down { justify-self: center; }
.motion .topo-link { animation: flow-y 0.8s linear infinite; }
@media (min-width: 560px) { .motion .topo-edge .topo-link { animation-name: flow-x; } }
@keyframes flow-y { to { background-position: 0 8px; } }
@keyframes flow-x { to { background-position: 8px 0; } }
.topo-server { border: 1.5px dashed var(--line-2); border-radius: 16px; padding: 14px; display: grid; gap: 12px; background: var(--bg-2); }
.topo-title { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.topo-proxy { justify-self: center; min-width: 60%; }
.topo-groups { display: grid; gap: 10px; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); }
.topo-group { display: grid; gap: 6px; align-content: start; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.topo-group .topo-label { margin: 0 0 2px; }
.topo-public { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.topo-public .topo-label { color: var(--ok); }
.topo-private .topo-box { font-weight: 400; }
.topo-net { grid-template-columns: 1fr 1fr; }
.topo-ops { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); line-height: 1.5; }
.topo-ops span { color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 6px; }
.topo-cap { margin-top: 10px; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); text-align: right; }

/* Websites card */
@media (min-width: 900px) { .project-web { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.project-link {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px 26px; border-radius: var(--radius); background: var(--ink); color: var(--bg); text-decoration: none;
  font-family: var(--mono); font-size: 1.05rem; min-width: 260px;
  transition: background 0.3s, color 0.3s;
}
.project-link-arrow { font-size: 1.4rem; transition: transform 0.35s var(--ease); }
.project-link:hover { background: var(--accent); color: #14110E; }
.project-link:hover .project-link-arrow { transform: translate(3px, -3px); }

/* ---------- Training ---------- */
.certs { border-top: 1px solid var(--line); }
.certs li { display: grid; gap: 2px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .certs li { grid-template-columns: 110px minmax(0, 1fr) auto; align-items: baseline; } }
.cert-date { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.cert-name { font-weight: 500; font-size: 1.08rem; }
.cert-org { font-family: var(--mono); font-size: 0.8rem; color: var(--accent-ink); }

/* ---------- Contact ---------- */
.contact { padding-bottom: 120px; }
.contact-title { margin-top: 14px; font-size: clamp(2.6rem, 6vw + 0.5rem, 5.5rem); letter-spacing: -0.045em; line-height: 0.98; max-width: 14ch; }
.contact-lead { margin-top: 22px; font-size: 1.15rem; color: var(--ink-2); }
.contact-mail {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 36px; max-width: 100%;
  font-size: clamp(1.2rem, 2.6vw + 0.6rem, 2.3rem); font-weight: 500; letter-spacing: -0.02em;
  text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 6px;
}
/* Never break the address: it fits on one line even at 320px (font scales with the viewport). */
.contact-mail-text { white-space: nowrap; }
.contact-mail-arrow { flex: none; color: var(--accent); transition: transform 0.35s var(--ease); }
.contact-mail:hover .contact-mail-arrow { transform: translateX(6px); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer p { display: inline-flex; align-items: center; gap: 10px; }

/* ==========================================================================
   Motion (only when JS is on and the visitor allows motion)
   ========================================================================== */

/* Hero entrance */
.motion .rise { animation: rise 0.9s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms + 80ms); }
.motion.boot .rise { animation-play-state: paused; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* Scroll reveal */
.motion .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.motion .reveal.is-in { opacity: 1; transform: none; }

/* Boot screen */
.boot-screen { display: none; }
.boot .boot-screen, .boot-screen.is-leaving {
  display: flex; position: fixed; inset: 0; z-index: 200;
  align-items: center; justify-content: center; padding: 24px 16px;
  background: #0B0C0E; color: #D9DBDF; font-family: var(--mono);
  cursor: pointer;
}
.boot-screen.is-leaving { pointer-events: none; animation: boot-out 0.75s var(--ease) forwards; }
@keyframes boot-out { to { clip-path: inset(0 0 100% 0); } }
.boot-inner { width: min(640px, 100%); font-size: clamp(0.72rem, 1.6vw, 0.92rem); line-height: 1.75; }
.boot-title { color: #FFFFFF; font-weight: 500; margin-bottom: 14px; }
.boot-title span { color: #6F737B; }
.boot-log li { white-space: pre-wrap; opacity: 0; transform: translateX(-4px); transition: opacity 0.15s, transform 0.25s var(--ease); }
.boot-log li.is-on { opacity: 1; transform: none; }
.boot-log .st { display: inline-block; width: 6ch; color: #6F737B; }
.boot-log .st.ok { color: #3DD68C; }
.boot-log .k { color: #FF8A3D; }
.boot-log .final { color: #FFFFFF; margin-top: 10px; }
.boot-skip { margin-top: 26px; color: #565A61; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.boot { overflow: hidden; }

/* Print: show everything, drop chrome. */
@media print {
  .nav, .scroll-progress, .boot-screen, .skillmap-wires, .theme-toggle { display: none !important; }
  .reveal, .rise { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; }
}
