/* ─── RESET ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #0c0b09;
  --bg2:     #141210;
  --bg3:     #1b1916;
  --text:    #d8cfc4;
  --muted:   #968b80;
  --border:  rgba(255,255,255,0.1);
  --koi:     #e05a20;
  --koi-dim: rgba(224,90,32,0.18);
  --font:    'Space Mono', monospace;
  --max:     1080px;
  --edge:    clamp(18px, 4vw, 40px);
  --section: clamp(72px, 10vw, 100px);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.68;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ─── NAV ────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: rgba(12,11,9,0.92);
  backdrop-filter: blur(14px);
  border-color: var(--border);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--edge);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand { display: flex; align-items: baseline; gap: 12px; }

.brand-koi {
  font-size: 17px;
  font-weight: 700;
  color: var(--koi);
  letter-spacing: 0.06em;
}

.brand-full {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-links { display: flex; gap: clamp(16px, 3vw, 28px); }

.nav-links a {
  font-size: 11px;
  color: rgba(216,207,196,0.68);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

/* ─── HERO ───────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 56px;
}

#koi-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 10vw, 88px) var(--edge);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(32px, 7vw, 72px);
  width: 100%;
}

.hero-text {
  flex: 1 1 360px;
  max-width: 560px;
}

.hero-note {
  margin-bottom: 14px;
  color: #f0bb96;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.9;
}

.hero-text h1 {
  font-size: clamp(5.5rem, 13vw, 11rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 10px;
}

.spell {
  font-size: 12px;
  color: var(--koi);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.tagline {
  font-size: 1.02rem;
  color: rgba(216,207,196,0.8);
  line-height: 1.8;
}

.hero-summary {
  margin-top: 22px;
  max-width: 38rem;
}

.hero-summary p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.85;
}

.hero-summary p + p {
  margin-top: 14px;
  color: rgba(216,207,196,0.68);
}

/* ─── GRID WIDGET ────────────────────────────────── */
.grid-label {
  font-size: 9px;
  color: rgba(216,207,196,0.64);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.sq-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  width: 100%;
}

#demo-grid { max-width: 260px; }

.cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg2);
  border: 1px solid var(--border);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

/* ─── DEMO ───────────────────────────────────────── */
#motivation {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.motivation-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.motivation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 0 var(--edge);
}

.motivation-card {
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
}

.motivation-card h3 {
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.motivation-card p {
  font-size: 12px;
  color: rgba(216,207,196,0.72);
  line-height: 1.9;
}

/* ─── DEMO ───────────────────────────────────────── */
#demo {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.demo-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--edge);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(28px, 5vw, 52px);
  align-items: stretch;
}

.demo-scene-col,
.demo-grid-col {
  min-width: 0;
  padding: 14px 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20,18,16,0.96), rgba(12,11,9,0.9));
  box-shadow: 0 18px 38px rgba(0,0,0,0.24);
}

.demo-grid-col {
  width: min(100%, 260px);
}

#scene-canvas {
  width: 100%;
  height: clamp(260px, 38vw, 340px);
  display: block;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: #120f0b;
}

.demo-grid-frame {
  display: grid;
  grid-template-columns: 16px 1fr;
  grid-template-rows: 1fr 16px;
  column-gap: 10px;
  row-gap: 8px;
  align-items: end;
}

.demo-grid-frame #demo-grid {
  grid-column: 2;
  grid-row: 1;
}

.demo-axis {
  font-size: 8px;
  color: rgba(216,207,196,0.58);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.demo-axis-y {
  grid-column: 1;
  grid-row: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  align-self: center;
}

.demo-axis-x {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 9px;
  color: rgba(216,207,196,0.66);
  letter-spacing: 0.08em;
}

.legend-bar {
  flex: 1;
  height: 3px;
  background: linear-gradient(90deg, #2a211a, #ff8740);
  border-radius: 1px;
}

/* ─── SYSTEM ─────────────────────────────────────── */
#system {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: var(--max);
  margin: 0 auto 32px;
  padding: 0 var(--edge);
}

.section-kicker {
  font-size: 10px;
  color: var(--koi);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.15;
  margin-bottom: 14px;
}

.section-copy {
  max-width: 48rem;
  color: rgba(216,207,196,0.72);
  font-size: 0.96rem;
  line-height: 1.9;
}

.system-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--edge);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.step {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
}

.step-num {
  font-size: 10px;
  color: var(--koi);
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}

.step h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.4;
}

.step p {
  font-size: 12px;
  color: rgba(216,207,196,0.72);
  line-height: 1.9;
}

#team {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.team-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 0 var(--edge);
}

.team-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  align-items: center;
}

.team-photo {
  width: 88px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  display: block;
  grid-row: 1 / span 3;
}

.team-card h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.team-card p {
  font-size: 12px;
  color: rgba(216,207,196,0.72);
  line-height: 1.8;
}

/* ─── FOOTER ─────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px var(--edge);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-koi {
  font-size: 15px;
  font-weight: 700;
  color: var(--koi);
  letter-spacing: 0.06em;
}

.footer-copy {
  font-size: 10px;
  color: rgba(216,207,196,0.58);
  letter-spacing: 0.08em;
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 980px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-top: clamp(190px, 28vw, 260px);
  }

  .demo-grid-col {
    width: min(100%, 260px);
  }

  .demo-scene-col {
    width: 100%;
  }

  .demo-inner {
    grid-template-columns: 1fr;
  }

  .motivation-grid {
    grid-template-columns: 1fr;
  }

  .system-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .step {
    padding: 22px 24px;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .brand-full  { display: none; }
  .tagline     { max-width: 34ch; }
  .section-head { margin-bottom: 24px; }

  #koi-canvas {
    clip-path: inset(0 0 52% 28%);
    opacity: 0.58;
  }
}

@media (max-width: 480px) {
  :root {
    --edge: 22px;
  }

  nav {
    height: 60px;
  }

  #hero {
    padding-top: 60px;
    align-items: flex-start;
  }

  #koi-canvas {
    clip-path: inset(0 0 60% 0);
    opacity: 0.7;
  }

  .nav-links a {
    font-size: 10px;
  }

  .hero-inner {
    padding-top: 208px;
    padding-bottom: 56px;
  }

  .hero-text h1 {
    font-size: clamp(3.8rem, 24vw, 4.8rem);
  }

  .hero-note {
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  .spell {
    letter-spacing: 0.16em;
  }

  .tagline {
    font-size: 1rem;
    line-height: 1.75;
  }

  .hero-summary {
    margin-top: 18px;
  }

  .hero-summary p,
  .section-copy {
    font-size: 0.9rem;
    line-height: 1.8;
  }

  .motivation-card p,
  .step p,
  .team-card p {
    font-size: 11px;
  }

  #demo-grid {
    max-width: 220px;
  }

  .demo-grid-frame {
    column-gap: 8px;
  }

  .demo-axis {
    font-size: 7px;
  }

  #scene-canvas {
    height: 240px;
  }

  .step {
    padding: 18px 18px 20px;
  }

  .motivation-card {
    padding: 18px 18px 20px;
  }

  .team-card {
    padding: 18px 18px 20px;
    grid-template-columns: 64px 1fr;
    gap: 14px;
    align-items: start;
  }

  .team-photo {
    width: 64px;
  }

  .footer-inner {
    align-items: flex-start;
    gap: 6px;
    flex-direction: column;
  }
}
