/* =========================================================
   STEAM in Saudi — Design System v3
   A confident, contemporary palette drawn straight from the
   brand mark (deep forest, terracotta, gold) on a clean warm
   white — paired with a modern humanist type system. Keeps the
   hand-set personality (offset shadows, dashed rules, a touch
   of rotation) without reading like scanned vintage paper.
   ========================================================= */

:root {
  --paper:        #FAF7F2;
  --paper-deep:    #F0EAE0;
  --ink:        #16211C;
  --ink-soft:    #465049;
  --muted:        #7C8880;
  --line:        #DEE3D8;

  --forest:        #1F6B4F;   /* primary accent, from the brand mark */
  --forest-deep:    #12362A;
  --rust:        #E2572B;   /* secondary accent */
  --gold:        #EFA53C;   /* tertiary accent */

  --card:        #FFFFFF;

  --font-display: "Bricolage Grotesque", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1120px;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -0.015em;
}
p { margin: 0 0 1em; }
button { font-family: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  z-index: 1000;
}
.skip-link:focus { left: 0; top: 0; }

/* ---------- Links (keep a nod to the plain-web underline the old site had) ---------- */
.text-link {
  text-decoration: underline;
  text-decoration-color: var(--rust);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: 600;
}
.text-link:hover { text-decoration-color: var(--ink); }

/* ---------- Buttons: flat, hard offset shadow, not a soft glowing pill ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--ink); }
.btn-solid {
  background: var(--rust);
  border-color: var(--ink);
  color: #fff;
}
.btn-on-dark {
  border-color: var(--paper);
  color: var(--paper);
  background: transparent;
  box-shadow: 4px 4px 0 var(--paper);
}
.btn-on-dark:hover { box-shadow: 6px 6px 0 var(--paper); }
.btn:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
}
.brand-mark-img { width: 48px; height: 48px; flex-shrink: 0; display: block; object-fit: contain; }
.brand-mark-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--rust);
}
.nav-cta { margin-left: 6px; }
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 6px;
}
.nav-toggle svg { width: 22px; height: 22px; display: block; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border-bottom: 2px solid var(--ink);
    display: none;
    gap: 2px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 14px; border-bottom: none; border-left: 3px solid transparent; }
  .nav-links a:hover, .nav-links a[aria-current="page"] { border-left-color: var(--rust); border-bottom: none; background: var(--paper-deep); }
  .nav-cta { margin-left: 0; margin-top: 6px; }
}

/* ---------- Sticker / stamp badges (hand annotation feel) ---------- */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display); font-style: italic;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rust);
  border: 2px dashed var(--rust);
  padding: 3px 14px 5px;
  border-radius: 999px;
  transform: rotate(-2deg);
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-deep);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.5rem);
  margin: 14px 0 18px;
  color: var(--forest-deep);
}
.hero h1 em {
  font-style: italic;
  color: var(--rust);
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 48ch;
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art {
  position: relative;
  transform: rotate(2deg);
}
.hero-art svg { width: 100%; height: auto; }

.tape {
  position: absolute;
  width: 70px;
  height: 26px;
  background: rgba(239,165,60,0.55);
  border: 1px solid rgba(239,165,60,0.7);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* ---------- Sections ---------- */
.section { padding: 76px 0; }
.section-tight { padding: 52px 0; }
.section-alt { background: var(--paper-deep); }
.section-dark {
  background: var(--forest-deep);
  color: var(--paper);
}
.section-head {
  max-width: 700px;
  margin: 0 0 44px;
}
.section-head.centered { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .kicker {
  font-family: var(--font-display); font-style: italic;
  color: var(--rust);
  font-weight: 700;
  font-size: 1.3rem;
  display: block;
  margin-bottom: 2px;
  transform: rotate(-1deg);
}
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; margin-bottom:0; }
.section-dark .section-head p { color: rgba(246,241,228,0.75); }
.section-dark .section-head .kicker { color: var(--gold); }

.rule {
  border: none;
  border-top: 2px dashed var(--line);
  margin: 0 0 44px;
}

/* ---------- Feature grid: index-card style, not soft-shadow squares ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.card:nth-child(3n+1) { transform: rotate(-0.6deg); }
.card:nth-child(3n+2) { transform: rotate(0.5deg); }
.card:nth-child(3n)   { transform: rotate(-0.3deg); }

.icon-sketch {
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  color: var(--forest);
}
.icon-sketch svg { width: 100%; height: 100%; }
.card h3 { font-size: 1.12rem; }
.card p { color: var(--ink-soft); margin-bottom: 0; font-size: 0.96rem; }

/* ---------- Numbered list (History) — ledger style, not a dot-timeline ---------- */
.ledger { max-width: 760px; }
.ledger-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-top: 2px dashed var(--line);
}
.ledger-item:last-child { border-bottom: 2px dashed var(--line); }
.ledger-num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--line);
  font-weight: 700;
}
.ledger-item .tag {
  display: inline-block;
  font-family: var(--font-display); font-style: italic;
  color: var(--forest);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.ledger-item h3 { font-size: 1.08rem; margin-bottom: 6px; }
.ledger-item p { color: var(--ink-soft); margin-bottom: 0; }

/* ---------- Quote ---------- */
.quote-block { max-width: 720px; }
.quote-block blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  margin: 0 0 14px;
  color: var(--forest-deep);
}
.quote-block cite { color: var(--muted); font-family: var(--font-display); font-style: italic; font-size: 1.2rem; }

