:root {
  color-scheme: light;
  --bg: #f7f8f3;
  --surface: #ffffff;
  --surface-2: #eef5f0;
  --ink: #202421;
  --muted: #66716b;
  --line: #d7ded8;
  --accent: #1f7a5a;
  --accent-2: #225d8f;
  --accent-3: #9b4d37;
  --soft: #e7efe7;
  --shadow: 0 18px 50px rgba(32, 36, 33, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(31, 122, 90, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(34, 93, 143, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 243, 0.92);
  backdrop-filter: blur(16px);
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a,
.nav-toggle,
.nav-link-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--muted);
  background: transparent;
}

.nav-links a:hover,
.nav-toggle:hover,
.nav-link-button:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.nav-toggle {
  display: none;
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 76px 20px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 420px;
  gap: 28px;
  align-items: stretch;
}

.hero-copy {
  min-height: 520px;
  padding: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(231, 239, 231, 0.78)),
    radial-gradient(circle at 80% 30%, rgba(155, 77, 55, 0.14), transparent 36%);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 790px;
  margin-bottom: 22px;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 26px;
  line-height: 1.12;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

h4 {
  margin-bottom: 10px;
  font-size: 18px;
}

.hero-lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}

.hero-actions,
.form-actions,
.output-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button.secondary,
.icon-button {
  color: var(--ink);
  background: var(--surface);
}

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

.hero-panel,
.generator-card,
.output-card,
.ad-box,
.ad-band,
.trend-card,
.example-card,
.seo article,
.blog-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-panel {
  padding: 28px;
  box-shadow: var(--shadow);
}

.instruction {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.instruction p,
.section-heading p,
.form-section p,
.seo p,
.blog-card span {
  color: var(--muted);
  line-height: 1.6;
}

.ad-band {
  max-width: 1180px;
  min-height: 92px;
  margin: 0 auto 26px;
  padding: 18px 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: repeating-linear-gradient(135deg, #ffffff, #ffffff 10px, #f1f4ef 10px, #f1f4ef 20px);
}

.ad-band span,
.ad-box span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-3);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 20px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.trend-groups {
  display: grid;
  gap: 28px;
}

.trend-section h3 {
  margin-bottom: 14px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.trend-card,
.example-card {
  min-height: 240px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.trend-card:hover,
.example-card:hover,
.category-card:hover {
  border-color: rgba(31, 122, 90, 0.55);
  box-shadow: 0 12px 28px rgba(32, 36, 33, 0.1);
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.trend-card p,
.example-card p {
  color: var(--muted);
  line-height: 1.5;
}

.load-link {
  margin-top: auto;
  color: var(--accent);
  font-weight: 800;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.example-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(31, 122, 90, 0.9), rgba(34, 93, 143, 0.74)),
    repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(255, 255, 255, 0.22) 8px, rgba(255, 255, 255, 0.22) 10px);
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.generator-card {
  padding: 24px;
}

.form-section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.form-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.field-label {
  display: block;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 900;
}

textarea,
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  color: var(--ink);
  background: #fbfcfa;
  outline: none;
}

textarea:focus,
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.14);
}

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

.category-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #fbfcfa;
  cursor: pointer;
  text-align: left;
}

.category-card strong {
  display: block;
  margin-bottom: 4px;
}

.category-card span {
  color: var(--muted);
  font-size: 13px;
}

.category-card.active,
.pill.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.category-card.active span {
  color: rgba(255, 255, 255, 0.82);
}

.control-grid {
  display: grid;
  gap: 18px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.negative-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: #fbfcfa;
  color: var(--ink);
  cursor: pointer;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px;
  background: #fbfcfa;
  cursor: pointer;
}

.toggle-card input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.toggle-card strong {
  display: block;
  margin-bottom: 4px;
}

