/* ============================================================
   SMALL MIND - system of record
   Type:  Archivo (display) · IBM Plex Sans (body) · IBM Plex Mono (record)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --ink:      #0B0E12;
  --paper:    #F5F6F7;
  --purple:   #9932CC;
  --aubergine:#3A2145;
  --slate:    #5C6B7A;
  --rule:     #D8DBDE;
  --signal:   #C4362F;   /* reserved: caught defect / FAIL only */

  --display: 'Archivo', system-ui, sans-serif;
  --body:    'IBM Plex Sans', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);

  /* surfaces that differ between themes */
  --surface:  #ffffff;   /* record strip, stamp, cards */
  --hero-quiet: var(--slate);
}

/* ---------- dark mode (system preference) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:      #ECEDEF;   /* text goes light */
    --paper:    #0C0E13;   /* background goes near-black */
    --purple:   #B45CE6;   /* a hair brighter so it doesn't vibrate on dark */
    --aubergine:#2A1836;
    --slate:    #8A97A5;   /* lifted for contrast on dark */
    --rule:     #232833;   /* subtle dark divider */
    --signal:   #E5645C;   /* FAIL red, lifted for dark legibility */
    --surface:  #14171E;   /* cards sit just above the background */
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- shell ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: var(--measure); }

/* ---------- header ---------- */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 0; border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
/* logo mark - swaps variant by theme so it stays visible on dark */
.brand__mark {
  width: 30px; height: 30px; flex: none; display: block;
  background-image: var(--logo-icon);
  background-size: contain; background-repeat: no-repeat; background-position: center;
}
:root { --logo-icon: url('assets/logo/icon-primary.svg'); }
@media (prefers-color-scheme: dark) {
  :root { --logo-icon: url('assets/logo/icon-reversed.svg'); }
}
.brand__word {
  font-family: var(--mono); font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.9rem;
}
.brand__word b { color: var(--ink); font-weight: 600; }
.brand__word span { color: var(--slate); font-weight: 400; }

.nav { display: flex; gap: 1.75rem; }
.nav a {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--slate); text-decoration: none;
  padding-bottom: 2px; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--purple); border-color: var(--purple); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--purple); margin-bottom: 1rem;
}
p + p { margin-top: 1.1rem; }
a { color: var(--purple); text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* ---------- hero ---------- */
.hero { padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero h1 {
  font-weight: 800; font-size: clamp(2.4rem, 6.5vw, 4.5rem);
  max-width: 16ch;
}
.hero .lede {
  margin-top: 1.75rem; max-width: 54ch; font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--ink);
}
.hero .lede .quiet { color: var(--slate); }

/* ---------- the record strip (signature element) ---------- */
.record {
  margin-top: 3rem; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--surface); overflow: hidden;
}
.record__row {
  display: grid; grid-template-columns: 1fr; gap: 0;
}
.record__cell { padding: 1.1rem 1.4rem; border-top: 1px solid var(--rule); }
.record__cell:first-child { border-top: 0; }
.record__k { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); }
.record__v { font-family: var(--mono); font-size: 0.82rem; color: var(--ink); margin-top: 0.35rem; word-break: break-all; }
.record__v.pass { color: var(--purple); }
.record__v.fail { color: var(--signal); }

/* ---------- section ---------- */
section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-rule { border-top: 1px solid var(--rule); }
h2.section-title { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 700; margin-bottom: 1.5rem; }

/* ---------- principle list ---------- */
.principles { display: grid; gap: 0; }
.principle {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem;
  padding: 1.5rem 0; border-top: 1px solid var(--rule);
}
.principle:first-child { border-top: 0; }
.principle__n { font-family: var(--mono); font-size: 0.8rem; color: var(--purple); padding-top: 0.2rem; }
.principle h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.4rem; }
.principle p { color: var(--slate); max-width: 60ch; }

/* ---------- writing index ---------- */
.entry {
  display: block; text-decoration: none; color: inherit;
  padding: 1.75rem 0; border-top: 1px solid var(--rule);
  transition: padding-left .18s;
}
.entry:hover { padding-left: 0.5rem; }
.entry:first-of-type { border-top: 1px solid var(--rule); }
.entry__meta { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.entry h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 700; margin: 0.5rem 0; }
.entry p { color: var(--slate); max-width: 66ch; }
.entry__fp { font-family: var(--mono); font-size: 0.7rem; color: var(--slate); margin-top: 0.75rem; word-break: break-all; }
.entry__fp b { color: var(--purple); font-weight: 500; }

/* ---------- founder ---------- */
.founder-hero { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: start; padding-top: clamp(2.5rem,7vw,5rem); }
.founder-hero__img { width: 100%; border-radius: 12px; border: 1px solid var(--rule); display: block; }
.founder-hero__img-wrap { max-width: 340px; }
.arc { max-width: var(--measure); }
.arc p { margin-top: 1.2rem; }
.arc p:first-child { margin-top: 0; }
.arc .drop::first-letter {
  font-family: var(--display); font-weight: 800; font-size: 3.4rem;
  float: left; line-height: 0.8; padding: 0.35rem 0.6rem 0 0; color: var(--purple);
}

/* ---------- built list ---------- */
.built { list-style: none; margin-top: 1.25rem; border-top: 1px solid var(--rule); }
.built li {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--rule);
  font-size: 0.98rem;
}
.built li span { font-family: var(--mono); font-size: 0.72rem; color: var(--purple); padding-top: 0.25rem; white-space: nowrap; }

/* ---------- paper page ---------- */
.paper { max-width: var(--measure); padding-top: clamp(2rem,5vw,3.5rem); }
.paper h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
.paper .paper__sub { color: var(--slate); font-size: 1.15rem; margin-top: 1rem; }
.paper .paper__by { font-family: var(--mono); font-size: 0.8rem; color: var(--slate); margin-top: 1.25rem; letter-spacing: 0.05em; }
.paper article { margin-top: 2.5rem; }
.paper article h2 { font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 1rem; }
.paper article h3 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.6rem; font-family: var(--display); }
.paper article p { margin-top: 1rem; }
.paper article strong { font-weight: 600; }
.paper article em { color: var(--ink); }
.paper article code { font-family: var(--mono); font-size: 0.88em; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 0.05em 0.35em; word-break: break-word; }
.paper hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.paper .ledger-ref { font-family: var(--mono); font-size: 0.82em; color: var(--slate); }

/* fingerprint stamp on paper pages */
.stamp {
  margin: 2.5rem 0; padding: 1.25rem 1.4rem; border: 1px solid var(--rule);
  border-left: 3px solid var(--purple); border-radius: 8px; background: var(--surface);
}
.stamp__k { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); }
.stamp__v { font-family: var(--mono); font-size: 0.8rem; color: var(--ink); margin-top: 0.4rem; word-break: break-all; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--rule); margin-top: 4rem; padding: 2.5rem 0 3.5rem; }
.foot { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.foot__brand { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate); }
.foot__links { display: flex; gap: 1.5rem; }
.foot__links a { font-family: var(--mono); font-size: 0.78rem; color: var(--slate); text-decoration: none; }
.foot__links a:hover { color: var(--purple); }

/* ---------- responsive ---------- */
@media (min-width: 720px) {
  .founder-hero { grid-template-columns: 340px 1fr; gap: 3rem; }
  .record__row { grid-template-columns: repeat(3, 1fr); }
  .record__cell { border-top: 0; border-left: 1px solid var(--rule); }
  .record__cell:first-child { border-left: 0; }
}

::selection { background: var(--purple); color: var(--paper); }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 2px; }
