/* ================================================================
   HOBBYWORLD — platform.css
   Layer 1: Global tokens, reset, typography, layout grid
   Layer 2: Platform UI components (nav, cards, badges, footer)
   ================================================================ */

/* ── Layer 1: Platform Tokens ─────────────────────────────────── */
:root {
  /* Brand */
  --hw-brand:       #1e1812;
  --hw-brand-soft:  #3a2e24;
  --hw-accent:      #c9973b;
  --hw-accent-light:#f5e8cc;
  --hw-accent-dark: #a07828;

  /* Surface */
  --hw-bg:          #f8f5f0;
  --hw-bg-raised:   #ffffff;
  --hw-bg-subtle:   #f0ebe3;
  --hw-border:      #e0d8cc;
  --hw-border-soft: #ece6de;

  /* Text */
  --hw-text:        #1c1612;
  --hw-text-soft:   #5a4e40;
  --hw-text-muted:  #8a7c6e;
  --hw-text-inverse:#faf6f0;

  /* Category palette — set by platform.js per URL segment */
  --cat-primary:    #3a6ea5;   /* default: visual-arts blue */
  --cat-light:      #d0e0f5;
  --cat-dark:       #2a5080;

  /* Curriculum tokens — overridden by each curriculum's theme.css */
  --cur-accent:     var(--cat-primary);
  --cur-light:      var(--cat-light);
  --cur-paper:      #faf6f0;
  --cur-phase-1:    #3a6ea5;
  --cur-phase-2:    #5c8a6a;
  --cur-phase-3:    #c4622d;
  --cur-phase-4:    #c9973b;
  --cur-phase-5:    #7a5c9e;

  /* Typography */
  --hw-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --hw-font-body:    'Lora', Georgia, 'Palatino Linotype', serif;
  --hw-font-ui:      system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hw-font-mono:    'Inconsolata', 'Courier New', Consolas, monospace;

  /* Spacing */
  --sp-xs:  0.4rem;
  --sp-sm:  0.8rem;
  --sp-md:  1.5rem;
  --sp-lg:  2.5rem;
  --sp-xl:  4rem;
  --sp-2xl: 6rem;

  /* Radii */
  --r-sm:  4px;
  --r-md:  10px;
  --r-lg:  18px;
  --r-xl:  28px;
  --r-pill:999px;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(0,0,0,.07);
  --shadow-md:  0 4px 16px rgba(0,0,0,.09);
  --shadow-lg:  0 10px 32px rgba(0,0,0,.12);

  /* Transitions */
  --ease: cubic-bezier(.25,.46,.45,.94);
  --t-fast: 0.15s;
  --t-std:  0.25s;
  --t-slow: 0.4s;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--hw-bg);
  color: var(--hw-text);
  font-family: var(--hw-font-body);
  line-height: 1.7;
  min-height: 100vh;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--cat-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Typography ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--hw-font-display);
  line-height: 1.22;
  color: var(--hw-text);
}
h1 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.55rem); }
h4 { font-size: 1.05rem; }
h5 { font-size: 0.9rem; }

p { margin-bottom: var(--sp-md); max-width: 70ch; }
p:last-child { margin-bottom: 0; }

.hw-lead { font-size: 1.1rem; color: var(--hw-text-soft); font-style: italic; }
.hw-eyebrow {
  font-family: var(--hw-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hw-accent);
  margin-bottom: var(--sp-sm);
  display: block;
}

/* ── Layout ───────────────────────────────────────────────────── */
.hw-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}
.hw-container--narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

