/* ─────────────────────────────────────────────────────────────────────────────
   IOL-AI 2026 — companion site styling.
   Palette and type drawn from ioling.org: warm browns, golden yellow, terracotta
   red, on a light paper background. Serif headings (Source Serif 4) + Raleway sans.
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  --paper:    #fcfaf5;   /* page background — warm off-white */
  --paper-2:  #f4efe4;   /* alternating section band */
  --panel:    #ffffff;   /* cards, tables */
  --ink:      #3a2622;   /* primary text — deep brown */
  --ink-soft: #6b554f;   /* secondary text */
  --brown:    #492e2a;   /* headings */
  --brown-2:  #5b3a34;
  --gold:     #fabb00;   /* IOL signature yellow */
  --gold-hi:  #ffeb1a;
  --gold-deep:#d99000;
  --terra:    #c95c1e;   /* terracotta accent */
  --red:      #c92323;
  --border:   #e3d9c6;   /* warm hairline */
  --border-2: #d8cab0;
  --radius: 10px;
  --maxw: 1080px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Raleway", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono:  "Source Code Pro", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); color: var(--brown); font-weight: 700; }
a { color: var(--terra); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.88em; background: #f1ead9; color: var(--brown-2); padding: 0.1em 0.4em; border-radius: 4px; }
em { font-style: italic; }

/* HEADER */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(252,250,245,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--serif); font-size: 1.2rem; color: var(--brown); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; }
.brand-text strong { color: var(--terra); }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav a { color: var(--ink-soft); font-size: 0.9rem; font-weight: 500; letter-spacing: 0.01em; }
.site-nav a:hover { color: var(--brown); text-decoration: none; }
.site-nav .btn { color: var(--brown); }

/* BUTTONS */
.btn {
  display: inline-block; padding: 0.6rem 1.15rem; border-radius: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: var(--brown); box-shadow: 0 4px 14px rgba(217,144,0,0.28); border-color: var(--gold-deep); }
.btn-primary:hover { background: var(--gold-hi); }
.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--brown); }
.btn-ghost:hover { border-color: var(--terra); color: var(--terra); }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.02rem; }

/* HERO */
.hero {
  padding: clamp(3.5rem, 9vw, 6.5rem) clamp(1rem, 4vw, 2.5rem) 3.5rem;
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(250,187,0,0.20), transparent 62%),
    radial-gradient(760px 420px at 6% 4%, rgba(201,92,30,0.12), transparent 58%),
    var(--paper);
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; }
.eyebrow { color: var(--terra); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.78rem; margin: 0 0 1.1rem; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.1rem); line-height: 1.08; margin: 0 0 1.3rem; letter-spacing: -0.01em; }
.grad {
  color: var(--terra);
  background: linear-gradient(180deg, transparent 62%, rgba(250,187,0,0.45) 62%);
  padding: 0 0.06em;
}
.lede { font-family: var(--serif); font-size: clamp(1.1rem, 2vw, 1.32rem); color: var(--ink); max-width: 60ch; margin: 0 0 2rem; line-height: 1.6; }
.lede strong { color: var(--brown); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2.6rem; }

/* COUNTDOWN */
.countdown { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.cd-cell { background: var(--panel); border: 1px solid var(--border-2); border-radius: 10px; padding: 0.65rem 1rem; text-align: center; min-width: 72px; box-shadow: 0 2px 8px rgba(73,46,42,0.05); }
.cd-num { display: block; font-family: var(--serif); font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brown); }
.cd-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.cd-caption { width: 100%; color: var(--ink-soft); font-size: 0.85rem; margin: 0.6rem 0 0; }

/* SECTIONS */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 4vw, 2.5rem); }
.section-alt { max-width: none; background: var(--paper-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: 2.2rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); margin: 0 0 0.5rem; letter-spacing: -0.005em; position: relative; padding-bottom: 0.6rem; }
.section-head h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 3rem; height: 3px; background: var(--gold); border-radius: 2px; }
.section-sub { color: var(--ink-soft); margin: 0; font-size: 1.08rem; }
.prose p { color: var(--ink); max-width: 70ch; font-size: 1.04rem; }
.prose p + p { margin-top: 1.1rem; }
.note { color: var(--ink-soft); font-size: 0.96rem; border-left: 3px solid var(--gold); padding: 0.2rem 0 0.2rem 1rem; margin-top: 2rem; background: rgba(250,187,0,0.06); }

