:root {
  --ink: #0e1714;
  --ink-soft: #1a2924;
  --panel: #15221e;
  --line: rgba(140, 190, 170, 0.18);
  --mist: #8fbcad;
  --jade: #5fad8e;
  --jade-bright: #7fd4ad;
  --warm: #e8c27a;
  --paper: #e8f0ec;
  --muted: #8aa39a;
  --danger: #e07a6a;
  --radius: 2px;
  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--font-body);
  background: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

/* ——— Atmosphere ——— */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 70% 10%, rgba(95, 173, 142, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 10% 80%, rgba(232, 194, 122, 0.08), transparent 50%),
    linear-gradient(180deg, #0c1411 0%, #0e1714 40%, #0b1210 100%);
}

.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* ——— Nav ——— */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  animation: rise 0.9s var(--ease) both;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.nav-brand span {
  color: var(--jade-bright);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--paper);
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: calc(100vh - 4rem);
  display: grid;
  align-items: end;
  padding-bottom: 4.5rem;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  max-width: 34rem;
  animation: rise 1s var(--ease) 0.12s both;
}

.hero-brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 10vw, 6.2rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.hero-brand em {
  font-style: normal;
  color: var(--jade-bright);
}

.hero-lead {
  margin: 0 0 1.75rem;
  max-width: 26rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--jade);
  color: var(--ink);
  font-weight: 650;
}

.btn-primary:hover {
  background: var(--jade-bright);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--paper);
}

.btn-ghost:hover {
  border-color: var(--mist);
}

/* ——— Tools section ——— */
.tools {
  padding: 5rem 0 6rem;
}

.section-head {
  margin-bottom: 2rem;
  animation: rise 0.8s var(--ease) both;
}

.section-head h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
}

.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tool-tab {
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.tool-tab:hover {
  color: var(--paper);
  border-color: var(--mist);
}

.tool-tab.active {
  color: var(--ink);
  background: var(--jade);
  border-color: var(--jade);
  font-weight: 650;
}

.tool-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1rem;
  min-height: 480px;
  background: linear-gradient(160deg, rgba(26, 41, 36, 0.9), rgba(14, 23, 20, 0.95));
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.canvas-pane {
  position: relative;
  min-height: 420px;
  background:
    radial-gradient(circle at 30% 20%, rgba(95, 173, 142, 0.08), transparent 45%),
    #0a1210;
}

.canvas-pane canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  cursor: crosshair;
}

.controls {
  padding: 1.15rem 1.1rem 1.35rem;
  border-left: 1px solid var(--line);
  background: rgba(10, 18, 16, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.controls h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.controls .hint {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus,
.field select:focus {
  border-color: var(--jade);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--jade);
}

.field .value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--warm);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.chip:hover {
  border-color: var(--jade);
  color: var(--jade-bright);
}

.readout {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mist);
  line-height: 1.7;
  white-space: pre-wrap;
}

.panel[hidden] {
  display: none !important;
}

/* ——— Footer ——— */
.footer {
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.footer-copy {
  margin: 0;
  max-width: 46rem;
  line-height: 1.6;
}

.footer-icp {
  color: var(--jade);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.footer-icp:hover {
  color: var(--jade-bright);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .tool-stage {
    grid-template-columns: 1fr;
  }

  .controls {
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: calc(100vh - 3.5rem);
    padding-bottom: 3rem;
  }
}
