/* ==========================================================================
   Seufic AI — Identity
   One content column, one spacing scale, one alignment edge.
   Palette follows anthropic.com: ivory, cloud, slate, clay.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */

:root {
  color-scheme: light;

  --bg: #faf9f5;          /* ivory */
  --surface: #ffffff;
  --surface-2: #f0eee6;   /* cloud light */
  --surface-3: #e6e4da;

  --ink: #141413;         /* brand text */
  --ink-strong: #141413;
  --ink-muted: #5e5d59;   /* slate light */
  --ink-faint: #91908a;

  --line: #e5e3da;
  --line-strong: #d4d2c7;

  --accent: #d97757;      /* clay */
  --accent-ink: #b8563a;
  --accent-soft: #f7ece7;

  --danger: #a03530;
  --danger-soft: #f8ebea;
  --positive: #3b6b52;
  --positive-soft: #e9f0ec;

  --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.05);
  --shadow-md: 0 1px 2px rgba(20, 20, 19, 0.04), 0 10px 24px -16px rgba(20, 20, 19, 0.22);
  --shadow-lg: 0 20px 48px -28px rgba(20, 20, 19, 0.34);
}

/* Jet black. Pure #000 ground, with surfaces stepping up in near-neutral greys. */
:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #131313;
  --surface-3: #1d1d1d;

  --ink: #ebebe9;
  --ink-strong: #ffffff;
  --ink-muted: #9b9b96;
  --ink-faint: #6e6e6a;

  --line: #1f1f1f;
  --line-strong: #2e2e2e;

  --accent: #d97757;
  --accent-ink: #e79376;
  --accent-soft: #1d1512;

  --danger: #e08b85;
  --danger-soft: #1e1312;
  --positive: #7fbb9b;
  --positive-soft: #101d16;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.7), 0 10px 24px -16px rgba(0, 0, 0, 1);
  --shadow-lg: 0 20px 48px -28px rgba(0, 0, 0, 1);
}

:root {
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* A single 4px-based spacing scale. Nothing uses a value outside it. */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.625rem;
  --s-4: 0.875rem;
  --s-5: 1rem;
  --s-6: 1.25rem;
  --s-8: 1.625rem;
  --s-10: 2rem;
  --s-12: 2.5rem;
  --s-16: 3.25rem;

  /* Layout: one column width, one gutter, one gap. Everything aligns to it.
     1432px matches anthropic.com's min(89.5rem, 100vw) content box. */
  --measure: 1432px;
  --measure-prose: 66ch;
  --gutter: clamp(1.25rem, 3.9vw, 5rem);
  --gap: clamp(1rem, 1.8vw, 1.5rem);
  --section-gap: clamp(3.5rem, 5.2vw, 6rem);

  /* The sign-in page's own inset. The header and the left panel both use it,
     so the wordmark and the panel copy share one left edge. */
  --auth-gutter: clamp(2rem, 4.5vw, 4.5rem);

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 8px;
  --r-xl: 24px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 420ms;
  --dur-fast: 170ms;

  --header-h: 56px;
}

/* ----------------------------------------------------------------- reset -- */

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

html {
  -webkit-text-size-adjust: 100%;

  /* Reserve the scrollbar track on every page, so moving between a short page
     and a long one does not shift the layout sideways. */
  scrollbar-gutter: stable;

  /* Anchored jumps stop below the sticky header rather than under it. */
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

/* Smooth scrolling is opt-in, on same-page anchor jumps only. Applying it to
   the whole document also captures back/forward restoration and every
   programmatic scroll, which makes ordinary navigation feel sluggish. */
@media (prefers-reduced-motion: no-preference) {
  html:focus-within { scroll-behavior: smooth; }
}

/* One scrollbar treatment, in both themes and every scroll container. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: var(--r-pill);
}
*::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* Anthropic sets no negative tracking anywhere — the type sits open. Tightened
   tracking is what makes a page read as generic; letter-spacing stays normal. */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  color: var(--ink-strong);
}

p { margin: 0; }

