/* SITE LAB — deep navy + teal, local fonts only */
:root {
  --bg-deep: #07111f;
  --bg-navy: #0a1628;
  --bg-panel: #0f2138;
  --bg-panel-2: #132a45;
  --line: rgba(46, 230, 197, 0.18);
  --line-strong: rgba(46, 230, 197, 0.42);
  --text: #e8f1ff;
  --text-muted: #9bb0c9;
  --teal: #2ee6c5;
  --teal-dim: #1ab89c;
  --teal-glow: rgba(46, 230, 197, 0.22);
  --warn: #f0c674;
  --radius: 12px;
  --font-display: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Gill Sans", "Trebuchet MS", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "Menlo", "Consolas", monospace;
  --space: clamp(1rem, 2vw, 1.75rem);
  --max: 1180px;
  --focus: 0 0 0 3px var(--teal-glow), 0 0 0 1px var(--teal);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(46, 230, 197, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(80, 140, 255, 0.1), transparent 50%),
    linear-gradient(165deg, var(--bg-deep) 0%, var(--bg-navy) 45%, #0c1a2e 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(46, 230, 197, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 230, 197, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--teal);
  color: var(--bg-deep);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  outline: none;
  box-shadow: var(--focus);
}

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--space) 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-glyph {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  border: 1.5px solid var(--teal);
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 45%, var(--teal) 45%, var(--teal) 55%, transparent 55%),
    linear-gradient(45deg, transparent 40%, rgba(46, 230, 197, 0.35) 40%, rgba(46, 230, 197, 0.35) 48%, transparent 48%);
  box-shadow: inset 0 0 0 4px var(--bg-navy);
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: var(--text);
}

.brand-sub {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  color: var(--teal);
  letter-spacing: 0.12em;
}

.sim-badge {
  margin: 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--warn);
  border: 1px solid rgba(240, 198, 116, 0.45);
  border-radius: 999px;
  background: rgba(240, 198, 116, 0.08);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space) 3rem;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 1.75rem;
  align-items: start;
  margin-top: 1.25rem;
  animation: rise 0.7s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.hero-lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 36em;
}

