/* blog.veblen.ai — black / white / grey ledger spec.
   Tokens, type scale and layout follow the handoff doc. */

:root {
  --ink: #0A0A0A;
  --ink-hover: #383838;
  --text-2: #4D4D4D;
  --text-3: #666666;
  --text-4: #8F8F8F;
  --line: #EAEAEA;
  --line-2: #D4D4D4;
  --surface: #FFFFFF;
  --canvas: #FAFAFA;
  --hover: #F5F5F5;
  --error: #D93036;
  --prose: #262626;

  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1200px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: #fff; }

a { color: var(--text-3); text-decoration: none; }
a:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  z-index: 100;
  font-size: 14px;
}
.skip:focus { left: 16px; top: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.shell { max-width: var(--shell); padding: 0 24px; margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  height: 64px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .shell {
  height: 100%;
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand__tile {
  width: 28px; height: 28px;
  background: var(--ink);
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand__tile svg { width: 18px; height: 18px; }
.brand__tile--sm { width: 22px; height: 22px; border-radius: 6px; }
.brand__tile--sm svg { width: 14px; height: 14px; }
.brand__name {
  font-size: 17px; font-weight: 600; letter-spacing: -0.03em;
  color: var(--ink);
}

.site-nav { display: flex; gap: 16px; margin-left: 16px; }
.site-nav a {
  font-size: 14px; font-weight: 400;
  color: var(--text-3);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }

.site-cta { margin-left: auto; display: flex; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 12px;
  font-size: 14px; font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.btn--md { height: 44px; padding: 0 18px; }
.btn--ghost {
  background: var(--surface); color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: #F2F2F2; color: var(--ink); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--ink-hover); color: #fff; }

@media (max-width: 640px) {
  .site-nav { display: none; }
}

/* ---------- Intro ---------- */
.intro {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 32px;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-3); margin: 0 0 20px;
  letter-spacing: 0.02em;
}
.intro__h1 {
  font-size: clamp(44px, 5.4vw, 72px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.0;
  text-wrap: balance;
  max-width: 820px;
  margin: 0 0 20px;
  color: var(--ink);
}
.intro__lead {
  font-size: 18px; line-height: 1.6;
  color: var(--text-3);
  max-width: 600px; margin: 0;
}

/* ---------- Banner ---------- */
.banner-wrap { background: var(--canvas); }
.banner-wrap .shell { padding-top: 32px; padding-bottom: 0; }
.banner {
  position: relative;
  height: 340px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink);
  overflow: hidden;
  background: var(--ink);
}
.banner__art, .banner__art svg { width: 100%; height: 100%; display: block; }
.banner__badge {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--font-mono); font-size: 11px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* ---------- Reader ---------- */
.reader { background: var(--canvas); }
.reader__grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 32px 24px 80px;
}

/* --- Post list (left column) --- */
.post-list {
  position: sticky; top: 88px;
}
.post-list__label {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-4);
  margin: 0 0 12px 16px;
  letter-spacing: 0.02em;
}
.post-list__items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.post-list__item {
  display: flex; gap: 12px; align-items: center;
  padding: 16px;
  border-left: 2px solid transparent;
  border-radius: 0 10px 10px 0;
  color: var(--ink);
  text-decoration: none;
}
.post-list__item:hover { background: var(--hover); color: var(--ink); }
.post-list__item.is-current {
  background: var(--surface);
  border-left-color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}
.post-list__thumb {
  width: 72px; height: 48px;
  flex: 0 0 72px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.post-list__thumb svg { width: 100%; height: 100%; display: block; }
.post-list__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.post-list__meta {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--text-4);
  letter-spacing: 0.02em;
}
.post-list__title {
  font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3;
  color: var(--ink);
}

/* --- Pane (right column) --- */
.reader__pane { min-width: 0; }

.pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 36px 40px 44px;
  max-width: 720px;
}
.pane__meta {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-4); margin: 0 0 16px;
  letter-spacing: 0.02em;
}
.pane__status { color: var(--text-4); }
.pane__title {
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.02;
  margin: 0 0 16px;
  color: var(--ink);
}
.pane__title:focus { outline: none; }
.pane__dek {
  font-size: 19px; line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 28px;
}
.pane__rule {
  border: 0; border-top: 1px solid var(--line);
  margin: 28px 0;
}

/* --- Byline --- */
.byline {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 8px;
}
.byline__avatar {
  width: 36px; height: 36px; flex: 0 0 36px;
  background: var(--ink); color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
}
.byline__who { display: flex; flex-direction: column; }
.byline__name { font-size: 15px; font-weight: 500; color: var(--ink); }
.byline__role { font-size: 13px; color: var(--text-4); }
.copy-link { margin-left: auto; }

/* --- Prose --- */
.prose { font-size: 19px; color: var(--prose); line-height: 1.7; }
.prose p { margin: 0 0 22px; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 {
  font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2;
  margin: 52px 0 16px;
  color: var(--ink);
}
.prose h3 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25;
  margin: 40px 0 12px;
  color: var(--ink);
}
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 8px 0; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--text-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code {
  font-family: var(--font-mono); font-size: 0.9em;
  background: var(--canvas); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 4px;
}

.pullquote {
  margin: 36px 0 44px;
  padding: 32px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.pullquote blockquote {
  margin: 0; padding: 0;
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 600; letter-spacing: -0.035em; line-height: 1.2;
  color: var(--ink);
}

.post-figure {
  margin: 36px 0;
}
.post-figure__art {
  aspect-ratio: 16 / 8;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--canvas);
}
.post-figure__art svg { width: 100%; height: 100%; display: block; }
.post-figure figcaption {
  margin-top: 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-4);
  letter-spacing: 0.02em;
}

