/* ==========================================================================
   TOKENS
   ========================================================================== */
:root {
  --ink:        #0B0E14;
  --ink-2:      #12161F;
  --paper:      #ECE8DE;
  --paper-dim:  #C9C4B6;
  --signal:     #6BFFB8;
  --amber:      #FF8A3D;
  --wire:       #2B3140;
  --wire-soft:  #1A1F2B;
  --text-soft:  #A8AFC0;
  --text-dim:   #626B80;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius: 2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

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

a { color: inherit; }

::selection { background: var(--signal); color: var(--ink); }

/* ==========================================================================
   DECORATIVE CORNER TICKS
   ========================================================================== */
.tick {
  position: fixed;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 14px;
  z-index: 5;
  pointer-events: none;
  user-select: none;
}
.tick--tl { top: 16px; left: 16px; }
.tick--tr { top: 16px; right: 16px; }
.tick--bl { bottom: 16px; left: 16px; }
.tick--br { bottom: 16px; right: 16px; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  border-bottom: 1px solid var(--wire);
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--paper);
}

.brand__mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: conic-gradient(from 90deg, var(--signal), var(--amber), var(--signal));
  display: inline-block;
}

.site-nav {
  display: flex;
  gap: 32px;
  font-size: 14px;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-soft);
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--signal); }

.readout {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .site-header { padding: 20px 24px; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  padding: 72px 48px 96px;
  max-width: 1280px;
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--signal);
  margin: 0 0 20px;
}

.eyebrow--center { text-align: center; }

.hero__intro {
  max-width: 640px;
  margin-bottom: 56px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

.hero__lead {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 52ch;
  margin: 0;
}

/* ---- studio layout ---- */
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
}

/* ---- instrument (canvas) ---- */
.instrument__frame {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--wire);
  padding: 24px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.instrument__frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--ink);
}

.instrument__corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid var(--signal);
  opacity: 0.7;
}
.instrument__corner--tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.instrument__corner--tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.instrument__corner--bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.instrument__corner--br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.instrument__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

#seedValue, #paletteValue { color: var(--text-soft); }

/* ---- control panel ---- */
.panel {
  background: var(--ink-2);
  border: 1px solid var(--wire);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.control-group__label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin: 0 0 12px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--wire);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.option:hover { border-color: var(--text-soft); color: var(--paper); }

.option.is-active {
  border-color: var(--signal);
  color: var(--ink);
  background: var(--signal);
}

.action-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.1s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--signal);
  color: var(--ink);
}
.btn--primary:hover { opacity: 0.9; }

.btn__key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

.btn--ghost {
  background: transparent;
  border-color: var(--wire);
  color: var(--paper);
  justify-content: center;
}
.btn--ghost:hover { border-color: var(--paper); }

.panel__hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
}

kbd {
  font-family: var(--font-mono);
  background: var(--wire-soft);
  border: 1px solid var(--wire);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
}

/* ==========================================================================
   HOW IT WORKS
   ========================================================================== */
.how {
  background: var(--paper);
  color: var(--ink);
  padding: 96px 48px;
}

.how__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 42px);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
  letter-spacing: -0.01em;
}

.how .eyebrow--center { color: #8A6A4A; }

.how__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .how__grid { grid-template-columns: 1fr; gap: 48px; }
}

.how__step {
  border-top: 2px solid var(--ink);
  padding-top: 20px;
}

.how__index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  display: block;
  margin-bottom: 12px;
}

.how__step h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 10px;
}

.how__step p {
  margin: 0;
  color: #4A4740;
  font-size: 15px;
}

/* ==========================================================================
   GALLERY
   ========================================================================== */
.gallery {
  padding: 96px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

.gallery__head { margin-bottom: 40px; max-width: 540px; }

.gallery__head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.5vw, 34px);
  margin: 0 0 12px;
}

.gallery__lead {
  color: var(--text-soft);
  margin: 0;
  font-size: 15px;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.gallery__empty {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  padding: 32px 0;
}

.specimen {
  aspect-ratio: 1 / 1;
  background: var(--ink-2);
  border: 1px solid var(--wire);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.specimen:hover { border-color: var(--signal); transform: translateY(-2px); }

.specimen img { width: 100%; height: 100%; display: block; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 48px 48px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  border-top: 1px solid var(--wire);
  flex-wrap: wrap;
  gap: 12px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { color: var(--signal); }

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