.panel {
  background: linear-gradient(160deg, var(--bg-panel) 0%, var(--bg-panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.35rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.field-label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}

.prompt-input {
  width: 100%;
  min-height: 8.5rem;
  resize: vertical;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: rgba(7, 17, 31, 0.65);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-input:hover {
  border-color: var(--line-strong);
}

.prompt-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--focus);
}

.field-hint {
  margin: 0.5rem 0 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.preset-fieldset {
  margin: 0 0 1.1rem;
  padding: 0;
  border: 0;
}

.preset-fieldset legend {
  padding: 0;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-btn,
.style-btn,
.btn-primary {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.preset-btn,
.style-btn {
  padding: 0.5rem 0.85rem;
  color: var(--text);
  background: rgba(7, 17, 31, 0.45);
  border: 1px solid var(--line);
}

.preset-btn:hover,
.style-btn:hover {
  border-color: var(--line-strong);
  background: rgba(46, 230, 197, 0.08);
}

.preset-btn[aria-pressed="true"],
.style-btn.is-active,
.style-btn[aria-pressed="true"] {
  color: var(--bg-deep);
  background: var(--teal);
  border-color: var(--teal);
  font-weight: 600;
}

.preset-btn:focus-visible,
.style-btn:focus-visible,
.btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
}

.btn-primary {
  padding: 0.7rem 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dim) 100%);
  border: 1px solid transparent;
  min-height: 2.75rem;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-primary:active:not(:disabled) {
  transform: none;
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.gen-status {
  margin: 0;
  flex: 1 1 12rem;
  min-height: 1.4em;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.gen-status.is-running {
  color: var(--teal);
}

.gen-status.is-done {
  color: var(--warn);
}

.workbench-right {
  min-width: 0;
  animation: rise 0.7s ease 0.12s both;
}

.preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.preview-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.style-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preview-note {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.preview-stage {
  min-height: 28rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  transition: opacity 0.25s ease;
}

.preview-stage.is-updating {
  opacity: 0.72;
}

/* —— Preview themes (real DOM styles) —— */
.site-preview {
  min-height: 28rem;
  font-size: 15px;
  line-height: 1.5;
}

.site-preview a {
  color: inherit;
  text-decoration: none;
}

.site-preview .pv-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
}

.site-preview .pv-logo {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-preview .pv-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.site-preview .pv-hero {
  padding: 1.5rem 1.1rem 1.75rem;
}

.site-preview .pv-hero h3 {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  line-height: 1.2;
}

.site-preview .pv-hero p {
  margin: 0 0 1rem;
  max-width: 28em;
}

.site-preview .pv-cta {
  display: inline-block;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: default;
}

.site-preview .pv-grid {
  display: grid;
  gap: 0.75rem;
  padding: 0 1.1rem 1.35rem;
}

.site-preview .pv-block {
  padding: 0.9rem 1rem;
}

.site-preview .pv-block h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.site-preview .pv-block p {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.88;
}

.site-preview .pv-geo {
  display: block;
  height: 4.5rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
}

.site-preview .pv-footer {
  padding: 0.85rem 1.1rem;
  font-size: 0.75rem;
  opacity: 0.75;
}

/* Editorial */
.preview-stage[data-style="editorial"] .site-preview {
  background: #f7f3eb;
  color: #1c2430;
  font-family: Georgia, "Songti SC", "SimSun", serif;
}

.preview-stage[data-style="editorial"] .pv-nav {
  border-bottom: 1px solid #d8cfc0;
  background: #fffdf8;
}

.preview-stage[data-style="editorial"] .pv-logo {
  font-style: italic;
  letter-spacing: 0.08em;
}

.preview-stage[data-style="editorial"] .pv-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  border-bottom: 1px solid #d8cfc0;
}

.preview-stage[data-style="editorial"] .pv-hero h3 {
  font-size: 1.7rem;
  font-weight: 500;
}

.preview-stage[data-style="editorial"] .pv-cta {
  background: #1c2430;
  color: #f7f3eb;
  border-radius: 2px;
}

.preview-stage[data-style="editorial"] .pv-grid {
  grid-template-columns: 1fr 1fr 1fr;
}

.preview-stage[data-style="editorial"] .pv-block {
  background: #fff;
  border-top: 3px solid #c4a574;
}

.preview-stage[data-style="editorial"] .pv-geo {
  background: linear-gradient(120deg, #c4a574 0%, #e8dcc8 50%, #8a9a7b 100%);
}

.preview-stage[data-style="editorial"] .pv-footer {
  border-top: 1px solid #d8cfc0;
  background: #fffdf8;
}

/* Minimal */
.preview-stage[data-style="minimal"] .site-preview {
  background: #fafafa;
  color: #222;
  font-family: "Avenir Next", "Helvetica Neue", "PingFang SC", sans-serif;
}

.preview-stage[data-style="minimal"] .pv-nav {
  padding: 1.25rem 1.5rem 0.5rem;
  background: transparent;
}

.preview-stage[data-style="minimal"] .pv-links {
  gap: 1.25rem;
  opacity: 0.55;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-stage[data-style="minimal"] .pv-hero {
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}

.preview-stage[data-style="minimal"] .pv-hero h3 {
  font-size: 1.9rem;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.preview-stage[data-style="minimal"] .pv-hero p {
  margin-left: auto;
  margin-right: auto;
  color: #666;
}

.preview-stage[data-style="minimal"] .pv-cta {
  background: transparent;
  color: #222;
  border: 1px solid #222;
  border-radius: 0;
  letter-spacing: 0.08em;
}

.preview-stage[data-style="minimal"] .pv-grid {
  grid-template-columns: 1fr;
  max-width: 22rem;
  margin: 0 auto;
  padding-bottom: 2rem;
  gap: 0;
}

.preview-stage[data-style="minimal"] .pv-block {
  padding: 1rem 0;
  border-top: 1px solid #e5e5e5;
  background: transparent;
}

.preview-stage[data-style="minimal"] .pv-geo {
  height: 2px;
  margin: 0 0 1rem;
  border-radius: 0;
  background: #222;
}

.preview-stage[data-style="minimal"] .pv-block:first-child .pv-geo {
  display: none;
}

.preview-stage[data-style="minimal"] .pv-footer {
  text-align: center;
  border-top: none;
  padding-bottom: 1.5rem;
}

/* Bold */
.preview-stage[data-style="bold"] .site-preview {
  background: #0b1020;
  color: #f2f7ff;
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", sans-serif;
}

.preview-stage[data-style="bold"] .pv-nav {
  background: #121a33;
  border-bottom: 2px solid #2ee6c5;
}

.preview-stage[data-style="bold"] .pv-logo {
  color: #2ee6c5;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
}

.preview-stage[data-style="bold"] .pv-hero {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background:
    radial-gradient(circle at 90% 20%, rgba(46, 230, 197, 0.25), transparent 40%),
    linear-gradient(135deg, #121a33 0%, #1a1040 100%);
  padding: 2rem 1.2rem;
}

.preview-stage[data-style="bold"] .pv-hero h3 {
  font-size: 1.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.preview-stage[data-style="bold"] .pv-cta {
  align-self: flex-start;
  background: #2ee6c5;
  color: #0b1020;
  border-radius: 999px;
  font-weight: 800;
}

.preview-stage[data-style="bold"] .pv-grid {
  grid-template-columns: 1.4fr 1fr;
  background: #0b1020;
  gap: 0.6rem;
  padding-top: 0.85rem;
}

.preview-stage[data-style="bold"] .pv-block {
  background: #161f3a;
  border: 1px solid rgba(46, 230, 197, 0.25);
  border-radius: 10px;
}

.preview-stage[data-style="bold"] .pv-block:first-child {
  grid-row: span 2;
}

.preview-stage[data-style="bold"] .pv-geo {
  background: linear-gradient(90deg, #2ee6c5, #5b8cff 60%, #ff6bcb);
  height: 5.5rem;
  border-radius: 8px;
}

.preview-stage[data-style="bold"] .pv-footer {
  background: #121a33;
  color: #2ee6c5;
}

.flow-section,
.about-section {
  margin-top: 2.75rem;
  animation: rise 0.7s ease 0.2s both;
}

.section-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.flow-list li {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: rgba(15, 33, 56, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.flow-step {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--teal);
  line-height: 1.4;
}

.flow-list h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.flow-list p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.about-section p {
  margin: 0;
  max-width: 48em;
  color: var(--text-muted);
}

.about-section code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--teal);
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space) 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

/* Mobile / narrow */
@media (max-width: 900px) {
  .workbench {
    grid-template-columns: 1fr;
  }

  .preview-stage[data-style="editorial"] .pv-hero {
    grid-template-columns: 1fr;
  }

  .preview-stage[data-style="editorial"] .pv-grid {
    grid-template-columns: 1fr;
  }

  .preview-stage[data-style="bold"] .pv-grid {
    grid-template-columns: 1fr;
  }

  .preview-stage[data-style="bold"] .pv-block:first-child {
    grid-row: auto;
  }

  .flow-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  body {
    font-size: 16px;
  }

  .site-header,
  main,
  .site-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .preset-btn,
  .style-btn,
  .btn-primary {
    font-size: 0.875rem;
  }

  .preview-stage {
    min-height: 22rem;
  }

  .site-preview {
    min-height: 22rem;
  }
}

/* Presentation refinements */
.hero-title { font-size: clamp(2.7rem, 4.5vw, 4.1rem); font-weight: 750; line-height: 1.14; letter-spacing: -.035em; }
.site-preview { font-size: 16px; overflow-wrap: anywhere; }
.site-preview .pv-block p { font-size: 1rem; }
.site-preview .pv-cta { cursor: pointer; }
.site-preview a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.site-preview .pv-block { min-width: 0; scroll-margin-top: 1rem; }
.flow-list p { font-size: 1rem; }
.prompt-input { max-width: 100%; }
