/* ═══════════════════════════════════════════════
   Layout — header, hero, builder grid, footer, modals
   ═══════════════════════════════════════════════ */

/* ─── HEADER ─── */
.header {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-bright);
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--cyan);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--bg);
}

.logo-text {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.5px;
}

.logo-text span { color: var(--cyan); }

.nav {
  display: flex;
  gap: 4px;
}

.nav a,
.nav button {
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--speed-fast);
}

.nav a:hover,
.nav a.active {
  color: var(--text-bright);
  background: var(--bg3);
}

/* ─── HERO ─── */
.hero {
  text-align: center;
  padding: 64px 24px 48px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(86, 212, 221, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-prompt {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.hero-prompt span { color: var(--green); }

.hero h1 {
  font-family: 'Space Mono', monospace;
  font-size: clamp(28px, 5vw, 48px);
  color: var(--text-bright);
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero h1 .accent { color: var(--cyan); }

.hero p {
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 32px;
  font-size: 14px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 12px;
  color: var(--text-dim);
}

.hero-stats .num {
  color: var(--cyan);
  font-weight: 700;
  font-size: 18px;
  display: block;
}

.hero-stats .stat-label {
  display: block;
  margin-top: 2px;
}

/* ─── BUILDER GRID ─── */
.builder {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
  align-self: start;
}

/* ─── INSTALL SECTION ─── */
.install-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.install-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.install-header h3 {
  font-size: 14px;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.install-body {
  padding: 20px;
}

.install-url {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.url-box {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--cyan);
  overflow-x: auto;
  white-space: nowrap;
}

.install-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ─── TAB BAR ─── */
.tab-bar {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 10px 16px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all var(--speed-fast);
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* ─── MODALS ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  overflow-y: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-container {
  max-width: 900px;
  margin: 60px auto;
  padding: 0 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  color: var(--text-bright);
  font-family: 'Space Mono', monospace;
}

.scripts-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.raw-script-content {
  padding: 20px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--green);
  overflow-x: auto;
  max-height: 70vh;
  overflow-y: auto;
}

/* ─── FOOTER ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.footer-sub {
  margin-top: 8px;
  color: var(--border);
}
