/* Shared page chrome for the GDD Builder and the Unity Guide.
   Colours, fonts and radii come from gdd-theme.css. */

:root {
  --header-h: 68px;
  --progress-h: 44px;
  --nav-offset: calc(var(--header-h) + var(--progress-h));
}
@media (max-width: 600px) { :root { --header-h: 60px; } }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-offset) + 12px); }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
button { font: inherit; }
.root { min-height: 100vh; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-pill); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* header */
.header {
  position: sticky; top: 0; z-index: 1001;
  height: var(--header-h);
  padding: 0 var(--space-6);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.header-inner { display: flex; align-items: center; gap: var(--space-4); max-width: 1300px; width: 100%; margin: 0 auto; }
.pixel-icon { width: clamp(72px, 10vw, 120px); height: 40px; flex-shrink: 0; display: flex; align-items: center; }
.pixel-icon img { width: 100%; height: 100%; object-fit: contain; }
[data-theme="light"] .pixel-icon img { filter: invert(1); }
.header-text { min-width: 0; flex: 1; }
.title {
  font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.2;
  letter-spacing: -0.01em; color: var(--ink);
}
.subtitle { font-size: 14px; line-height: 1.4; color: var(--ink-muted); margin-top: 2px; }
@media (max-width: 600px) { .title { font-size: 17px; } .subtitle { display: none; } }

.theme-toggle {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-pill);
  background: var(--surface-raised); color: var(--ink);
  border: 1px solid var(--border); cursor: pointer;
  transition: border-color .15s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* progress */
.progress-wrap {
  position: sticky; top: var(--header-h); z-index: 999;
  height: var(--progress-h);
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-6);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.progress-label, .progress-pct {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-subtle); white-space: nowrap;
}
.progress-pct { color: var(--accent); min-width: 40px; text-align: right; }
.progress-track { flex: 1; height: 6px; background: var(--surface-raised); border-radius: var(--radius-pill); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: var(--radius-pill); transition: width .3s ease; }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-8) var(--space-6) var(--space-6);
  margin-top: var(--space-12);
}
.footer-copy {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-subtle);
}
.footer-version { font-size: 14px; color: var(--ink-subtle); }

@media (max-width: 600px) {
  .header, .progress-wrap { padding: 0 16px; }
  .site-footer { padding: var(--space-6) 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
