﻿:root {
  color-scheme: dark;
  --bg: #0f1412;
  --bg-alt: #111c18;
  --surface: #17211d;
  --surface-soft: #1d2924;
  --ink: #f2f7f1;
  --muted: #9fb0a5;
  --accent: #7ed957;
  --accent-strong: #55b24a;
  --accent-glow: #b7f79b;
  --border: #334239;
  --border-soft: rgba(255, 255, 255, 0.12);
  --border-faint: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.45);
  --shadow-strong: rgba(0, 0, 0, 0.55);
  --grid: rgba(255, 255, 255, 0.04);
  --topbar-bg: rgba(12, 18, 15, 0.88);
  --hint-bg: rgba(20, 30, 26, 0.75);
  --hint-border: rgba(255, 255, 255, 0.18);
  --chip-bg: rgba(18, 26, 22, 0.8);
  --overlay: rgba(8, 12, 10, 0.75);
  --overlay-chip: rgba(255, 255, 255, 0.15);
  --button-surface: #1c2722;
  --widget-bg: #0f1512;
  --slider-track: linear-gradient(90deg, rgba(126, 217, 87, 0.3), rgba(126, 217, 87, 0.08));
  --scroll-offset: 96px;
  --radius: 14px;
  --radius-sm: 10px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4ee;
  --bg-alt: #e2ecdf;
  --surface: #ffffff;
  --surface-soft: #f3f6ef;
  --ink: #1a1f1c;
  --muted: #5a6a60;
  --accent: #2e7d32;
  --accent-strong: #1f5c2e;
  --accent-glow: #9dd46a;
  --border: #1e2a22;
  --border-soft: rgba(30, 42, 34, 0.2);
  --border-faint: rgba(30, 42, 34, 0.12);
  --shadow: rgba(15, 28, 20, 0.2);
  --shadow-strong: rgba(15, 28, 20, 0.25);
  --grid: rgba(24, 34, 28, 0.06);
  --topbar-bg: rgba(247, 244, 238, 0.8);
  --hint-bg: rgba(255, 255, 255, 0.7);
  --hint-border: rgba(30, 42, 34, 0.25);
  --chip-bg: rgba(255, 255, 255, 0.8);
  --overlay: rgba(15, 21, 16, 0.65);
  --overlay-chip: rgba(255, 255, 255, 0.15);
  --button-surface: #ffffff;
  --widget-bg: #f1f4ec;
  --slider-track: linear-gradient(90deg, rgba(46, 125, 50, 0.35), rgba(46, 125, 50, 0.08));
}

html {
  scroll-behavior: smooth;
}

html.theme-transition,
html.theme-transition * {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: linear-gradient(140deg, var(--bg) 0%, var(--bg-alt) 48%, var(--bg) 100%);
  min-height: 100vh;
}

section[id] {
  scroll-margin-top: var(--scroll-offset);
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(180deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-faint);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: "Press Start 2P", monospace;
  font-size: 0.75rem;
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--shadow);
}

.brand-title {
  font-family: "Press Start 2P", monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 20px;
  font-weight: 500;
  align-items: center;
  flex-wrap: wrap;
}

.nav a {
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  border-bottom-color: var(--accent);
}

.cta {
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--accent);
  color: #f7fff0;
  font-weight: 600;
  box-shadow: 4px 4px 0 var(--shadow);
  white-space: nowrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.theme-toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(126, 217, 87, 0.2);
}

.theme-toggle:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--shadow);
}

.nav-toggle {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 88px;
}

.page-narrow {
  max-width: 860px;
  padding-top: 32px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  align-items: start;
  padding: 48px 0 72px;
  animation: rise 0.9s ease both;
}

.hero.hero-single {
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 56px;
}

.hero.hero-single .hero-text {
  max-width: 720px;
}

.hero.hero-single h1 {
  text-wrap: balance;
}

.hero-text {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.eyebrow {
  font-family: "Press Start 2P", monospace;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--accent-strong);
}

h1 {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.9rem, 2.4vw + 1.4rem, 3.2rem);
  line-height: 1.35;
  margin: 16px 0 12px;
}

h2 {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.1rem, 1.4vw + 0.8rem, 1.6rem);
  margin: 0 0 8px;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.hero-hint {
  font-size: 0.95rem;
  color: var(--muted);
  background: var(--hint-bg);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px dashed var(--hint-border);
  max-width: 460px;
}

.hero-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  align-self: start;
}

.hero-preview {
  width: min(100%, 420px);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--shadow-strong);
  padding: 18px;
  display: grid;
  gap: 16px;
  animation: rise 0.9s ease 0.2s both;
  position: relative;
}

.preview-label {
  align-self: start;
  justify-self: start;
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: rgba(157, 212, 106, 0.2);
  color: var(--accent-strong);
}

.hero-preview-note {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.hero-preview-cta {
  white-space: nowrap;
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  font-weight: 600;
}

.preview-canvas {
  position: relative;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: linear-gradient(135deg, #273a2f, #1f2b22);
  height: 210px;
  overflow: hidden;
}

.preview-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
}

.preview-text {
  position: absolute;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  font-family: "Press Start 2P", monospace;
  color: #f5f1e8;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.preview-text.small {
  top: auto;
  bottom: 28px;
  font-size: 0.9rem;
}

.preview-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--chip-bg);
  font-size: 0.85rem;
  font-weight: 600;
}

.panel {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 24px;
  display: grid;
  gap: 20px;
  animation: rise 0.9s ease 0.3s both;
}

.canvas-panel {
  align-self: start;
}

