/* ============================================================
   YAKKI EDU — Site Design System
   Zero-dependency, WCAG 2.2 AA, RTL-ready (logical properties)
   Light professional theme; navy + gold brand continuity
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --navy-900: #0D1B2A;
  --navy-800: #1B263B;
  --navy-700: #27374D;
  --navy-100: #E3E8EF;
  --gold-500: #C9A227;   /* accessible gold for text on light bg */
  --gold-400: #E0B93B;
  --gold-bright: #FFD700; /* accents on dark surfaces only */

  /* Neutrals */
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --surface-alt: #F1F4F8;
  --text: #1A202C;
  --text-muted: #4A5568;
  --border: #D8DEE7;

  /* Status */
  --status-available-bg: #E6F4EA;
  --status-available-fg: #1E6B34;
  --status-pilot-bg: #FFF4E0;
  --status-pilot-fg: #8A5A00;
  --status-dev-bg: #E8EEF7;
  --status-dev-fg: #2B4C7E;

  /* Semantic */
  --link: #1D4E89;
  --link-hover: #0D1B2A;
  --focus-ring: #1D4E89;

  /* Type scale */
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Hebrew", "Noto Sans Arabic", sans-serif;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-2xl: 2.125rem;
  --fs-3xl: 2.75rem;

  --maxw: 72rem;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(13, 27, 42, 0.08), 0 4px 14px rgba(13, 27, 42, 0.06);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy-900); margin: 0 0 0.6em; }
h1 { font-size: var(--fs-3xl); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 3px;
}
ul, ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
table { border-collapse: collapse; width: 100%; margin: 0 0 1.5em; }
th, td { border: 1px solid var(--border); padding: 0.6em 0.8em; text-align: start; vertical-align: top; }
th { background: var(--surface-alt); color: var(--navy-900); }
blockquote {
  margin: 0 0 1.2em;
  padding: 0.8em 1.2em;
  border-inline-start: 4px solid var(--gold-500);
  background: var(--surface-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
}
code { background: var(--surface-alt); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.92em; }
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ---------- Utilities ---------- */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: 0; top: -48px;
  background: var(--navy-900); color: #fff; padding: 0.6em 1.2em;
  z-index: 100; transition: top 0.15s;
}
.skip-link:focus { top: 0; }
.text-muted { color: var(--text-muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--navy-900);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}
.site-header .container {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 64px; flex-wrap: wrap; padding-block: 0.5rem;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.3rem;
}
.brand .brand-mark { color: var(--gold-bright); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-inline-start: auto; align-items: center; }
.site-nav a {
  color: #E0E1DD; text-decoration: none; padding: 0.45em 0.75em;
  border-radius: 6px; font-size: var(--fs-sm); font-weight: 600;
}
.site-nav a:hover { background: var(--navy-700); color: #fff; }
.site-nav a[aria-current="page"] { background: var(--navy-700); color: var(--gold-bright); }
.lang-switch {
  display: flex; gap: 0.15rem; margin-inline-start: 0.75rem;
  border: 1px solid var(--navy-700); border-radius: 6px; padding: 2px;
}
.lang-switch a {
  color: #E0E1DD; text-decoration: none; font-size: 0.8rem; font-weight: 700;
  padding: 0.25em 0.55em; border-radius: 4px; text-transform: uppercase;
}
.lang-switch a:hover { background: var(--navy-700); }
.lang-switch a[aria-current="true"] { background: var(--gold-500); color: var(--navy-900); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 70%, var(--navy-700) 100%);
  color: #fff;
  padding-block: 4rem 4.5rem;
}
.hero h1 { color: #fff; max-width: 46rem; }
.hero .tagline { color: var(--gold-bright); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: var(--fs-sm); margin-bottom: 1rem; }
.hero p.lead { font-size: var(--fs-lg); color: #D7DEE8; max-width: 44rem; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.8rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 700;
  padding: 0.7em 1.5em; border-radius: 8px; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--gold-500); color: var(--navy-900); }
