/* SPDX-FileCopyrightText: 2026 ceearrbee <hello@breve.im> */
/* SPDX-License-Identifier: AGPL-3.0-or-later */

/* The rules of the app's own style (src/style/tokens.css): one surface, hairlines between parts,
   9px controls and 12px cards, secondary text at 78% (62% in dark), the ink from the fill, and
   the sender palette of src/domain/space_color.rs as the only hues. Every picture is drawn by the
   app itself (`just site-pictures`, `just screenshots`, `just layout-pictures`, `just help-figures`). */
:root {
  --fill: #3584e4;
  --fill-fg: #ffffff;
  --ink: oklab(from var(--fill) min(l, 0.5) a b);
  --view: #ffffff;
  --fg: rgb(0 0 6 / 80%);
  --strong: rgb(0 0 6 / 92%);
  --dim: 78%;
  --line: rgb(0 0 6 / 10%);
  --fillc: rgb(0 0 6 / 6%);
  --c0: #c0392b; --c1: #c0660a; --c2: #92840a; --c3: #1e8449;
  --c4: #178a8a; --c5: #2a6fb0; --c6: #7d5ba6; --c7: #b03060;
  --ui: "Adwaita Sans", Cantarell, Inter, system-ui, sans-serif;
  --show-light: block; --show-dark: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: oklab(from var(--fill) max(l, 0.85) a b);
    --view: #1d1d20; --fg: rgb(255 255 255 / 92%); --strong: #ffffff; --dim: 62%;
    --line: rgb(255 255 255 / 10%); --fillc: rgb(255 255 255 / 8%);
    --c0: #ef7a70; --c1: #e29142; --c2: #c9ba3e; --c3: #54c085;
    --c4: #48c4c4; --c5: #74acea; --c6: #b89ada; --c7: #e4789e;
    --show-light: none; --show-dark: block;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: oklab(from var(--fill) max(l, 0.85) a b);
  --view: #1d1d20; --fg: rgb(255 255 255 / 92%); --strong: #ffffff; --dim: 62%;
  --line: rgb(255 255 255 / 10%); --fillc: rgb(255 255 255 / 8%);
  --c0: #ef7a70; --c1: #e29142; --c2: #c9ba3e; --c3: #54c085;
  --c4: #48c4c4; --c5: #74acea; --c6: #b89ada; --c7: #e4789e;
  --show-light: none; --show-dark: block;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-contrast: more) {
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] { --dim: 100%; --line: currentColor; }
  .btn, .mode { border: 1px solid currentColor; }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 5.5rem; }
/* A short page keeps the footer at the bottom of the window. */
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip; background: var(--view); color: var(--fg); font: 400 1.0625rem/1.55 var(--ui); }
main { flex: 1 0 auto; }
h1, h2, h3 { color: var(--strong); margin: 0; line-height: 1.2; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
a { color: var(--ink); text-underline-offset: .15em; }
img { max-width: 100%; height: auto; display: block; }
img.l { display: var(--show-light); } img.d { display: var(--show-dark); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 9px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.shot { border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.dim { opacity: var(--dim); }

.btn { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .5rem 1.25rem; border-radius: 9px; font: 600 1rem/1.2 var(--ui); text-decoration: none; color: var(--strong); background: var(--fillc); transition: background-color 150ms ease-out; }
.btn:hover { background: color-mix(in srgb, var(--strong) 10%, transparent); }
.btn.suggested { background: var(--fill); color: var(--fill-fg); }
.btn.suggested:hover { background: color-mix(in srgb, var(--fill) 88%, white); }

/* The first stop of the keyboard: straight to the content. */
.skip { position: absolute; left: 12px; top: -100px; z-index: 30; padding: .5rem .9rem; border-radius: 9px; background: var(--view); color: var(--strong); font-weight: 700; box-shadow: 0 0 0 2px var(--ink); }
.skip:focus { top: 10px; }

/* ===== Header bar ===== */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--view); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 54px; padding-block: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; color: var(--strong); text-decoration: none; margin-right: auto; }
.brand img { width: 30px; height: 30px; }
.bar nav a { color: var(--fg); text-decoration: none; font-weight: 600; font-size: .9375rem; padding: 7px 12px; border-radius: 9px; }
.bar nav a:hover { background: var(--fillc); }
/* The current page as the current tab of the app: a short bar under the label. */
.bar nav a[aria-current="page"] { position: relative; color: var(--strong); }
.bar nav a[aria-current="page"]::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--ink); }
.bar .btn { min-height: 2.25rem; padding: .35rem 1rem; font-size: .875rem; margin-left: 6px; }
/* The style switch: a sun in light, a moon in dark. */
.mode { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--strong); cursor: pointer; display: grid; place-items: center; margin-left: 4px; }
.mode:hover { background: var(--fillc); }
.mode[hidden] { display: none; }
.mode .sun { width: 18px; height: 18px; border-radius: 50%; background: currentColor; box-shadow: inset -6px -6px 0 0 var(--view); transform: rotate(-30deg); }

