/* cterm.dev (p24.2): the landing page and the blog, in the app's own colours. Dark by default, light under the
   visitor's light scheme, and either one by the toggle (site.js sets data-theme, the key the documentation at /docs
   shares). Readable on a phone, with no sideways scroll. */
:root {
  color-scheme: dark;
  --sans: "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --bg: #0b0e13; --bg-2: #0f131a; --panel: #141920; --sunken: #090c10;
  --line: #222a35; --line-soft: #19202a; --ink: #e8ebf0; --muted: #96a0ae; --faint: #646e7c;
  --accent: #3ccbb8; --accent-2: #7fe3d5; --accent-ink: #04211d; --accent-soft: rgba(60, 203, 184, .12); --accent-line: #1f4a44;
  --hover: #161c25; --code-ink: #cfe3ff; --glow: rgba(60, 203, 184, .18);
  --shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .04);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f8f6f1; --bg-2: #f1eee7; --panel: #ffffff; --sunken: #efebe3;
    --line: #ddd7cb; --line-soft: #e9e4da; --ink: #1c2026; --muted: #5f6168; --faint: #94918a;
    --accent: #0f8a7a; --accent-2: #0b6d60; --accent-ink: #ffffff; --accent-soft: rgba(15, 138, 122, .1); --accent-line: #b5d9d1;
    --hover: #ece8df; --code-ink: #1d3a5f; --glow: rgba(15, 138, 122, .12);
    --shadow: 0 30px 70px rgba(60, 50, 30, .18), 0 0 0 1px rgba(0, 0, 0, .05);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f6f1; --bg-2: #f1eee7; --panel: #ffffff; --sunken: #efebe3;
  --line: #ddd7cb; --line-soft: #e9e4da; --ink: #1c2026; --muted: #5f6168; --faint: #94918a;
  --accent: #0f8a7a; --accent-2: #0b6d60; --accent-ink: #ffffff; --accent-soft: rgba(15, 138, 122, .1); --accent-line: #b5d9d1;
  --hover: #ece8df; --code-ink: #1d3a5f; --glow: rgba(15, 138, 122, .12);
  --shadow: 0 30px 70px rgba(60, 50, 30, .18), 0 0 0 1px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .86em; background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 5px; color: var(--code-ink); }
pre { font-family: var(--mono); font-size: 14px; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; font-size: 1em; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.12; margin: 0 0 14px; font-weight: 650; }
p { margin: 0 0 16px; }
.muted { color: var(--faint); }

/* A screenshot in the reader's theme: both pictures in the page, one shown. */
.for-light { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .for-dark { display: none; }
  :root:not([data-theme="dark"]) .for-light { display: block; }
}
:root[data-theme="light"] .for-dark { display: none; }
:root[data-theme="light"] .for-light { display: block; }

/* The bar on top */
.bar { position: sticky; top: 0; z-index: 10; height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 max(16px, calc((100vw - 1180px) / 2)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 650; font-size: 18px; letter-spacing: -.01em; margin-right: auto; }
.brand:hover { text-decoration: none; }
.bar-links { display: flex; gap: 2px; }
.bar-links a { color: var(--muted); font-size: 14.5px; padding: 6px 12px; border-radius: 8px; }
.bar-links a:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.theme { background: none; border: 1px solid transparent; color: var(--muted); border-radius: 8px; width: 34px; height: 34px; font: inherit; font-size: 16px; cursor: pointer; }
.theme:hover { color: var(--ink); background: var(--hover); }
.signin { font-size: 14px; font-weight: 550; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent); border-radius: 9px; padding: 6px 14px; white-space: nowrap; }
.signin:hover { text-decoration: none; filter: brightness(1.1); }

