/* Palette taken from Atlas's own Theme.swift: paper, ink and the two process inks. */
:root {
  --bg: #F3F2F2;
  --surface: #F8F4F4;
  --sunken: #EAE9E9;
  --grid: #E7E4E4;
  --line: #D7D3D3;
  --line-strong: #BAB6B6;
  --text: #201E1D;
  --muted: #605D5D;
  --faint: #9B9797;
  --cyan: #0088B0;
  --cyan-deep: #006786;
  --magenta: #D6006C;
  --code-bg: #201E1D;
  --code-text: #F0EDEB;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #242221;
    --sunken: #1D1B1A;
    --grid: #1B1918;
    --line: #35322F;
    --line-strong: #4A4643;
    --text: #F0EDEB;
    --muted: #A8A29E;
    --faint: #7A7570;
    --cyan: #4FC3E8;
    --cyan-deep: #99E0FF;
    --magenta: #FF7FAE;
    --code-bg: #0E0D0C;
    --code-text: #F0EDEB;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  /* The faint rule grid the app window is set on. */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  font: 17px/1.6 ui-serif, "New York", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
code, pre, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.wrap { width: min(1040px, 100% - 32px); margin-inline: auto; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 19px; }
.bar-right { display: flex; align-items: center; gap: 12px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.lang button {
  font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em;
  padding: 7px 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.gh-link { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; color: var(--muted); }
.gh-link:hover { color: var(--text); background: var(--sunken); }

/* Buttons: ink on paper, like the app's primary actions */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--text); color: var(--bg); border: 1px solid var(--text);
  text-decoration: none; font: 600 16px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  border-radius: 8px; transition: background .15s ease, color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--cyan-deep); border-color: var(--cyan-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--sunken); color: var(--text); border-color: var(--line-strong); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 15px 24px; font-size: 17px; }
.btn:focus-visible, .lang button:focus-visible, .gh-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cyan) 50%, transparent); outline-offset: 2px;
}

/* Hero */
.hero { text-align: center; padding: 72px 0 40px; }
.hero-icon { margin: 0 auto 22px; border-radius: 22px; }
.eyebrow {
  margin: 0 0 14px; color: var(--cyan);
  font: 600 13px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; text-transform: uppercase;
}
h1 {
  margin: 0 auto; max-width: 17ch; text-wrap: balance;
  font-size: clamp(36px, 6.4vw, 62px); line-height: 1.06; letter-spacing: -.02em; font-weight: 600;
}
.lead { margin: 20px auto 0; max-width: 56ch; color: var(--muted); font-size: clamp(17px, 2vw, 20px); text-wrap: pretty; }
.cta { margin-top: 34px; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.meta { margin: 14px 0 0; color: var(--muted); font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
.meta + .meta { margin-top: 6px; }
.text-link { color: var(--cyan-deep); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* Ladder illustration */
.figure-wrap { padding: 24px 0 80px; }
.plate {
  margin: 0; padding: 28px 24px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.plate-scroll { overflow-x: auto; }
.ladder { width: 100%; min-width: 600px; height: auto; overflow: visible; }
.ladder .cols text { fill: var(--faint); font: 13px ui-monospace, Menlo, monospace; text-anchor: middle; }
.ladder .cards rect { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1; }
.ladder .cards text { fill: var(--text); font: 15px ui-monospace, "SF Mono", Menlo, monospace; }
/* "You are here" is set in ink weight, not a third hue. */
.ladder .cards .here rect { stroke: var(--text); stroke-width: 2.5; }
.ladder .cards .here text { font-weight: 700; }
.ladder .e-cyan path { fill: none; stroke: var(--cyan); stroke-width: 1.8; }
.ladder .e-magenta { fill: none; stroke: var(--magenta); stroke-width: 2; stroke-dasharray: 6 5; }
.f-cyan { fill: var(--cyan); }
.f-magenta { fill: var(--magenta); }
.plate figcaption { margin-top: 16px; color: var(--muted); font-size: 15px; text-align: center; text-wrap: balance; }

/* Sections */
h2 { margin: 0 0 28px; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -.015em; font-weight: 600; text-wrap: balance; }
h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; }
.views, .inks, .bench, .install { padding: 24px 0 80px; }
.note { margin: -12px 0 22px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid article { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.grid p { margin: 0; color: var(--muted); font-size: 16px; }
.num { display: block; margin-bottom: 10px; color: var(--cyan); font: 600 13px ui-monospace, Menlo, monospace; }

.ink-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 30px; }
.ink { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
.ink p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.sw { flex: none; width: 40px; height: 6px; margin-top: 12px; border-radius: 3px; }
.sw-cyan { background: var(--cyan); }
.sw-magenta { background: var(--magenta); }
.inks .note { margin: 0; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font: 15px/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
th, td { padding: 13px 18px; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); }
tr + tr td { border-top: 1px solid var(--line); }
.r { text-align: right; }
.langs { margin: 22px 0 0; color: var(--muted); font-size: 15px; }
.langs span { color: var(--text); font-weight: 600; }

.ins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li {
  counter-increment: s; position: relative;
  padding: 14px 16px 14px 54px; margin-bottom: 10px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 14px;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: var(--bg); font: 700 13px ui-monospace, Menlo, monospace;
}
.alt { margin: 18px 0 8px; color: var(--muted); font-size: 15px; }
pre { margin: 0; padding: 14px 16px; border-radius: 8px; overflow-x: auto; background: var(--code-bg); color: var(--code-text); font-size: 14px; }

.final { text-align: center; padding: 30px 0 90px; }
.final h2 { margin-bottom: 26px; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; background: var(--bg); }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px 0; }
.foot-links { display: flex; gap: 18px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

@media (max-width: 760px) {
  .grid, .ink-row, .ins-grid { grid-template-columns: 1fr; }
  .plate { padding: 18px 12px 14px; }
}
@media (max-width: 560px) {
  .hero { padding-top: 48px; }
  .btn-sm { display: none; }
  .cta-row .btn-lg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
