/* ============================================================
   kgounaris.com — design system
   Palette: phosphor terminal
     --ink #0A0908 · --surface #15130C · --amber #FFB000
     --amber-hot #FFCE54 · --green #53F26B · --text #EDE6D6 · --muted #8C8470
   Type: Space Grotesk (display) · Source Serif 4 (long-form) · IBM Plex Mono (utility)
   ============================================================ */
:root {
  --ink: #0A0908;
  --ink-2: #100E0A;
  --surface: #15130C;
  --surface-2: #1B1810;
  --amber: #FFB000;
  --amber-hot: #FFCE54;
  --green: #53F26B;
  --text: #EDE6D6;
  --text-dim: #B5AC97;
  --muted: #8C8470;
  --line: rgba(255, 176, 0, 0.14);
  --line-soft: rgba(237, 230, 214, 0.09);
  --glow-soft: rgba(255, 176, 0, 0.18);
  --glow-strong: rgba(255, 176, 0, 0.38);
  color-scheme: dark;
  --display: "Space Grotesk", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", monospace;
  /* type scale (1.25 ratio, fluid at display sizes) */
  --t-xs: 11px;
  --t-sm: 13px;
  --t-base: 16px;
  --t-md: 20px;
  --t-lg: clamp(24px, 2.6vw, 31px);
  --t-xl: clamp(30px, 3.6vw, 48px);
  --t-2xl: clamp(40px, 5.2vw, 76px);
  --t-hero: clamp(44px, 6.4vw, 96px);
  --gutter: clamp(20px, 4.5vw, 64px);
  --section: clamp(90px, 12vh, 150px);
}
/* ---------- light theme ---------- */
[data-theme="light"] {
  color-scheme: light;
  --ink: #F2EDE0;
  --ink-2: #EAE3D1;
  --surface: #EAE3D0;
  --surface-2: #E2DAC4;
  --amber: #9C6A00;
  --amber-hot: #6E4A00;
  --green: #1E7A33;
  --text: #221D12;
  --text-dim: #524A37;
  --muted: #7E7458;
  --line: rgba(156, 106, 0, 0.30);
  --line-soft: rgba(34, 29, 18, 0.13);
  --glow-soft: rgba(156, 106, 0, 0);
  --glow-strong: rgba(156, 106, 0, 0);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--display);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}
::selection { background: var(--amber); color: var(--ink); }
:focus-visible { outline: 1px solid var(--amber); outline-offset: 3px; }
a { color: inherit; }

/* ---------- the atmosphere ---------- */
canvas.nebula {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}
canvas.nebula.band {
  position: absolute;
  z-index: 0;
}
/* designed fallback when WebGL is unavailable */
body.no-webgl canvas.nebula { display: none; }
body.no-webgl::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 90% 70% at 30% 20%, rgba(255, 176, 0, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 60% at 75% 75%, rgba(255, 176, 0, 0.07), transparent 65%),
    radial-gradient(ellipse 40% 35% at 60% 40%, rgba(83, 242, 107, 0.04), transparent 70%),
    var(--ink);
}
[data-theme="light"] body.no-webgl::before {
  background:
    radial-gradient(ellipse 90% 70% at 30% 20%, rgba(156, 106, 0, 0.12), transparent 60%),
    radial-gradient(ellipse 70% 60% at 75% 75%, rgba(156, 106, 0, 0.08), transparent 65%),
    var(--ink);
}