.control-panel {
  align-self: start;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.muted {
  color: var(--muted);
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-section .section-title + .row {
  margin-top: 8px;
}

.panel-section .row + .text-list {
  margin-top: 10px;
}

.text-list .muted {
  padding-top: 4px;
}

.panel-section + .panel-section {
  border-top: 1px solid var(--border-faint);
  padding-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface-soft);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--shadow);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.primary {
  background: var(--accent);
  color: #f4fff0;
}

.btn.secondary {
  background: var(--surface-soft);
}

.btn.ghost {
  background: transparent;
}

.preset-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  margin-bottom: 12px;
}

.preset-row .chip {
  cursor: pointer;
}

.canvas-frame {
  position: relative;
  border: 2px dashed var(--border-soft);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-soft);
  min-height: 260px;
}

.canvas-frame.dragover {
  border-color: var(--accent);
  background: rgba(157, 212, 106, 0.2);
}

#memeCanvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #0f1510;
}

.canvas-overlay {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
  border-radius: 10px;
  background: var(--overlay);
  color: #f5f5ef;
  font-weight: 600;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.canvas-overlay.is-hidden {
  opacity: 0;
}

.overlay-title {
  font-family: "Press Start 2P", monospace;
  font-size: 0.95rem;
}

.overlay-sub span {
  background: var(--overlay-chip);
  padding: 2px 6px;
  border-radius: 6px;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.studio {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 72px;
}

.text-list {
  display: grid;
  gap: 16px;
}

.text-item {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 12px;
  background: var(--surface-soft);
}

.text-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(157, 212, 106, 0.35);
}

.text-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.text-item-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--button-surface);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.icon-btn.danger {
  color: #b42318;
}

.mini-btn {
  border: 1px solid var(--border);
  background: var(--button-surface);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.mini-btn.ghost {
  background: transparent;
}

.text-item textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  padding: 8px;
  font-family: "Space Grotesk", sans-serif;
}

.text-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.text-item label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.text-item select,
.text-item input[type="color"],
.text-item input[type="range"],
.text-item input[type="checkbox"] {
  width: 100%;
}

.toggle-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.snap-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.range-grid {
  display: grid;
  gap: 14px;
  margin-top: 4px;
}

.range-grid + .row {
  margin-top: 8px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: transparent;
  margin: 0;
  accent-color: var(--accent);
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: var(--slider-track);
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  width: 18px;
  margin-top: -5px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 6px 12px var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.04);
  box-shadow: 0 4px 10px var(--shadow-strong);
}

input[type="range"]::-moz-range-track {
  height: 8px;
  background: var(--slider-track);
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}

input[type="range"]::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 6px 12px var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.04);
  box-shadow: 0 4px 10px var(--shadow-strong);
}

.range-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) 1fr minmax(64px, 80px);
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.range-value {
  text-align: right;
  font-weight: 600;
}

.features {
  margin: 0 0 80px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.feature-card {
  background: var(--surface);
  border-radius: 12px;
  border: 2px solid var(--border);
  padding: 20px;
  box-shadow: 6px 6px 0 var(--shadow);
}

.community {
  margin: 0 0 80px;
}

.community-shell {
  margin-top: 24px;
  background: var(--surface);
  border-radius: 16px;
  border: 2px solid var(--border);
  padding: 24px;
  box-shadow: 8px 8px 0 var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 360px);
  gap: 24px;
  align-items: stretch;
}

.community-copy {
  display: grid;
  gap: 12px;
  align-content: start;
}

.community-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.community-embed {
  display: grid;
  gap: 10px;
  justify-items: center;
  align-content: start;
  width: 100%;
}

.widget-frame {
  width: 100%;
  max-width: 360px;
  background: var(--widget-bg);
  border-radius: 14px;
  border: 2px solid var(--border);
  padding: 6px;
  box-shadow: 6px 6px 0 var(--shadow);
}

.widget-frame iframe {
  display: block;
  width: 100%;
  height: 500px;
  border: 0;
  border-radius: 10px;
}

.tiny {
  font-size: 0.85rem;
  text-align: center;
}

.legal-links {
  margin: 0 0 80px;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.link-card {
  border-radius: 12px;
  border: 2px solid var(--border);
  padding: 20px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--shadow);
  display: grid;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.link-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--shadow-strong);
}

.link-arrow {
  font-weight: 600;
  color: var(--accent-strong);
}

.legal {
  margin-bottom: 60px;
}

.legal-card {
  background: var(--surface);
  border-radius: 12px;
  border: 2px solid var(--border);
  padding: 20px;
  box-shadow: 6px 6px 0 var(--shadow);
  display: grid;
  gap: 12px;
}

.legal-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.legal-note {
  background: rgba(157, 212, 106, 0.18);
  border: 1px dashed var(--border-soft);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.legal-placeholder {
  background: rgba(244, 196, 80, 0.18);
  padding: 4px 6px;
  border-radius: 6px;
  display: inline-block;
}

.footer {
  padding: 20px 24px 40px;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.footer-links {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-divider {
  opacity: 0.6;
}

.page-title {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
  margin: 12px 0 4px;
}

.legal-back {
  margin-top: 24px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .hero,
  .studio {
    grid-template-columns: 1fr;
  }

  .panel {
    animation-delay: 0.1s;
  }
}

@media (max-width: 900px) {
  :root {
    --scroll-offset: 128px;
  }

  .topbar-inner {
    flex-wrap: wrap;
  }

  .nav {
    display: none;
  }

  .cta {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  body.nav-open .nav {
    position: absolute;
    top: 72px;
    right: 24px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: grid;
    gap: 10px;
    box-shadow: 6px 6px 0 var(--shadow);
  }
}

@media (max-width: 720px) {
  .page {
    padding: 12px 16px 64px;
  }

  .page-narrow {
    padding-top: 16px;
  }

  .range-row {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .range-value {
    text-align: left;
  }

  .text-item-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .community-shell {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}