/* Components below set display on .field, .btn and friends, which would
   otherwise beat the user agent's [hidden] rule. State it once and win. */
[hidden] { display: none !important; }

img, svg { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }

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

::selection { background: var(--accent-soft); color: var(--ink-strong); }

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--bg);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-pill);
  z-index: 100;
}
.skip-link:focus { left: var(--s-4); top: var(--s-4); }

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

/* ==========================================================================
   Layout
   Every block on a page is a direct child of .container, so every block
   shares one left edge and one right edge. No exceptions.
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.page {
  padding-bottom: var(--s-16);
  animation: page-in 480ms var(--ease-out) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* The masthead of every page: same spacing, same rule beneath it. */
/* The hero. No rule underneath it — the space does that work. */
.page-head {
  padding-top: clamp(3rem, 6vw, 6.5rem);
  padding-bottom: 0;
}
.page-head .eyebrow { margin-bottom: var(--s-4); }
.page-head .lede { margin-top: var(--s-6); }
.page-head .btn-row { margin-top: var(--s-8); }

/* Title on the left, actions on the right, when the page has both. */
.page-head-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-8);
  flex-wrap: wrap;
}
.page-head-split > * { min-width: 0; }
.page-head-split .btn-row { margin-top: 0; }

/* App pages keep the tighter masthead: a rule, and less air above it. */
.page-head-compact {
  padding-top: clamp(2rem, 3.5vw, 3rem);
  padding-bottom: var(--s-8);
  border-bottom: 1px solid var(--line);
}
.page-head-compact .page-title { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.page-head-compact .lede { margin-top: var(--s-4); max-width: 52ch; }

.section { margin-top: var(--section-gap); }

/* The header for a block of content. Full container width, always. */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding-bottom: var(--s-5);
  margin-bottom: var(--s-8);
  border-bottom: 1px solid var(--line);
}
.section-head > div { min-width: 0; }
.section-head p { margin-top: var(--s-2); }
.section-meta { color: var(--ink-muted); font-size: 0.875rem; }

/* Grids. Explicit tracks, never auto-fit, so column counts never surprise. */
.grid { display: grid; gap: var(--gap); align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.grid-stretch { align-items: stretch; }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

.btn-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.prose { max-width: var(--measure-prose); }

/* ------------------------------------------------------------ typography -- */

/* The display line. Sans, bold, set large, tracking left alone. */
.page-title {
  font-size: clamp(2.125rem, 4.5vw, 3.625rem);
  font-weight: 700;
  line-height: 1.1;
}

/* The counterpart: the same size set in the serif at book weight. Used once
   per page at most, for a statement rather than a label. */
.display-serif {
  font-family: var(--font-serif);
  font-size: clamp(1.875rem, 4.5vw, 3.625rem);
  font-weight: 400;
  line-height: 1.1;
}

/* Section headings stay small. Hierarchy comes from space, not size. */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.eyebrow {
  font-size: 0.875rem;
  color: var(--ink-muted);
  font-weight: 400;
  line-height: 1.4;
}

/* Anthropic sets body copy in a serif, at a real reading size. */
.lede {
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 1.6vw, 1.5rem);
  color: var(--ink);
  max-width: 40ch;
  line-height: 1.4;
}

.prose-serif {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--ink);
}

.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.small { font-size: 0.875rem; line-height: 1.5; }
.mono { font-family: var(--font-mono); font-size: 0.82rem; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------------- icons -- */
/* Font Awesome glyphs vary in width. min-width keeps columns of icons lined
   up without clipping the wide ones. */

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1em;
  flex: none;
  line-height: 1;
  color: var(--ink-faint);
}
.icon-accent { color: var(--accent); }

/* Inline SVG glyphs stroke themselves with currentColor. */
.icon-svg { display: block; flex: none; }
.icon-button .icon-svg { transition: transform var(--dur) var(--ease-out); }
.icon-button:hover .icon-svg { transform: rotate(-12deg); }

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  flex: none;
}

/* ==========================================================================
   Header and footer
   ========================================================================== */

