/* ── Digital Biology — Site Styles ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --black:    #080808;
  --bg:       #0d0d0d;
  --bg-off:   #141414;
  --bg-card:  #1a1a1a;
  --rule:     #252525;
  --mid:      #666666;
  --text:     #d8d8d8;
  --white:    #f0f0f0;

  /* FP colors */
  --fp-azurite:     #2255cc;
  --fp-mturquoise2: #00cccc;
  --fp-sfgfp:       #44dd44;
  --fp-venus:       #dddd00;
  --fp-mko2:        #ff8800;
  --fp-mscarlet:    #ee2222;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }

/* ── NAV ── */
nav {
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  position: sticky;
  top: 0;
  background: rgba(13,13,13,0.96);
  backdrop-filter: blur(8px);
  z-index: 200;
}

.logo {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--white);
  text-transform: uppercase;
}
.logo span { color: var(--fp-sfgfp); }

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); opacity: 1; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 24px;
  border: 1px solid var(--white);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  background: var(--white);
  color: #000;
  white-space: nowrap;
}
.btn:hover { background: transparent; color: var(--white); opacity: 1; }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: var(--rule);
}
.btn-ghost:hover { border-color: var(--white); background: transparent; opacity: 1; }
.btn:disabled, .btn[disabled] { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.btn-sm { padding: 7px 16px; font-size: 11px; }
.btn-accent {
  background: var(--fp-sfgfp);
  border-color: var(--fp-sfgfp);
  color: #000;
}
.btn-accent:hover { background: transparent; color: var(--fp-sfgfp); }

/* ── LAYOUT ── */
.page { max-width: 1400px; margin: 0 auto; padding: 40px 40px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ── TYPOGRAPHY ── */
h1 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.15;
  color: var(--white);
  letter-spacing: -0.02em;
}
h2 {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 28px);
  color: var(--white);
  letter-spacing: -0.01em;
}
h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
}
.eyebrow {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
}
.section-sub {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.75;
  max-width: 58ch;
}
.text-muted { color: var(--mid); }
.text-green { color: var(--fp-sfgfp); }
.mono { font-family: 'Space Mono', monospace; }

/* ── PIXEL CANVAS GRID ── */
.canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#pixel-canvas {
  display: grid;
  grid-template-columns: repeat(48, 1fr);
  grid-template-rows: repeat(32, 1fr);
  width: 100%;
  max-width: 960px;
  aspect-ratio: 48 / 32;
  background: #000;
  border: 1px solid var(--rule);
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.px {
  border: 0.5px solid rgba(255,255,255,0.04);
  transition: filter 0.1s;
  position: relative;
}
.px:hover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(200, 200, 200, 0.22);
  pointer-events: none;
}
.px:hover {
  z-index: 2;
}
.px.painted {
  border-color: rgba(0,0,0,0.2);
}
.px.selected-brush {
  outline: 1px solid rgba(255,255,255,0.6);
  z-index: 3;
}
.px.purchased {
  cursor: not-allowed !important;
  opacity: 0.5;
}
.px.purchased:hover::after { display: none; }

/* ── PALETTE PANEL ── */
.palette-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  min-width: 200px;
}
.palette-bar h3 {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.fp-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: border-color 0.12s, background 0.12s;
}
.fp-option:hover { background: var(--bg-off); }
.fp-option.active { border-color: var(--white); background: var(--bg-off); }
.fp-option.active .fp-name { color: var(--white); }

.fp-swatch {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--color, #fff);
}
.fp-name {
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--mid);
  line-height: 1;
}
.fp-meta {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  color: var(--mid);
  opacity: 0.6;
}

/* Eraser option */
.fp-option.eraser .fp-swatch {
  background: var(--bg);
  border: 1px dashed var(--mid);
  box-shadow: none;
}