.toggle-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.info-strip {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.info-strip ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.negative-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.negative-chip.active {
  color: #fff;
  background: var(--accent-3);
  border-color: var(--accent-3);
}

.output-column {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 14px;
}

.output-card {
  overflow: hidden;
}

.output-head {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

pre {
  min-height: 560px;
  max-height: 760px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre-wrap;
  color: #d8f1e8;
  background: #17201c;
  font-size: 13px;
  line-height: 1.6;
}

.ad-box {
  min-height: 250px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: repeating-linear-gradient(135deg, #ffffff, #ffffff 10px, #f1f4ef 10px, #f1f4ef 20px);
}

.seo {
  display: grid;
  gap: 16px;
}

.seo article {
  padding: 24px;
}

.steps,
.benefits,
.blog-grid {
  display: grid;
  gap: 12px;
}

.target-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.target-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: var(--surface-2);
}

.target-list b {
  color: var(--accent);
}

code {
  display: block;
  border-radius: 6px;
  padding: 14px;
  overflow-x: auto;
  color: #d8f1e8;
  background: #17201c;
}

.blog-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.blog-card {
  min-height: 160px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-weight: 800;
}

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 60px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--ink);
  font-weight: 700;
}

.legal-note {
  max-width: 520px;
  font-size: 13px;
}

.footer-link-button {
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.footer-link-button:hover {
  color: var(--ink);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 32, 28, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(560px, 100%);
  max-height: min(720px, 86vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 11px;
  color: var(--ink);
  background: #fbfcfa;
  cursor: pointer;
  font-weight: 800;
}

.modal-body {
  padding: 20px;
}

.modal-body p {
  color: var(--muted);
  line-height: 1.65;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .hero-copy {
    min-height: auto;
    padding: 36px;
  }

  .trend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .example-grid,
  .category-grid,
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .output-column {
    position: static;
  }
}

@media (max-width: 720px) {
  .page-layout {
    display: flex;
    flex-direction: column;
  }

  .nav {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    width: 100%;
    display: none;
    flex-wrap: wrap;
    padding-bottom: 8px;
  }

  .nav-links.open {
    display: flex;
  }

  .hero {
    order: 1;
    padding-top: 18px;
    padding-bottom: 8px;
  }

  .hero-copy,
  .hero-panel,
  .generator-card {
    padding: 20px;
  }

  h1 {
    font-size: 29px;
    line-height: 1.08;
    margin-bottom: 12px;
  }

  .hero-lede {
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 16px;
  }

  .hero-panel {
    display: none;
  }

  .workspace {
    order: 3;
    padding-top: 8px;
    padding-bottom: 28px;
  }

  .ad-band {
    order: 2;
    min-height: 54px;
    margin: 0 20px 8px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .ad-band span {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .ad-band strong {
    font-size: 13px;
  }

  #trends {
    order: 4;
  }

  .examples-section {
    order: 5;
  }

  #guide {
    order: 6;
  }

  #blog {
    order: 7;
  }

  .generator-card {
    display: flex;
    flex-direction: column;
    border-color: rgba(31, 122, 90, 0.42);
    box-shadow: 0 16px 36px rgba(32, 36, 33, 0.1);
  }

  .generator-card .form-section:nth-child(2) {
    order: 1;
    border-top: 0;
    padding-top: 0;
  }

  .generator-card .form-section:nth-child(1) {
    order: 2;
  }

  .generator-card .form-section:nth-child(n+3) {
    order: 3;
  }

  .generator-card .form-actions {
    order: 4;
  }

  .form-section {
    padding: 20px 0;
  }

  .category-card,
  .toggle-card {
    min-height: 64px;
  }

  .trend-grid,
  .example-grid,
  .toggle-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-card {
    min-height: 76px;
    padding: 12px;
  }

  .category-card span {
    font-size: 12px;
    line-height: 1.35;
  }

  .output-head,
  .site-footer {
    flex-direction: column;
  }

  pre {
    min-height: 320px;
    max-height: 460px;
  }

  .section {
    padding-top: 36px;
    padding-bottom: 36px;
  }
}

@media (max-width: 430px) {
  .brand span {
    font-size: 16px;
  }

  .hero-copy {
    padding: 16px;
  }

  h1 {
    font-size: 27px;
  }

  .button,
  .icon-button {
    width: 100%;
  }

  .hero-actions,
  .form-actions,
  .output-actions {
    width: 100%;
  }

  .pill {
    min-height: 38px;
  }
}
