/* peiralabs.com. Colours are the Brass palette from the Peira app
   (lib/core/theme/brass.dart): Brass.light by default, Brass.dark only when
   the reader's system asks for it. Flat colour throughout; the only shadow is
   under the product screenshot. */

@font-face { font-family: "Spectral"; src: url("/_a/spectral-400.cf8daee3b8.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("/_a/spectral-400-italic.db397149a9.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("/_a/spectral-600.33faca8b57.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/_a/plex-mono-400.08949f728d.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --paper: #f1eadc;
  --paper-deep: #e5dbc7;
  --ink: #2b3423;
  --text: #3c4634;
  --muted: #525d48;
  --link: #386649;
  --rule: #9a7a2e;
  --rule-text: #6e5220;
  --hair: rgba(110, 82, 32, 0.35);
  --pass: #38702e;
  --fail: #9e362c;
  --band-bg: #2b3423;
  --band-fg: #f1eadc;
  --term-bg: #0f1912;
  --term-fg: #d6dec8;
  --shadow: 0 22px 44px -24px rgba(43, 52, 35, 0.45);
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --mono: "Plex Mono", ui-monospace, "DejaVu Sans Mono", Menlo, monospace;
  --wide: 72rem;
  --measure: 44rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1912;
    --paper-deep: #1c2c1f;
    --ink: #f4eeda;
    --text: #d6dec8;
    --muted: #94a684;
    --link: #a9c78f;
    --rule: #c9a24a;
    --rule-text: #c9a24a;
    --hair: rgba(201, 170, 88, 0.28);
    --pass: #7bb26a;
    --fail: #d79f92;
    --band-bg: #223224;
    --band-fg: #f4eeda;
    --term-bg: #09100b;
    --term-fg: #d6dec8;
    --shadow: 0 22px 44px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--paper); padding: 0.4rem 0.8rem; border: 1px solid var(--ink); z-index: 2; }
.skip:focus { left: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.wrap.narrow { max-width: 50rem; }

h1, h2, h3 { color: var(--ink); font-weight: 600; line-height: 1.2; }
p, ul, ol, dl, table, pre, figure { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
code, pre, .rev { font-family: var(--mono); }
code { font-size: 0.86em; }
figure { margin-left: 0; margin-right: 0; }

/* Header */
.masthead { border-bottom: 1px solid var(--hair); }
.masthead-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.2rem; letter-spacing: 0.01em; }
.mark { width: 1.4rem; height: 1.4rem; fill: var(--rule); flex: none; }
.mark .mark-dot { fill: var(--paper); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.4rem; font-size: 1rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); }
.site-nav .nav-contact { color: var(--ink); border: 1px solid var(--ink); border-radius: 3px; padding: 0.3rem 0.8rem; }
.site-nav .nav-contact:hover { background: var(--paper-deep); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
}
.button:hover { background: var(--paper-deep); }
.button-primary { background: var(--ink); color: var(--paper); }
.button-primary:hover { background: var(--link); border-color: var(--link); color: var(--paper); }

/* Hero */
.hero { padding: 4.5rem 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.5rem + 3vw, 3.5rem); line-height: 1.07; letter-spacing: -0.02em; margin: 0 0 1.25rem; max-width: 15ch; }
.hero .lede { font-size: 1.2rem; line-height: 1.55; color: var(--text); max-width: 34em; margin-bottom: 1.75rem; }
.announce { margin: 0 0 1.5rem; }
.announce a { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.25rem 0.85rem 0.25rem 0.3rem; border: 1px solid var(--hair); border-radius: 999px; color: var(--ink); font-size: 0.92rem; text-decoration: none; line-height: 1.35; }
.announce a:hover { border-color: var(--rule); }
.announce-tag { background: var(--ink); color: var(--paper); border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.fine { font-size: 0.92rem; color: var(--muted); margin: 0; }
.hero-shot { margin: 0; }
.hero-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--hair); border-radius: 6px; box-shadow: var(--shadow); }
.hero-shot figcaption { margin-top: 0.85rem; font-size: 0.9rem; color: var(--muted); }

/* Latest releases */
.releases { background: var(--paper-deep); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.releases-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2rem; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.releases-label { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rule-text); }
.releases ul { display: flex; flex-wrap: wrap; gap: 0.4rem 0; list-style: none; padding: 0; margin: 0; }
.releases li { margin: 0; padding: 0 1.25rem; border-left: 1px solid var(--hair); }
.releases li:first-child { padding-left: 0; border-left: 0; }
.releases a { text-decoration: none; color: var(--ink); font-size: 0.98rem; }
.releases a:hover .rel-name { text-decoration: underline; }
.rel-name { font-weight: 600; }
.rel-date { color: var(--muted); margin-left: 0.35rem; }

