/* ---------- Tokens ---------- */
:root {
  /* Light theme — warm paper */
  --bg: #f6f5f1;
  --surface: #fbfaf6;
  --surface-2: #efeee8;
  --border: #d9d6cc;
  --border-strong: #b9b6ab;
  --text: #1a1a18;
  --text-muted: #5a5953;
  --text-faint: #8e8c83;
  --accent: #1f3a3d; /* deep teal-ink */
  --accent-soft: rgba(31, 58, 61, 0.08);
  --rule: #2a2a26;

  /* Type */
  --font-sans: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --font-serif: "Gambarino", "Iowan Old Style", "Source Serif Pro", Georgia,
    "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo,
    Consolas, monospace;

  /* Scale */
  --step-1: clamp(0.78rem, 0.74rem + 0.18vw, 0.84rem);
  --step-0: clamp(0.95rem, 0.9rem + 0.25vw, 1.06rem);
  --step-1-up: clamp(1.1rem, 1rem + 0.4vw, 1.25rem);
  --step-2: clamp(1.4rem, 1.2rem + 0.7vw, 1.7rem);
  --step-3: clamp(1.9rem, 1.5rem + 1.4vw, 2.6rem);
  --step-4: clamp(2.5rem, 1.8rem + 3vw, 4.4rem);

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --s-9: 112px;

  --max: 1120px;

  /* Misc */
  --radius: 4px;
  --focus: 2px solid var(--accent);
  --focus-offset: 3px;
}

[data-theme="dark"] {
  --bg: #0e0f10;
  --surface: #131416;
  --surface-2: #1a1c1e;
  --border: #2a2c2f;
  --border-strong: #3a3d41;
  --text: #e7e6e1;
  --text-muted: #9a9892;
  --text-faint: #6a6862;
  --accent: #c2d8d6;
  --accent-soft: rgba(194, 216, 214, 0.08);
  --rule: #d4d2cc;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
:focus-visible {
  outline: var(--focus);
  outline-offset: var(--focus-offset);
  border-radius: 2px;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus {
  left: 12px;
  top: 12px;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px clamp(20px, 4vw, 40px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-5);
}
.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.brand__logo {
  display: block;
  width: clamp(9.75rem, 7.5rem + 7vw, 13.5rem);
  aspect-ratio: 467 / 97;
  background: currentColor;
  mask: url("assets/claritas-wordmark-mask.png") center / contain no-repeat;
  -webkit-mask: url("assets/claritas-wordmark-mask.png") center / contain no-repeat;
}
.brand__logo--small {
  width: 5.8rem;
}
@media (max-width: 620px) {
  .brand__logo {
    width: clamp(7rem, 32vw, 9rem);
  }
}

.topbar__nav {
  display: flex;
  gap: var(--s-5);
  justify-content: center;
  font-size: var(--step-1);
  color: var(--text-muted);
}
.topbar__nav a {
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s ease;
}
.topbar__nav a:hover {
  color: var(--text);
}
@media (max-width: 820px) {
  .topbar__nav {
    display: none;
  }
}

.topbar__controls {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover {
  border-color: var(--border-strong);
}
.theme-toggle__icon--moon {
  display: none;
}
[data-theme="dark"] .theme-toggle__icon--sun {
  display: none;
}
[data-theme="dark"] .theme-toggle__icon--moon {
  display: block;
}

.metastrip {
  max-width: var(--max);
  margin: 0 auto;
  padding: 6px clamp(20px, 4vw, 40px) 8px;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  text-transform: uppercase;
  border-top: 1px dashed var(--border);
}
.metastrip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.metastrip__sep {
  opacity: 0.5;
}

/* ---------- Variants ---------- */
.variant {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 40px) clamp(60px, 8vw, 120px);
}

/* ============================================================
   VARIANT A — Editorial / memo
   Emphasis: serif display, asymmetric grid, kv-style detail,
   reads like a quiet technical note.
   ============================================================ */
.variant-a {
  /* explicit font choice — serif headlines, sans body */
}

.hero-a {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  padding: clamp(24px, 5vw, 60px) 0 clamp(40px, 6vw, 80px);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.hero-a__rule {
  width: 56px;
  height: 1px;
  background: var(--rule);
  margin-bottom: var(--s-4);
}
.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hero-a__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--step-4);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 22ch;
}
.hero-a__title em {
  font-style: italic;
  color: var(--accent);
}
.hero-a__lede {
  margin: var(--s-4) 0 0;
  font-size: var(--step-1-up);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
}
.hero-a__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-top: var(--s-5);
}

/* memo blocks */
.memo {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--s-7);
  padding: clamp(36px, 5vw, 64px) 0;
  border-bottom: 1px solid var(--border);
}
.memo:last-of-type {
  border-bottom: 0;
}
@media (max-width: 720px) {
  .memo {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
}
.memo__head {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  position: sticky;
  top: 100px;
  align-self: start;
}
.memo__label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.memo__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}
.memo__body {
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  max-width: 60ch;
}
.memo__body p {
  margin: 0 0 var(--s-4);
}
.memo__body p:last-child {
  margin-bottom: 0;
}
.memo__lead {
  font-size: var(--step-1-up);
  line-height: 1.5;
  color: var(--text);
}