/* The header sits flat on an unscrolled page and picks up its rule only once
   content has moved underneath it. The JS sets data-scrolled; without this the
   attribute was doing nothing. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-header[data-scrolled='true'] {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

.header-inner {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
  /* Less the 1px border below, so the header box is exactly --header-h and
     anything offset by it (the auth screen, the sticky rail) lands true. */
  height: calc(var(--header-h) - 1px);
  display: flex;
  align-items: center;
  gap: var(--s-5);
}

/* Wordmark. Always first in the row, always the leftmost thing on the page. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  margin-right: var(--s-1);
  color: var(--ink-strong);
}
.brand-name {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1;
  white-space: nowrap;
}
.brand:hover .brand-name { color: var(--accent-ink); }

/* Serif navigation, no icons and no pills — the way anthropic.com sets it.
   The current page is marked with a rule, not a filled shape. */
.nav {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  height: 100%;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink-muted);
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.nav-link:hover { color: var(--ink-strong); }
.nav-link[aria-current='page'] {
  color: var(--ink-strong);
  border-bottom-color: var(--ink-strong);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.8125rem;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.icon-button .icon { color: inherit; }

.nav-toggle { display: none; }
@media (max-width: 1000px) { .nav-toggle { order: 3; } }

@media (max-width: 1000px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: var(--s-2) var(--gutter) var(--s-3);
    display: none;
  }
  .nav[data-open='true'] { display: flex; animation: page-in 200ms var(--ease-out) both; }
  .nav-link {
    height: 3rem;
    font-size: 1.25rem;
    border-bottom: 1px solid var(--line);
  }
  .nav-link:last-child { border-bottom: none; }
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--s-12);
  padding-block: var(--s-6);
}
.footer-inner {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-8);
  align-items: center;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 0.84rem;
}
.footer-note { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-links { display: flex; align-items: center; gap: var(--s-6); flex-wrap: wrap; }
.footer-links a { transition: color var(--dur-fast) var(--ease); }
.footer-links a:hover { color: var(--ink); }

/* ==========================================================================
   Controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.875rem;
  padding-inline: 1.375rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1;
  cursor: pointer;
  background: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.btn .icon { color: inherit; font-size: 0.9em; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--ink-strong); color: #faf9f5; }
.btn-primary:hover:not(:disabled) { background: #3d3d3a; }
:root[data-theme='dark'] .btn-primary { background: #ebebe9; color: #000; }
:root[data-theme='dark'] .btn-primary:hover:not(:disabled) { background: #ffffff; }

.btn-accent { background: var(--accent); color: #ffffff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-ink); }

.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.btn-quiet { color: var(--ink-muted); }
.btn-quiet:hover:not(:disabled) { color: var(--ink); background: var(--surface-2); }

.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }

/* App chrome — row actions, toolbars — keeps the tighter control. */
.btn-sm { height: 2rem; padding-inline: 0.75rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ==========================================================================
   Surfaces
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--s-8);
}
.card > * + * { margin-top: var(--s-5); }
.card-tight { padding: var(--s-6); }

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title + p { margin-top: var(--s-2); }

/* Editorial cards carry no border, no shadow and no fill. A tinted block on
   top, a heading, serif copy — the same anatomy as the releases row on
   anthropic.com. The page background shows through. */
.card-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  height: 100%;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}
.card-link > * + * { margin-top: 0; }

.card-visual {
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: var(--s-6);
  overflow: hidden;
  position: relative;
  transition: background var(--dur) var(--ease-out);
}
/* A quiet mark, drawn rather than iconographic. */
.card-visual::after {
  content: '';
  position: absolute;
  left: var(--s-6);
  bottom: var(--s-6);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-pill);
  background: var(--accent);
  opacity: 0.9;
  transition: transform var(--dur) var(--ease-out);
}
.card-link:nth-child(2) .card-visual::after { border-radius: 6px; }
.card-link:nth-child(3) .card-visual::after {
  border-radius: var(--r-pill);
  background: none;
  border: 6px solid var(--accent);
}
.card-link:hover .card-visual { background: var(--surface-3); }
.card-link:hover .card-visual::after { transform: translateY(-4px); }