/* --- Draft ("coming soon") --- */
.draft-art {
  aspect-ratio: 16 / 8;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 24px 0 20px;
  background: var(--canvas);
}
.draft-art svg { width: 100%; height: 100%; display: block; }
.draft-box {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--canvas);
  padding: 20px 22px;
}
.draft-box__heading { margin: 0 0 4px; font-size: 16px; font-weight: 500; color: var(--ink); }
.draft-box__sub { margin: 0; font-size: 15px; color: var(--text-3); line-height: 1.5; }

/* ---------- Newsletter ---------- */
.newsletter {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 72px 0;
}
.newsletter__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 40px;
  align-items: center;
}
.newsletter__h {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600; letter-spacing: -0.045em; line-height: 1.1;
  color: var(--ink);
  margin: 0 0 12px;
}
.newsletter__sub { font-size: 18px; color: var(--text-3); line-height: 1.6; margin: 0; }

.newsletter__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.newsletter__form input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 15px;
  color: var(--ink);
  background: var(--surface);
}
.newsletter__form input::placeholder { color: var(--text-4); }
.newsletter__form input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.newsletter__form input[aria-invalid="true"] { border-color: var(--error); }
.newsletter__error {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--error);
}
.newsletter__success {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  background: var(--surface);
}
.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer__brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.site-footer__name { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.site-footer__tagline { font-size: 14px; color: var(--text-4); }
.site-footer__meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer__nav { display: flex; gap: 14px; }
.site-footer__nav a { font-size: 14px; color: var(--text-3); }
.site-footer__nav a:hover { color: var(--ink); }
.site-footer__copy { font-size: 14px; color: var(--text-4); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .reader__grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 24px 24px 60px;
  }
  .post-list { position: static; }
  .post-list__label { margin-left: 0; }
  .pane { max-width: none; }
}
@media (max-width: 640px) {
  .banner { height: 220px; }
  .intro { padding: 44px 0 24px; }
  .pane { padding: 24px 20px 32px; border-radius: var(--radius-lg); }
  .prose { font-size: 17px; }
  .pane__dek { font-size: 17px; }
  .newsletter { padding: 56px 0; }
  .newsletter__row { grid-template-columns: 1fr; }
  .newsletter__form { grid-template-columns: 1fr; }
}

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