/* Sections */
.band { padding: 5rem 0; }
.band-alt { background: var(--paper-deep); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.section-head { max-width: 42rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.35rem); letter-spacing: -0.01em; margin: 0 0 0.85rem; }
.section-head p { color: var(--text); margin: 0; }
.eyebrow { margin: 0 0 0.6rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rule-text); }

/* Products */
.meta { font-size: 0.92rem; color: var(--muted); margin: 0 0 0.5rem; }
.status { font-weight: 600; color: var(--ink); letter-spacing: 0.02em; }
.feature { border: 1px solid var(--hair); background: var(--paper-deep); border-radius: 4px; }
.feature h3 { margin: 0 0 0.75rem; }
.feature-peira { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; padding: 2.5rem; border-top: 3px solid var(--rule); }
.feature-peira h3 { font-size: 2.1rem; letter-spacing: -0.01em; }
.feature-lede { font-size: 1.12rem; color: var(--text); margin-bottom: 1.5rem; }
.feature-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.capabilities { list-style: none; padding: 0; margin: 0; align-self: center; }
.capabilities li { margin: 0; padding: 0.7rem 0; border-top: 1px solid var(--hair); font-size: 1rem; }
.capabilities li:last-child { border-bottom: 1px solid var(--hair); }
.capabilities strong { color: var(--ink); font-weight: 600; }
.feature-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; margin-top: 1.5rem; }
.feature-small { padding: 2rem; display: flex; flex-direction: column; min-width: 0; }
.feature-small > * { min-width: 0; }
.feature-small h3 { font-size: 1.55rem; }
.feature-small > p:last-child { margin-top: auto; margin-bottom: 0; }
.more { font-weight: 600; }
pre.term { background: var(--term-bg); color: var(--term-fg); border-radius: 4px; padding: 0.9rem 1rem; font-size: 0.78rem; line-height: 1.55; overflow-x: auto; margin-bottom: 0.4rem; }
.caption { font-size: 0.88rem; color: var(--muted); }
.questions { padding-left: 1.4rem; }
.also { margin-top: 3.5rem; }
.also-title { margin: 0 0 1.25rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rule-text); }
.also-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin: 0; }
.also-list div { border-top: 1px solid var(--rule); padding-top: 1rem; }
.also-list dt { font-weight: 600; color: var(--ink); margin-bottom: 0.4rem; font-size: 1.1rem; }
.also-list dt a { color: var(--ink); }
.also-list dd { margin: 0; font-size: 0.98rem; }
.status-chip { display: inline-block; margin-left: 0.4rem; padding: 0 0.45rem; border: 1px solid var(--hair); border-radius: 3px; font-size: 0.72rem; font-weight: 400; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); vertical-align: 0.15em; }