.card-link h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
.card-link p {
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.4;
  margin-top: var(--s-3);
}
.card-foot {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.card-foot .icon { transition: transform var(--dur) var(--ease-out); }
.card-link:hover .card-foot { color: var(--ink); }
.card-link:hover .card-foot .icon { transform: translateX(4px); }

/* Panel: a bordered box whose children are separated by full-bleed rules. */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.panel-row {
  padding: var(--s-5) var(--s-8);
  border-top: 1px solid var(--line);
}
.panel-row:first-child { border-top: none; }

/* ==========================================================================
   Page furniture
   ========================================================================== */

/* Key and value pairs */
.kv { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: var(--s-4) var(--s-6); }
.kv dt {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.4;
}
.kv dd {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.kv dd.empty { color: var(--ink-faint); }
@media (max-width: 560px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { margin-top: var(--s-4); }
  .kv dt:first-child { margin-top: 0; }
}

/* Activity rows live inside a .panel, which supplies padding and dividers. */
.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.activity-main { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.activity-label { min-width: 0; transition: color var(--dur-fast) var(--ease); }
a.activity-label:hover { color: var(--accent-ink); }
.activity-when { color: var(--ink-faint); font-size: 0.8rem; white-space: nowrap; }

/* Tag row */
.tags { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 1.5rem;
  padding-inline: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.71rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.badge .icon { font-size: 0.85em; color: inherit; }
.badge-accent { border-color: transparent; color: var(--accent-ink); background: var(--accent-soft); }
.badge-positive { border-color: transparent; color: var(--positive); background: var(--positive-soft); }

.chip-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding-inline: 0.6875rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink-muted);
  max-width: 100%;
  overflow: hidden;
}

/* The statement. One large ink panel with a serif display line, set against
   the ivory page. This is the page's single loud moment. */
.statement {
  background: var(--ink-strong);
  border-radius: var(--r-xl);
  padding: clamp(2.5rem, 5.5vw, 5.5rem) clamp(1.75rem, 4.5vw, 4.5rem);
  color: #faf9f5;
}
:root[data-theme='dark'] .statement {
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.statement .display-serif { color: #faf9f5; max-width: 18ch; }
.statement p {
  margin-top: var(--s-6);
  max-width: 46ch;
  font-size: 1.25rem;
  line-height: 1.4;
  color: rgba(250, 249, 245, 0.78);
}
.statement .btn-row { margin-top: var(--s-8); }
.statement .btn-ghost {
  background: none;
  border-color: rgba(250, 249, 245, 0.32);
  color: #faf9f5;
}
.statement .btn-ghost:hover:not(:disabled) { background: rgba(250, 249, 245, 0.1); }
.statement .btn-primary { background: #faf9f5; color: #141413; }
.statement .btn-primary:hover:not(:disabled) { background: #ffffff; }

/* The quiet sibling of .statement: an inline note on the app pages. Flat
   cloud fill, serif copy, no border and no icon. */
.trust {
  padding: var(--s-6) var(--s-8);
  border-radius: 12px;
  background: var(--surface-2);
}
.trust > div { min-width: 0; }
.trust h3 { font-size: 1.125rem; font-weight: 600; }
.trust p {
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.4;
  margin-top: var(--s-3);
  max-width: 60ch;
}
.trust .tags { margin-top: var(--s-5); }

/* Labelled metadata, in rules. The DATE / CATEGORY pattern. */
.meta-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 var(--gap);
  border-top: 1px solid var(--line);
}
.meta-list > div {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.meta-label {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}
.meta-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.meta-value-text { font-size: 1.125rem; font-weight: 400; font-family: var(--font-serif); }
@media (max-width: 760px) { .meta-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field + .field,
.form-grid + .field,
.field + .form-grid,
.form-grid + .form-grid { margin-top: var(--s-5); }

/* Sentence case, at reading size. Uppercase micro-labels read as dashboard
   furniture; anthropic.com sets form labels like prose. */
.field label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}
.field-hint { font-size: 0.875rem; color: var(--ink-muted); line-height: 1.4; }

.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 0 0.875rem;
  height: 2.75rem;
  font-size: 1rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.textarea { height: auto; min-height: 6.5rem; padding: 0.6875rem 0.875rem; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 2rem; cursor: pointer; }
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--surface-3);
}

/* The wrapper carries the border, so it has to match a bare input exactly:
   same 2.5rem box, with the inner field filling it. */
.input-affix {
  display: flex;
  align-items: stretch;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}
.input-affix .input { height: 100%; border: none; border-radius: 0; }
.input-affix .input:focus { box-shadow: none; }
.input-affix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--surface-3); }
.affix {
  display: flex;
  align-items: center;
  padding-inline: 0.6875rem;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-5);
  align-items: start;
}
/* Side-by-side fields are spaced by the grid gap. The stacking margin above
   must not also apply, or the second column drops out of line. */
.form-grid > .field + .field { margin-top: 0; }
@media (max-width: 620px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.form-actions-bare { border-top: none; padding-top: 0; margin-top: var(--s-4); }
.form-status { color: var(--ink-faint); font-size: 0.8rem; margin-left: auto; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-muted);
  margin-bottom: var(--s-4);
}
.notice .icon { margin-top: 0.2rem; color: inherit; }
.notice[data-tone='error'] { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.notice[data-tone='positive'] { border-color: transparent; background: var(--positive-soft); color: var(--positive); }

/* ==========================================================================
   Records: documents, memories, suggestions
   ========================================================================== */

.record-list { display: flex; flex-direction: column; gap: var(--s-2); }

.record {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--s-6) var(--s-8);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-4);
  align-items: start;
  animation: page-in 320ms var(--ease-out) both;
  transition: border-color var(--dur-fast) var(--ease);
}
.record:hover { border-color: var(--line-strong); }
.record-main { min-width: 0; }
.record-head { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.record-title { font-size: 1.125rem; font-weight: 600; overflow-wrap: anywhere; }
.record-meta {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-top: var(--s-2);
}
.record-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.record-body {
  margin-top: var(--s-3);
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.4;
  max-width: var(--measure-prose);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.record-actions { display: flex; align-items: center; gap: var(--s-1); flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 680px) {
  .record { grid-template-columns: minmax(0, 1fr); }
  .record-actions { justify-content: flex-start; }
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  padding: var(--s-10) var(--s-6);
  text-align: center;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}
.empty-state h3 { font-size: 1rem; }
.empty-state p { font-size: 0.875rem; max-width: 42ch; }

/* Dropzone */
.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: var(--s-10) var(--s-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  text-align: center;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.dropzone[data-drag='true'] { border-color: var(--accent); background: var(--accent-soft); }
.dropzone h3 { font-size: 1rem; }
.dropzone p { font-size: 0.875rem; }
.dropzone .btn { margin-top: var(--s-2); }
.dropzone-progress { width: min(320px, 100%); margin-top: var(--s-3); }

.progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: var(--s-3); }
.progress i {
  display: block;
  height: 100%;
  width: 30%;
  background: var(--accent);
  border-radius: 2px;
  animation: slide 1.4s var(--ease) infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}

/* Skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--r-sm);
  height: 0.8rem;
}
.skeleton + .skeleton { margin-top: var(--s-3); }
.skeleton-w40 { width: 40%; }
.skeleton-w55 { width: 55%; }
.skeleton-w70 { width: 70%; }
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ==========================================================================
   Assistant
   ========================================================================== */

.assistant-layout {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: var(--s-10);
  align-items: start;
  padding-top: var(--s-6);
}
@media (max-width: 940px) {
  .assistant-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-8); }
  .rail { order: 2; }
}

