/* Low Gravitas Zen — site-specific styles
   Shared layout rules are in low-gravitas-common.css.
   Color variables come from low-gravitas-zen.css (linked in HTML). */

/* ── Main ── */

main {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ── Hero ── */

.hero {
  text-align: center;
  margin-bottom: 48px;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent);
}
.hero .tagline {
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 24px;
}
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Section headers ── */

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--lgz-bright-blue);
}

/* ── Per-demo wrappers ── */

.demo-section { margin-bottom: 1.5rem; }

.demo-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.demo-header h2 { margin-top: 0; }
.demo-header:not(:has(h2)) { justify-content: flex-end; margin-bottom: 6px; }

.demo-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
  transition: border-color 0.15s;
}
.demo-toggle:hover { border-color: var(--accent); }
.demo-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Swatches ── */

.swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-bottom: 1.5rem;
}
.swatch {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4px;
  min-height: 60px;
  border: 1px solid var(--border);
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.swatch:hover { transform: scale(1.05); }
.swatch span { font-size: 0.6rem; text-align: center; word-break: break-all; }
[data-theme="dark"] .swatch span { color: var(--label-dark); }
[data-theme="light"] .swatch span { color: var(--label-light); }
.swatch::after {
  content: attr(data-dark);
  font-size: 0.55rem;
  font-family: "SF Mono", monospace;
  opacity: 0;
  transition: opacity 0.15s;
  position: absolute;
  top: 4px; left: 0; right: 0;
  text-align: center;
}
[data-theme="light"] .swatch::after { content: attr(data-light); }
[data-theme="dark"] .swatch::after { color: var(--label-dark); }
[data-theme="light"] .swatch::after { color: var(--label-light); }
.swatch:hover::after { opacity: 1; }

/* ── IDE mockup ── */

.ide {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s;
}
.ide-titlebar {
  background: var(--surface-raised);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.ide-dots { display: flex; gap: 5px; }
.ide-dots span { width: 10px; height: 10px; border-radius: 50%; }
.ide-body { display: flex; min-height: 280px; }
.ide-sidebar {
  background: var(--surface);
  width: 170px;
  flex-shrink: 0;
  padding: 8px 0;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 0.75rem;
  line-height: 1.8;
  border-right: 1px solid var(--border);
  color: var(--text);
}
.ide-sidebar .file { padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-sidebar .file.active { background: var(--bg); color: var(--lgz-bright-white); }
.ide-sidebar .dir { padding: 0 12px; color: var(--lgz-yellow); }
.ide-editor {
  background: var(--bg);
  color: var(--text);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ide-tabs {
  background: var(--surface);
  display: flex;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.ide-tab { padding: 5px 14px; color: var(--text-dim); border-right: 1px solid var(--border); }
.ide-tab.active { background: var(--bg); color: var(--lgz-bright-white); border-bottom: 3px solid var(--accent); }
.ide-code {
  flex: 1;
  padding: 8px 12px;
  overflow-x: auto;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre;
}
.ide-code .line-num { display: inline-block; width: 2.5em; text-align: right; padding-right: 1em; color: var(--text-dim); user-select: none; }
.ide-statusbar {
  background: var(--surface-raised);
  padding: 3px 12px;
  font-size: 0.7rem;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
}

/* ── Token colors ── */

.tk-keyword { color: var(--lgz-bright-red); }
.tk-string { color: var(--lgz-green); }
.tk-comment { color: var(--lgz-blue); font-style: italic; }
.tk-number { color: var(--lgz-bright-yellow); }
.tk-function { color: var(--lgz-bright-blue); }
.tk-type { color: var(--lgz-yellow); }
.tk-variable { color: var(--lgz-bright-magenta); }

/* ── Terminal ── */

.terminal {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.terminal-titlebar {
  background: var(--surface-raised);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.terminal-body {
  padding: 10px 14px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.8rem;
  line-height: 1.6;
}

/* ── Selection & cursor ── */

.selected-text { background: var(--lgz-selection); border-radius: 2px; }
.cursor-line { background: var(--surface); }
.cursor-bar {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--border);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .cursor-bar { animation: none; }
  .swatch { transition: none; }
  .ide, .terminal { transition: none; }
  .demo-toggle { transition: none; }
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .swatches { grid-template-columns: repeat(4, 1fr); }
  .ide-sidebar { display: none; }
}
