*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d0d0f;
  --surface: #141417;
  --surface2: #1c1c21;
  --border: #2a2a32;
  --border-light: #3a3a45;
  --text: #e8e8f0;
  --text-muted: #7a7a90;
  --text-dim: #4a4a5a;
  --accent: #6ee7b7;
  --accent-dim: #1a3d30;
  --accent2: #a78bfa;
  --accent2-dim: #2d1f5e;
  --error: #f87171;
  --mono: 'DM Mono', monospace;
  --serif: 'Instrument Serif', serif;
  --sans: 'Geist', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── HEADER ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(13, 13, 15, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.logo {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: block;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.badge {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* ── TOOL BAR ── */
.tool-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow-x: auto;
}

.tool-bar-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.tool-bar-links {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.tool-bar-links a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.tool-bar-links a:hover {
  color: var(--text-muted);
  border-color: var(--border);
}

.tool-bar-links .tool-bar-current {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(110, 231, 183, 0.15);
  cursor: default;
}

/* ── HERO ── */
.hero {
  padding: 80px 32px 64px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 20px;
  display: block;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.btn-cta {
  display: inline-block;
  padding: 14px 40px;
  background: var(--accent);
  color: #0a2018;
  border: none;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-cta:hover {
  background: #a7f3d0;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(110, 231, 183, 0.2);
}

/* ── SECTION LABELS ── */
.section-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

/* ── INTRO SECTION ── */
.intro-section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 64px 32px;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
}

.intro-icon {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.intro-card h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.intro-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro-list li {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.intro-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
}

.intro-steps li::before {
  content: none;
}

.intro-steps {
  counter-reset: step;
}

.intro-steps li {
  counter-increment: step;
  padding-left: 24px;
}

.intro-steps li::after {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  width: 18px;
  text-align: center;
}

.intro-list li strong {
  color: var(--text);
  font-weight: 500;
}

.intro-callout {
  margin-top: 4px;
  padding: 8px 16px !important;
  background: var(--accent2-dim);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 6px;
}

.intro-callout::before {
  background: var(--accent2) !important;
  border-color: var(--accent2) !important;
}

.intro-callout a {
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.intro-callout a:hover {
  color: #c4b5fd;
}

/* ── FRAMEWORKS SECTION ── */
.frameworks-section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 32px 80px;
}

.frameworks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}

.fw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.fw-tag {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 8px;
}

.fw-tag.ccpa {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

.fw-tag.pipa {
  color: var(--accent2);
  background: var(--accent2-dim);
}

.fw-region {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.fw-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── GENERATOR SECTION ── */
.generator-section {
  padding: 80px 0 0;
  border-top: 1px solid var(--border);
}

/* ── MAIN LAYOUT ── */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 32px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ── FORM PANEL ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h3 {
  font-size: 13px;
  font-weight: 500;
  font-family: var(--mono);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.panel-icon {
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.form-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--mono);
}

.optional {
  color: var(--text-dim);
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.field-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-bottom: 2px;
}

input,
select,
textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.08);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select option {
  background: var(--surface2);
}

/* ── CHECKBOXES ── */
.check-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.check-group-3col {
  grid-template-columns: repeat(3, 1fr);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.check-item:hover {
  border-color: var(--border-light);
  background: #1f1f26;
}

.framework-item {
  background: var(--accent2-dim);
  border-color: rgba(167, 139, 250, 0.2);
}

.framework-item:hover {
  border-color: var(--accent2);
}

.framework-item span small {
  color: var(--text-dim);
  font-size: 10px;
}

.check-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.check-item span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-weight: 400;
}

/* ── GENERATE BUTTON ── */
.btn-generate {
  width: 100%;
  padding: 14px 24px;
  background: var(--accent);
  color: #0a2018;
  border: none;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.btn-generate:hover {
  background: #a7f3d0;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(110, 231, 183, 0.2);
}

.btn-generate:active {
  transform: translateY(0);
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── OUTPUT PANEL ── */
.output-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: 80px;
}

.output-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.output-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.output-actions {
  display: flex;
  gap: 6px;
}

.btn-action {
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.04em;
}

.btn-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.output-body {
  padding: 24px;
  min-height: 400px;
  max-height: 70vh;
  overflow-y: auto;
}

.output-body::-webkit-scrollbar { width: 4px; }
.output-body::-webkit-scrollbar-track { background: transparent; }
.output-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── EMPTY STATE ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  gap: 16px;
  color: var(--text-dim);
}

.empty-icon {
  width: 56px;
  height: 56px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.empty-state p {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
}

/* ── GENERATED POLICY ── */
.policy-content {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text);
}

.policy-content h1 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
  text-align: left;
  letter-spacing: -0.01em;
}

.policy-content .effective-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 24px;
  display: block;
}

.policy-content h2 {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--accent-dim);
}

.policy-content p {
  margin-bottom: 12px;
  color: var(--text-muted);
}

.policy-content ul {
  margin: 8px 0 12px 16px;
  color: var(--text-muted);
}

.policy-content li {
  margin-bottom: 4px;
}

.policy-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── POST-GENERATE CTA ── */
.post-generate-cta {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--accent-dim);
}

.post-generate-cta p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}

.cta-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

.cta-link:hover {
  color: #a7f3d0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── NEWSLETTER SECTION ── */
.newsletter-section {
  max-width: 560px;
  margin: 0 auto;
  padding: 72px 32px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.newsletter-quote {
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 26px);
  font-style: italic;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 24px;
}

.btn-substack {
  display: inline-block;
  padding: 12px 32px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-substack:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(110, 231, 183, 0.12);
}

/* ── FAQ SECTION ── */
.faq-section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 80px 32px;
  border-top: 1px solid var(--border);
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.faq-item h4 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.faq-item p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.faq-item p strong {
  color: var(--text);
  font-weight: 500;
}

/* ── ERROR BOX ── */
.error-box {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  color: var(--error);
  font-family: var(--mono);
  margin: 16px 0;
  line-height: 1.6;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent);
  color: #0a2018;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999;
  pointer-events: none;
}

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

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 32px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

footer a {
  color: var(--text-dim);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent);
}

.divider {
  width: 1px;
  height: 12px;
  background: var(--border);
  display: inline-block;
  vertical-align: middle;
  margin: 0 12px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .tool-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 20px;
    gap: 8px;
  }

  .tool-bar-links {
    flex-wrap: wrap;
    gap: 4px;
  }

  header {
    padding: 16px 20px;
  }

  .hero {
    padding: 48px 20px 40px;
  }

  .intro-section {
    padding: 40px 20px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .frameworks-section {
    padding: 32px 20px 60px;
  }

  .frameworks-grid {
    grid-template-columns: 1fr;
  }

  .generator-section {
    padding: 48px 0 0;
  }

  .container {
    grid-template-columns: 1fr;
    padding: 0 20px 60px;
  }

  .check-group-3col {
    grid-template-columns: 1fr;
  }

  .output-panel {
    position: static;
  }

  .faq-section {
    padding: 48px 20px;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 32px;
  }
}