/* ── Platform Bar (Tier 1 — always visible) ───────────────────── */
.hw-platform-bar {
  background: var(--hw-brand);
  color: var(--hw-text-inverse);
  height: 48px;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 2px solid var(--hw-accent);
}
.hw-platform-bar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}
.hw-platform-logo {
  font-family: var(--hw-font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--hw-text-inverse);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hw-platform-logo em {
  color: var(--hw-accent);
  font-style: normal;
}
.hw-platform-logo__icon { font-size: 1.1rem; }
.hw-platform-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-left: auto;
}
.hw-platform-nav a {
  color: rgba(255,255,255,0.75);
  font-family: var(--hw-font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  transition: color var(--t-fast);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.hw-platform-nav a:hover {
  color: var(--hw-accent);
  text-decoration: none;
}
.hw-platform-nav a.active { color: var(--hw-accent); }

/* Platform bar mobile hamburger */
.hw-platform-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 6px;
  margin-left: auto;
}
.hw-platform-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--hw-text-inverse);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
body.hw-menu-open .hw-platform-hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.hw-menu-open .hw-platform-hamburger span:nth-child(2) { opacity: 0; }
body.hw-menu-open .hw-platform-hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Curriculum Bar (Tier 2 — inside a curriculum) ────────────── */
.hw-curriculum-bar {
  background: var(--cur-paper, #faf6f0);
  border-bottom: 1px solid var(--hw-border);
  position: sticky;
  top: 48px;
  z-index: 190;
  box-shadow: var(--shadow-sm);
}
.hw-curriculum-bar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
  display: flex;
  align-items: center;
  gap: 0;
  height: 44px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hw-curriculum-bar__inner::-webkit-scrollbar { display: none; }
.hw-curriculum-bar__back {
  color: var(--hw-text-muted);
  font-family: var(--hw-font-ui);
  font-size: 0.78rem;
  white-space: nowrap;
  padding-right: var(--sp-md);
  border-right: 1px solid var(--hw-border);
  margin-right: var(--sp-md);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--t-fast);
  flex-shrink: 0;
}
.hw-curriculum-bar__back:hover { color: var(--cur-accent); text-decoration: none; }
.hw-curriculum-bar__title {
  font-family: var(--hw-font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--hw-text);
  white-space: nowrap;
  margin-right: var(--sp-lg);
  flex-shrink: 0;
}
.hw-curriculum-bar__phases {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.hw-curriculum-bar__phases a {
  font-family: var(--hw-font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hw-text-muted);
  padding: 0.28rem 0.75rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.hw-curriculum-bar__phases a:hover {
  background: var(--cur-light);
  color: var(--cur-accent);
  text-decoration: none;
}
.hw-curriculum-bar__phases a.active {
  background: var(--cur-accent);
  color: white;
}
.hw-curriculum-bar__resources {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--hw-font-ui);
  font-size: 0.75rem;
  color: var(--hw-text-muted);
  padding: 0.28rem 0.75rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
  border: 1px solid var(--hw-border);
  transition: all var(--t-fast);
}
.hw-curriculum-bar__resources:hover {
  color: var(--cur-accent);
  border-color: var(--cur-accent);
  text-decoration: none;
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
.hw-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--hw-font-ui);
  font-size: 0.75rem;
  color: var(--hw-text-muted);
  padding: var(--sp-sm) 0;
  flex-wrap: wrap;
}
.hw-breadcrumb a {
  color: var(--hw-text-muted);
  transition: color var(--t-fast);
}
.hw-breadcrumb a:hover { color: var(--cur-accent); text-decoration: none; }
.hw-breadcrumb__sep { opacity: 0.5; user-select: none; }
.hw-breadcrumb__current { color: var(--hw-text-soft); font-weight: 600; }

/* ── Platform Footer ──────────────────────────────────────────── */
.hw-platform-footer {
  background: var(--hw-brand);
  color: var(--hw-text-inverse);
  padding: var(--sp-xl) 0 var(--sp-lg);
  margin-top: var(--sp-2xl);
}
.hw-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-lg);
}
.hw-footer-brand h3 {
  font-family: var(--hw-font-display);
  font-size: 1.3rem;
  color: var(--hw-text-inverse);
  margin-bottom: var(--sp-sm);
}
.hw-footer-brand h3 em { color: var(--hw-accent); font-style: normal; }
.hw-footer-brand p { font-size: 0.85rem; color: rgba(255,255,255,0.55); max-width: 32ch; }
.hw-footer-col h4 {
  font-family: var(--hw-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hw-accent);
  margin-bottom: var(--sp-sm);
}
.hw-footer-col li { margin-bottom: 0.4rem; }
.hw-footer-col a { color: rgba(255,255,255,0.6); font-size: 0.85rem; transition: color var(--t-fast); }
.hw-footer-col a:hover { color: var(--hw-accent); text-decoration: none; }
.hw-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--sp-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
}
.hw-footer-bottom a { color: rgba(255,255,255,0.5); }