/* ---------- chrome ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  background: var(--amber);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--t-sm);
  padding: 8px 14px;
  text-decoration: none;
}
.skip:focus { left: 12px; }
header.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
  background: linear-gradient(color-mix(in srgb, var(--ink) 85%, transparent), transparent);
}
.brand {
  font-family: var(--mono);
  font-size: var(--t-sm);
  letter-spacing: 0.18em;
  color: var(--amber);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--muted); }
header.top nav { display: flex; gap: clamp(16px, 3vw, 34px); align-items: center; }
header.top nav a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.25s ease;
}
header.top nav a:hover { color: var(--amber-hot); }
header.top nav a[aria-current="page"] {
  color: var(--text);
  border-bottom: 1px solid var(--amber);
}
.theme-toggle {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.theme-toggle:hover { color: var(--amber-hot); border-color: var(--amber); }
main { display: block; }

/* ---------- shared section grammar ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
section.block { padding: var(--section) 0; }
.kicker {
  font-family: var(--mono);
  font-size: var(--t-sm);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 22px;
}
h2.title {
  font-size: var(--t-xl);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
  max-width: 18ch;
}
.lede {
  margin-top: 20px;
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 56ch;
  text-wrap: pretty;
}

/* ---------- landing ---------- */
.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  text-align: center;
  padding: 0 var(--gutter);
}
.hero .kicker { letter-spacing: 0.32em; }
h1.statement {
  font-size: var(--t-hero);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 700;
  text-wrap: balance;
  text-shadow: 0 0 60px var(--glow-soft);
}
.hero .sub {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.hero .sub em { color: var(--text); font-style: normal; }
.scroll-cue {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.3em;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.scroll-cue::after {
  content: "";
  width: 1px; height: 34px;
  background: linear-gradient(var(--amber), transparent);
}
.hero-hint {
  position: absolute;
  bottom: 32px; right: var(--gutter);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  color: var(--muted);
}
.hero-hint b { color: var(--green); font-weight: 400; }

/* about strip */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 6vw, 90px);
  align-items: start;
}
.about-grid .lede { font-size: var(--t-lg); line-height: 1.4; color: var(--text); max-width: 24ch; font-weight: 500; letter-spacing: -0.01em; }
.cap-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.cap-list > div { padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.cap-list h3 {
  font-family: var(--mono);
  font-size: var(--t-sm);
  letter-spacing: 0.22em;
  color: var(--amber);
  font-weight: 400;
  margin-bottom: 6px;
}
.cap-list p { color: var(--text-dim); font-size: 15px; max-width: 44ch; }

/* paths */
.paths { border-top: 1px solid var(--line); }
.path {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: clamp(26px, 4vh, 44px) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding-left 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.path:hover { padding-left: 14px; }
.path .idx { font-family: var(--mono); font-size: var(--t-sm); color: var(--muted); }
.path .name {
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.path:hover .name { color: var(--amber-hot); text-shadow: 0 0 40px var(--glow-strong); }
.path .meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--muted); text-align: right; }
.path .meta::after { content: " →"; color: var(--amber); }

/* ---------- work index ---------- */
.page-head { padding: calc(var(--section) + 70px) 0 calc(var(--section) * 0.55); }
.work-list { border-top: 1px solid var(--line); }
.work-row {
  display: grid;
  grid-template-columns: 64px 1.6fr 1fr;
  gap: clamp(18px, 3vw, 40px);
  padding: clamp(28px, 4.5vh, 46px) 0;
  border-bottom: 1px solid var(--line);
}
.work-row .idx { font-family: var(--mono); font-size: var(--t-sm); color: var(--muted); padding-top: 10px; }
.work-row h3 {
  font-size: var(--t-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.work-row:hover h3 { color: var(--amber-hot); text-shadow: 0 0 44px var(--glow-strong); }
.work-row .desc { margin-top: 12px; color: var(--text-dim); max-width: 52ch; font-size: 15.5px; text-wrap: pretty; }
.work-side { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  padding: 4px 9px;
  border-radius: 2px;
  white-space: nowrap;
}
.tag.role { color: var(--amber); border-color: var(--line); }
.ext {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.ext:hover { color: var(--amber-hot); border-color: var(--amber); }
.aside-note {
  margin-top: 34px;
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--muted);
}
.aside-note a { color: var(--text-dim); }
.aside-note a:hover { color: var(--amber-hot); }

/* ---------- experiments ---------- */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.exp-card {
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  text-decoration: none;
  overflow: hidden;
  backdrop-filter: blur(6px);
  transition: border-color 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.exp-card:hover { border-color: rgba(255, 176, 0, 0.4); transform: translateY(-3px); }
/* previews are little phosphor terminals — they stay dark in both themes */
.prev {
  height: 156px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
  background: #100E0A;
}
.prev canvas, .prev svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.prev pre {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.45;
  color: #FFB000;
  overflow: hidden;
  white-space: pre;
}
.prev pre .g { color: #53F26B; }
.prev pre .d { color: #8C8470; }
.exp-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.exp-body .lang { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.18em; color: var(--amber); }
.exp-body h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; transition: color 0.25s ease; }
.exp-card:hover h3 { color: var(--amber-hot); }
.exp-body p { font-size: 14px; color: var(--text-dim); line-height: 1.55; flex: 1; }
.exp-body .repo {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 6px;
}
.exp-card:hover .repo { color: var(--green); }

/* ---------- blog ---------- */
.post-list { border-top: 1px solid var(--line); max-width: 860px; }
.post {
  display: block;
  padding: clamp(28px, 4.5vh, 44px) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.post .meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  display: flex;
  gap: 18px;
  margin-bottom: 14px;
}
.post h3 {
  font-size: var(--t-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  max-width: 20ch;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.post:hover h3 { color: var(--amber-hot); text-shadow: 0 0 44px var(--glow-strong); }
.post .excerpt {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--text-dim);
  max-width: 58ch;
  text-wrap: pretty;
}
.post .read { margin-top: 16px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; color: var(--amber); }

/* ---------- article ---------- */
.article-hero {
  position: relative;
  padding: 200px 0 90px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.article-hero .wrap { position: relative; z-index: 1; }
.article-hero h1 {
  font-size: var(--t-2xl);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 700;
  max-width: 17ch;
  text-wrap: balance;
  text-shadow: 0 0 50px var(--glow-soft);
}
.article-hero .meta {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: var(--t-sm);
  letter-spacing: 0.16em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.article-hero .meta b { color: var(--amber); font-weight: 400; }
article.body {
  max-width: 72ch;
  margin: 0 auto;
  padding: 70px var(--gutter) 40px;
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.75;
  color: var(--text);
}
article.body > p { margin-bottom: 1.5em; text-wrap: pretty; }
article.body .lead { font-size: 21px; color: var(--text); }
article.body h2 {
  font-family: var(--display);
  font-size: 27px;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 2.2em 0 0.8em;
}
article.body h2 .h-idx { font-family: var(--mono); font-size: 14px; color: var(--amber); font-weight: 400; margin-right: 12px; letter-spacing: 0.1em; }
article.body a { color: var(--amber-hot); text-decoration: none; border-bottom: 1px solid var(--line); }
article.body a:hover { border-color: var(--amber); }
article.body strong { color: var(--text); }
article.body code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--amber-hot);
}
/* code blocks stay phosphor-dark in both themes */
article.body pre {
  background: #0D0C08;
  border: 1px solid rgba(237, 230, 214, 0.09);
  border-left: 2px solid rgba(255, 176, 0, 0.2);
  border-radius: 4px;
  padding: 20px 22px;
  margin: 1.8em 0;
  overflow-x: auto;
}
article.body pre code {
  background: none; border: 0; padding: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: #B5AC97;
  display: block;
}
/* syntax tokens */
pre .cm { color: #6F6753; font-style: italic; }
pre .st { color: #9FD98F; }
pre .fl { color: #FFB000; }
pre .cd { color: #EDE6D6; font-weight: 500; }
pre .vr { color: #FFCE54; }
.pullquote {
  margin: 2.2em 0;
  padding-left: 22px;
  border-left: 2px solid var(--amber);
  font-size: 23px;
  line-height: 1.45;
  color: var(--text);
  font-style: italic;
}
.article-end {
  max-width: 72ch;
  margin: 0 auto;
  padding: 0 var(--gutter) 90px;
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--muted);
}
.article-end a { color: var(--text-dim); }
.article-end a:hover { color: var(--amber-hot); }

/* ---------- footer ---------- */
footer.contact {
  border-top: 1px solid var(--line);
  padding: var(--section) 0 46px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--ink) 70%, transparent));
}
footer.contact .kicker { margin-bottom: 16px; }
footer.contact h2 {
  font-size: var(--t-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 16ch;
  line-height: 1.08;
}
.mail {
  display: inline-block;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: clamp(16px, 2.4vw, 24px);
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  transition: color 0.25s ease, border-color 0.25s ease, text-shadow 0.25s ease;
}
.mail:hover { color: var(--amber-hot); border-color: var(--amber); text-shadow: 0 0 30px var(--glow-strong); }
.footer-links { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 34px; }
.footer-links a {
  font-family: var(--mono);
  font-size: var(--t-sm);
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.25s ease;
}
.footer-links a:hover { color: var(--amber-hot); }
.footer-links a::after { content: " ↗"; color: var(--muted); }
.colophon {
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  justify-content: space-between;
}

/* ---------- reveal choreography ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
.fx { opacity: 0; transform: translateY(14px); }
body.ready .fx { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
body.ready .fx.d1 { animation-delay: 0.15s; }
body.ready .fx.d2 { animation-delay: 0.35s; }
body.ready .fx.d3 { animation-delay: 0.6s; }
body.ready .fx.d4 { animation-delay: 1s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .fx, .reveal { opacity: 1; transform: none; transition: none; }
  body.ready .fx { animation: none; }
  .path, .path:hover { transition: none; padding-left: 0; }
  .exp-card, .exp-card:hover { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; }
  .work-row { grid-template-columns: 1fr; gap: 10px; }
  .work-row .idx { padding-top: 0; }
  .work-side { padding-top: 4px; }
  .path { grid-template-columns: 44px 1fr; }
  .path .meta { grid-column: 2; text-align: left; }
}
@media (max-width: 640px) {
  .brand span { display: none; }
  .hero-hint { display: none; }
  .article-hero { padding-top: 150px; }
  article.body { font-size: 17px; }
}