/* ── TOOLS ROW ── */
.tools-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tool-btn {
  padding: 6px 14px;
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  letter-spacing: 0.08em;
  border: 1px solid var(--rule);
  color: var(--mid);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.tool-btn:hover { border-color: var(--white); color: var(--white); }
.tool-btn.active { border-color: var(--white); color: var(--white); background: var(--bg-card); }

/* ── CART / CHECKOUT PANEL ── */
.checkout-panel {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 24px;
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.checkout-panel h3 {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.checkout-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.checkout-stat .label {
  font-size: 12px;
  color: var(--mid);
  font-family: 'Inter', sans-serif;
}
.checkout-stat .value {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
}
.checkout-stat.total .value {
  font-size: 28px;
  color: var(--fp-sfgfp);
}
.checkout-divider {
  border: none;
  border-top: 1px solid var(--rule);
}

/* ── FORM ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
}
.form-group input {
  background: var(--bg-off);
  border: 1px solid var(--rule);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.12s;
}
.form-group input:focus { border-color: var(--fp-sfgfp); }
.form-group input::placeholder { color: var(--mid); }

/* ── STATS ROW ── */
.stats-row {
  display: flex;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat-item {
  flex: 1;
  padding: 24px;
  border-right: 1px solid var(--rule);
  text-align: center;
}
.stat-item:last-child { border-right: none; }
.stat-item .n {
  display: block;
  font-size: 28px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-item .l {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  font-family: 'Inter', sans-serif;
}

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--white);
  padding: 10px 22px;
  font-size: 12px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 9999;
  border: 1px solid var(--rule);
  white-space: nowrap;
}
#toast.show { opacity: 1; }

/* ── ABOUT PAGE ── */
.about-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}
.about-text {
  padding: 64px 56px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.about-text p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--mid);
  max-width: 54ch;
}
.about-text p strong { color: var(--white); font-weight: 600; }
.about-text p em { font-style: italic; }
.about-visual {
  background: var(--bg-off);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  min-height: 360px;
}
.step-num {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fp-sfgfp);
  margin-bottom: 12px;
}

/* FP pill list */
.fp-pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fp-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--rule);
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  color: var(--mid);
}
.fp-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--color, #fff);
}

/* ── GALLERY PAGE ── */
.gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 120px 40px;
  text-align: center;
  border: 1px dashed var(--rule);
  margin: 40px;
  min-height: 480px;
}
.gallery-placeholder .big-date {
  font-family: 'Space Mono', monospace;
  font-size: clamp(40px, 8vw, 96px);
  font-weight: 700;
  color: var(--rule);
  letter-spacing: -0.02em;
  line-height: 1;
}
.gallery-placeholder h2 { color: var(--mid); }
.gallery-placeholder p { color: var(--mid); max-width: 50ch; font-size: 14px; line-height: 1.75; }

/* ── SHARE BAR ── */
.share-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
}
.share-bar h3 {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  letter-spacing: 0.06em;
  border: 1px solid var(--rule);
  color: var(--mid);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  text-decoration: none;
  white-space: nowrap;
}
.share-btn:hover { border-color: var(--white); color: var(--white); opacity: 1; }
.share-btn svg { width: 14px; height: 14px; flex-shrink: 0; fill: currentColor; }
.share-btn.copied { border-color: var(--fp-sfgfp); color: var(--fp-sfgfp); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--rule);
  background: var(--black);
  padding: 24px 40px;
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 11px;
  color: var(--mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 64px;
  font-family: 'Inter', sans-serif;
}
footer a { color: var(--mid); }
footer a:hover { color: var(--white); opacity: 1; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  nav { padding: 14px 20px; }
  .page { padding: 24px 20px; }
  footer { padding: 20px 20px; flex-wrap: wrap; }
  .about-block { grid-template-columns: 1fr; }
  .about-text { padding: 40px 24px; border-right: none; border-bottom: 1px solid var(--rule); }
  .about-visual { padding: 32px 24px; min-height: 200px; }
  .canvas-shop-layout { flex-direction: column !important; }
  .palette-bar { min-width: unset; flex-direction: row; flex-wrap: wrap; }
  .checkout-panel { position: static; }
}
