/* Sablebyte site styles.
   Layout: one editorial column on a warm sable-black ground. The hero splits into
   words and a byte grid on wide screens; hairline rules separate sections, and
   section bodies line up under their headings on desktop.
   Two themes. Dark is the brand's own look (it is named after a black). Light is a warm-paper
   version of it. The visitor's system setting decides, and the header toggle can override it
   (assets/theme.js sets data-theme on <html>). Every colour below is a token: change them here only.
   The light tokens appear TWICE (system preference, and explicit data-theme="light") and must stay
   identical: check S11 in tools/check-site.mjs fails if they drift or if contrast drops below AA. */
:root {
  color-scheme: dark;
  --sable: #0f0d0c;
  --sable-2: #171412;
  --ink: #efe8dd;
  --ink-2: #b6ab9e;
  --ink-3: #8d8378; /* 4.9:1 on --sable-2, 5.2:1 on --sable (was #847a6f: 4.36:1 on cards, below AA) */
  --rule: rgb(239 232 221 / 0.12);
  --phosphor: #ffb347;
  --phosphor-hi: #ffc670;
  --phosphor-glow: rgb(255 179 71 / 0.35);
  --shadow: rgb(0 0 0 / 0.75);
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-label: 0.8125rem;
  --fs-body: 1.125rem;
  --fs-h3: 1.5rem;
  --fs-h2: clamp(1.875rem, 4.6vw, 2.75rem);
  --fs-hero: clamp(3.4rem, 13vw, 7.25rem);
  --gutter: clamp(16px, 5vw, 48px);
  --maxw: 74rem;
  --label-col: 13rem;
  --col-gap: 40px;
}

/* Light theme, tokens only. Contrast: ink 15.7:1, ink-2 8.8:1, ink-3 5.6:1 (5.0:1 on cards) on --sable;
   button text on --phosphor 4.8:1. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --sable: #f7f2ea;
    --sable-2: #ece5d8;
    --ink: #1d1916;
    --ink-2: #4b4239;
    --ink-3: #6a5f53;
    --rule: rgb(29 25 22 / 0.14);
    --phosphor: #a65500;
    --phosphor-hi: #8a4600;
    --phosphor-glow: rgb(166 85 0 / 0.28);
    --shadow: rgb(60 40 20 / 0.32);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --sable: #f7f2ea;
  --sable-2: #ece5d8;
  --ink: #1d1916;
  --ink-2: #4b4239;
  --ink-3: #6a5f53;
  --rule: rgb(29 25 22 / 0.14);
  --phosphor: #a65500;
  --phosphor-hi: #8a4600;
  --phosphor-glow: rgb(166 85 0 / 0.28);
  --shadow: rgb(60 40 20 / 0.32);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--sable);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 3px; }
::selection { background: var(--phosphor); color: var(--sable); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* Header */
.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 16px; padding-block: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; text-decoration: none; }
.brand img { width: 36px; height: auto; }

/* Theme toggle: shown by assets/theme.js (hidden without JavaScript; the system setting still applies) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--rule); border-radius: 2px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .i-moon { display: none; }
.theme-toggle[data-mode="light"] .i-sun { display: none; }
.theme-toggle[data-mode="light"] .i-moon { display: inline; }
.brand span { font-family: var(--mono); font-weight: 500; font-size: 0.9375rem; letter-spacing: 0.18em; }
.nav { display: flex; gap: clamp(16px, 3vw, 30px); font-family: var(--mono); font-size: var(--fs-label); }
.nav a { text-decoration: none; color: var(--ink-2); padding-block: 6px; }
.nav a:hover { color: var(--ink); }

/* Shared type */
.label {
  margin: 0;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2);
}
.label::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 1px; background: var(--phosphor); box-shadow: 0 0 8px var(--phosphor-glow); }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
h3 { margin: 0 0 8px; font-size: var(--fs-h3); line-height: 1.2; }

/* Hero */
.hero { display: grid; gap: 56px; padding-block: clamp(40px, 8vw, 104px) clamp(64px, 10vw, 128px); }
.hero-title { margin: 22px 0 0; font-size: var(--fs-hero); line-height: 0.92; letter-spacing: -0.025em; }
.hero-title span { display: block; }
.hero-title .evolve { font-style: italic; font-weight: 400; }
.lede { margin: 28px 0 0; max-width: 34rem; font-size: clamp(1.1875rem, 2.4vw, 1.375rem); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: 2px;
  font-family: var(--mono); font-size: 0.9375rem; font-weight: 500; text-decoration: none;
  background: var(--phosphor); color: var(--sable);
}
.btn:hover { background: var(--phosphor-hi); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }

/* Sections */
.section { padding-block: clamp(56px, 9vw, 104px); border-top: 1px solid var(--rule); }
.sec-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 5vw, 56px); }
.sec-head h2 { margin: 0; max-width: 22ch; font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.015em; }

/* Skip link: first thing on every page, visible only when focused */
.skip { position: absolute; left: 16px; top: -64px; z-index: 10; padding: 10px 14px; border-radius: 2px; background: var(--phosphor); color: var(--sable); font-family: var(--mono); font-size: var(--fs-label); text-decoration: none; }
.skip:focus { top: 12px; }