/* ── Category Color Injection (by platform.js) ────────────────── */
[data-category="visual-arts"]   { --cat-primary:#3a6ea5; --cat-light:#d0e0f5; --cat-dark:#2a5080; }
[data-category="applied-crafts"]{ --cat-primary:#8a5a2a; --cat-light:#f0ddc0; --cat-dark:#6a4218; }
[data-category="culinary-arts"] { --cat-primary:#c4622d; --cat-light:#f5ddd0; --cat-dark:#a04820; }
[data-category="technical"]     { --cat-primary:#4a6a7a; --cat-light:#d8e8f0; --cat-dark:#32505e; }
[data-category="digital-media"] { --cat-primary:#5a4a9e; --cat-light:#ddd8f8; --cat-dark:#3e308c; }

/* ── Curriculum Cards (Explore page) ─────────────────────────── */
.hw-curriculum-card {
  background: var(--hw-bg-raised);
  border: 1px solid var(--hw-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-std) var(--ease), box-shadow var(--t-std) var(--ease);
  text-decoration: none;
  color: inherit;
}
.hw-curriculum-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.hw-curriculum-card__cover {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.hw-curriculum-card__cover-icon { font-size: 3.5rem; z-index: 1; }
.hw-curriculum-card__cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-cover-bg, var(--cat-primary));
  opacity: 0.9;
}
.hw-curriculum-card__body { padding: var(--sp-md); flex: 1; display: flex; flex-direction: column; }
.hw-curriculum-card__category {
  font-family: var(--hw-font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--hw-text-muted);
  margin-bottom: var(--sp-xs);
}
.hw-curriculum-card h3 {
  font-size: 1.05rem;
  margin-bottom: var(--sp-xs);
  line-height: 1.3;
}
.hw-curriculum-card p {
  font-size: 0.82rem;
  color: var(--hw-text-soft);
  flex: 1;
  margin-bottom: var(--sp-sm);
}
.hw-curriculum-card__meta {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-top: auto;
}

/* ── Badges & Tags ────────────────────────────────────────────── */
.hw-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--r-pill);
  font-family: var(--hw-font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hw-badge--age-kids     { background: #fff0d8; color: #b87818; }
.hw-badge--age-teens    { background: #d8f0e8; color: #2a7858; }
.hw-badge--age-adults   { background: var(--hw-accent-light); color: var(--hw-accent-dark); }
.hw-badge--age-all      { background: #e8e0f5; color: #5a489e; }
.hw-badge--beginner     { background: #d8edd8; color: #2a6a2a; }
.hw-badge--intermediate { background: #fff0d0; color: #a06010; }
.hw-badge--advanced     { background: #f0d8d8; color: #8a2020; }
.hw-badge--duration     { background: var(--hw-bg-subtle); color: var(--hw-text-soft); }
.hw-badge--category     { background: var(--cat-light); color: var(--cat-dark); }

/* ── Filter Bar (Explore) ─────────────────────────────────────── */
.hw-filter-bar {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  align-items: center;
  padding: var(--sp-md) 0;
}
.hw-filter-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--hw-border);
  background: var(--hw-bg-raised);
  color: var(--hw-text-soft);
  font-family: var(--hw-font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--t-fast);
}
.hw-filter-btn:hover {
  border-color: var(--cat-primary);
  color: var(--cat-primary);
}
.hw-filter-btn.active {
  background: var(--cat-primary);
  border-color: var(--cat-primary);
  color: white;
}

/* ── Category Hero Band ───────────────────────────────────────── */
.hw-hero {
  padding: var(--sp-2xl) 0 var(--sp-xl);
  position: relative;
  overflow: hidden;
}
.hw-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(var(--hero-r,58),var(--hero-g,110),var(--hero-b,165),0.10) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(201,151,59,0.07) 0%, transparent 55%);
  pointer-events: none;
}
.hw-hero__eyebrow {
  font-family: var(--hw-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cat-primary);
  margin-bottom: var(--sp-sm);
  display: block;
}
.hw-hero__title { margin-bottom: var(--sp-md); }
.hw-hero__title em { color: var(--cat-primary); font-style: italic; }
.hw-hero__subtitle {
  font-size: 1.1rem;
  color: var(--hw-text-soft);
  font-style: italic;
  max-width: 55ch;
  margin-bottom: var(--sp-lg);
}
.hw-hero__cta-row {
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.hw-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.75rem;
  border-radius: var(--r-pill);
  font-family: var(--hw-font-body);
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-std);
  border: 2px solid transparent;
  cursor: pointer;
}
.hw-btn:hover { transform: translateY(-2px); text-decoration: none; }

.hw-btn--primary {
  background: var(--hw-brand);
  color: var(--hw-text-inverse);
  border-color: var(--hw-brand);
}
.hw-btn--primary:hover {
  background: var(--cat-primary);
  border-color: var(--cat-primary);
  box-shadow: 0 6px 20px rgba(58,110,165,.3);
  color: white;
}
.hw-btn--outline {
  background: transparent;
  color: var(--hw-text);
  border-color: var(--hw-border);
}
.hw-btn--outline:hover {
  border-color: var(--hw-text);
  box-shadow: var(--shadow-sm);
}
.hw-btn--accent {
  background: var(--hw-accent);
  color: white;
  border-color: var(--hw-accent);
}
.hw-btn--accent:hover {
  background: var(--hw-accent-dark);
  border-color: var(--hw-accent-dark);
  box-shadow: 0 6px 20px rgba(201,151,59,.35);
  color: white;
}
.hw-btn--sm {
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
}
.hw-btn--complete {
  background: #5c8a6a !important;
  color: white !important;
  border-color: #5c8a6a !important;
}

/* ── Scroll Reveal ────────────────────────────────────────────── */
.hw-reveal,
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.hw-reveal.revealed,
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Section utilities ────────────────────────────────────────── */
.hw-section { padding: var(--sp-xl) 0; }
.hw-section--alt { background: var(--hw-bg-subtle); }
.hw-section--brand { background: var(--hw-brand); color: var(--hw-text-inverse); }

.hw-section-label {
  font-family: var(--hw-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hw-text-muted);
  margin-bottom: var(--sp-sm);
  display: block;
}
.hw-divider {
  border: none;
  border-top: 1px dashed var(--hw-border);
  margin: var(--sp-xl) 0;
}

/* ── Curriculum progress strip ────────────────────────────────── */
.hw-progress-strip {
  display: flex;
  gap: 3px;
  margin: var(--sp-sm) 0;
}
.hw-progress-strip__seg {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--hw-border);
  transition: background 0.3s;
}
.hw-progress-strip__seg.done { background: var(--cur-accent); }

/* ── Table scroll wrapper ─────────────────────────────────────── */
.hw-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--sp-md) 0; }

/* ── ===== RESPONSIVE ===== ───────────────────────────────────── */
@media (max-width: 1024px) {
  .hw-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sp-lg: 1.5rem; --sp-xl: 2.5rem; }

  .hw-container { padding: 0 1rem; }

  /* Platform bar mobile */
  .hw-platform-hamburger { display: flex; }
  .hw-platform-nav {
    display: none;
    position: absolute;
    top: 48px;
    left: 0; right: 0;
    background: var(--hw-brand);
    flex-direction: column;
    padding: var(--sp-md) var(--sp-lg);
    gap: 0;
    border-top: 2px solid var(--hw-accent);
    box-shadow: var(--shadow-lg);
    z-index: 199;
    align-items: flex-start;
  }
  body.hw-menu-open .hw-platform-nav { display: flex; }
  .hw-platform-nav a {
    padding: 0.75rem 0;
    width: 100%;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .hw-platform-bar__inner { position: relative; }

  /* Curriculum bar on mobile: just show phases as scrollable pills */
  .hw-curriculum-bar__back span:not(:first-child) { display: none; }
  .hw-curriculum-bar__resources { margin-left: var(--sp-sm); }

  .hw-footer-grid { grid-template-columns: 1fr 1fr; }
  .hw-hero { padding: var(--sp-xl) 0 var(--sp-lg); }
  .hw-hero__cta-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hw-footer-grid { grid-template-columns: 1fr; }
  .hw-hero__title { font-size: clamp(1.5rem, 8vw, 2rem); }
  .hw-curriculum-bar__title { display: none; }
  .hw-btn { max-width: 100%; justify-content: center; }
  .hw-breadcrumb { font-size: 0.68rem; }
}
