/* =========================================================
   TOKENS
   ========================================================= */
:root {
  /* color */
  --ink:      #0E1116;   /* page background */
  --panel:    #171B22;   /* card / panel background */
  --panel-2:  #1D222B;   /* raised panel */
  --line:     #2A2F3A;   /* hairline borders */
  --paper:    #E8EAED;   /* primary text */
  --muted:    #8A93A3;   /* secondary text */
  --signal:   #5EEAD4;   /* primary accent — "signal" teal */
  --signal-dim: #2E7A70; /* dimmed teal for borders/backgrounds */
  --warn:     #F5A623;   /* secondary accent — "warning" amber */
  --danger:   #E5484D;   /* off status */

  /* type */
  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* layout */
  --maxw: 1120px;
  --radius: 6px;
  --gap: 24px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

/* =========================================================
   SIGNATURE ELEMENT — status light / spec strip
   ========================================================= */
.light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.light--on   { background: var(--signal); box-shadow: 0 0 8px 1px rgba(94,234,212,0.55); }
.light--warn { background: var(--warn); box-shadow: 0 0 8px 1px rgba(245,166,35,0.5); }
.light--off  { background: var(--muted); }

.spec-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.spec-bar__item { display: flex; align-items: center; gap: 8px; }
.spec-bar__item b { color: var(--paper); font-weight: 500; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14,17,22,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-header__brand {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--paper);
  white-space: nowrap;
}
.site-header__brand span { color: var(--signal); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: color .15s ease, background .15s ease;
}
.site-nav a:hover { color: var(--paper); background: var(--panel); }
.site-nav a.is-active { color: var(--signal); }

.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.lang-toggle:hover { border-color: var(--signal-dim); color: var(--paper); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  width: 38px;
  height: 34px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
  }
  .nav-toggle { display: block; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at top right, rgba(94,234,212,0.06), transparent 60%);
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--paper);
  max-width: 14ch;
}
.hero__tagline {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 52ch;
  margin: 0 0 32px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn--primary { background: var(--signal); color: #06211D; font-weight: 600; }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { border-color: var(--line); color: var(--paper); }
.btn--ghost:hover { border-color: var(--signal-dim); }

/* =========================================================
   PROJECT GRID / MODULE CARDS
   ========================================================= */
.section { padding: 72px 0; }
.section--panel { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { margin-bottom: 40px; max-width: 60ch; }
.section__head p { color: var(--muted); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}
@media (max-width: 760px) {
  .project-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--signal-dim); transform: translateY(-2px); }

.card__media {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1A2029, #12151B);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__title { font-size: 1.25rem; margin: 0; }
.card__tags {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.card__desc { color: var(--muted); font-size: 0.93rem; margin: 0; flex: 1; }
.card__link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.card__link:hover { text-decoration: underline; }

/* =========================================================
   ABOUT
   ========================================================= */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }
.about p { color: var(--muted); max-width: 62ch; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
}
.about__panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.about__panel h3 { font-size: 0.95rem; margin-bottom: 16px; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.link-list a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.link-list a:hover { color: var(--signal); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.site-footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.site-footer__social { display: flex; gap: 16px; }
.site-footer__social a:hover { color: var(--signal); }

/* =========================================================
   PROJECT DETAIL PAGES
   ========================================================= */
.detail-banner {
  aspect-ratio: 21/8;
  background: linear-gradient(135deg, #1A2029, #12151B);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}
.detail-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-banner__overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(0deg, rgba(14,17,22,0.92), rgba(14,17,22,0));
  padding: 60px 0 24px;
}
.detail-banner__overlay .wrap { max-width: var(--maxw); }
.detail-banner h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 6px; }
.detail-banner__sub { color: var(--muted); font-family: var(--font-mono); font-size: 0.85rem; }

.detail-links { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 0; }

.prose { max-width: 74ch; }
.prose p { color: var(--muted); margin: 0 0 1.1em; }
.prose h2 { font-size: 1.5rem; margin-top: 0; }

.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 24px; }
@media (max-width: 700px) { .feature-list { grid-template-columns: 1fr; } }
.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature__media {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1A2029, #12151B);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__body { padding: 20px 22px; }
.feature h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.feature p { color: var(--muted); margin: 0; font-size: 0.94rem; }

.debug-box {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background: #12151B;
  border: 1px solid var(--signal-dim);
  border-radius: var(--radius);
  padding: 22px 24px;
  color: var(--muted);
  margin-top: 24px;
}
.debug-box__title {
  color: var(--warn);
  margin-bottom: 12px;
  display: block;
}
.debug-box p { margin: 0; line-height: 1.7; }

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 28px 0 0;
  margin-top: 56px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.project-nav a { color: var(--muted); }
.project-nav a:hover { color: var(--signal); }

/* image placeholder (visible until real assets are dropped in) */
.img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.55;
}
.img-placeholder svg { width: 34px; height: 34px; opacity: 0.6; }

/* reveal-on-scroll (respects reduced motion via the block at top) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