.rail {
  position: sticky;
  top: calc(var(--header-h) + var(--s-8));
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  max-height: calc(100dvh - var(--header-h) - var(--s-12));
  min-width: 0;
}
@media (max-width: 940px) { .rail { position: static; max-height: none; } }

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}

/* Reaching the end of this list must not start scrolling the page behind it. */
.conversation-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.conversation-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: 2rem;
  padding-inline: 0.5rem;
  text-align: left;
  border: none;
  background: none;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.conversation-item > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item:hover { background: var(--surface-2); color: var(--ink); }
.conversation-item[aria-current='true'] { background: var(--surface-2); color: var(--ink-strong); }
.conversation-item .del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  flex: none;
  opacity: 0;
  border: none;
  background: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  color: var(--ink-faint);
  transition: opacity var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.conversation-item:hover .del, .conversation-item .del:focus-visible { opacity: 1; }
.conversation-item .del:hover { color: var(--danger); }

.chat {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--header-h) - var(--s-16));
}
.chat-scroll { flex: 1; display: flex; flex-direction: column; gap: var(--s-6); padding-bottom: var(--s-6); }

.message { max-width: var(--measure-prose); animation: page-in 320ms var(--ease-out) both; }
.message-role {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-faint);
  margin-bottom: var(--s-1);
}
.message-body { font-size: 1rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-user .message-body {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  color: var(--ink);
}

.chat-empty {
  margin: auto;
  max-width: 44ch;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-3);
  padding-block: var(--s-16);
}
.chat-empty h2 { font-size: 1.3rem; }
.chat-empty p { font-size: 0.875rem; }
.suggestions { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: center; margin-top: var(--s-3); }