/* ===== Front page: one screen, then a row of three ===== */
.hero { padding-block: 48px 40px; }
.hero .top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; }
.greet { font-weight: 700; color: var(--c1); min-height: 1.5em; }
.hero h1 { font-size: clamp(2.25rem, calc(2rem + 2.4vw - 1rem), 3rem); margin-top: 4px; }
.hero .lede { font-size: 1.125rem; opacity: var(--dim); margin-top: 12px; max-width: 30rem; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero small { display: block; font-size: .875rem; opacity: var(--dim); margin-top: 12px; }
.latest { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--strong); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.latest span { color: var(--c1); font-weight: 700; }
.latest:hover { text-decoration: underline; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; padding-block: 40px 64px; border-top: 1px solid var(--line); }
.item h2 { font-size: 1.125rem; margin-top: 14px; }
.item p { margin-top: 6px; font-size: .9375rem; opacity: var(--dim); }
.item a { color: inherit; text-decoration: none; }
.item a:hover h2 { text-decoration: underline; }
.thumb { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); background: var(--fillc); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.thumb.icon { display: grid; place-items: center; }
.thumb.icon img { width: 96px; height: 96px; object-fit: contain; }

/* ===== Other pages ===== */
.page-head { padding-block: 40px 16px; }
.page-head h1 { font-size: clamp(2rem, calc(1.75rem + 2vw - 1rem), 2.75rem); }
.page-head .lede { font-size: 1.125rem; opacity: var(--dim); margin-top: 10px; max-width: 40rem; }


/* Get Breve: plain sections with commands. */
.doc { padding-block: 8px 64px; }
.doc > section { max-width: 46rem; margin-top: 36px; scroll-margin-top: 80px; }
.doc h2 { font-size: 1.375rem; margin-bottom: 8px; }
.doc p { margin-top: 8px; }
.doc ul { margin: 8px 0 0; padding-left: 1.2rem; }
.doc li + li { margin-top: 4px; }
.steps { margin: 12px 0 0; padding-left: 1.4rem; display: grid; gap: 10px; }
.steps li { min-width: 0; }
pre { background: var(--fillc); border-radius: 9px; padding: .7rem 1rem; overflow-x: auto; margin: 8px 0 0; }
code, pre { font-family: "Adwaita Mono", "Source Code Pro", ui-monospace, monospace; font-size: .9375rem; }

/* ===== News ===== */
.news-list { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.news-list li { padding-block: 20px; border-bottom: 1px solid var(--line); }
.news-list time, .post-meta { font-size: .9375rem; opacity: var(--dim); }
.news-list h2 { font-size: 1.375rem; margin-top: 4px; }
.news-list h2 a { color: var(--strong); text-decoration: none; }
.news-list h2 a:hover { text-decoration: underline; }
.news-list p { margin-top: 6px; opacity: var(--dim); }
.post { max-width: calc(42rem + 40px); padding-block: 48px 72px; }
.post h1 { font-size: clamp(2rem, calc(2rem + 2vw - 1rem), 2.75rem); margin-top: 8px; }
.post h2 { font-size: 1.5rem; margin-top: 40px; }
.post h3 { font-size: 1.1875rem; margin-top: 28px; }
.post p, .post ul, .post ol, .post blockquote, .post figure, .post img, .post table { margin-top: 16px; }
.post ul, .post ol { padding-left: 1.4rem; }
.post li + li { margin-top: 6px; }
.post blockquote { margin-inline: 0; padding-left: 1rem; border-left: 3px solid var(--line); opacity: var(--dim); }
.post img { border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.post figure { margin-inline: 0; }
.post figcaption { margin-top: 8px; font-size: .9375rem; opacity: var(--dim); }
.post table { border-collapse: collapse; }
.post th, .post td { padding: 6px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.post-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-weight: 600; }

footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding-block: 22px 30px; font-size: .9062rem; }
footer .wrap > span { margin-right: auto; opacity: var(--dim); }
footer a { color: var(--fg); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .hero .top, .three { grid-template-columns: minmax(0, 1fr); }
  .bar nav a.opt { display: none; }
}
/* Below 520 px the long buttons wrap instead of leaving the screen. */
@media (max-width: 520px) {
  .btn { white-space: normal; text-align: center; }
  .bar nav a { padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* Forced colors: the system draws the colors, so each control keeps an edge it can see. */
@media (forced-colors: active) {
  .btn, .mode, .shot, .thumb, pre { border: 1px solid CanvasText; }
  .btn.suggested { border-color: Highlight; }
  .bar nav a[aria-current="page"]::after { background: Highlight; }
  .mode .sun { forced-color-adjust: none; background: ButtonText; box-shadow: inset -6px -6px 0 0 ButtonFace; }
  :focus-visible { outline-color: Highlight; }
}

/* Features: a row for each big feature, text beside its picture, sides alternating. */
.features { padding-block: 0 24px; }
.row { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 32px 56px; align-items: center; padding-block: 56px; scroll-margin-top: 64px; }
.row:nth-of-type(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
.row:nth-of-type(even) .copy { order: 2; }
.row.wide { grid-template-columns: minmax(0, 1fr); }
.row.wide .copy, .row.wide:nth-of-type(even) .copy { order: 0; text-align: center; justify-self: center; }
.row.wide .copy h2, .row.wide .copy .pitch { margin-inline: auto; }
.row .kicker { font-size: .9375rem; font-weight: 700; color: var(--tone); }
.row h2 { font-size: clamp(1.75rem, calc(1.25rem + 1.6vw), 2.5rem); line-height: 1.12; letter-spacing: -.01em; margin-top: 6px; max-width: 18ch; }
.row .pitch { margin-top: 12px; font-size: 1.1875rem; opacity: var(--dim); max-width: 32rem; }
.row ul { justify-self: center; margin: 0; padding-left: 1.2rem; font-size: 1.0625rem; }
.row li + li { margin-top: 6px; }
.stage { display: grid; justify-items: center; align-items: start; gap: 20px; padding: clamp(16px, 3vw, 40px); border-radius: 20px; background: color-mix(in srgb, var(--tone) 12%, transparent); }
.stage.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stage figure { margin: 0; }
.stage figcaption { margin-top: 8px; font-size: .9375rem; font-weight: 600; text-align: center; }
.stage .shot { box-shadow: 0 0 0 1px var(--line), 0 12px 32px color-mix(in srgb, var(--tone) 22%, transparent); }
.also { padding-block: 48px 72px; border-top: 1px solid var(--line); }
.also > h2 { font-size: clamp(1.5rem, calc(1.1rem + 1.2vw), 2rem); text-align: center; }
.also-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px 40px; margin-top: 32px; }
.also h3 { font-size: 1.0625rem; }
.also ul { margin: 6px 0 0; padding-left: 1.1rem; opacity: var(--dim); }
.also li + li { margin-top: 2px; }
.also .not-yet { margin-top: 40px; text-align: center; font-size: .9375rem; opacity: var(--dim); }
@media (max-width: 900px) {
  .row, .row:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); padding-block: 36px; }
  .row:nth-of-type(even) .copy { order: 0; }
  .stage.two { grid-template-columns: minmax(0, 1fr); }
}
}
}
