/* ============================================================
   OnChain Mycos — "Mycelium Field-Lab" aesthetic
   Dark forest-floor · bioluminescent spore-green · specimen art
   ============================================================ */
:root {
  --bg: #0a0d09;
  --bg-soft: #0f130d;
  --panel: rgba(20, 26, 17, 0.66);
  --panel-solid: #141a12;
  --line: rgba(192, 204, 160, 0.12);
  --line-strong: rgba(192, 204, 160, 0.26);
  --ink: #ECE8D6;
  --ink-dim: #9aa188;
  --ink-faint: #6a7060;
  --glow: #7DE8A8;
  --glow-2: #49c486;
  --amber: #FFB24D;
  --red: #E0463F;
  --display: "Fraunces", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pixel: "Pixelify Sans", var(--mono);
  --r: 14px;
  --r-sm: 9px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(120% 90% at 50% -10%, #16200f 0%, var(--bg) 55%, #06080a 100%);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--glow); }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--glow);
  background: rgba(125, 232, 168, 0.08);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(125, 232, 168, 0.16);
}
.hidden { display: none !important; }

/* background layers */
#bg-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0.9;
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
main, .site-header, .site-footer { position: relative; z-index: 2; }

/* typography helpers */
.display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.04;
  margin: 0;
}
.mono-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint);
}
.mono-val { font-family: var(--mono); font-size: 13px; color: var(--ink); }

/* pixel art tiles */
.art svg, .specimen-art svg, .colony-art svg, .stage-art svg, .sp-art svg {
  width: 100%; height: auto; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; gap: 24px;
  max-width: var(--maxw); margin: 0 auto; padding: 22px 28px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; display: block;
  background: #0e120c; border: 1px solid var(--line-strong);
  box-shadow: 0 0 18px rgba(125, 232, 168, 0.18);
}
.brand-mark svg { width: 100%; height: 100%; image-rendering: pixelated; border-radius: 6px; }
.brand-name { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.brand-dot { color: var(--glow); }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-dim); transition: color 0.2s;
}
.nav a:hover { color: var(--glow); }
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line-strong);
  background: #0c100a; border-radius: var(--r-sm); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { width: 17px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.25s, opacity 0.2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.btn {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  padding: 10px 18px; border-radius: var(--r-sm); cursor: pointer;
  transition: transform 0.12s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-wallet { display: inline-flex; align-items: center; gap: 9px; }