/* The studio: one large statement */
.statement { margin: 18px 0 0; max-width: 30em; font-size: clamp(1.5rem, 3.6vw, 2.375rem); line-height: 1.3; letter-spacing: -0.01em; text-wrap: pretty; }

/* What we build: four kinds of work */
.quad { display: grid; gap: 0 28px; }
.quad article { padding-block: 22px; border-top: 1px solid var(--rule); }
.quad article:first-child { padding-top: 0; border-top: 0; }
.quad p { margin: 0; color: var(--ink-2); }
.quad .kind { margin: 0 0 10px; font-family: var(--mono); font-size: var(--fs-label); color: var(--phosphor); }

/* Apps: one card per app, on the home page and on /apps/ */
.app-grid { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.app-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 4px 20px; align-items: start; height: 100%; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--rule); border-radius: 8px; background: var(--sable-2); }
.app-card > :not(img) { grid-column: 2; }
.app-card img { grid-column: 1; grid-row: 1 / span 5; width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 0 0 1px var(--rule); }
.app-card .tag { margin: 0; font-family: var(--mono); font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--phosphor); }
.app-card h2, .app-card h3 { margin: 2px 0 4px; font-size: 1.5rem; line-height: 1.2; letter-spacing: 0; }
.app-card .line { margin: 0 0 10px; color: var(--ink-2); }
.app-card .status { margin: 0 0 12px; }
.app-card .go { justify-self: start; font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; color: var(--ink); text-underline-offset: 4px; text-decoration-color: var(--phosphor); }
.app-card.more { grid-template-columns: minmax(0, 1fr); border-style: dashed; background: transparent; }
.app-card.more > * { grid-column: 1; }
.app-card.more p { margin: 0; color: var(--ink-2); }
.apps-all { margin: 28px 0 0; font-family: var(--mono); font-size: var(--fs-label); }
.apps-all a { color: var(--ink); text-underline-offset: 4px; text-decoration-color: var(--phosphor); }

/* Principles */
.principles { display: grid; gap: 28px 40px; margin: 0; padding: 0; list-style: none; }
.principles li { padding-top: 18px; border-top: 1px solid var(--rule); }
.principles h3 { margin: 0 0 6px; }
.principles p { margin: 0; color: var(--ink-2); }

/* About */
.about-text { max-width: 36rem; margin: 0 0 36px; color: var(--ink-2); }
.about-end { max-width: 36rem; margin: 28px 0 0; color: var(--ink-2); }
.about-end a { color: var(--ink); text-underline-offset: 4px; text-decoration-color: var(--phosphor); }

/* Work */
.feature { display: grid; gap: 32px; align-items: center; }
.feature-media { max-width: 340px; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule), 0 30px 60px -30px var(--shadow); }
.status { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-2); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--phosphor); box-shadow: 0 0 10px var(--phosphor-glow); }
.feature h3 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -0.015em; }
.feature-body > p { max-width: 34rem; margin: 0; color: var(--ink-2); }
.specs { display: grid; max-width: 34rem; margin: 28px 0 0; border-top: 1px solid var(--rule); }
.specs div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--rule); }
.specs dt { padding-top: 4px; font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-3); }
.specs dd { margin: 0; }

/* Approach */
.steps { display: grid; gap: 28px; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); align-content: start; gap: 4px 12px; padding-top: 20px; border-top: 1px solid var(--rule); }
.steps .num { grid-row: span 2; padding-top: 8px; font-family: var(--mono); font-size: var(--fs-label); color: var(--phosphor); }
.steps h3 { margin: 0; }
.steps p { margin: 0; color: var(--ink-2); }

/* The name */
.pair { display: grid; gap: 20px; }
.entry { padding: clamp(22px, 4vw, 32px); border: 1px solid var(--rule); border-radius: 4px; background: var(--sable-2); }
.entry .word { margin: 0; font-size: clamp(2.25rem, 6vw, 3rem); font-style: italic; line-height: 1; }
.entry .pos { margin: 10px 0 16px; font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-3); }
.entry p:last-child { margin: 0; color: var(--ink-2); }

/* Next up: a product that is announced but not yet featured */
.next { margin-top: clamp(40px, 6vw, 64px); padding-top: 28px; border-top: 1px solid var(--rule); }
.next h3 { margin: 0 0 6px; font-size: clamp(1.5rem, 4vw, 2rem); }
.next p:last-child { margin: 0; max-width: 34rem; color: var(--ink-2); }
.feature-body .cta { margin-top: 28px; }