/* Approach */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.75rem 3.5rem; }
.principle { border-top: 2px solid var(--rule); padding-top: 1.1rem; }
.principle h3 { font-size: 1.3rem; margin: 0 0 0.6rem; }
.principle p { margin-bottom: 0.6rem; }
.principle .source { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* Demo */
.demo { border: 1px solid var(--hair); border-top: 2px solid var(--rule); background: var(--paper-deep); border-radius: 4px; padding: 1.25rem 1.25rem 0.25rem; margin: 0 0 1.25rem; }
.demo-store, .demo-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.demo-cell { min-width: 0; }
.demo-label { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.25rem; }
.demo-value, .demo-answer { margin: 0 0 0.9rem; font-size: 1.02rem; color: var(--ink); }
.rev { font-size: 0.82rem; padding: 0.05rem 0.35rem; border: 1px solid var(--hair); background: var(--paper); color: var(--text); white-space: nowrap; }
.rev.is-behind { border-color: var(--fail); color: var(--fail); }
.demo-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.9rem 0; margin-bottom: 0.9rem; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.demo button { font: inherit; font-size: 0.98rem; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 3px; padding: 0.4rem 0.85rem; cursor: pointer; }
.demo button:hover { background: var(--paper-deep); }
.demo-answer.is-refused { color: var(--fail); }
.demo-answer.is-ok { color: var(--pass); }
.demo-static { border-left: 2px solid var(--rule); padding-left: 0.9rem; }
.aside { font-size: 0.95rem; color: var(--muted); border-left: 2px solid var(--rule); padding-left: 0.9rem; }

/* Contact */
.contact-band { background: var(--band-bg); color: var(--band-fg); padding: 3.5rem 0; }
.contact-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.contact-band h2 { color: var(--band-fg); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin: 0 0 0.4rem; }
.contact-band p { margin: 0; }
.contact-band .actions { margin: 0; }
.contact-band .button { border-color: var(--band-fg); color: var(--band-fg); }
.contact-band .button:hover { background: rgba(241, 234, 220, 0.12); }
.contact-band .button-primary { background: var(--band-fg); color: var(--band-bg); }
.contact-band .button-primary:hover { background: var(--paper-deep); border-color: var(--paper-deep); color: var(--ink); }

/* Inner pages */
.page { max-width: calc(var(--measure) + 2.5rem); margin: 0 auto; padding: 3rem 1.25rem 1rem; }
.page h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 2.75rem); letter-spacing: -0.012em; margin: 0 0 1.1rem; max-width: 22ch; }
.page h2 { font-size: 1.4rem; margin: 3.25rem 0 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--hair); }
.page .lede { font-size: 1.28rem; line-height: 1.5; color: var(--ink); max-width: 36em; }
.kicker { font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.6rem; color: var(--rule-text); }
.kicker a { color: var(--rule-text); text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.source-note, figcaption { font-size: 0.95rem; color: var(--muted); }
.page pre { background: var(--paper-deep); border-left: 2px solid var(--rule); padding: 0.9rem 1rem; overflow-x: auto; line-height: 1.5; font-size: 0.86rem; }
.page pre code { font-size: inherit; }
.page figure pre { margin-bottom: 0.4rem; }
.fpr { word-spacing: 0.1em; }
.product-list li { margin-bottom: 0.5rem; }

table.plain { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.45; }
table.plain th { text-align: left; font-weight: 400; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); padding: 0 0.75rem 0.45rem 0; }
table.plain td { vertical-align: top; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--hair); }
table.plain td:first-child { color: var(--ink); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; font-size: 1rem; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 0.75rem 0; }
.facts div { display: contents; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
/* The facts block already closes the page head with a rule. */
.opening:has(.facts) + section > h2 { border-top: 0; padding-top: 0; }

.secno { font-family: var(--mono); font-weight: 400; font-size: 0.85em; color: var(--rule-text); margin-right: 0.5rem; }
.reqs { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; }
.reqs div { display: contents; }
.reqs dt { font-family: var(--mono); color: var(--rule-text); }
.reqs dd { margin: 0; }
.levels td:first-child { white-space: nowrap; }
.greek { font-family: "Gentium Plus", "Noto Serif", "DejaVu Serif", Georgia, serif; }

/* Footer */
.site-footer { border-top: 1px solid var(--hair); padding: 3.5rem 0 2.5rem; margin-top: 0; font-size: 0.95rem; }
.inner .site-footer { margin-top: 4rem; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.brand-line { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--ink); font-size: 1.1rem; margin-bottom: 0.5rem; }
.footer-brand p:last-child { color: var(--muted); max-width: 22em; }
.footer-head { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rule-text); margin: 0 0 0.7rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); text-decoration: underline; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; margin-top: 2.75rem; padding-top: 1.25rem; border-top: 1px solid var(--hair); font-size: 0.85rem; color: var(--muted); }
.footer-base p { margin: 0; }
.footer-base .revision { max-width: 46rem; }
.footer-base code { color: var(--text); }

/* Narrower screens */
@media (max-width: 64rem) {
  .hero { padding: 3rem 0 2.5rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .hero h1 { max-width: 18ch; }
  .feature-peira { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; padding: 2rem; }
}
@media (max-width: 48rem) {
  .band { padding: 3.5rem 0; }
  .feature-pair, .also-list, .principles { grid-template-columns: minmax(0, 1fr); }
  .principles { gap: 2rem; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .releases li { padding: 0 0.9rem; }
}
@media (max-width: 30rem) {
  .site-nav { gap: 0.4rem 0.8rem; font-size: 0.9rem; }
  .site-nav .nav-contact { padding: 0.2rem 0.55rem; }
  .feature-peira, .feature-small { padding: 1.4rem; }
  .releases ul { flex-direction: column; }
  .releases li { padding: 0; border-left: 0; }
  .demo-store, .demo-answers { grid-template-columns: 1fr; gap: 0; }
  table.plain thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.plain, table.plain tbody, table.plain tr, table.plain td { display: block; width: 100%; }
  table.plain tr { padding: 0.6rem 0; border-bottom: 1px solid var(--hair); }
  table.plain td { border: 0; padding: 0.1rem 0; overflow-wrap: anywhere; }
  table.plain td:first-child { font-weight: 600; }
}
@media (max-width: 28rem) {
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dt { margin-top: 0.45rem; font-size: 0.9rem; }
}

@media print {
  :root { --paper: #fff; --paper-deep: #f3f3f3; --ink: #000; --text: #111; --muted: #444; --link: #000; --band-bg: #fff; --band-fg: #000; }
  .site-nav, .skip, .demo, .hero-shot, .contact-band .actions { display: none; }
  .demo-static { display: block; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444; }
  h2 { break-after: avoid; }
  pre, table, figure, .feature { break-inside: avoid; }
}