/* ---------- Filter bar ---------- */
.filter-group { margin-bottom: 18px; }
.filter-group:last-of-type { margin-bottom: 36px; }
.filter-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ink);
  cursor: pointer;
}
.filter-btn.is-active { background: var(--forest); border-color: var(--forest); color: #fff; }

/* ---------- Project cards with real video thumbnails ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 980px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } }

.project-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project-card:nth-child(4n+1) { transform: rotate(-0.5deg); }
.project-card:nth-child(4n+2) { transform: rotate(0.4deg); }
.project-card:nth-child(4n+3) { transform: rotate(-0.3deg); }
.project-card:nth-child(4n+4) { transform: rotate(0.5deg); }

.video-frame {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--ink);
  border-bottom: 2px solid var(--ink);
  cursor: pointer;
}
.video-frame img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-btn::after {
  content: "";
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--rust);
  border: 2px solid var(--paper);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
}
.play-btn svg {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  color: #fff;
  margin-left: 3px;
}
.project-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.project-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 6px; }
.level-pill {
  font-family: var(--font-display); font-style: italic;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 1px 10px 3px;
  border: 2px solid currentColor;
  border-radius: 999px;
}
.level-beginner { color: var(--forest); }
.level-intermediate { color: var(--gold); }
.level-advanced { color: var(--rust); }
.age-pill { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.project-card h3 { font-size: 1.06rem; margin-bottom: 4px; }
.cat-line { font-size: 0.78rem; color: var(--forest); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.project-card p { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 0; }

/* Competition cards */
.comp-card {
  border-top: 2px dashed var(--line);
  padding: 26px 0;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 22px;
  align-items: start;
}
.comp-card:last-child { border-bottom: 2px dashed var(--line); }
.comp-card .org-logo-chip { width: 84px; height: 84px; border-radius: 16px; }
.comp-card h3 { font-size: 1.08rem; margin-bottom: 4px; }
.comp-org {
  display: block;
  font-family: var(--font-display); font-style: italic;
  font-size: 1rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 6px;
}
.comp-card p { color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 0; }

.subsection-title {
  font-size: 1.4rem;
  margin: 0 0 6px;
}
.subsection-sub { color: var(--muted); margin-bottom: 8px; font-size: 0.95rem; }

/* ---------- Provider cards ---------- */
.provider-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.provider-card:nth-child(3n+1) { transform: rotate(-0.4deg); }
.provider-card:nth-child(3n+2) { transform: rotate(0.4deg); }
.provider-card:nth-child(3n)   { transform: rotate(-0.2deg); }
.provider-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}
.provider-rank {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--line);
}

