/* Centrum AURA — design system
   Light-first editorial. Long-form reference reading is the primary job.
   Dark mode follows the OS. Colours are tokens; change them here only. */

:root {
  --ink:        #14181d;
  --ink-2:      #3d454f;
  --muted:      #6b7480;
  --faint:      #98a1ac;
  --bg:         #ffffff;
  --bg-2:       #f7f8f9;
  --bg-3:       #eef0f2;
  --line:       #e2e5e9;
  --line-2:     #cdd2d8;

  --accent:     #1f6f5c;   /* deep green — "value", the thing you want more of */
  --accent-ink: #14503f;
  --accent-bg:  #e9f3ef;
  --warn:       #a8541c;   /* amber — "failure demand" */
  --warn-bg:    #fbf0e6;
  --ctx:        #40567d;   /* blue — "context demand" */
  --ctx-bg:     #eaeef6;

  --ink-inv:    #f4f6f7;
  --dark-bg:    #14181d;
  --dark-bg-2:  #1c2229;
  --dark-line:  #2c343d;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --wrap: 1120px;
  --read: 68ch;
  --r: 10px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(20,24,29,.04), 0 8px 24px -12px rgba(20,24,29,.12);
  --shadow-lg: 0 2px 4px rgba(20,24,29,.04), 0 24px 48px -20px rgba(20,24,29,.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ebee; --ink-2: #bcc4cd; --muted: #8d97a3; --faint: #6b7480;
    --bg: #14181d; --bg-2: #1a1f25; --bg-3: #222932;
    --line: #272e37; --line-2: #38414c;
    --accent: #5cbfa2; --accent-ink: #8ad6bf; --accent-bg: #14302a;
    --warn: #d9955c; --warn-bg: #322015;
    --ctx: #8aa4d4; --ctx-bg: #1b2434;
    --ink-inv: #14181d;
    --dark-bg: #0e1114; --dark-bg-2: #171c22; --dark-line: #262d36;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 24px 48px -20px rgba(0,0,0,.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.02em; }
h1 { font-family: var(--serif); font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -.03em; }
h2 { font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.3rem); letter-spacing: -.025em; }
h3 { font-size: 1.18rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1.15em; }
a { color: var(--accent-ink); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--bg-3); padding: .12em .38em; border-radius: 4px; }
ul, ol { margin: 0 0 1.15em; padding-left: 1.3em; }
li { margin-bottom: .4em; }
img, svg { max-width: 100%; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 200; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-size: .98rem; letter-spacing: -.01em; flex-shrink: 0; }
.brand-text { font-weight: 400; color: var(--muted); }
.brand-text strong { font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.brand-mark { width: 17px; height: 17px; border-radius: 50%; background: conic-gradient(from 140deg, var(--accent), var(--ctx) 45%, var(--warn) 72%, var(--accent)); }

.nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; margin: 0; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: .89rem; font-weight: 500;
  color: var(--ink-2); text-decoration: none;
  padding: 8px 11px; border-radius: 7px; border: 0; background: none; cursor: pointer;
}
.nav-link:hover { background: var(--bg-3); color: var(--ink); }
.nav-link.is-current, .has-menu.is-current > .nav-link { color: var(--accent-ink); }
.chev { opacity: .5; transition: transform .18s; }
.nav-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

