:root {
  --bg-page: #f7f5f0;
  --bg-surface: #ffffff;
  --bg-subtle: #edeae2;
  --bg-stage: #151624;

  --ink-primary: #181826;
  --ink-secondary: #4b4d63;
  --ink-muted: #6e718a;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;

  --border-hairline: #dfdace;
  --border-strong: #c9c2b2;

  --shadow-card: 0 1px 3px rgba(24, 24, 38, 0.04), 0 10px 28px -8px rgba(24, 24, 38, 0.07);
  --shadow-button: 0 3px 12px rgba(79, 70, 229, 0.26);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--ink-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink-primary);
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.brand-name {
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.025em;
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  padding-left: 0.6rem;
  border-left: 1px solid var(--border-hairline);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.header-nav a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.header-nav a:hover {
  color: var(--ink-primary);
}

.privacy-indicator {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.68rem;
  border-radius: 6px;
  font-weight: 600;
}

.main-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
}

.hero-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.45rem;
}

.hero-copy h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.14;
  color: var(--ink-primary);
}

.hero-copy h1 em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
  font-size: 1.12em;
}

.hero-copy p {
  margin: 0;
  color: var(--ink-secondary);
  max-width: 680px;
  font-size: 0.97rem;
}

.btn-primary {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.74rem 1.28rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-button);
  transition: background 0.16s ease, transform 0.12s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.ad-slot-leaderboard {
  width: 100%;
  min-height: 90px;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  letter-spacing: 0.04em;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.35rem;
  align-items: start;
}

@media (max-width: 980px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
  .brand-tag {
    display: none;
  }
}

.stage-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.stage-toolbar {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-surface);
}

.inspector-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.tool-pill {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.tool-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.telemetry-readout {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink-secondary);
  background: var(--bg-subtle);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
}

.canvas-viewport {
  position: relative;
  width: 100%;
  min-height: 500px;
  max-height: 640px;
  background: var(--bg-stage);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  padding: 0.75rem;
}

.canvas-viewport.drag-over {
  outline: 3px solid var(--accent);
  outline-offset: -6px;
}

#studioCanvas {
  max-width: 100%;
  max-height: 600px;
  width: auto;
  height: auto;
  display: block;
  cursor: ew-resize;
  border-radius: 4px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}

.split-badge {
  position: absolute;
  top: 14px;
  padding: 0.28rem 0.64rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(21, 22, 36, 0.82);
  color: #f8fafc;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.split-badge.left { left: 14px; }
.split-badge.right { right: 14px; background: rgba(67, 56, 202, 0.92); }

.processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(21, 22, 36, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.processing-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.spinner-ring {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: spin 0.72s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.sample-strip {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
}

.sample-items {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sample-chip {
  padding: 0.42rem 0.72rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--ink-primary);
  text-align: left;
  transition: all 0.14s ease;
}

.sample-chip:hover {
  border-color: var(--accent);
}

.sample-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-card);
}

.card-heading {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.mode-btn {
  padding: 0.54rem 0.6rem;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.14s ease;
}

.mode-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.mode-note {
  margin: 0;
  font-size: 0.77rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.reset-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.reset-link:hover {
  text-decoration: underline;
}

.slider-group {
  margin-bottom: 0.9rem;
}

.slider-group:last-child {
  margin-bottom: 0;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.81rem;
  margin-bottom: 0.32rem;
}

.slider-header label {
  font-weight: 600;
  color: var(--ink-primary);
}

.slider-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.download-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.download-stack .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
}

.export-note {
  margin: 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.ad-slot-rectangle {
  width: 100%;
  min-height: 250px;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  text-align: center;
  padding: 1rem;
}

.seo-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-hairline);
}

.seo-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 820px) {
  .seo-columns {
    grid-template-columns: 1fr;
  }
}

.seo-feature {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.35rem;
}

.seo-feature h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.seo-feature p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.9rem;
}

.faq-wrap {
  max-width: 820px;
}

.faq-wrap h2 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

details.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.15rem;
  margin-bottom: 0.65rem;
}

details.faq-item summary {
  font-weight: 600;
  cursor: pointer;
}

details.faq-item p {
  margin: 0.6rem 0 0;
  color: var(--ink-secondary);
  font-size: 0.9rem;
}