.composer {
  position: sticky;
  bottom: 0;
  padding-block: var(--s-4);
  background: var(--bg);
  /* Above the streaming reply as it scrolls up behind the fade. */
  z-index: 2;
}
.composer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: var(--s-8);
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}
.composer-inner {
  display: flex;
  gap: var(--s-2);
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 0.375rem 0.375rem 0.375rem 0.75rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease-out);
}
.composer-inner:focus-within { border-color: var(--ink); box-shadow: var(--shadow-md); }
.composer textarea {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  resize: none;
  max-height: 200px;
  padding: 0.5rem 0;
  line-height: 1.5;
  font-size: 1rem;
}
.composer textarea:focus { outline: none; }
.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-top: var(--s-2);
  padding-inline: 0.25rem;
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.composer-meta span { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }

.caret::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 1.05em;
  background: var(--ink);
  margin-left: 2px;
  vertical-align: -0.18em;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.thinking { display: inline-flex; gap: 4px; align-items: center; height: 1.5em; }
.thinking i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: bob 1.15s var(--ease) infinite;
}
.thinking i:nth-child(2) { animation-delay: 0.14s; }
.thinking i:nth-child(3) { animation-delay: 0.28s; }
@keyframes bob {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* ==========================================================================
   Auth
   ========================================================================== */

/* Two panels: the pitch on the left, the form on the right. On the form side
   the card is borderless — the page itself is the frame. */
/* The sign-in page is exactly one screen. It never scrolls: the two panels
   fill the space under the header and the footer is suppressed. Below the
   height floor set further down, it reverts to a normal scrolling page rather
   than clipping the form. */
.auth-wrap {
  height: calc(100dvh - var(--header-h));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 0;
  animation: none;
  overflow: hidden;
}
body[data-page='login'] .site-footer { display: none; }

/* The left panel is the ink block from the home page, run to the edge. */
.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.5rem, 4vh, 3rem);
  padding: clamp(2rem, 6vh, 4.5rem) var(--auth-gutter);
  background: var(--ink-strong);
  color: #faf9f5;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
:root[data-theme='dark'] .auth-aside {
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}
.auth-aside .eyebrow { color: rgba(250, 249, 245, 0.62); }
.auth-aside-body { max-width: 34rem; }
.auth-quote {
  margin-top: var(--s-5);
  font-family: var(--font-serif);
  font-size: clamp(1.625rem, 2.6vw + 0.5vh, 2.75rem);
  font-weight: 400;
  line-height: 1.1;
  color: #faf9f5;
  max-width: 16ch;
}
.auth-quote + p {
  margin-top: clamp(0.875rem, 2vh, 1.25rem);
  color: rgba(250, 249, 245, 0.72);
  font-size: 1.0625rem;
  line-height: 1.45;
  max-width: 42ch;
}

