/* ============================================================
   SEMITONE — Shared Stylesheet
   Outfit (display) + JetBrains Mono (code)
   Ocean Lead palette — terroir colours
   ============================================================ */

/* ── Fonts (static weight files from google-webfonts-helper) ── */
@font-face {
  font-display: swap;
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/outfit-v15-latin-400.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/outfit-v15-latin-500.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/outfit-v15-latin-600.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/outfit-v15-latin-700.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 800;
  src: url('../fonts/outfit-v15-latin-800.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/jetbrains-mono-v24-latin-400.woff2') format('woff2');
}
@font-face {
  font-display: swap;
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/jetbrains-mono-v24-latin-600.woff2') format('woff2');
}

/* ── Colour tokens ────────────────────────────────────────── */
:root {
  --palm:      #8FB178;
  --sea:       #4AB8BC;
  --sunrise:   #F5B85A;
  --ocean:     #0D8AB8;
  --sky:       #5A9BD4;
  --sand:      #D4B896;
  --copper:    #E87047;
  --dawn:      #C7717D;
  --verdigris: #00AE84;
  --sun:       #FFD60A;
  --bg-deep:   #12121A;
  --bg:        #1A1A24;
  --surface:   #232330;
  --surface-l: #2E2E3D;
  --border:    #3A3A4A;
  --border-l:  #4A4A5D;
  --muted:     #6E6E84;
  --subtle:    #9494AC;
  --text:      #E4E4EC;
  --bright:    #FFFFFF;
  --syn-keyword:  #0D8AB8;
  --syn-builtin:  #8FB178;
  --syn-operator: #9494AC;
  --syn-ident:    #E4E4EC;
  --syn-integer:  #FFD60A;
  --syn-float:    #5A9BD4;
  --syn-string:   #C7717D;
  --syn-bracket:  #4AB8BC;
  --syn-punct:    #00AE84;
  --syn-comment:  #6E6E84;
  --syn-error:    #E87047;
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
}
h1 { font-size: clamp(34px, 5vw, 60px); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; color: var(--bright); }
h2 { font-size: clamp(20px, 3vw, 28px); font-weight: 700; line-height: 1.2; color: var(--bright); margin-bottom: 18px; }
h3 { font-size: 17px; font-weight: 700; color: var(--bright); margin-bottom: 8px; }
h4 { font-size: 14px; font-weight: 700; color: var(--bright); margin-bottom: 6px; }
p  { line-height: 1.75; color: var(--subtle); }
a  { color: var(--ocean); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--sea);
  background: rgba(74,184,188,0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Mathematical fraction ────────────────────────────────── */
.frac {
  display: inline-block;
  text-align: center;
  line-height: 1.2;
  font-size: 0.6em;
  vertical-align: -0.42em;
}
.frac__num {
  display: block;
  border-bottom: 2px solid currentColor;
  padding-bottom: 1px;
}
.frac__den { display: block; padding-top: 1px; }

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(26,26,36,0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.nav__logo-icon {
  display: flex;
  align-items: center;
  height: 36px;
}
.nav__logo-icon img { height: 36px; width: auto; display: block; }
.nav__logo-wordmark {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.02em;
  color: var(--bright);
}
.nav__links { display: flex; gap: 2px; list-style: none; }
.nav__links a {
  display: block;
  padding: 7px 15px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--subtle);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.nav__links a:hover { color: var(--bright); background: rgba(13,138,184,0.1); }
.nav__links a.active {
  color: var(--bright);
  font-weight: 600;
  background: rgba(13,138,184,0.15);
  border-color: rgba(13,138,184,0.3);
}
.nav__right {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: nowrap;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  padding: 24px 40px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer__main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.footer__credit { font-size: 13px; color: var(--subtle); }
.footer__links { display: flex; gap: 18px; list-style: none; }
.footer__links a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s;
}
.footer__links a:hover { color: var(--ocean); }
.footer__ratio {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--border-l);
}
.footer__disclaimer {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.65;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── LAYOUT 1: Home (full-width hero) ─────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding: 60px 64px 80px;
}
.hero__glow {
  position: absolute; top: 10%; right: 5%;
  width: 980px; height: 980px; border-radius: 50%;
  background: radial-gradient(circle, rgba(13,138,184,0.11) 0%, transparent 70%);
  pointer-events: none;
}
.hero__glow2 {
  position: absolute; bottom: 12%; left: 1%;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74,184,188,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero__wave {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.09; pointer-events: none;
}
.hero__content { position: relative; max-width: 780px; }
.hero__content ul { margin-top: -10px; margin-bottom: 20px; }

.hero__chips { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.hero__title { margin-bottom: 18px; }
.hero__gradient-text {
  background: linear-gradient(90deg, var(--sea), var(--ocean), var(--sunrise));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__sub {
  font-size: 16px;
  max-width: 640px;
  margin-bottom: 12px;
  color: var(--subtle);
  line-height: 1.8;
}
.hero__footnote {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 600px;
  margin-bottom: 32px;
  padding: 10px 14px;
  border-left: 2px solid var(--border);
  background: rgba(255,255,255,0.02);
  border-radius: 0 6px 6px 0;
}

/* ── LAYOUT 2: Sidebar (all inner pages) ──────────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
}
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 36px 16px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.sidebar__label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 0 10px;
}
.sidebar__nav { list-style: none; margin-bottom: 24px; }
.sidebar__nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 400;
  color: var(--subtle);
  text-decoration: none;
  border: 1px solid transparent;
  margin-bottom: 2px;
  transition: all 0.18s;
}
.sidebar__nav a:hover { color: var(--bright); background: rgba(13,138,184,0.07); }
.sidebar__nav a.active {
  color: var(--bright);
  font-weight: 600;
  background: rgba(13,138,184,0.14);
  border-color: rgba(13,138,184,0.28);
}
.sidebar__divider { height: 1px; background: var(--border); margin: 16px 0; }
.sidebar__note { padding: 0 10px; font-size: 11px; color: var(--muted); line-height: 1.6; }

.page-content { padding: 48px 56px; max-width: 860px; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
}
.card--ocean    { box-shadow: 0 0 20px rgba(13,138,184,0.10); }
.card--verdigris{ box-shadow: 0 0 20px rgba(0,174,132,0.10); }
.card--info     { background: rgba(13,138,184,0.05); border-color: rgba(13,138,184,0.18); }

/* ── Chip ─────────────────────────────────────────────────── */
.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
}
.chip--ocean    { background: rgba(13,138,184,0.14);  border: 1px solid rgba(13,138,184,0.28);  color: var(--ocean); }
.chip--verdigris{ background: rgba(0,174,132,0.11);   border: 1px solid rgba(0,174,132,0.28);   color: var(--verdigris); }
.chip--sunrise  { background: rgba(245,184,90,0.11);  border: 1px solid rgba(245,184,90,0.28);  color: var(--sunrise); }
.chip--palm     { background: rgba(143,177,120,0.11); border: 1px solid rgba(143,177,120,0.28); color: var(--palm); }
.chip--sea      { background: rgba(74,184,188,0.11);  border: 1px solid rgba(74,184,188,0.28);  color: var(--sea); }
.chip--dawn     { background: rgba(199,113,125,0.11); border: 1px solid rgba(199,113,125,0.28); color: var(--dawn); }
.chip--muted    { background: rgba(110,110,132,0.11); border: 1px solid rgba(110,110,132,0.28); color: var(--muted); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: opacity 0.18s;
  cursor: pointer;
  border: none;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn--primary { background: var(--ocean); color: var(--bright); box-shadow: 0 4px 16px rgba(13,138,184,0.38); }
.btn--secondary { background: transparent; color: var(--text); border: 1px solid var(--border-l); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Code blocks ──────────────────────────────────────────── */
pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  line-height: 1.85;
}
.code-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}
.kw  { color: var(--syn-keyword);  }
.blt { color: var(--syn-builtin);  }
.op  { color: var(--syn-operator); }
.id  { color: var(--syn-ident);    }
.int { color: var(--syn-integer);  }
.flt { color: var(--syn-float);    }
.str { color: var(--syn-string);   }
.brk { color: var(--syn-bracket);  }
.pct { color: var(--syn-punct);    }
.cmt { color: var(--syn-comment);  }
.err { color: var(--syn-error);    }

/* ── Tables ───────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  padding: 9px 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 8px 14px; border-bottom: 1px solid rgba(58,58,74,0.35); color: var(--text); }
tbody tr:nth-child(even) { background: rgba(26,26,36,0.5); }
td.mono { font-family: 'JetBrains Mono', monospace; color: var(--sea); font-size: 12px; }
td.dim  { color: var(--subtle); font-size: 12px; }

/* ── Infobox ──────────────────────────────────────────────── */
.infobox {
  padding: 15px 18px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.infobox--bar { display: flex; gap: 14px; }
.infobox__bar { width: 4px; flex-shrink: 0; border-radius: 3px; background: var(--ocean); }
.infobox__title { font-size: 13px; font-weight: 700; color: var(--bright); margin-bottom: 4px; }
.infobox__body  { font-size: 13px; color: var(--subtle); line-height: 1.7; }

/* ── Dot lists ────────────────────────────────────────────── */
.dotlist { list-style: none; }
.dotlist li {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 6px; font-size: 13px; color: var(--subtle); line-height: 1.5;
}
.dotlist li::before { content: '—'; color: var(--border-l); flex-shrink: 0; margin-top: 1px; }
.dotlist--diamond li::before { content: '◆'; font-size: 8px; color: inherit; margin-top: 4px; }

/* ── Section ──────────────────────────────────────────────── */
.section { margin-bottom: 56px; }
.section__eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 10px;
}
.section[id] {
  scroll-margin-top: 80px;
}

/* ── Status dot ───────────────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0; margin-top: 2px;
}

/* ── Roadmap ──────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 52px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 19px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--ocean), var(--verdigris), var(--sunrise), var(--palm));
  opacity: 0.3;
}
.timeline__item { position: relative; margin-bottom: 24px; }
.timeline__dot {
  position: absolute; left: -52px; top: 4px;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ocean);
  background: rgba(13,138,184,0.1);
}
.timeline__dot--verdigris { border-color: var(--verdigris); background: rgba(0,174,132,0.1); box-shadow: 0 0 14px rgba(0,174,132,0.35); }
.timeline__dot--ocean     { border-color: var(--ocean);     background: rgba(13,138,184,0.1); }
.timeline__dot--sunrise   { border-color: var(--sunrise);   background: rgba(245,184,90,0.09); }
.timeline__dot--palm      { border-color: var(--palm);      background: rgba(143,177,120,0.09); }
.timeline__pip { width: 10px; height: 10px; border-radius: 50%; background: var(--ocean); }
.timeline__pip--verdigris { background: var(--verdigris); }
.timeline__pip--sunrise   { background: var(--sunrise); }
.timeline__pip--palm      { background: var(--palm); }
.status-chip {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.status-chip--current { background: rgba(13,138,184,0.13); border: 1px solid rgba(13,138,184,0.28); color: var(--ocean); }
.status-chip--next    { background: rgba(0,174,132,0.16);  border: 1px solid rgba(0,174,132,0.32);  color: var(--verdigris); }
.status-chip--planned { background: rgba(245,184,90,0.11); border: 1px solid rgba(245,184,90,0.26); color: var(--sunrise); }
.status-chip--future  { background: var(--surface);        border: 1px solid var(--border);         color: var(--muted); }

/* ── Demo panels ──────────────────────────────────────────── */
.demo-section { margin-bottom: 52px; padding-bottom: 52px; border-bottom: 1px solid var(--border); }
.demo-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.demo-section > p { margin-bottom: 20px; font-size: 14px; }
.demo-panels { display: grid; gap: 12px; }
.demo-panels--2 { grid-template-columns: 1fr 1fr; }
.demo-panels--3 { grid-template-columns: 1fr 1fr 1fr; }
.demo-panel { display: flex; flex-direction: column; }
.demo-panel__label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 6px;
}
.demo-panel__editor {
  flex: 1; min-height: 280px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-deep);
}
.demo-panel__editor .cm-editor {
  height: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.demo-panel__editor .cm-editor.cm-focused {
  outline: none;
  box-shadow: 0 0 0 2px rgba(13,138,184,0.4);
  border-radius: 10px;
}
.demo-panel__output {
  min-height: 120px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-deep);
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--subtle);
  white-space: pre-wrap; overflow-y: auto; resize: vertical;
}
.demo-panel__ast {
  min-height: 120px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-deep);
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--muted);
  white-space: pre; overflow: auto; resize: vertical;
}
.demo-panel__bitmap {
  min-height: 200px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.demo-panel__bitmap img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; cursor: zoom-in;
}
.demo-panel__svg {
  min-height: 200px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 16px;
}
.demo-panel__placeholder {
  color: var(--muted); font-size: 12px; text-align: center; padding: 16px;
}
.demo-run { display: flex; gap: 10px; align-items: center; margin: 12px 0; }
.demo-run button {
  padding: 8px 20px;
  background: var(--ocean); border: none; border-radius: 6px;
  color: var(--bright);
  font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  cursor: pointer; transition: opacity 0.18s;
}
.demo-run button:hover { opacity: 0.85; }
.demo-run button:disabled { opacity: 0.4; cursor: not-allowed; }
.demo-run__status { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* ── Utility ──────────────────────────────────────────────── */
.mb-6  { margin-bottom: 6px;  }
.mb-8  { margin-bottom: 8px;  }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-28 { margin-bottom: 28px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.grid-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.color-ocean     { color: var(--ocean); }
.color-verdigris { color: var(--verdigris); }
.color-sunrise   { color: var(--sunrise); }
.color-palm      { color: var(--palm); }
.color-sea       { color: var(--sea); }
.color-muted     { color: var(--muted); }
.color-bright    { color: var(--bright); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mono    { font-family: 'JetBrains Mono', monospace; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 20px 24px; }
  .sidebar__nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .sidebar__nav li { margin-bottom: 0; }
  .page-content { padding: 32px 24px; }
  .demo-panels--2, .demo-panels--3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { padding: 48px 24px 60px; min-height: auto; }
  .nav { padding: 0 20px; }
  .nav__right { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer { padding: 20px 24px; }
  .footer__main { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .nav__links { display: none; }
}
