/* ==========================================================================
   SpendSomeTime — shared design system
   One source of truth for color, type, spacing and core components.
   ========================================================================== */

:root {
  /* Color */
  --color-bg: #faf8f4;
  --color-surface: #ffffff;
  --color-surface-alt: #f2efe8;
  --color-border: #e4e0d6;
  --color-text: #1e1c18;
  --color-text-muted: #6b6558;
  --color-accent: #b5502a;
  --color-accent-dark: #963f20;
  --color-accent-soft: #f3e3da;
  --color-ink: #2c3532;
  --color-success: #3f7d5c;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Spacing / shape */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(30, 28, 24, 0.06);
  --shadow-md: 0 6px 20px rgba(30, 28, 24, 0.08);
  --content-width: 1120px;
  --nav-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--color-text-muted); }
a { color: var(--color-accent); }

::selection { background: var(--color-accent-soft); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
}

.nav-content {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.nav-links a:hover { color: var(--color-text); }

.nav-stats {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.nav-stats .stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
}

.nav-stats .stat-pill strong {
  color: var(--color-text);
  font-weight: 600;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

main { max-width: var(--content-width); margin: 0 auto; padding: 0 1.5rem; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-primary {
  background: var(--color-text);
  color: var(--color-bg);
}
.btn-primary:hover { background: var(--color-accent-dark); }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-text); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-ghost:hover { color: var(--color-text); border-color: var(--color-text); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ==========================================================================
   Cards / sections
   ========================================================================== */

.card, .panel, .skill-card, .game-container, .question {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.card { box-shadow: var(--shadow-sm); }

section.section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

/* Forms */
input[type=search], input[type=text], select, textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-family: var(--font-body);
  color: var(--color-text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* Stat / quick-action grids (used on the homepage) */
.stats-banner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.5rem;
}

.stat-item { text-align: left; }
.stat-item .number {
  display: block;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.stat-item .label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.quick-action-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-action-card:hover {
  border-color: var(--color-text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-action-card .icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  color: var(--color-accent);
  margin-bottom: 1rem;
}
.quick-action-card .icon svg { width: 20px; height: 20px; }

.quick-action-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.quick-action-card p {
  font-size: 0.9rem;
  margin: 0;
}

/* Skills / tags (used on skills, weird, diagram pages) */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.skill-card h3 { margin: 0 0 0.5rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.tag {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-weight: 600;
  font-size: 0.78rem;
}

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; padding: 1rem; border-radius: var(--radius-md); }

.progress-bar { height: 8px; background: var(--color-surface-alt); border-radius: 999px; overflow: hidden; }
.progress-bar-inner { height: 100%; width: 0; background: var(--color-accent); transition: width 0.3s ease; }

/* ==========================================================================
   Footer
   ========================================================================== */

footer.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 5rem;
  padding: 2.5rem 1.5rem;
}
.footer-content {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-content p { margin: 0; color: var(--color-text-muted); font-size: 0.88rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--color-text-muted); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
.footer-links a:hover { color: var(--color-text); text-decoration: underline; }

/* ==========================================================================
   Motion
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0.75rem; right: 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .menu-toggle { display: flex; }
  .nav-stats { order: 3; }
}

@media (max-width: 640px) {
  .stats-banner { grid-template-columns: repeat(2, 1fr); }
  section.section { padding: 3rem 1.25rem; }
}