.btn-wallet .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); transition: background 0.2s, box-shadow 0.2s; }
.btn-wallet.connected .dot { background: var(--glow); box-shadow: 0 0 9px var(--glow); }
.btn-primary {
  background: linear-gradient(180deg, var(--glow) 0%, var(--glow-2) 100%);
  color: #06160d; border-color: transparent; font-weight: 700;
  box-shadow: 0 6px 26px rgba(125, 232, 168, 0.22), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-primary:hover { box-shadow: 0 8px 34px rgba(125, 232, 168, 0.34); }
.btn-primary:disabled { background: #2a3324; color: var(--ink-faint); box-shadow: none; cursor: not-allowed; }
.btn-ghost { color: var(--ink-dim); }
.btn-ghost:hover { color: var(--glow); border-color: var(--glow); }
.btn-block { width: 100%; padding: 15px; font-size: 15px; }
.btn-sm { padding: 7px 13px; font-size: 12px; }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 28px 70px;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas: "head stage" "rest stage";
  column-gap: 56px; row-gap: 0; align-items: center;
}
.hero-head { grid-area: head; }
.hero-rest { grid-area: rest; }
.hero-stage { grid-area: stage; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim);
  margin: 0 0 22px;
}
.eyebrow .tick { width: 6px; height: 6px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 10px var(--glow); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.hero h1 { font-size: clamp(40px, 6vw, 72px); }
.lede { color: var(--ink-dim); font-size: 15.5px; max-width: 30em; margin: 24px 0 30px; }
.lede b { color: var(--ink); font-weight: 500; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats {
  list-style: none; margin: 44px 0 0; padding: 22px 0 0; display: grid;
  grid-template-columns: repeat(4, auto); gap: 30px; border-top: 1px solid var(--line);
}
.hero-stats .num { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1; }
.hero-stats .num .sub { font-family: var(--mono); font-size: 12px; color: var(--glow); vertical-align: super; margin-left: 2px; }
.hero-stats .lab { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }

/* specimen showcase */
.hero-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.specimen {
  width: min(380px, 86%); aspect-ratio: 1; position: relative; border-radius: 20px;
  background: linear-gradient(180deg, #11160e, #0a0d08);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.02), 0 0 60px rgba(125,232,168,0.06);
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.specimen-art {
  flex: 1; border-radius: 12px; overflow: hidden;
  background: #06080a; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line), 0 0 40px rgba(125,232,168,0.05);
}
.specimen-art svg { width: 100%; }
.specimen-plate { display: flex; align-items: center; justify-content: space-between; }
.stage-badge {
  font-family: var(--pixel); font-size: 16px; color: var(--glow);
  text-transform: lowercase; letter-spacing: 0.04em;
  text-shadow: 0 0 14px rgba(125,232,168,0.4);
}
.specimen-id { font-size: 12px; color: var(--ink-dim); letter-spacing: 0.06em; }
.evo-rail { display: flex; gap: 6px; }
.evo-rail span { flex: 1; height: 3px; border-radius: 3px; background: var(--line-strong); transition: background 0.4s, box-shadow 0.4s; }
.evo-rail span.on { background: var(--glow); box-shadow: 0 0 10px var(--glow); }
.specimen-caption { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.08em; }

/* ---------- section shells ---------- */
section { max-width: var(--maxw); margin: 0 auto; padding: 64px 28px; }
.section-head { margin-bottom: 38px; }
.kicker { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--glow); }
.section-head .display { font-size: clamp(28px, 4vw, 44px); margin-top: 10px; }
.section-sub { color: var(--ink-dim); max-width: 46em; margin: 14px 0 0; font-size: 14.5px; }

.card {
  background: var(--panel); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--r);
}

/* ---------- mint ---------- */
.mint-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.mint-panel { padding: 28px; }
.mint-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-bottom: 22px; }
.supply-bar { height: 8px; border-radius: 6px; background: #0c100a; border: 1px solid var(--line); overflow: hidden; }
.supply-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--glow-2), var(--glow)); box-shadow: 0 0 14px rgba(125,232,168,0.5); transition: width 0.6s ease; }
.mint-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.ms { background: #0c100a; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 15px; display: flex; flex-direction: column; gap: 5px; }
.ms-v { font-family: var(--display); font-size: 19px; font-weight: 600; }
.qty-block { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.qty-btn { width: 42px; height: 42px; background: #0c100a; color: var(--ink); border: none; font-size: 20px; cursor: pointer; transition: background 0.18s; }
.qty-btn:hover { background: rgba(125,232,168,0.12); color: var(--glow); }
.qty-val { width: 50px; text-align: center; font-family: var(--display); font-size: 21px; font-weight: 600; }
.qty-cost { margin-left: auto; color: var(--glow); font-size: 15px; }
.mint-note { font-size: 12.5px; color: var(--ink-faint); margin: 16px 0 0; }
.reveal-strip { margin-top: 18px; padding: 13px 16px; border-radius: var(--r-sm); background: rgba(125,232,168,0.08); border: 1px solid rgba(125,232,168,0.2); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.mint-side { padding: 26px; }
.side-title { font-family: var(--display); font-size: 18px; margin: 0 0 16px; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rules li { font-size: 13px; color: var(--ink-dim); padding-left: 20px; position: relative; }
.rules li::before { content: "◣"; position: absolute; left: 0; color: var(--glow); font-size: 9px; top: 4px; }
.rules b { color: var(--ink); font-weight: 600; }

/* ---------- lifecycle ---------- */
.stages { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stage-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; position: relative; overflow: hidden; transition: transform 0.2s, border-color 0.2s; }
.stage-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.stage-art { background: #06080a; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 14px; }
.stage-no { font-family: var(--pixel); font-size: 13px; color: var(--glow); }
.stage-card h4 { font-family: var(--display); font-size: 19px; margin: 4px 0 6px; }
.stage-card .when { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.stage-card p { font-size: 12.5px; color: var(--ink-dim); margin: 0; }
.stage-arrow { position: absolute; right: -11px; top: 50%; color: var(--glow); font-size: 20px; z-index: 3; opacity: 0.6; }
.mechanics { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mech { padding: 24px; }
.mech-icon { font-size: 24px; }
.mech h4 { font-family: var(--display); font-size: 20px; margin: 12px 0 8px; }
.mech p { color: var(--ink-dim); font-size: 13.5px; margin: 0; }

/* ---------- species ---------- */
.species-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.sp-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; transition: transform 0.2s, border-color 0.2s; }
.sp-card:hover { transform: translateY(-4px); }
.sp-art { background: #06080a; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 12px; }
.sp-name { font-family: var(--display); font-size: 17px; font-weight: 600; }
.sp-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.rarity-chip { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; border: 1px solid currentColor; }
.sp-weight { font-size: 11px; color: var(--ink-faint); margin-left: auto; }

/* ---------- field manual ---------- */
.manual-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
.manual { padding: 24px; position: relative; }
.manual .m-no { font-family: var(--display); font-style: italic; font-size: 15px; color: var(--glow); opacity: 0.8; }
.manual h3 { font-family: var(--display); font-size: 19px; margin: 6px 0 10px; }
.manual p { color: var(--ink-dim); font-size: 13.5px; margin: 0; line-height: 1.66; }
.manual b { color: var(--ink); font-weight: 500; }

.rarity-block { padding: 26px 28px; }
.rarity-head h3 { font-family: var(--display); font-size: 21px; margin: 0 0 4px; }
.rarity-head p { color: var(--ink-dim); font-size: 13px; margin: 0 0 20px; }
.rarity-table { display: flex; flex-direction: column; gap: 9px; }
.rt-row { display: grid; grid-template-columns: 40px 1.3fr auto 2fr 48px 64px; gap: 14px; align-items: center; }
.rt-art { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; background: #06080a; box-shadow: inset 0 0 0 1px var(--line); }
.rt-name { font-family: var(--display); font-size: 15px; font-weight: 500; }
.rt-bar { height: 7px; border-radius: 5px; background: #0c100a; border: 1px solid var(--line); overflow: hidden; }
.rt-fill { height: 100%; border-radius: 5px; opacity: 0.85; }
.rt-pct { font-family: var(--mono); font-size: 13px; text-align: right; color: var(--ink); }
.rt-count { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--ink-faint); }

/* ---------- faq ---------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.faq-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color 0.2s; }
.faq-item.open { border-color: var(--line-strong); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--ink); font-family: var(--display); font-size: 16.5px; font-weight: 500;
  padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq-q:hover { color: var(--glow); }
.faq-tog { font-family: var(--mono); font-size: 20px; color: var(--glow); flex-shrink: 0; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.32s ease; }
.faq-item.open .faq-a { max-height: 280px; }
.faq-a p { color: var(--ink-dim); font-size: 13.5px; line-height: 1.7; margin: 0; padding: 0 22px 20px; }
.faq-a b { color: var(--ink); font-weight: 500; }

@media (max-width: 920px) {
  .manual-grid { grid-template-columns: 1fr 1fr; }
  .rt-row { grid-template-columns: 36px 1fr auto 52px; }
  .rt-bar, .rt-count { display: none; }
}
@media (max-width: 560px) { .manual-grid { grid-template-columns: 1fr; } }

/* ---------- collection ---------- */
.placeholder { color: var(--ink-dim); text-align: center; padding: 50px 0; font-size: 14px; }
.colony-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.colony-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.colony-art { background: #06080a; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 12px; }
.colony-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.colony-id { font-family: var(--display); font-weight: 600; font-size: 16px; }
.colony-stage { font-family: var(--pixel); font-size: 14px; color: var(--glow); }
.colony-attrs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.attr-chip { font-size: 10px; color: var(--ink-dim); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; }
.colony-cooldown { font-size: 11px; color: var(--ink-faint); margin-bottom: 10px; }
.colony-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.colony-actions .btn { flex: 1; min-width: 0; }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--maxw); margin: 40px auto 0; padding: 40px 28px;
  border-top: 1px solid var(--line); display: flex; justify-content: space-between;
  gap: 30px; flex-wrap: wrap; align-items: flex-end;
}
.foot-left p { color: var(--ink-faint); font-size: 12.5px; margin: 8px 0 0; }
.foot-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.foot-right a { color: var(--glow); font-size: 13px; }
.foot-note { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 50; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-left: 3px solid var(--glow);
  border-radius: var(--r-sm); padding: 13px 18px; font-size: 13px; color: var(--ink);
  max-width: 340px; box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  animation: toastIn 0.3s ease; backdrop-filter: blur(10px);
}
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* reveal-on-scroll */
.reveal-up { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-up.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .site-header { padding: 16px 18px; gap: 12px; }
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 70px; right: 18px; left: 18px; z-index: 30;
    flex-direction: column; gap: 4px; margin-left: 0; padding: 10px;
    background: var(--panel-solid); border: 1px solid var(--line-strong);
    border-radius: var(--r); box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    display: none;
  }
  .nav.open { display: flex; animation: toastIn 0.22s ease; }
  .nav a { padding: 12px 14px; border-radius: var(--r-sm); }
  .nav a:hover { background: rgba(125,232,168,0.08); }
  .hero { grid-template-columns: 1fr; grid-template-areas: "head" "stage" "rest"; row-gap: 26px; padding-top: 24px; }
  .hero-head h1 { font-size: clamp(34px, 9vw, 52px); }
  .specimen { width: min(330px, 82%); }
  .mint-grid { grid-template-columns: 1fr; }
  .stages { grid-template-columns: 1fr 1fr; }
  .species-grid { grid-template-columns: 1fr 1fr; }
  .mechanics { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  section { padding: 48px 18px; }
  .hero { padding: 24px 18px 50px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 20px; }
  .stages, .species-grid { grid-template-columns: 1fr 1fr; }
  .stage-arrow { display: none; }
  .qty-cost { margin-left: 0; width: 100%; }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .foot-right { align-items: flex-start; }
}
@media (max-width: 400px) {
  .stages, .species-grid { grid-template-columns: 1fr; }
}
