/* Low Gravitas Zen — theme demo styles, scoped under .demo-zen-theme */

@layer demos {

/* ── Main ── */

.demo-zen-theme main {
  max-width: var(--content-wide);
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ── Hero ── */

.demo-zen-theme .hero {
  text-align: center;
  margin-bottom: 48px;
}
.demo-zen-theme .hero h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent);
}
.demo-zen-theme .hero .tagline {
  color: var(--text-dim);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  max-width: 520px;
  margin: 0 auto 24px;
}
.demo-zen-theme .hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Section headers ── */

.demo-zen-theme h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--lgz-bright-blue);
}

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

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

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

/* ── Demo theme toggle switch ── */

.demo-zen-theme .demo-switch-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  border-radius: var(--radius-lg);
  padding: 4px 10px 4px 4px;
}

.demo-zen-theme .demo-switch-text {
  font-size: 0.92rem;
  color: var(--text-dim);
  user-select: none;
}

.demo-zen-theme .demo-switch {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.demo-zen-theme .demo-switch-track {
  position: relative;
  width: 56px;
  height: 30px;
  border-radius: 15px;
  background: var(--grad-pressed);
  box-shadow: var(--shadow-pressed-sm);
  border: 1px solid var(--border-medium);
  pointer-events: none;
  transition: background 0.2s;
}

.demo-zen-theme .demo-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, #4a3e30, #2a2016);
  box-shadow: var(--shadow-raised-sm);
  transition: transform 0.2s ease;
}

[data-theme="light"] .demo-zen-theme .demo-switch-knob {
  background: linear-gradient(145deg, #f0e8dc, #d8cfc0);
}

.demo-zen-theme .demo-switch[aria-checked="true"] .demo-switch-track {
  background: linear-gradient(145deg, var(--accent), var(--accent));
  box-shadow: var(--shadow-pressed-sm), 0 0 6px rgba(255,255,134,0.1);
  border-color: transparent;
}

[data-theme="light"] .demo-zen-theme .demo-switch[aria-checked="true"] .demo-switch-track {
  box-shadow: var(--shadow-pressed-sm), 0 0 6px rgba(92,45,145,0.1);
  border-color: transparent;
}

.demo-zen-theme .demo-switch[aria-checked="true"] .demo-switch-knob {
  transform: translateX(26px);
}

.demo-zen-theme .demo-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 15px;
}

@media (prefers-reduced-motion: reduce) {
  .demo-zen-theme .demo-switch-knob { transition: none; }
  .demo-zen-theme .demo-switch-track { transition: none; }
}

/* ── Swatches ── */

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

/* ── IDE mockup ── */

.demo-zen-theme .ide {
  border: 1px solid var(--border-light);
  border-radius: var(--code-radius);
  box-shadow: var(--shadow-raised);
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: box-shadow var(--duration-normal);
}
.demo-zen-theme .ide-titlebar {
  background: var(--surface-raised);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text);
  border-bottom: 1px solid var(--border-subtle);
}
.demo-zen-theme .ide-dots { display: flex; gap: 5px; }
.demo-zen-theme .ide-dots span { width: 10px; height: 10px; border-radius: 50%; }
.demo-zen-theme .ide-body { display: flex; min-height: 280px; }
.demo-zen-theme .ide-sidebar {
  background: var(--surface);
  width: 170px;
  flex-shrink: 0;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.8;
  border-right: 1px solid var(--border-subtle);
  color: var(--text);
}
.demo-zen-theme .ide-sidebar .file { padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-zen-theme .ide-sidebar .file.active { background: var(--bg); color: var(--lgz-bright-white); }
.demo-zen-theme .ide-sidebar .dir { padding: 0 12px; color: var(--lgz-yellow); }
.demo-zen-theme .ide-editor {
  background: var(--bg);
  color: var(--text);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.demo-zen-theme .ide-tabs {
  background: var(--surface);
  display: flex;
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--border-subtle);
}
.demo-zen-theme .ide-tab { padding: 5px 14px; color: var(--text-dim); border-right: 1px solid var(--border-subtle); }
.demo-zen-theme .ide-tab.active { background: var(--bg); color: var(--lgz-bright-white); border-bottom: 3px solid var(--accent); }
.demo-zen-theme .ide-code {
  flex: 1;
  padding: 8px 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre;
}
.demo-zen-theme .ide-code .line-num { display: inline-block; width: 2.5em; text-align: right; padding-right: 1em; color: var(--text-dim); user-select: none; }
.demo-zen-theme .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-subtle);
}

/* ── Token colors ── */

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

/* ── Terminal ── */

.demo-zen-theme .terminal {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: var(--code-radius);
  box-shadow: var(--shadow-raised);
  overflow: hidden;
  transition: box-shadow var(--duration-normal);
}
.demo-zen-theme .terminal-titlebar {
  background: var(--surface-raised);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text);
  border-bottom: 1px solid var(--border-subtle);
}
.demo-zen-theme .terminal-body {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: var(--leading-normal);
}

/* ── Selection & cursor ── */

.demo-zen-theme .selected-text { background: var(--lgz-selection); border-radius: 2px; }
.demo-zen-theme .cursor-line { background: var(--surface); }
.demo-zen-theme .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) {
  .demo-zen-theme .cursor-bar { animation: none; }
  .demo-zen-theme .swatch { transition: none; }
  .demo-zen-theme .ide, .demo-zen-theme .terminal { transition: none; }
  .demo-zen-theme .demo-toggle { transition: none; }
}

/* ── Responsive ── */

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

} /* end @layer demos */
