/* DeskOS — blueprint. One accent, thin rules, no decoration without a reason. */

@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-var.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #f1f5f8;
  --panel: #fbfdff;
  --panel-2: #f0f5fa;
  --line: #cfdae4;
  --line-soft: #e1e9f1;
  --paper: #1e2a33;
  --muted: #5e7183;
  --accent: #4e7892;
  --accent-hi: #5f8da8;
  --green: #4e7892;
  --violet: #6f7fb0;
  --red: #a5564a;
  --blue: #2f5b93;
  --wrap: 1200px;
  --gutter: clamp(1.1rem, 4vw, 3rem);
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
}

/* The paper grid: two weights of rule, both barely there. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(30,42,51,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30,42,51,.035) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px;
  z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }

a { color: var(--paper); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(var(--wrap), 100% - var(--gutter) * 2); margin-inline: auto; }
.narrow { max-width: 780px; }
.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--ink); padding: .6rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

/* Nav */
.nav { border-bottom: 1px solid var(--line-soft); }
.nav-inner { display: flex; align-items: center; gap: 2rem; padding: 1.1rem 0; }
.nav-inner > nav { margin-left: auto; }
.brand { display: inline-flex; }
.wordmark { height: 30px; width: auto; display: block; }
.links { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.links a { text-decoration: none; color: var(--muted); font-size: .95rem; }
.links a:hover { color: var(--paper); }
.nav-cta { margin-left: .5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.2rem; border-radius: var(--radius);
  font-weight: 700; font-size: .95rem; text-decoration: none; border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-solid { background: var(--accent); color: var(--ink); }
.btn-solid:hover { background: var(--accent-hi); color: var(--ink); }
.btn-ghost { border-color: var(--line); color: var(--paper); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Hero */
.hero { padding: clamp(2.4rem, 5vw, 4rem) 0 0; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 1.18fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.eyebrow {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1.2rem;
}
h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: .95; letter-spacing: -.035em; font-weight: 800;
  margin: 0 0 1.4rem; text-wrap: balance;
}
.mark { color: var(--accent); position: relative; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #3a4753; max-width: 34ch; margin: 0 0 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.note { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 1.6rem; }

/* Two columns that alternate: text one side, plate the other. */
.split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split-text { min-width: 0; }
.split-figure { margin: 0; min-width: 0; position: relative; }
.split-figure::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 12px 12px var(--ink); }
.split-figure img { display: block; width: 100%; height: auto; mix-blend-mode: darken; }
.split.flip .split-text { order: 2; }
.split.flip .split-figure { order: 1; }
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .split.flip .split-text, .split.flip .split-figure { order: initial; }
}
.split .light-note { margin-top: 1rem; }

/* Illustrations (notebook plates: no frame, they sit on the paper) */
.figure-plain { margin: 2.2rem 0 0; position: relative; }
/* The plates are photographed paper: their edges carry a faint vignette. A
   shadow in the page colour feathers it away without cropping the drawing. */
.figure-plain::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 12px 12px var(--ink); }
.figure-narrow { max-width: 720px; margin-inline: auto; }
.figure-plain picture { display: block; }
.figure-plain img { display: block; width: 100%; height: auto; }
/* The plates carry their own paper, a shade lighter than the page: darken keeps
   the ink and takes the paper from the page, so there is no rectangle. */
.figure-plain img { mix-blend-mode: darken; }
.hero-figure { margin-top: .4rem; }

/* Hero visual */
.hero-visual { min-width: 0; }
.hero-plate { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #111414; box-shadow: 8px 8px 0 rgba(44,47,39,.12); }
.hero-plate img { display: block; width: 100%; height: auto; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft);
  margin: clamp(2rem, 4vw, 3rem) 0 0;
}
.stats div { background: var(--ink); padding: 1.3rem 1.4rem; }
.stats dt { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stats dd { margin: .35rem 0 0; color: var(--muted); font-size: .85rem; }

/* Sections */
.section { padding: clamp(2.6rem, 5vw, 4rem) 0; border-top: 1px solid var(--line-soft); margin-top: 0; }
.label {
  display: flex; align-items: center; gap: .8rem;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 2.2rem;
}
.label::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }
.label .num { color: var(--accent); }
.h2 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 800; margin: 0 0 1.4rem; text-wrap: balance; }
.body { color: #3a4753; max-width: 56ch; margin: 0 0 1rem; }
.body strong { color: var(--paper); }
.section-lede { max-width: 62ch; margin-bottom: 2.4rem; }
.section-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.install-copy { max-width: none; }

.compile-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: end; margin-bottom: 1.6rem; }
.compile-head .h2 { margin-bottom: 0; }
/* Light band: the explanation lives on paper */
.section.light { background: transparent; color: var(--paper); }
.section.light .label { color: var(--muted); }
.section.light .label::after { background: var(--line-soft); }
.section.light .label .num { color: var(--accent); }
.section.light .h2 { color: var(--paper); }
.section.light .body { color: #3a4753; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.step3 { background: var(--ink); padding: 1.3rem 1.2rem; }
.n3 { color: var(--accent); font-size: .64rem; }
.step3 h3 { margin: .6rem 0 .4rem; font-size: 1.02rem; color: var(--paper); letter-spacing: -.01em; }
.step3 p { margin: 0 0 .9rem; color: #4b4f45; font-size: .9rem; }
.mini-v { border: 1px solid var(--line-soft); background: var(--panel); padding: .6rem .7rem; font-family: var(--mono); font-size: .63rem; line-height: 1.7; color: #3e403a; white-space: pre-wrap; word-break: break-word; }
.mini-v .l-blue { color: #2f6fed; }
.mini-v .dim { color: #7d7a70; }
.bars3 { display: grid; gap: .25rem; }
.bars3 span { display: block; padding: .25rem .5rem; background: var(--paper); border-left: 2px solid #2f6fed; font-size: .6rem; text-transform: uppercase; letter-spacing: .04em; color: #4c4e47; }
.bars3 span:nth-child(2) { width: 84%; }
.bars3 span:nth-child(3) { width: 68%; }
.light-figure { margin: 1.8rem 0 0; }
.light-figure img, .light-figure svg { display: block; width: 100%; height: auto; }
.light-note { margin: 1.1rem 0 0; color: var(--muted); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; }
.stack { position: relative; width: 66px; height: 46px; flex: none; }
.stack i { position: absolute; left: 0; width: 56px; height: 12px; border: 2px solid var(--accent); background: var(--ink); border-radius: 2px; }
.stack i:nth-child(1) { top: 0; } .stack i:nth-child(2) { top: 11px; left: 4px; } .stack i:nth-child(3) { top: 22px; left: 8px; }

/* Platform table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); }
.platforms { width: 100%; border-collapse: collapse; min-width: 720px; }
.platforms th, .platforms td { text-align: left; padding: .95rem 1.1rem; border-bottom: 1px solid var(--line-soft); font-size: .93rem; }
.platforms thead th { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--panel); }
.platforms tbody th { font-weight: 700; }
.platforms tbody tr:last-child th, .platforms tbody tr:last-child td { border-bottom: 0; }
.platforms td.mono { font-size: .8rem; letter-spacing: 0; text-transform: none; color: #3a4753; }
.dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .5rem; vertical-align: middle; }
.dot-green { background: var(--green); }
.dot-violet { background: var(--violet); }
.dot-red { background: var(--red); }
.dot-muted { background: #5a6560; }
.table-note { color: var(--muted); font-size: .88rem; margin: 1rem 0 0; }

/* Terminal */
.terminal { margin: 0; background: #0a0d0c; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cycle { margin: 0; }
.cycle svg { display: block; width: 100%; height: auto; }
.terminal figcaption { padding: .7rem 1rem; border-bottom: 1px solid var(--line-soft); color: var(--muted); background: var(--panel); }
.terminal pre { margin: 0; padding: 1.2rem 1rem; overflow-x: auto; font-family: var(--mono); font-size: .82rem; line-height: 1.7; }
.c-dim { color: #6b7772; }
.c-prompt { color: var(--green); }
.c-cmd { color: var(--accent); }
.c-flag { color: var(--blue); }

/* FAQ */
details { border-top: 1px solid var(--line-soft); padding: 1.1rem 0; }
details:last-of-type { border-bottom: 1px solid var(--line-soft); }
summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-family: var(--mono); font-weight: 400; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); margin: .8rem 0 0; max-width: 66ch; }

/* Footer */
.footer { border-top: 1px solid var(--line-soft); margin-top: 0; padding: 2.2rem 0 1.2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-note { color: var(--muted); margin: .9rem 0 0; font-size: .92rem; }
.footer-title { color: var(--muted); margin: 0 0 .8rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer ul a { color: #3a4753; text-decoration: none; font-size: .93rem; }
.footer ul a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line-soft); margin-top: 2.5rem; padding-top: 1.2rem; color: var(--muted); font-size: .68rem; }

@media (max-width: 980px) {
  .hero-grid, .section-grid { grid-template-columns: 1fr; }
  .spec { max-width: 560px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .compile-head, .tech { grid-template-columns: 1fr; }
  .lesson-step { grid-template-columns: 2.6rem 1fr; }
  .lesson-visual { grid-column: 2; }
  .merge { grid-template-columns: 1fr; }
  .merge-arrow { transform: rotate(90deg); }
  .pair { grid-template-columns: 1fr; }
  .glossary { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .links { display: none; }
  .nav-inner { justify-content: space-between; }
  .nav-cta { margin-left: 0; }
  .actions .btn { flex: 1 1 auto; }
  .lesson-step { grid-template-columns: 1fr; }
  .lesson-visual { grid-column: 1; }
  .facts { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .terminal pre { font-size: .7rem; white-space: pre-wrap; word-break: break-word; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