.nav-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 268px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 7px; display: none;
}
.nav-toggle[aria-expanded="true"] + .nav-menu { display: block; }
.nav-menu-link { display: block; padding: 9px 11px; border-radius: 9px; text-decoration: none; }
.nav-menu-link:hover { background: var(--bg-2); }
.nav-menu-label { display: block; font-size: .9rem; font-weight: 500; color: var(--ink); }
.nav-menu-note { display: block; font-size: .78rem; color: var(--muted); margin-top: 1px; }
.nav-menu-link.is-current .nav-menu-label { color: var(--accent-ink); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.nav-signin { text-decoration: none; }
@media (max-width: 640px) { .nav-signin { display: none; } }
.nav-burger { display: none; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; cursor: pointer; padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.nav-burger span { display: block; width: 16px; height: 1.5px; background: var(--ink); border-radius: 2px; transition: .2s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 940px) {
  .nav-burger { display: flex; }
  .nav { position: fixed; inset: 64px 0 auto; margin: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 24px 22px; display: none; max-height: calc(100vh - 64px); overflow-y: auto; }
  .nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link { width: 100%; justify-content: space-between; padding: 11px 12px; font-size: .96rem; }
  .nav-menu { position: static; display: block; box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; margin: 2px 0 8px 12px; min-width: 0; padding: 0 0 0 6px; }
  .chev { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: .92rem; font-weight: 500; line-height: 1;
  padding: 12px 20px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--ink); text-decoration: none; cursor: pointer;
  transition: transform .12s, box-shadow .16s, background .16s, border-color .16s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0d1f1a; } }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { .btn-primary:hover { background: var(--accent-ink); } }
.btn-ghost { background: transparent; }
.btn-sm { padding: 8px 14px; font-size: .86rem; border-radius: 7px; }
.btn-lg { padding: 15px 26px; font-size: 1rem; }
@media (max-width: 560px) { .header-actions .btn-sm { display: none; } }

/* ---------- Layout primitives ---------- */
.band { padding: clamp(56px, 8vw, 96px) 0; }
.band-tint { background: var(--bg-2); border-block: 1px solid var(--line); }
.band-dark { background: var(--dark-bg); color: #b8c1cc; }
.band-dark h1, .band-dark h2, .band-dark h3, .band-dark strong { color: #fff; }
.band-dark a { color: #7fd8bd; }
.band-tight { padding: clamp(40px, 5vw, 64px) 0; }

.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: .73rem; font-weight: 500;
  letter-spacing: .11em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px;
}
.band-dark .eyebrow { color: #7fd8bd; }
.lede { font-size: clamp(1.08rem, 1.9vw, 1.3rem); line-height: 1.55; color: var(--ink-2); max-width: 62ch; }
.section-head { max-width: 66ch; margin-bottom: 44px; }
.prose { max-width: var(--read); }
.prose h2 { margin-top: 2.4em; }
.prose h3 { margin-top: 1.8em; }
.prose > :first-child { margin-top: 0; }

.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g-3, .g-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px; transition: border-color .16s, box-shadow .16s, transform .16s;
}
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card-link { text-decoration: none; display: block; color: inherit; }
.card-link:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-num { font-family: var(--mono); font-size: .75rem; color: var(--faint); display: block; margin-bottom: 12px; letter-spacing: .08em; }

/* ---------- Hero ---------- */
.hero { padding: clamp(64px, 10vw, 120px) 0 clamp(48px, 7vw, 80px); position: relative; overflow: hidden; }
.hero::after {
  content: ''; position: absolute; top: -30%; right: -12%; width: 620px; height: 620px; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent), transparent 68%);
  pointer-events: none;
}
.hero h1 { max-width: 19ch; margin-bottom: .38em; }
.hero .lede { max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-note { font-size: .85rem; color: var(--muted); margin-top: 18px; }

/* Two-kinds split graphic */
.split-demand { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); margin: 40px 0 0; }
.split-demand > div { padding: 24px 26px; background: var(--bg); }
.sd-value { border-right: 1px solid var(--line); }
.sd-fail { background: var(--warn-bg); }
.sd-label { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.sd-fail .sd-label { color: var(--warn); }
.sd-quote { font-size: 1rem; color: var(--ink); margin-bottom: 6px; }
.sd-quote + .sd-quote { margin-top: 0; }
.sd-note { font-size: .86rem; color: var(--muted); margin: 12px 0 0; }
@media (max-width: 620px) { .split-demand { grid-template-columns: 1fr; } .sd-value { border-right: 0; border-bottom: 1px solid var(--line); } }

/* ---------- Pull quote / callout ---------- */
.pull {
  font-family: var(--serif); font-size: clamp(1.35rem, 2.8vw, 1.9rem); line-height: 1.32;
  color: var(--ink); letter-spacing: -.02em; border-left: 3px solid var(--accent);
  padding-left: 26px; margin: 2.4em 0; max-width: 26ch;
}
.callout {
  background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0; padding: 20px 24px; margin: 1.8em 0; font-size: .96rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout-warn { border-left-color: var(--warn); }

/* ---------- Steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 28px 52px; margin: 0; }
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-size: .72rem; color: var(--accent);
  width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; background: var(--bg);
}
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 1px; background: var(--line); }
.steps h3 { margin-bottom: .25em; }
.steps p { margin-bottom: 0; font-size: .96rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink); background: var(--bg-2); font-size: .8rem; letter-spacing: .03em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono);
  font-size: .7rem; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; background: var(--bg-3); color: var(--muted); white-space: nowrap;
}
.badge-fail { background: var(--warn-bg); color: var(--warn); }
.badge-value { background: var(--accent-bg); color: var(--accent-ink); }
.badge-ctx { background: var(--ctx-bg); color: var(--ctx); }
.badge-route { background: var(--ctx-bg); color: var(--ctx); }

/* ---------- Taxonomy browser ---------- */
.tx-controls { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; margin-bottom: 8px; align-items: center; }
@media (max-width: 800px) { .tx-controls { grid-template-columns: 1fr 1fr; } .tx-search { grid-column: 1 / -1; } }
.field {
  width: 100%; font: inherit; font-size: .92rem; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); color: var(--ink);
}
.field::placeholder { color: var(--faint); }
select.field { cursor: pointer; padding-right: 34px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7480' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.tx-meta { font-size: .85rem; color: var(--muted); margin: 14px 0 18px; font-family: var(--mono); }
.tx-list { display: grid; gap: 10px; }
.tx-item { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.tx-head { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 15px 18px; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }
.tx-head:hover { background: var(--bg-2); }
.tx-name { font-weight: 500; color: var(--ink); font-size: .98rem; }
.tx-id { font-family: var(--mono); font-size: .74rem; color: var(--faint); display: block; margin-top: 2px; }
.tx-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tx-body { padding: 0 18px 18px; display: none; border-top: 1px solid var(--line); margin-top: -1px; }
.tx-item.is-open .tx-body { display: block; padding-top: 16px; }
.tx-body dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 18px; margin: 0; font-size: .92rem; }
.tx-body dt { font-family: var(--mono); font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.tx-body dd { margin: 0; }
@media (max-width: 620px) { .tx-body dl { grid-template-columns: 1fr; gap: 3px 0; } .tx-body dd { margin-bottom: 10px; } .tx-tags { justify-content: flex-start; } .tx-head { grid-template-columns: 1fr; } }
.tx-empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.tx-further:empty { display: none; }
.tx-further-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 1.6em 0 0; }
.tx-further-card { border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; background: var(--bg); }
.tx-further-card h3 { font-size: 1rem; margin: 0 0 2px; }
.tx-further-count { font-family: var(--mono); font-size: .74rem; color: var(--accent-ink); letter-spacing: .04em; margin: 0 0 12px; text-transform: uppercase; }
.tx-further-card ul { list-style: none; margin: 0; padding: 0; font-size: .88rem; color: var(--ink-2); }
.tx-further-card li { margin-bottom: 5px; padding-left: 14px; position: relative; }
.tx-further-card li::before { content: ''; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }

/* ---------- Calculator ---------- */
.calc { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .calc { grid-template-columns: 1fr; gap: 28px; } }
.calc-inputs { display: grid; gap: 20px; }
.calc-field label { display: block; font-size: .9rem; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.calc-hint { font-size: .8rem; color: var(--muted); margin: 5px 0 0; }
.calc-row { display: flex; align-items: center; gap: 12px; }
.calc-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.calc-num { width: 118px; flex-shrink: 0; text-align: right; font-family: var(--mono); font-size: .9rem; }
.calc-out { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; position: sticky; top: 84px; }
.calc-headline { font-family: var(--serif); font-size: clamp(2rem, 5vw, 2.9rem); color: var(--ink); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 6px; }
.calc-sub { font-size: .92rem; color: var(--muted); margin-bottom: 24px; }
.calc-bar { height: 34px; border-radius: 7px; overflow: hidden; display: flex; border: 1px solid var(--line); margin-bottom: 10px; }
.calc-bar-fail { background: var(--warn); transition: width .3s ease; }
.calc-bar-value { background: var(--accent); flex: 1; transition: width .3s ease; }
.calc-legend { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); font-family: var(--mono); margin-bottom: 24px; }
.calc-lines { display: grid; gap: 0; border-top: 1px solid var(--line); }
.calc-line { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.calc-line strong { font-family: var(--mono); font-weight: 500; }
.calc-line-total { font-size: 1rem; }
.calc-line-total strong { color: var(--warn); font-weight: 600; }
.calc-caveat { font-size: .82rem; color: var(--muted); margin: 20px 0 0; line-height: 1.5; }

/* ---------- Answers ---------- */
.answer-hero { padding: clamp(48px, 7vw, 76px) 0 0; }
.answer-lede { font-size: clamp(1.1rem, 2vw, 1.28rem); line-height: 1.55; color: var(--ink); border-left: 3px solid var(--accent); padding-left: 22px; margin: 0 0 2em; max-width: 62ch; }
.answer-list { display: grid; gap: 12px; }
.answer-row { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: inherit; background: var(--bg); transition: .16s; }
.answer-row:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.answer-q { font-weight: 500; color: var(--ink); font-size: 1.02rem; }
.answer-a { font-size: .89rem; color: var(--muted); margin: 4px 0 0; }
.answer-arrow { color: var(--faint); font-size: 1.1rem; }
.related { margin-top: 3.5em; padding-top: 2em; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.1rem; font-family: var(--sans); margin-bottom: 1em; }

/* ---------- Product pages ---------- */
.spec { display: grid; grid-template-columns: 180px 1fr; gap: 14px 28px; margin: 2em 0; font-size: .95rem; }
.spec dt { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.spec dd { margin: 0; color: var(--ink-2); }
@media (max-width: 620px) { .spec { grid-template-columns: 1fr; gap: 2px; } .spec dd { margin-bottom: 14px; } }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin: 40px 0; }
.stat { background: var(--bg); padding: 24px 26px; }
.stat-k { font-family: var(--serif); font-size: 1.7rem; color: var(--ink); line-height: 1; margin-bottom: 8px; letter-spacing: -.02em; }
.stat-v { font-size: .88rem; color: var(--muted); margin: 0; }
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; max-width: 560px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-2 { grid-template-columns: 1fr; } }
.form label { display: block; font-size: .88rem; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.form textarea.field { min-height: 92px; resize: vertical; font-family: inherit; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start; font-size: .88rem; color: var(--ink-2); }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.form-note { font-size: .84rem; color: var(--muted); margin: 0; }
.form-status { font-size: .9rem; padding: 12px 16px; border-radius: 9px; display: none; }
.form-status.ok { display: block; background: var(--accent-bg); color: var(--accent-ink); }
.form-status.err { display: block; background: var(--warn-bg); color: var(--warn); }

/* ---------- Writing ---------- */
.writing-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.writing-row { display: grid; grid-template-columns: 116px 1fr; gap: 26px; padding: 26px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background .16s; }
.writing-row:hover { background: var(--bg-2); box-shadow: 0 0 0 20px var(--bg-2); }
.writing-date { font-family: var(--mono); font-size: .78rem; color: var(--muted); padding-top: 4px; letter-spacing: .02em; }
.writing-title { font-family: var(--serif); font-size: 1.32rem; color: var(--ink); line-height: 1.22; letter-spacing: -.02em; margin: 0 0 .35em; }
.writing-sum { font-size: .95rem; color: var(--ink-2); margin: 0 0 12px; max-width: 62ch; }
.writing-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) { .writing-row { grid-template-columns: 1fr; gap: 8px; } .writing-row:hover { box-shadow: none; } }

.post-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); font-family: var(--mono); margin-bottom: 2em; }
.post-meta .badge { font-family: var(--mono); }
.post-foot { margin-top: 3em; padding-top: 1.6em; border-top: 1px solid var(--line); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: .92rem; }

/* ---------- Auth ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 0; min-height: calc(100vh - 64px); align-items: stretch; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; min-height: 0; } }
.auth-panel { padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 60px); display: flex; flex-direction: column; justify-content: center; }
.auth-brand { margin-bottom: 34px; }
.auth-title { font-size: clamp(1.7rem, 4vw, 2.1rem); margin-bottom: .2em; }
.auth-sub { color: var(--muted); font-size: .95rem; margin-bottom: 28px; }

.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 26px; }
.auth-tab { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); cursor: pointer; font: inherit; transition: .14s; }
.auth-tab:hover { border-color: var(--line-2); }
.auth-tab.is-active { border-color: var(--accent); background: var(--accent-bg); }
.auth-tab-name { display: block; font-size: .92rem; font-weight: 500; color: var(--ink); }
.auth-tab-note { display: block; font-size: .78rem; color: var(--muted); margin-top: 1px; }
.auth-tab.is-active .auth-tab-note { color: var(--accent-ink); }

.auth-form { max-width: none; gap: 16px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-minor { font-size: .82rem; color: var(--muted); text-decoration: none; }
.auth-minor:hover { color: var(--accent-ink); text-decoration: underline; }

.auth-divider { display: flex; align-items: center; gap: 14px; margin: 26px 0; color: var(--faint); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-sso { display: grid; gap: 10px; }
.auth-sso-btn { width: 100%; }
.auth-foot { font-size: .9rem; color: var(--ink-2); margin: 30px 0 0; line-height: 1.7; }
.auth-legal { font-size: .82rem; color: var(--muted); margin: 18px 0 0; line-height: 1.55; }

.auth-aside { background: var(--bg-2); border-left: 1px solid var(--line); padding: clamp(40px, 6vw, 72px) clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
@media (max-width: 900px) { .auth-aside { border-left: 0; border-top: 1px solid var(--line); } }
.auth-quote { font-family: var(--serif); font-size: clamp(1.5rem, 3.2vw, 2.1rem); line-height: 1.24; color: var(--ink); letter-spacing: -.025em; margin: 6px 0 18px; max-width: 18ch; }
.auth-aside-note { color: var(--ink-2); font-size: .95rem; max-width: 42ch; margin-bottom: 22px; }

/* ---------- CTA band ---------- */
.band-cta { background: var(--bg-2); border-top: 1px solid var(--line); padding: clamp(44px, 6vw, 68px) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .3em; }
.cta-sub { color: var(--muted); margin: 0; max-width: 52ch; font-size: .96rem; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Share ----------
   No third-party widgets: every one of them is a tracker, and the site claims
   not to run any. Plain links plus the clipboard API do the same job. */
.share-band { border-top: 1px solid var(--line); padding: 26px 0; }
.share { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.share-label { font-family: var(--mono); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: .84rem; font-weight: 500; line-height: 1;
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink-2); text-decoration: none; cursor: pointer;
  transition: border-color .14s, color .14s, background .14s;
}
.share-btn:hover { border-color: var(--line-2); color: var(--ink); background: var(--bg-2); }
.share-btn svg { flex-shrink: 0; opacity: .65; }
.share-btn:hover svg { opacity: 1; }
.share-btn.is-done { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-bg); }
.share-btn.is-done svg { opacity: 1; }
.share-btn[hidden] { display: none; }
@media (max-width: 520px) {
  .share { gap: 12px; }
  .share-actions { width: 100%; }
  .share-btn { flex: 1; justify-content: center; }
}

/* ---------- Cookie consent ----------
   Bottom sheet, not a blocking overlay. The site is fully readable behind it,
   which is both less obnoxious and avoids anything resembling a cookie wall.
   Accept and reject are the same size, same prominence — required, and also
   just the honest way round. */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); max-width: 660px; margin: 0 auto;
  opacity: 0; transform: translateY(12px); transition: opacity .22s ease, transform .22s ease;
}
.consent.is-in { opacity: 1; transform: none; }
.consent[hidden] { display: none; }
.consent-inner { padding: 22px 24px; display: grid; gap: 18px; }
.consent-title { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 0 0 6px; letter-spacing: -.01em; }
.consent-text p { font-size: .9rem; color: var(--ink-2); margin: 0 0 8px; line-height: 1.55; }
.consent-more { font-size: .85rem; margin: 0; }
.consent-actions { display: flex; gap: 10px; }
.consent-actions .btn { flex: 1; }
@media (min-width: 620px) {
  .consent-inner { grid-template-columns: 1fr auto; align-items: center; gap: 24px; }
  .consent-actions { flex-shrink: 0; }
  .consent-actions .btn { flex: none; min-width: 108px; }
}
@media (prefers-reduced-motion: reduce) {
  .consent { transition: none; opacity: 1; transform: none; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); padding: 56px 0 28px; font-size: .9rem; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 820px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-tag { color: var(--muted); font-size: .87rem; margin: 14px 0 0; line-height: 1.5; }
.footer-col h3 { font-size: .76rem; font-family: var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-base { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.footer-base p { margin: 0; }
.footer-base a { color: var(--muted); }