/* App pages (/shadeslip/) */
.page-head { display: grid; gap: 28px; padding-block: clamp(32px, 6vw, 72px) clamp(40px, 6vw, 72px); }
.app-id { display: flex; align-items: center; gap: 16px; }
.app-id img { width: 64px; height: 64px; border-radius: 14px; box-shadow: 0 0 0 1px var(--rule); }
.page-title { margin: 18px 0 0; font-size: clamp(2.5rem, 8vw, 4.75rem); line-height: 1; letter-spacing: -0.025em; }
.banner { margin: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule), 0 30px 60px -30px var(--shadow); }
.btn.soon { cursor: default; color: var(--ink-2); }
.btn.soon:hover { box-shadow: inset 0 0 0 1px var(--rule); }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 26px; color: var(--ink-2); }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 1px; background: var(--phosphor); box-shadow: 0 0 8px var(--phosphor-glow); }
.checks strong { color: var(--ink); font-weight: 500; }
.lead { margin: 0 0 28px; max-width: 36rem; color: var(--ink-2); }
.lead a { color: var(--ink); text-underline-offset: 3px; }
.checks + .lead { margin: 32px 0 0; }
.shots { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.shots.phone { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shots.tablet { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
.shots img { width: 100%; border-radius: 10px; box-shadow: 0 0 0 1px var(--rule); }
.shots-note { margin: 18px 0 0; font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-3); }

/* Support page: FAQ */
.faq details { border-top: 1px solid var(--rule); padding-block: 4px; }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding-block: 14px; font-size: 1.125rem; color: var(--ink); list-style-position: outside; }
.faq summary:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 3px; }
.faq details p { margin: 0 0 16px; color: var(--ink-2); }

/* Contact */
.contact h2 { margin: 16px 0 12px; max-width: 22ch; font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.015em; }
.contact > p { margin: 0 0 28px; color: var(--ink-2); }
.contact > .support-note { margin: 28px 0 0; font-size: 1rem; }
.contact .support-note a { color: var(--ink); text-underline-offset: 3px; }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.mail { font-size: clamp(1.5rem, 5.5vw, 2.5rem); line-height: 1.2; text-decoration: none; border-bottom: 1px solid var(--ink-3); overflow-wrap: anywhere; }
.mail:hover { border-bottom-color: var(--phosphor); }
.copy {
  padding: 10px 14px; border: 1px solid var(--rule); border-radius: 2px; cursor: pointer;
  font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-2); background: transparent;
}
.copy:hover { color: var(--ink); border-color: var(--ink-3); }

/* Footer: link columns, then a base row */
.site-foot { padding-block: 40px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-3); }
.site-foot p { margin: 0; }
.foot-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 13rem)); gap: 28px 48px; margin-bottom: 32px; }
.foot-cols nav { display: grid; gap: 8px; align-content: start; }
.foot-h { margin: 0 0 4px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.foot-cols a { padding-block: 2px; color: var(--ink-2); text-decoration: none; }
.foot-cols a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; border-top: 1px solid var(--rule); }

/* Privacy policy and other text pages */
.doc { max-width: 44rem; padding-block: clamp(40px, 7vw, 88px); }
.doc h1 { margin: 18px 0 8px; font-size: clamp(2.5rem, 7vw, 3.75rem); line-height: 1.05; letter-spacing: -0.02em; }
.doc .meta { margin: 0 0 40px; font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-3); }
.doc h2 { margin: 44px 0 10px; font-size: 1.625rem; line-height: 1.2; }
.doc h3 { margin: 28px 0 8px; font-size: 1.25rem; }
.doc p, .doc li { color: var(--ink-2); }
.doc a { color: var(--ink); text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.doc ul { margin: 0 0 1em; padding-left: 1.25rem; }
.doc li { margin-bottom: 0.5em; }
.doc strong { color: var(--ink); font-weight: 500; }
.doc .lede { margin-top: 0; }
.doc .back { margin-top: 44px; }

/* Phones: with the toggle shown, the header becomes two rows (logo and toggle, then the menu) so nothing wraps awkwardly */
@media (max-width: 480px) {
  .site-head:has(.theme-toggle:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .site-head:has(.theme-toggle:not([hidden])) .nav { grid-column: 1 / -1; grid-row: 2; }
  .site-head:has(.theme-toggle:not([hidden])) .theme-toggle { grid-column: 2; grid-row: 1; }
}

/* Narrow phones: keep the logo and menu on one line */
@media (max-width: 420px) {
  .brand { gap: 10px; }
  .brand span { letter-spacing: 0.12em; }
  .nav { gap: 14px; }
}

/* Wider screens */
@media (min-width: 760px) {
  .quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quad article:nth-child(2) { padding-top: 0; border-top: 0; }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 56px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
  .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shots.phone { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shots.phone.tall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shots.tablet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .sec-head { grid-template-columns: var(--label-col) minmax(0, 1fr); column-gap: var(--col-gap); align-items: baseline; }
  .indent { margin-left: calc(var(--label-col) + var(--col-gap)); }
  .shots.tablet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Three items in the "what we build" row (and the Respect list): three columns from tablet width up */
@media (min-width: 760px) {
  .quad.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .quad.three article { padding: 0 24px; border-top: 0; border-left: 1px solid var(--rule); }
  .quad.three article:first-child { padding-left: 0; border-left: 0; }
}
@media (min-width: 960px) {
  .principles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .quad { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  .quad.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quad article { padding: 0 24px; border-top: 0; border-left: 1px solid var(--rule); }
  .quad article:first-child { padding-left: 0; border-left: 0; }
}