/* Rule-separated claims. No icons — the rules do the separating. */
.auth-points {
  margin-top: clamp(1.25rem, 4vh, 2.5rem);
  border-top: 1px solid rgba(250, 249, 245, 0.16);
  max-width: 42ch;
}
.auth-points li {
  padding: clamp(0.625rem, 1.6vh, 1rem) 0;
  border-bottom: 1px solid rgba(250, 249, 245, 0.16);
  min-width: 0;
}
.auth-points strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #faf9f5;
  line-height: 1.35;
}
.auth-points span {
  display: block;
  margin-top: var(--s-2);
  font-family: var(--font-serif);
  font-size: 1rem;
  color: rgba(250, 249, 245, 0.72);
  line-height: 1.4;
}
.auth-aside-foot {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: rgba(250, 249, 245, 0.55);
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: var(--s-8) clamp(1.25rem, 4vw, 3rem);
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}
.auth-card {
  width: min(380px, 100%);
  animation: page-in 440ms var(--ease-out) both;
}
.auth-card h1 { font-size: 2rem; font-weight: 600; line-height: 1.15; }
.auth-card h1 + p {
  margin-top: var(--s-4);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--ink-muted);
}
.auth-form { margin-top: clamp(1.25rem, 3.5vh, 2rem); }
.auth-form .btn { margin-top: clamp(1.25rem, 3vh, 1.625rem); }
.auth-form .field + .field { margin-top: clamp(0.75rem, 2vh, 1rem); }

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: clamp(1.25rem, 3vh, 1.625rem);
  padding-top: clamp(1rem, 2.5vh, 1.25rem);
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--ink-muted);
}
.auth-switch button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink-strong);
  font-weight: 500;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-switch button:hover { color: var(--accent-ink); }

.auth-legal {
  margin-top: clamp(1rem, 2.5vh, 1.25rem);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-faint);
  text-align: center;
}
.auth-legal a { text-decoration: underline; text-underline-offset: 2px; }

/* The auth page runs full bleed, so its header does too — that puts the
   wordmark on the same left edge as the panel copy beneath it. */
body[data-page='login'] .header-inner {
  max-width: none;
  padding-inline: var(--auth-gutter);
}

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-panel { padding-block: var(--s-10); }
  body[data-page='login'] .header-inner { padding-inline: var(--gutter); }
}

/* Shed the least load-bearing line before the panel starts clipping. The
   quote and the three claims carry the message on their own. */
@media (max-height: 820px) {
  .auth-quote + p { display: none; }
}

/* Too short to hold a sign-in form on one screen. Clipping the submit button
   would be worse than a scrollbar, so hand the page back to the scroller. */
@media (max-height: 620px) {
  .auth-wrap { height: auto; min-height: calc(100dvh - var(--header-h)); overflow: visible; }
  .auth-aside, .auth-panel { overflow: visible; }
}

/* ==========================================================================
   Overlays
   ========================================================================== */

.toast-region {
  position: fixed;
  bottom: var(--s-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  z-index: 90;
  pointer-events: none;
  width: min(440px, calc(100vw - 2rem));
}
.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink-strong);
  color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  animation: toast-in 300ms var(--ease-out) both;
}
.toast .icon { color: inherit; }
.toast[data-tone='error'] { background: var(--danger); color: #fff; }
.toast[data-leaving='true'] { animation: toast-out 220ms var(--ease) forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

.setup-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.55rem var(--gutter);
  text-align: center;
}
.setup-banner .icon { color: inherit; }
.setup-banner code {
  font-family: var(--font-mono);
  background: color-mix(in srgb, var(--bg) 18%, transparent);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

/* --------------------------------------------------------------- reveals -- */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out);
  transition-delay: calc(var(--reveal-delay, 0) * 70ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
