/* Colours live in tokens so the dark theme only has to redefine them. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #0f1b33;
  --muted: #55607a;
  --line: #dfe4ee;
  --accent: #2b59ff;
  --accent-ink: #ffffff;
  --code: #eef1f8;
  --teal: #0fa3a3;
  --green: #2f9e44;
  --amber: #d98e04;
  --violet: #7c4dff;
  --grid: rgb(15 27 51 / .07);
  --glow: .22;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1222;
    --surface: #121c33;
    --ink: #e8ecf5;
    --muted: #9aa5bd;
    --line: #23304d;
    --accent: #6f8cff;
    --accent-ink: #0b1222;
    --code: #1a2542;
    --teal: #3cc8c8;
    --green: #5fcf74;
    --amber: #f2b33d;
    --violet: #a487ff;
    --grid: rgb(255 255 255 / .05);
    --glow: .3;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* Background: a graph-paper grid and two colour glows behind the hero, faded out with a mask
   so the rest of the page stays plain and readable. Pure CSS, so no extra requests. */
body::before, body::after { content: ""; position: absolute; left: 0; right: 0; z-index: -1; pointer-events: none; }
body::before {
  top: 0; height: 1100px;
  background:
    radial-gradient(40rem 26rem at 15% 10%, rgb(43 89 255 / var(--glow)), transparent 70%),
    radial-gradient(34rem 24rem at 85% 30%, rgb(124 77 255 / var(--glow)), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 40px 40px;
  -webkit-mask-image: linear-gradient(#000 45%, transparent);
  mask-image: linear-gradient(#000 45%, transparent);
}
body::after {
  bottom: 0; height: 700px;
  background: radial-gradient(36rem 22rem at 50% 100%, rgb(15 163 163 / var(--glow)), transparent 70%);
}

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  position: relative; isolation: isolate;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
code { font-family: var(--mono); font-size: .88em; background: var(--code); padding: .1em .35em; border-radius: 4px; }

.wrap { width: min(1080px, 100% - 2rem); margin-inline: auto; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: .5rem 1rem; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 3.75rem; }
.nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav ul a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav ul a:hover { color: var(--ink); }
.brand { font: 700 1.25rem var(--mono); color: var(--ink); text-decoration: none; }
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* Hero */
.hero { padding: 5.5rem 0 4rem; }
.prompt { font: .95rem var(--mono); color: var(--muted); margin: 0 0 .75rem; }
.prompt .user { color: var(--green); }
.prompt .path { color: var(--accent); }
/* The hero command types itself out once; a monospace font makes 1ch exactly one letter wide. */
.type { display: inline-block; vertical-align: bottom; overflow: hidden; white-space: nowrap; width: 6ch; animation: type .9s steps(6) .4s both; }
.caret { display: inline-block; width: .55em; height: 1.1em; margin-left: .15em; vertical-align: text-bottom; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes type { from { width: 0; } }
@media (prefers-reduced-motion: reduce) { .type, .caret { animation: none; } }
section:not(.hero) > .prompt { margin-bottom: .35rem; font-size: .85rem; }
.foot .prompt { margin-bottom: .5rem; }
h1 {
  font-size: clamp(2.75rem, 8vw, 5rem); line-height: 1.15; letter-spacing: -.03em; margin: 0 0 1rem; padding-bottom: .08em;
  background: linear-gradient(100deg, var(--ink) 30%, var(--accent) 70%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: 1.25rem; max-width: 40rem; color: var(--muted); margin: 0 0 2rem; }
.lead strong { color: var(--ink); }
.cta, .links { display: flex; flex-wrap: wrap; gap: .75rem; }
.facts { display: flex; flex-wrap: wrap; gap: .5rem 2rem; list-style: none; padding: 0; margin: 2.5rem 0 0; font-size: .95rem; }
.facts span { display: block; font: .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.btn {
  display: inline-block; padding: .65rem 1.15rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; transition: transform .15s, border-color .15s;
  overflow-wrap: anywhere;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Sections */
section[id]:not(.hero) { padding: 3.5rem 0; }
h2 { font-size: 1.9rem; letter-spacing: -.02em; margin: 0 0 2rem; }
h3 { margin: 0 0 .5rem; font-size: 1.3rem; }
.tag { font: .8rem var(--mono); color: var(--muted); margin: 0 0 .5rem; }

.feature {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 1.5rem 2.5rem; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.5rem;
  border-top: 4px solid var(--accent);
}
.feature h3 { font-size: 1.75rem; }
.feature-intro > p:not(.tag) { margin: 0 0 1.25rem; }

/* Big shot on the left, two smaller ones stacked on the right; the images crop to fill their cell. */
.gallery {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: .75rem;
}
.gallery figure { margin: 0; position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); }
.gallery .main { grid-row: 1 / 3; }
.gallery a { display: block; height: 100%; }
.gallery img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.gallery figcaption {
  position: absolute; left: .5rem; bottom: .5rem;
  font: .75rem var(--mono); padding: .2rem .5rem; border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink);
}
.ticks { padding-left: 1.1rem; margin: 0; }
.ticks li { margin-bottom: .5rem; }
.ticks li::marker { content: "▸ "; color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 1.25rem; }
.card {
  --c: var(--accent);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem;
  border-left: 4px solid var(--c);
}
.card p:not(.tag) { color: var(--muted); flex: 1; margin: 0 0 1rem; }
.card .tag { color: var(--c); }
.c-teal { --c: var(--teal); }
.c-green { --c: var(--green); }
.c-amber { --c: var(--amber); }
.c-violet { --c: var(--violet); }
.more { font-weight: 600; text-decoration: none; color: var(--c); }
.more:hover { text-decoration: underline; }

.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem 2.5rem; }
.skills h3 { font-size: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.chips li { font: .85rem var(--mono); padding: .3rem .7rem; border-radius: 999px; background: var(--code); border: 1px solid var(--line); }

.contact { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 2rem; }
.contact p { margin: 0 0 1.25rem; font-size: 1.15rem; }

.foot { padding: 2rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

@media (max-width: 760px) {
  .hero { padding: 3.5rem 0 2.5rem; }
  .feature, .grid, .skills, .gallery { grid-template-columns: 1fr; }
  .gallery { grid-template-rows: auto; }
  .gallery .main { grid-row: auto; }
  .feature { padding: 1rem; }
  .nav ul { gap: 1rem; font-size: .95rem; }
}

/* Skills read like the output of `cat skills.txt` in a terminal window. */
.term { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.term-bar {
  margin: 0; padding: .6rem 1rem; display: flex; align-items: center; gap: .75rem;
  font: .8rem var(--mono); color: var(--muted); background: var(--code); border-bottom: 1px solid var(--line);
}
.dots { display: inline-flex; gap: .4rem; }
.dots i { width: .7rem; height: .7rem; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.term .skills { padding: 1.5rem; }