.btn-primary:hover { background: var(--gold-400); color: var(--navy-900); }
.btn-outline { border-color: currentColor; color: #fff; background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn-outline-dark { border-color: var(--navy-800); color: var(--navy-800); background: transparent; }
.btn-outline-dark:hover { background: var(--navy-100); color: var(--navy-900); }

/* ---------- Sections ---------- */
.section { padding-block: 3.5rem; }
.section-alt { background: var(--surface-alt); }
.section-dark { background: var(--navy-900); color: #E0E1DD; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-kicker {
  color: var(--gold-500); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: var(--fs-sm); margin-bottom: 0.4rem;
}

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.card h3, .card h4 { margin-top: 0; }
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover { border-color: var(--navy-700); color: inherit; }
.card-link:hover h3, .card-link:hover h4 { color: var(--link); }
.card .card-cta { color: var(--link); font-weight: 700; }

/* ---------- Status badges (committee F005 — mandatory) ---------- */
.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  padding: 0.22em 0.7em; border-radius: 999px; letter-spacing: 0.02em;
  vertical-align: middle; white-space: nowrap;
}
.badge-available { background: var(--status-available-bg); color: var(--status-available-fg); }
.badge-pilot { background: var(--status-pilot-bg); color: var(--status-pilot-fg); }
.badge-dev { background: var(--status-dev-bg); color: var(--status-dev-fg); }
.section-dark .badge-available { background: #1E6B34; color: #fff; }
.section-dark .badge-pilot { background: #8A5A00; color: #fff; }
.section-dark .badge-dev { background: #2B4C7E; color: #fff; }

/* ---------- Steps / timeline ---------- */
.steps { list-style: none; padding: 0; margin: 0 0 1.5em; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative;
  padding-inline-start: 3.2rem; padding-block: 0.7rem;
}
.steps li::before {
  content: counter(step);
  position: absolute; inset-inline-start: 0; top: 0.55rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--navy-900); color: var(--gold-bright);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.steps li + li { border-top: 1px dashed var(--border); }

/* ---------- Stats band ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: center; }
.stat { text-align: center; min-width: 8rem; }
.stat .stat-num { font-size: var(--fs-3xl); font-weight: 800; color: var(--gold-bright); line-height: 1.1; }
.stat .stat-label { color: #B9C2CF; font-size: var(--fs-sm); }
.section:not(.section-dark) .stat .stat-num { color: var(--navy-900); }
.section:not(.section-dark) .stat .stat-label { color: var(--text-muted); }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: #fff; border-radius: var(--radius);
  padding: 2.5rem 2rem; text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #C9D2DD; max-width: 38rem; margin-inline: auto; }

/* ---------- Notice / info boxes ---------- */
.notice {
  border: 1px solid var(--border); border-inline-start: 5px solid var(--gold-500);
  background: var(--surface); border-radius: var(--radius);
  padding: 1.1rem 1.4rem; margin-block: 1.5rem;
}
.notice.notice-dev { border-inline-start-color: var(--status-dev-fg); }
.notice.notice-warn { border-inline-start-color: var(--status-pilot-fg); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: var(--fs-sm); color: var(--text-muted); padding-block: 1rem 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4em; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "›"; margin-inline-end: 0.4em; color: var(--text-muted); }
[dir="rtl"] .breadcrumbs li + li::before { content: "‹"; }

/* ---------- Game catalog ---------- */
.category-tile { position: relative; }
.category-tile .count {
  font-size: var(--fs-sm); color: var(--text-muted);
}
.game-entry {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-block: 1rem;
}
.game-entry h3 { margin-bottom: 0.3em; display: flex; align-items: center; gap: 0.6em; flex-wrap: wrap; }
.game-meta { display: flex; flex-wrap: wrap; gap: 0.45em; margin: 0.4em 0 0.8em; }
.game-meta .chip {
  font-size: 0.75rem; background: var(--surface-alt); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 0.15em 0.65em;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900); color: #AEB8C4;
  padding-block: 3rem 2rem; margin-top: 4rem; font-size: var(--fs-sm);
}
.site-footer a { color: #D7DEE8; }
.site-footer a:hover { color: var(--gold-bright); }
.site-footer h4 { color: #fff; font-size: 1rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.footer-bottom {
  border-top: 1px solid var(--navy-700); margin-top: 2.5rem; padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5em; }

/* ---------- Details / accordion ---------- */
details.faq {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-block: 0.7rem; padding: 0;
}
details.faq summary {
  cursor: pointer; font-weight: 700; padding: 1rem 1.3rem;
  list-style-position: inside; color: var(--navy-900);
}
details.faq[open] summary { border-bottom: 1px solid var(--border); }
details.faq .faq-body { padding: 1rem 1.3rem; }

/* ---------- References (methodology) ---------- */
.references { font-size: var(--fs-sm); color: var(--text-muted); }
.references li { margin-bottom: 0.7em; }

/* ---------- Print (PDF via print-CSS, committee F009) ---------- */
@media print {
  .site-header, .site-footer, .skip-link, .cta-band, .no-print, .breadcrumbs, .lang-switch { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .hero { background: none; color: #000; padding-block: 0.5rem; }
  .hero h1 { color: #000; }
  .hero p.lead, .hero .tagline { color: #333; }
  .section { padding-block: 1rem; }
  .card, .game-entry, .notice { box-shadow: none; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .print-header { display: block !important; border-bottom: 2px solid #000; margin-bottom: 1rem; padding-bottom: 0.5rem; }
  h2, h3 { break-after: avoid; }
}
.print-header { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  :root { --fs-3xl: 2.1rem; --fs-2xl: 1.7rem; }
  .site-header .container { gap: 0.6rem; }
  .site-nav { margin-inline-start: 0; width: 100%; overflow-x: auto; padding-bottom: 0.3rem; }
  .hero { padding-block: 2.8rem 3.2rem; }
}
