:root {
  --bg: #0b0b0c;
  --panel: #141416;
  --panel-2: #1b1b1d;
  --text: #f5f4ef;
  --muted: #aaa59a;
  --line: rgba(245, 244, 239, 0.14);
  --gold: #d4a84f;
  --gold-2: #f1d28a;
  --green: #5dd39e;
  --red: #ef6f6c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(212, 168, 79, 0.12), transparent 34rem),
    linear-gradient(180deg, #0b0b0c 0%, #101011 52%, #0b0b0c 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 12, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border: 1px solid rgba(212, 168, 79, 0.65);
  background: #111;
  color: var(--gold-2);
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.65rem, 2vw, 1.35rem);
}

nav a,
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
.site-footer a:hover {
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(17rem, 0.82fr) minmax(20rem, 1.18fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
  min-height: calc(100svh - 4.6rem);
  padding: clamp(2rem, 5vw, 4.75rem) clamp(1rem, 4vw, 3rem);
}

.hero-copy {
  max-width: 43rem;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 0.7rem;
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 1.1rem;
  font-size: clamp(3.2rem, 9vw, 7.4rem);
  letter-spacing: 0;
  line-height: 0.91;
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 4.2rem);
  letter-spacing: 0;
  line-height: 1;
}

h3 {
  margin-bottom: 0.65rem;
}

.hero-text,
.section p,
.limits p {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.04rem;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.72rem 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: rgba(212, 168, 79, 0.9);
  background: var(--gold);
  color: #111;
  font-weight: 800;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.35rem;
}

.trust-strip span,
.local-badge {
  border: 1px solid rgba(212, 168, 79, 0.26);
  border-radius: 99rem;
  padding: 0.38rem 0.65rem;
  color: var(--gold-2);
  background: rgba(212, 168, 79, 0.08);
  font-size: 0.82rem;
}

.tool-surface {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgba(20, 20, 22, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tool-topbar,
.controls,
.category-grid,
.action-row {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.tool-topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.tool-topbar h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.panel-kicker {
  margin-bottom: 0.25rem;
}

.controls {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(12rem, 0.55fr);
  gap: 1rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.segmented label {
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: flex;
  min-height: 2.2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.35rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.segmented input:checked + span {
  background: var(--gold);
  color: #111;
  font-weight: 800;
}

.slider-control {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.slider-control input {
  accent-color: var(--gold);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.category-grid label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.91rem;
}

.category-grid input {
  accent-color: var(--gold);
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.editor-pane {
  display: grid;
  min-width: 0;
}

.editor-pane + .editor-pane {
  border-left: 1px solid var(--line);
}

.editor-pane span {
  padding: 0.75rem 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

textarea {
  width: 100%;
  min-height: 23rem;
  resize: vertical;
  border: 0;
  border-top: 1px solid var(--line);
  outline: 0;
  padding: 1rem;
  color: var(--text);
  background: #0e0e10;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.93rem;
  line-height: 1.55;
}

.output-pane textarea {
  background: #111113;
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
  background: #101011;
}

.metrics-band div {
  padding: 1.4rem clamp(1rem, 4vw, 3rem);
}

.metrics-band div + div {
  border-left: 1px solid var(--line);
}

.metrics-band strong,
.metrics-band span {
  display: block;
}

.metrics-band strong {
  color: var(--gold-2);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.metrics-band span {
  margin-top: 0.25rem;
  color: var(--muted);
}

.section {
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem);
}

.section-heading {
  max-width: 58rem;
  margin-bottom: 1.5rem;
}

.example-grid,
.limits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.example-card,
.limits article,
.export-preview {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
}

.example-card {
  display: grid;
  min-height: 11rem;
  padding: 1rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.example-card:hover {
  border-color: rgba(212, 168, 79, 0.65);
}

.example-card span {
  color: var(--gold-2);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.example-card strong {
  align-self: center;
  font-size: 1.2rem;
  line-height: 1.15;
}

.example-card small {
  align-self: end;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(18rem, 0.8fr) minmax(20rem, 1.2fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
  background: #0f0f10;
}

.export-preview {
  overflow: hidden;
}

pre {
  min-height: 15rem;
  margin: 0;
  overflow: auto;
  padding: 1rem;
  color: #e7dfcf;
  font-size: 0.88rem;
  line-height: 1.55;
}

.limits {
  background: #111113;
}

.limits article {
  padding: 1rem;
}

.limits article h3 {
  color: var(--gold-2);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  border: 1px solid rgba(212, 168, 79, 0.45);
  border-radius: 0.5rem;
  background: #151515;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  h1 {
    max-width: 12ch;
  }

  .editor-grid,
  .example-grid,
  .limits-grid {
    grid-template-columns: 1fr;
  }

  .editor-pane + .editor-pane {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: start;
    flex-direction: column;
  }

  .controls,
  .category-grid,
  .metrics-band {
    grid-template-columns: 1fr;
  }

  .metrics-band div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  textarea {
    min-height: 18rem;
  }
}