.memo__list {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
  counter-reset: m;
  display: grid;
  gap: var(--s-2);
}
.memo__list li {
  counter-increment: m;
  position: relative;
  padding-left: 2.4em;
  color: var(--text-muted);
}
.memo__list li::before {
  content: counter(m, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.18em;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.memo__list li span {
  color: var(--text);
  font-weight: 500;
}

/* key-value */
.kv {
  margin: 0;
  border-top: 1px solid var(--border);
}
.kv__row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border);
}
.kv__row dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 0;
}
.kv__row dd {
  margin: 0;
  color: var(--text);
}
@media (max-width: 480px) {
  .kv__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* boundary list */
.boundary-list {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--step-0);
  color: var(--text);
}
.boundary-list li {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
}
.boundary-list code {
  color: var(--text-faint);
  font-size: 0.95em;
}

.contact-line {
  margin-top: var(--s-5) !important;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-3);
  border-top: 1px solid var(--border);
  padding-top: var(--s-4);
}
.contact-line__name {
  font-weight: 500;
  color: var(--text);
}
.contact-line__email {
  font-family: var(--font-mono);
  font-size: var(--step-0);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.contact-line__email:hover {
  text-decoration-thickness: 2px;
}

/* ============================================================
   VARIANT B — Engineering / grid
   Emphasis: geometric sans, tighter grid, monospace data,
   numbered rows, terminal/observability vibe.
   ============================================================ */
.variant-b {
  padding-top: 0;
}

.hero-b {
  position: relative;
  padding: clamp(48px, 8vw, 100px) 0 clamp(48px, 7vw, 80px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-b__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      to right,
      var(--border) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  opacity: 0.45;
  mask-image: radial-gradient(
    ellipse at 30% 40%,
    rgba(0, 0, 0, 0.9),
    rgba(0, 0, 0, 0) 75%
  );
  -webkit-mask-image: radial-gradient(
    ellipse at 30% 40%,
    rgba(0, 0, 0, 0.9),
    rgba(0, 0, 0, 0) 75%
  );
}
.hero-b__inner {
  position: relative;
  display: grid;
  gap: var(--s-5);
}
.hero-b__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  width: max-content;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.hero-b__tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero-b__tag-sep {
  opacity: 0.4;
}
.hero-b__title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--step-4);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
  max-width: 22ch;
}
.hero-b__accent {
  color: var(--text-muted);
}
.hero-b__lede {
  margin: 0;
  font-size: var(--step-1-up);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
}

/* rows */
.grid-rows {
  display: grid;
}
.row {
  display: grid;
  grid-template-columns: 80px 280px 1fr;
  gap: var(--s-7);
  padding: clamp(36px, 5vw, 56px) 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.row:last-of-type {
  border-bottom: 0;
}
@media (max-width: 880px) {
  .row {
    grid-template-columns: 60px 1fr;
    gap: var(--s-5);
  }
  .row__head {
    grid-column: 1 / -1;
  }
}
@media (max-width: 540px) {
  .row {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
}
.row__index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding-top: 6px;
}
.row__head h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--step-2);
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.15;
}
.row__sub {
  margin: var(--s-2) 0 0;
  color: var(--text-muted);
  font-size: var(--step-0);
  max-width: 32ch;
}

/* card grid */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
@media (max-width: 720px) {
  .cards {
    grid-template-columns: 1fr;
  }
}
.card {
  padding: var(--s-5);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background-color 0.15s ease;
}
.card:hover {
  background: var(--surface-2);
}
.cards .card:nth-child(2n) {
  border-right: 0;
}
.cards .card:nth-last-child(-n + 2) {
  border-bottom: 0;
}
@media (max-width: 720px) {
  .card {
    border-right: 0;
  }
  .cards .card:last-child {
    border-bottom: 0;
  }
  .cards .card:nth-last-child(2) {
    border-bottom: 1px solid var(--border);
  }
}
.card__num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: var(--s-3);
}
.card h3 {
  margin: 0 0 var(--s-2);
  font-size: var(--step-1-up);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--step-0);
  line-height: 1.55;
}

/* status grid */
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
@media (max-width: 640px) {
  .status-grid {
    grid-template-columns: 1fr;
  }
}
.status-cell {
  padding: var(--s-5);
  border-right: 1px solid var(--border);
}
.status-cell:last-child {
  border-right: 0;
}
@media (max-width: 640px) {
  .status-cell {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .status-cell:last-child {
    border-bottom: 0;
  }
}
.status-cell__label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: var(--s-2);
}
.status-cell__value {
  font-size: var(--step-1-up);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
}

/* boundary list b */
.bound {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--step-0);
}
@media (max-width: 540px) {
  .bound {
    grid-template-columns: 1fr;
  }
}
.bound li {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.bound__x {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

/* contact card */
.contact-card {
  display: inline-flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
  text-decoration: none;
  padding: var(--s-5) var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, background-color 0.15s ease,
    transform 0.15s ease;
}
.contact-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.contact-card:hover .contact-card__arrow {
  transform: translate(2px, -2px);
}
.contact-card__name {
  font-weight: 500;
  white-space: nowrap;
}
.contact-card__email {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: var(--step-0);
}
.contact-card__arrow {
  transition: transform 0.15s ease;
  color: var(--accent);
}

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--border);
  margin-top: var(--s-7);
}
.foot__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--s-5) clamp(20px, 4vw, 40px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}
.foot__left {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.foot__right a {
  color: var(--text-muted);
  text-decoration: none;
}
.foot__right a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