/* MISSION PILLARS */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 2.5rem; }
.pillar { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem 1.4rem; box-shadow: 0 3px 12px rgba(73,46,42,0.05); }
.pillar-mark { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: rgba(250,187,0,0.18); color: var(--terra); font-family: var(--serif); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.9rem; }
.pillar h3 { margin: 0 0 0.45rem; font-size: 1.18rem; }
.pillar p { color: var(--ink-soft); margin: 0; font-size: 0.96rem; }

/* CARDS */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem 1.4rem; box-shadow: 0 3px 12px rgba(73,46,42,0.05); }
.card h3 { margin: 0 0 0.6rem; font-size: 1.22rem; }
.card p { color: var(--ink-soft); margin: 0; font-size: 0.96rem; }
.card-formula { background: linear-gradient(160deg, rgba(250,187,0,0.14), rgba(201,92,30,0.07)); border-color: var(--border-2); }
.formula { font-family: var(--mono); font-size: 1.05rem; color: var(--brown); background: rgba(255,255,255,0.7); border: 1px solid var(--border-2); border-radius: 8px; padding: 0.7rem 0.9rem; margin-bottom: 0.8rem; }

/* SPLIT + STEPS */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding: 0.6rem 0 0.6rem 2.7rem; color: var(--ink); border-bottom: 1px solid var(--border); font-size: 1rem; }
.steps li:last-child { border-bottom: none; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0.55rem;
  width: 1.85rem; height: 1.85rem; border-radius: 50%; background: var(--gold); color: var(--brown);
  font-family: var(--serif); font-weight: 700; font-size: 0.9rem; display: grid; place-items: center; border: 1px solid var(--gold-deep); }

/* CODE */
.code { background: #2e1f1c; border: 1px solid #3a2622; border-radius: var(--radius); padding: 1.2rem; overflow-x: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.55; color: #f0e6d6; box-shadow: 0 4px 16px rgba(73,46,42,0.12); }
.code code { background: none; padding: 0; color: inherit; }
.example { min-width: 0; }
.example-label { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 0.6rem; line-height: 1.5; }
.cta-row { margin-top: 2rem; }

/* TABLES */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: 0 3px 12px rgba(73,46,42,0.05); }
table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.def-table th, .def-table td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); }
.def-table th { background: var(--paper-2); color: var(--brown); font-weight: 700; font-family: var(--serif); }
.def-table tr:last-child td { border-bottom: none; }

/* LEADERBOARD */
.lb-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; color: var(--ink-soft); font-size: 0.88rem; }
.lb-table th, .lb-table td { padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--border); text-align: left; }
.lb-table th { background: var(--paper-2); color: var(--brown); font-family: var(--serif); font-weight: 700; position: sticky; top: 0; cursor: pointer; user-select: none; white-space: nowrap; }
.lb-table th.num, .lb-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.lb-table th[data-sort]:hover { color: var(--terra); }
.lb-table th.sorted-asc::after { content: " ▲"; color: var(--terra); }
.lb-table th.sorted-desc::after { content: " ▼"; color: var(--terra); }
.lb-table tbody tr:hover { background: rgba(250,187,0,0.07); }
.lb-table .rank-col { text-align: right; color: var(--ink-soft); width: 3rem; }
.lb-table tr:nth-child(1) .rank-col { color: var(--gold-deep); font-weight: 700; font-family: var(--serif); }
.score-cell { font-weight: 700; color: var(--terra); font-variant-numeric: tabular-nums; }
.team-cell { font-weight: 600; color: var(--brown); }
.lb-empty { text-align: center; color: var(--ink-soft); padding: 2.5rem 1rem; }
.badge { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; font-size: 0.75rem; }
.badge-elig { background: rgba(250,187,0,0.22); color: var(--gold-deep); border: 1px solid var(--gold); }
.team-cell .badge { margin-left: 0.4rem; }

/* TIMELINE */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: none; }
.t-date { color: var(--terra); font-weight: 700; font-family: var(--serif); }
.t-event { color: var(--ink); }

/* FOOTER */
.site-footer { background: var(--brown); padding: 2.6rem clamp(1rem, 4vw, 2.5rem); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; gap: 1.5rem; align-items: flex-start; }
.footer-logo { width: 50px; height: 50px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.site-footer p { color: #e6d8c8; font-size: 0.9rem; margin: 0 0 0.5rem; max-width: 70ch; }
.site-footer strong { color: #fff; }
.footer-links a { color: var(--gold-hi); font-weight: 600; }

/* RESPONSIVE */
@media (max-width: 820px) {
  .site-nav a:not(.btn) { display: none; }
  .pillars { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 0.2rem; }
}
