/* Parnote site styles. Swiss Banknote Minimalism. */

/* Fonts: self-hosted Latin subsets, SIL OFL 1.1 (see fonts/OFL-1.1.txt) */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500.woff2") format("woff2"); }

/* Tokens */
:root {
  --paper: #F6F3EC; --paper-subtle: #EDE8DD; --ink: #1A1D1B; --ink-muted: #565B57;
  --accent: #2F5D50; --accent-hover: #244A40; --accent-tint: #DFE8E2;
  --border: #D6D0C4; --border-strong: #8C8A80;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 40rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121513; --paper-subtle: #1B1F1C; --ink: #ECE8DF; --ink-muted: #A3A69F;
    --accent: #7FB3A0; --accent-hover: #9CC7B6; --accent-tint: #1E2D28;
    --border: #2C322E; --border-strong: #5E655F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121513; --paper-subtle: #1B1F1C; --ink: #ECE8DF; --ink-muted: #A3A69F;
  --accent: #7FB3A0; --accent-hover: #9CC7B6; --accent-tint: #1E2D28;
  --border: #2C322E; --border-strong: #5E655F;
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
p { margin: 0 0 1rem; }
strong { font-weight: 600; }
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--accent-hover); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 1px;
}
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "zero" 1;
  padding: 0.08em 0.35em;
  background: var(--paper-subtle);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow-wrap: anywhere;
}
h1, h2, h3 { margin: 0; color: var(--ink); }

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}
.skip:focus { top: 0.75rem; color: var(--paper); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.25rem;
}
.brand { display: inline-flex; color: var(--ink); flex: none; }
.lockup { display: block; height: 1.625rem; width: auto; fill: var(--ink); }
.lockup .bar { fill: var(--accent); }
.nav { margin-left: auto; }
.nav ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding-block: 0.25rem;
}
.nav a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; }

.theme-toggle {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin-right: -0.375rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle .ring { fill: none; stroke: currentColor; stroke-width: 1.5; }
.theme-toggle .half { fill: currentColor; }

/* Shared type */
.overline, .index, .layer-label, .facts dt, .spec-strip dt, .contacts dt, .licenses th {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Hero */
.hero { padding-block: clamp(4rem, 10vw, 8.5rem) clamp(3.5rem, 7vw, 6rem); }
.hero .overline { color: var(--accent); margin-bottom: 1.75rem; }
.hero h1 {
  font-size: clamp(2.375rem, 5.6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 17ch;
  padding-top: 1.75rem;
  border-top: 3px solid var(--ink);
}
.lede {
  max-width: 38rem;
  margin: 2rem 0 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-muted);
}
.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(3rem, 6vw, 4.5rem) 0 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--border-strong);
}
.spec-strip > div { padding: 1.125rem 1.25rem 1.25rem 0; }
.spec-strip > div + div { padding-left: 1.25rem; border-left: 1px solid var(--border); }
.spec-strip dt { color: var(--ink-muted); font-weight: 500; letter-spacing: 0.1em; margin-top: 0.5rem; }
.spec-strip dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
  color: var(--ink);
}
.spec-strip > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }

/* Sections */
.section { border-top: 1px solid var(--border-strong); }
.section .grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 2rem clamp(2rem, 4vw, 4rem);
  padding-block: clamp(3.5rem, 7vw, 6rem);
}
.section-head { align-self: start; position: sticky; top: 6.25rem; }
.index {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section-head h2 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.prose, .intro { max-width: var(--measure); }
.intro {
  font-size: 1.25rem;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-bottom: 1.75rem;
}
.prose h3, .layer h3, .principle h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.prose h3 { margin: 2.25rem 0 0.625rem; }
.prose p:last-child { margin-bottom: 0; }

/* Architecture */
.layers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 3vw, 2.5rem);
  margin-top: 2.5rem;
}
.layer { display: flex; flex-direction: column; border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.layer > p:last-of-type { margin-bottom: 1.5rem; }
.layer-label { color: var(--accent); margin-bottom: 0.625rem; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.08em; }
.layer h3 { margin-bottom: 1rem; }
.layer p { color: var(--ink); }
.facts { margin: auto 0 0; border-top: 1px solid var(--border-strong); }
.facts > div, .contacts > div {
  display: grid;
  grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.facts dt, .contacts dt { color: var(--ink-muted); font-weight: 500; letter-spacing: 0.1em; }
.facts dd, .contacts dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* Principles */
.principles { display: grid; gap: 2.75rem; margin-top: 2.5rem; max-width: 48rem; }
.principle { border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.principle h3 { margin-bottom: 1rem; }
.principle p { max-width: var(--measure); margin: 0; }
.plain { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.plain li { padding: 0.625rem 0 0.625rem 1.5rem; border-bottom: 1px solid var(--border); position: relative; }
.plain li:first-child { padding-top: 0; }
.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.35rem;
  width: 0.625rem;
  height: 1px;
  background: var(--accent);
}
.plain li:first-child::before { top: 0.75rem; }
.table-wrap { overflow-x: auto; }
.licenses {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.licenses th, .licenses td { text-align: left; padding: 0.625rem 1rem 0.625rem 0; vertical-align: baseline; }
.licenses th { color: var(--ink-muted); font-weight: 500; letter-spacing: 0.1em; border-bottom: 1px solid var(--border-strong); }
.licenses td { border-bottom: 1px solid var(--border); }
.licenses tbody tr:last-child td { border-bottom: 0; }
.licenses td code { white-space: nowrap; }

/* Security */
.contacts { margin: 0; max-width: 48rem; border-top: 1px solid var(--ink); }
.contacts dd { font-size: 0.9375rem; }
.contacts dd code { background: none; border: 0; padding: 0; font-size: 1em; }
.fingerprint { letter-spacing: 0.02em; word-spacing: 0.1em; }

/* Footer */
.site-footer { border-top: 1px solid var(--border-strong); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 2rem 2.5rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}
.footer-inner p { margin: 0; }

/* 404 */
.notfound { padding-block: clamp(5rem, 14vw, 10rem); }
.notfound h1 {
  font-size: clamp(2.375rem, 5.6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  padding-top: 1.75rem;
  border-top: 3px solid var(--ink);
  margin-bottom: 1.5rem;
}
.notfound .overline { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 1.75rem; }

/* Responsive */
@media (max-width: 60rem) {
  .section .grid { grid-template-columns: minmax(0, 1fr); }
  .section-head { position: static; }
  .layers { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-strip > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .spec-strip > div:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 48rem) {
  .header-inner { flex-wrap: wrap; gap: 0 1rem; padding-block: 0.875rem 0; }
  .theme-toggle { margin-left: auto; }
  .nav { order: 3; flex: 0 0 calc(100% + 2 * var(--gutter)); margin: 0.625rem calc(var(--gutter) * -1) 0; padding: 0 var(--gutter); border-top: 1px solid var(--border); overflow-x: auto; }
  .nav ul { gap: 1rem; justify-content: space-between; padding-block: 0.625rem; }
  .nav a { font-size: 0.8125rem; white-space: nowrap; }
  html { scroll-padding-top: 7.5rem; }
  .facts > div, .contacts > div { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .section-head h2 { font-size: 1.75rem; }
  .intro { font-size: 1.125rem; }
}
@media (max-width: 30rem) {
  .spec-strip dd { font-size: 0.875rem; white-space: nowrap; }
  .spec-strip dt { letter-spacing: 0.06em; }
  .spec-strip > div { padding-right: 0.75rem; }
  .spec-strip > div + div { padding-left: 0.75rem; }
  .spec-strip > div:nth-child(3) { padding-left: 0; }
}