/* Buttons */
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.button { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px; border-radius: 11px; padding: 12px 24px; border: 1px solid transparent; box-shadow: 0 6px 24px var(--glow); }
.button:hover { text-decoration: none; filter: brightness(1.07); }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.button.ghost:hover { background: var(--hover); }
.cta-note { color: var(--faint); font-size: 13.5px; text-align: center; margin: 14px 0 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 14px; }
.eyebrow a { color: inherit; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* The landing page */
main { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.home main > section { padding: 88px 0; }
.home main > section + section { border-top: 1px solid var(--line-soft); }
.hero { text-align: center; position: relative; padding-top: 96px !important; border-top: 0 !important; }
.hero::before { content: ""; position: absolute; inset: -60px calc(50% - 50vw) auto; height: 720px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 0%, var(--glow), transparent 70%),
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000 30%, transparent 75%); mask-image: radial-gradient(70% 60% at 50% 20%, #000 30%, transparent 75%); }
.hero h1 { font-size: clamp(40px, 7.4vw, 84px); letter-spacing: -.035em; line-height: 1.02; margin: 0 auto 22px; max-width: 900px; }
.hero .lede { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 720px; margin: 0 auto 30px; }
.window { margin: 64px auto 0; max-width: 1120px; border-radius: 14px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); border: 1px solid var(--line); text-align: left; }
.window-bar { height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.window-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.window-bar em { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--faint); margin: 0 auto; padding-right: 50px; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; padding: 0 !important; margin: 8px 0 0; }
.home main > .facts { padding: 0 !important; border-top: 1px solid var(--line-soft); }
.facts div { background: var(--bg); padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.facts strong { font-size: 15.5px; }
.facts span { color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.home main > .facts + section { border-top: 0; }

.how h2, .more-grid h2 { font-size: clamp(28px, 3.6vw, 40px); max-width: 820px; }
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: none; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.steps h3 { font-size: 18px; margin: 14px 0 8px; }
.steps p { color: var(--muted); font-size: 15px; margin: 0; }
.num { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-weight: 600; font-size: 14px; border: 1px solid var(--accent-line); }

.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.feature.flip .words { order: 2; }
.feature h2 { font-size: clamp(26px, 3.2vw, 36px); }
.feature .words p { color: var(--muted); font-size: 16.5px; }
.feature .art img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.feature.phone { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.phone .art { display: flex; justify-content: center; }
.feature.phone .art img { max-width: 330px; border-radius: 30px; border: 6px solid var(--panel); outline: 1px solid var(--line); }
.more { font-weight: 600; display: inline-flex; gap: 6px; }
.more::after { content: "→"; transition: transform .15s ease; }
.more:hover { text-decoration: none; }
.more:hover::after { transform: translateX(3px); }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 36px; }
.grid a { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); transition: border-color .15s ease, transform .15s ease; }
.grid a:hover { text-decoration: none; border-color: var(--accent-line); transform: translateY(-2px); }
.grid strong { font-size: 15.5px; }
.grid span { color: var(--muted); font-size: 14px; line-height: 1.5; }

.latest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.latest h2 { font-size: clamp(24px, 3vw, 32px); }
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.post-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.post-card:hover { text-decoration: none; border-color: var(--accent-line); }
.post-card time { color: var(--faint); font-size: 13px; font-family: var(--mono); }
.post-card strong { font-size: 17px; line-height: 1.3; }
.post-card span { color: var(--muted); font-size: 14.5px; line-height: 1.55; }

.closing { text-align: center; }
.closing h2 { font-size: clamp(30px, 4vw, 44px); }
.closing p { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 auto 28px; }

/* The blog */
main.narrow { max-width: 760px; padding-top: 64px; padding-bottom: 80px; }
.page-head { margin-bottom: 36px; }
.page-head h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -.03em; }
.page-head .lede { color: var(--muted); font-size: 19px; }
.post-list { display: flex; flex-direction: column; }
.post-row { padding: 26px 0; border-top: 1px solid var(--line-soft); }
.post-row time { color: var(--faint); font-family: var(--mono); font-size: 13px; }
.post-row h2 { font-size: 24px; margin: 6px 0 8px; }
.post-row h2 a { color: var(--ink); }
.post-row p { color: var(--muted); margin: 0; }
.prose { font-size: 17px; line-height: 1.75; }
.prose h2 { font-size: 26px; margin: 44px 0 14px; }
.prose h3 { font-size: 20px; margin: 32px 0 10px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin: 4px 0; }
.prose blockquote { margin: 0 0 18px; padding: 4px 18px; border-left: 3px solid var(--accent-line); color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 18px; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.shot { margin: 28px 0; }
.shot img { border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.shot figcaption { color: var(--faint); font-size: 14px; margin-top: 10px; line-height: 1.5; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.pager a { display: flex; flex-direction: column; max-width: 48%; color: var(--ink); font-weight: 550; }
.pager a span { color: var(--faint); font-size: 13px; font-weight: 400; }
.pager .next { text-align: right; margin-left: auto; }

/* The foot */
.foot { border-top: 1px solid var(--line-soft); background: var(--bg-2); margin-top: 0; }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 40px 16px 48px; display: grid; grid-template-columns: auto 1fr; gap: 14px 32px; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: flex-end; }
.foot nav a { color: var(--muted); font-size: 14px; }
.foot p { grid-column: 1 / -1; color: var(--faint); font-size: 13px; margin: 8px 0 0; }

@media (max-width: 960px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .feature, .feature.phone { grid-template-columns: 1fr; gap: 32px; }
  .feature.flip .words { order: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .posts { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .bar { gap: 2px; }
  .bar-links a { padding: 6px 8px; }
  .home main > section { padding: 60px 0; }
  .hero { padding-top: 56px !important; }
  .hero h1 br { display: none; }
  .window { margin-top: 44px; border-radius: 10px; }
  .window-bar { height: 28px; }
  .window-bar em { display: none; }
  .facts, .grid { grid-template-columns: 1fr; }
  .cta .button { flex: 1 1 100%; justify-content: center; }
  .foot-in { grid-template-columns: 1fr; }
  .foot nav { justify-content: flex-start; }
  main.narrow { padding-top: 40px; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
}