/* Shared org logo chip — used on provider cards and competition cards */
.org-logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: var(--card);
  padding: 12px;
  box-shadow: 3px 3px 0 rgba(22,33,28,0.14);
}
.org-logo-chip img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.org-logo-chip--dark { background: var(--ink); border-color: var(--ink); }
.org-logo-chip--fallback {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.15;
  color: var(--ink-soft);
  padding: 6px;
  background-image: repeating-linear-gradient(135deg, var(--paper-deep), var(--paper-deep) 8px, var(--paper) 8px, var(--paper) 16px);
}
.provider-logo-chip { width: 84px; height: 84px; border-radius: 16px; }

.provider-card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.provider-loc { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--forest); margin-bottom: 4px; }
.provider-card p { color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 0; }
.provider-card .text-link { font-size: 0.88rem; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--forest-deep);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.cta-banner h2 { margin-bottom: 6px; font-size: 1.5rem; color: var(--paper); }
.cta-banner p { margin: 0; color: rgba(246,241,228,0.78); }

/* ---------- Coming soon / notice ---------- */
.notice-card {
  max-width: 680px;
  padding: 48px 40px;
  background: var(--card);
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
}

/* ---------- Contact ---------- */
.contact-wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 44px; align-items: start; }
@media (max-width: 860px) { .contact-wrap { grid-template-columns: 1fr; } }
.contact-list { display: flex; flex-direction: column; gap: 20px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list .icon-sketch { flex-shrink: 0; margin-bottom: 0; width: 34px; height: 34px; }
.contact-list h4 { margin: 0 0 2px; font-size: 0.98rem; }
.contact-list p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.form-field input, .form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--paper);
}
.form-field input:focus, .form-field textarea:focus { outline: none; box-shadow: 3px 3px 0 var(--rust); }
.form-note { font-size: 0.82rem; color: var(--muted); margin-top: 10px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(246,241,228,0.8); padding: 56px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--paper); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-bottom: 12px; }
.footer-brand .brand-mark-chip { width: 44px; height: 44px; border-radius: 11px; }
.footer-brand .brand-mark-chip .brand-mark-img { width: 32px; height: 32px; }
.site-footer p { font-size: 0.92rem; color: rgba(246,241,228,0.6); max-width: 40ch; }
.footer-col h4 { color: var(--paper); font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 1.15rem; margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: 0.92rem; color: rgba(246,241,228,0.68); }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(246,241,228,0.15);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.83rem;
  color: rgba(246,241,228,0.5);
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: var(--paper-deep);
  border-bottom: 2px solid var(--ink);
  padding: 56px 0 48px;
}
.page-hero .kicker {
  font-family: var(--font-display); font-style: italic;
  color: var(--rust);
  font-weight: 700;
  font-size: 1.25rem;
  display: block;
  margin-bottom: 2px;
  transform: rotate(-1deg);
}
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 12px; color: var(--forest-deep); }
.page-hero p { color: var(--ink-soft); max-width: 62ch; font-size: 1.05rem; margin-bottom: 0; }

/* Utility */
.text-center { text-align: center; }
.mt-lg { margin-top: 44px; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 300px; margin: 0 auto 12px; }
  .section { padding: 56px 0; }
  .cta-banner { padding: 32px; text-align: center; justify-content: center; }
  .card, .project-card, .provider-card { transform: none !important; }
}

@media (max-width: 560px) {
  .comp-card { grid-template-columns: 64px 1fr; gap: 14px; }
  .comp-card .org-logo-chip { width: 64px; height: 64px; border-radius: 12px; }
}
