/* ============================================================
   iOi house stylesheet — the single source of truth.
   Neutral base (black/white core) + official iOi palette accents.
   Light and dark themes via [data-theme] on <html>.
   Change this file and every page that links it updates.
   ============================================================ */

:root {
  /* neutral tokens — LIGHT */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --fill: #f0f0f0;
  --ink: #1a1a1a;
  --ink-soft: #3d3d3d;
  --muted: #767676;
  --line: #dcdcdc;
  --line-soft: #ececec;
  --link: #1a5fb4;
  --code-bg: #1e1e1e;
  --code-ink: #f2f2f2;

  /* official iOi palette (same in both themes) */
  --yellow: #FFCB05;
  --blue:   #00B3DF;
  --red:    #EF4124;
  --green:  #00AB8A;
  --purple: #6462AB;
  --orange: #F79225;
  --pink:   #F9BEC9;
  --sand:   #CFC9BC;
  --charcoal:#877C78;

  --radius: 8px;
  --maxw: 940px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1c1f24;
  --surface-2: #22262c;
  --fill: #2a2f36;
  --ink: #eaeaea;
  --ink-soft: #c7ccd2;
  --muted: #9aa1a9;
  --line: #343a42;
  --line-soft: #2a2f36;
  --link: #6db3f2;
  --code-bg: #0e0f11;
  --code-ink: #eaeaea;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; font-family: var(--font); font-size: 17px; color: var(--ink);
  background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; }
p { color: var(--ink-soft); }
ul { color: var(--ink-soft); padding-left: 1.3em; }
ul li { margin: 6px 0; }
a { color: var(--link); }

/* theme toggle (injected by theme.js) */
.theme-toggle {
  position: fixed; top: 12px; right: 14px; z-index: 200;
  font: 600 .8rem/1 var(--font); color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.theme-toggle:hover { border-color: var(--muted); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar__inner { max-width: var(--maxw); margin: 0 auto; padding: 13px 24px; display: flex; align-items: baseline; gap: 12px; }
.topbar__brand, .topbar__title { font-weight: 700; font-size: .98rem; color: var(--ink); }
.topbar__sub { font-size: .82rem; color: var(--muted); }
.topbar__icon { width: 22px; height: 22px; object-fit: contain; display: block; flex: none; align-self: center; }

/* hero */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 52px 24px 8px; }
.hero h1 { font-size: 2.3rem; margin: 0 0 8px; font-weight: 700; letter-spacing: -.01em; }
.hero h1 .rule { display: block; width: 56px; height: 5px; border-radius: 3px; background: var(--red); margin: 16px 0 0; }
.hero p.lede { font-size: 1.14rem; color: var(--ink-soft); margin: 20px 0 0; max-width: 64ch; }
.eyebrow { display: block; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

/* stat band */
.stats { max-width: var(--maxw); margin: 40px auto 8px; padding: 0 24px; display: grid; gap: 14px; grid-template-columns: repeat(6, 1fr); }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px; }
.stat__num { font-size: 1.9rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.stat__label { font-size: .8rem; color: var(--muted); margin-top: 7px; }

/* sections */
.section { max-width: var(--maxw); margin: 44px auto 0; padding: 0 24px; }
.section__title, section > h2 { font-size: 1.5rem; margin: 0 0 10px; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.section__title.eyebrowed { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
section { margin: 0 0 48px; scroll-margin-top: 72px; }
section > h2 .num { color: var(--muted); font-weight: 700; margin-right: 6px; }
section h3 { font-size: 1.12rem; margin: 26px 0 6px; font-weight: 600; }
section strong { color: var(--ink); font-weight: 600; }

/* cards */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); margin: 18px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--muted); border-radius: var(--radius); padding: 18px 18px 16px; display: flex; flex-direction: column; }
.card h3, .card h4 { margin: 0 0 6px; font-size: 1.06rem; font-weight: 700; }
.card p { margin: 0 0 12px; font-size: .93rem; color: var(--ink-soft); }
.card .metric { margin-top: auto; font-size: .8rem; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 10px; }

/* launchpad — clickable project tiles (dashboard) */
.launch { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin: 18px 0; }
.launch a.tile {
  text-decoration: none; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-top: 4px solid var(--muted);
  border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s ease, transform .1s ease;
}
.launch a.tile:hover { border-color: var(--muted); transform: translateY(-2px); }
.launch .tile h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.launch .tile p { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.launch .tile .open { margin-top: 8px; font-size: .78rem; font-weight: 600; color: var(--link); }
.launch .tile .sub { margin-top: 6px; font-size: .74rem; color: var(--muted); }

/* callout */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--muted); background: var(--surface-2); border-radius: var(--radius); padding: 14px 18px; margin: 18px 0; color: var(--ink-soft); font-size: .97rem; }
.callout strong { color: var(--ink); }

/* toc */
.toc { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; margin: 32px 0 44px; }
.toc h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: 32px; }
.toc li { margin: 6px 0; }
.toc a { color: var(--link); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0; }
.steps li { position: relative; padding: 2px 0 16px 40px; margin: 0 0 0 12px; border-left: 1px solid var(--line); }
.steps li:last-child { border-left-color: transparent; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: -14px; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-weight: 600; font-size: .85rem; display: grid; place-items: center; }
.steps li strong { color: var(--ink); }

/* figure / screenshot */
figure.shot { margin: 22px 0; }
figure.shot .frame { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot.is-missing .frame::before { content: "Screenshot: " attr(data-label); display: flex; align-items: center; justify-content: center; min-height: 200px; padding: 28px; color: var(--muted); font-size: .92rem; font-weight: 600; text-align: center; background: var(--fill); }
figure.shot.is-missing .frame::after { content: "awaiting " attr(data-file); position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: .74rem; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
figure.shot.is-missing img { display: none; }
figcaption { margin-top: 8px; font-size: .85rem; color: var(--muted); text-align: center; }

/* board mockup */
.board { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); margin: 20px 0; font-size: .92rem; }
.board__group { font-weight: 600; padding: 10px 16px; background: var(--fill); color: var(--ink); border-bottom: 1px solid var(--line); }
.board table { width: 100%; border-collapse: collapse; }
.board th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.board td { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }
.board tr:last-child td { border-bottom: none; }
.pill { display: inline-block; font-weight: 600; font-size: .78rem; padding: 2px 10px; border-radius: var(--radius); border: 1px solid var(--line); color: var(--ink-soft); background: var(--fill); }

/* story strip */
.story { max-width: var(--maxw); margin: 40px auto 0; padding: 18px 24px; }
.story__inner { border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--radius); padding: 16px 20px; color: var(--ink-soft); font-size: .98rem; background: var(--surface-2); }
.story__inner strong { color: var(--ink); }

/* code */
pre.code { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; font-size: .85rem; line-height: 1.5; font-family: ui-monospace, Menlo, monospace; margin: 16px 0; }
code.inline { font-family: ui-monospace, Menlo, monospace; font-size: .88em; background: var(--fill); padding: 1px 6px; border-radius: 4px; color: var(--ink); }
.note-strip { border: 1px dashed var(--muted); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 8px; font-size: .9rem; color: var(--muted); }

/* wrap + footer */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 80px; }
.foot { max-width: var(--maxw); margin: 44px auto 0; padding: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

@media (max-width: 760px) { .stats { grid-template-columns: repeat(3, 1fr); } .hero h1 { font-size: 1.9rem; } .toc ol { columns: 1; } }
@media (max-width: 440px) { .stats { grid-template-columns: repeat(2, 1fr); } }
