/* ── 2026 Design System ── */

:root {
  --header-height: 73px;
  --font-neo-grotesque: Inter, Roboto, Helvetica Neue, Arial Nova, Nimbus Sans, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
  --font-size-fluid-1: max(1rem, min(4vw, 1.5rem));
  --font-size-fluid-2: max(1.5rem, min(6vw, 2.5rem));
  --font-size-fluid-3: max(2rem, min(9vw, 3.5rem));
  --size-2: 0.5rem;
  --size-3: 1rem;
  --size-4: 1.25rem;
  --size-5: 1.5rem;
  --size-6: 1.75rem;
  --size-7: 2rem;
  --size-8: 3rem;
  --size-9: 4rem;
  --size-10: 5rem;
  --size-fluid-4: max(2rem, min(4vw, 3rem));
  --size-fluid-5: max(4rem, min(5vw, 5rem));
  --surface-0: oklch(98% 0.01 80);
  --surface-1: oklch(99% 0.005 80);
  --surface-2: oklch(95% 0.01 78);
  --surface-3: oklch(90% 0.015 80);
  --ink-0: oklch(23% 0.02 60);
  --ink-1: oklch(35% 0.02 58);
  --ink-2: oklch(48% 0.015 60);
  --accent: oklch(27% 0.03 40);
  --accent-soft: oklch(91% 0.025 75);
  --border-soft: color-mix(in oklab, var(--ink-2) 18%, white);
  --shadow-soft: 0 1px 2px rgba(43, 33, 20, 0.04), 0 8px 32px rgba(43, 33, 20, 0.06);
  --shadow-hover: 0 2px 4px rgba(43, 33, 20, 0.05), 0 16px 48px rgba(43, 33, 20, 0.1);
  --radius-card: 24px;
  --radius-pill: 999px;
  --content-width: min(100% - 32px, 1160px);
  --reading-width: min(100% - 32px, 760px);
  --font-sans-custom: 'Sora', var(--font-neo-grotesque);
  --font-serif-custom: 'Sora', var(--font-neo-grotesque);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --select-chevron-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='10' viewBox='0 0 18 10' fill='none'%3E%3Cpath d='M2 2L9 8L16 2' stroke='%2353473D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --select-chevron-size: 0.9rem 0.55rem;
  --select-chevron-inset: 1rem;
  --select-padding-inline-end: 2.9rem;
}

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

::selection {
  background: oklch(88% 0.025 75);
  color: var(--ink-0);
}

html {
  background: linear-gradient(180deg, #fbfaf7 0%, #f4f0ea 100%);
  color: var(--ink-0);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans-custom);
  color: var(--ink-0);
  background:
    radial-gradient(circle at top left, rgba(202, 190, 172, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(248, 245, 239, 0.88) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease-out);
}

button,
input {
  font: inherit;
}

select {
  font: inherit;
}

select:not([multiple]):not([size]) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-inline-end: var(--select-padding-inline-end);
  background-image: var(--select-chevron-icon);
  background-repeat: no-repeat;
  background-position: right var(--select-chevron-inset) center;
  background-size: var(--select-chevron-size);
}

select:not([multiple]):not([size])::-ms-expand {
  display: none;
}

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

/* ── Page Shell ── */

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-height);
}

main {
  flex: 1;
}

/* ── Site Header ── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(248, 245, 239, 0.96);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 8px 26px rgba(43, 33, 20, 0.06);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.site-header.is-hidden {
  transform: translate3d(0, calc(-100% - 1px), 0);
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

.site-header__inner,
.site-footer__inner {
  width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-5);
}

.site-header__inner {
  min-height: 72px;
}

[id] {
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink-0);
  transition: opacity 0.2s var(--ease-out);
}

.site-brand:hover {
  opacity: 0.7;
}

.site-brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-family: var(--font-serif-custom);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  flex-shrink: 0;
}

.site-brand__text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--font-sans-custom);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s var(--ease-out);
}

.site-nav a:hover,
.site-nav a.is-active {
  background: rgba(17, 17, 17, 0.06);
  color: var(--ink-0);
}

/* ── Mobile Menu ── */

.site-header__menu,
.site-header__menu-button,
.site-header__drawer {
  display: none;
}

.site-header__menu {
  position: relative;
}

.site-header__menu-button {
  position: relative;
  z-index: 61;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-0);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  transition: all 0.25s var(--ease-out);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.site-header__menu-button:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: var(--shadow-soft);
}

.site-header__menu-button::-webkit-details-marker {
  display: none;
}

.site-header__menu-button::marker {
  content: "";
}

.site-header__menu-button span {
  width: 1rem;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transition: all 0.3s var(--ease-out);
}

.site-header__drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 100vw;
  padding: 5.25rem 1.5rem 1.5rem;
  border-left: none;
  background: rgba(251, 250, 247, 0.95);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  z-index: 60;
  overflow-y: auto;
}

.site-header__menu[open]::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  z-index: 50;
}

.site-header__menu[open] .site-header__menu-button {
  position: fixed;
  top: 12px;
  right: 16px;
  background: rgba(0, 0, 0, 0.05);
  border-color: transparent;
  box-shadow: none;
}

.site-header__menu[open] .site-header__menu-button span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header__menu[open] .site-header__menu-button span:nth-child(2) {
  opacity: 0;
}

.site-header__menu[open] .site-header__menu-button span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.site-header__drawer-nav {
  display: grid;
  gap: 0.15rem;
}

.site-header__drawer-nav a {
  display: block;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  color: var(--ink-1);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.2s var(--ease-out);
}

.site-header__drawer-nav a.is-active,
.site-header__drawer-nav a:hover {
  background: rgba(17, 17, 17, 0.06);
  color: var(--ink-0);
}

/* ── Main Layout ── */

main {
  width: var(--content-width);
  margin: 0 auto;
  padding: var(--size-fluid-5) 0 var(--size-10);
}

.hero,
.listing-hero,
.message-shell,
.tool-page,
.document-shell,
.section {
  margin-bottom: var(--size-fluid-5);
}

.tool-page {
  display: grid;
  gap: 0;
  min-width: 0;
  margin-top: calc(var(--size-fluid-4) * -0.75);
}

.tool-page__canvas {
  min-width: 0;
  overflow-x: hidden;
}

.page--tools .tool-page__canvas {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* ── Hero ── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 430px);
  gap: var(--size-8);
  align-items: start;
  padding: var(--size-9) 0 var(--size-6);
}

.hero h1,
.listing-hero h1,
.document-header h1,
.message-card h1,
.tool-page__intro h1 {
  margin: var(--size-2) 0 var(--size-4);
  max-width: 14ch;
  font-family: var(--font-serif-custom);
  font-size: var(--font-size-fluid-3);
  line-height: 0.96;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.hero__lede,
.listing-hero p,
.document-header__lede,
.message-card p,
.tool-page__intro p,
.tool-page__notes p {
  max-width: 64ch;
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.8;
  color: var(--ink-1);
}

.hero__stats {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--size-3);
  margin-top: var(--size-6);
}

.hero__stats article {
  flex: 1 1 0;
  min-width: 0;
  padding: var(--size-4);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  transition:
    background-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}

.hero__stats article:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.hero__stats strong,
.calculator-results strong {
  display: block;
  font-family: var(--font-serif-custom);
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  letter-spacing: -0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero__stats span,
.calculator-results span {
  color: var(--ink-2);
  font-size: 0.88rem;
}

/* ── Cards & Panels ── */

.subscribe-panel,
.feature-card,
.doc-card,
.message-card,
.tool-page__canvas,
.tool-page__notes,
.tool-promo,
.tool-callout,
.sidebar > .subscribe-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  transition:
    background-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}

@supports (content-visibility: auto) {
  .page--home .section {
    content-visibility: auto;
    contain-intrinsic-size: 900px;
  }

  .stack-list > .doc-card {
    content-visibility: auto;
    contain-intrinsic-size: 260px;
  }

  .page--tools .tool-page__canvas,
  .page--tools .tool-page__notes,
  .page--tools .tool-callout {
    content-visibility: auto;
    contain-intrinsic-size: 720px;
  }
}

.feature-card:hover,
.doc-card:hover,
.tool-promo:hover,
.tool-callout:hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.subscribe-panel,
.message-card,
.tool-page__notes,
.tool-page__canvas,
.tool-promo,
.tool-callout {
  padding: clamp(1.5rem, 2vw, 2rem);
}

.subscribe-panel h2,
.section-heading h2,
.feature-card h3,
.doc-card h3,
.tool-promo h2,
.tool-callout h2,
.tool-page__notes h2 {
  margin: var(--size-2) 0 var(--size-3);
  font-family: var(--font-serif-custom);
  font-size: var(--font-size-fluid-2);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.subscribe-panel p,
.feature-card p,
.doc-card p,
.tool-promo p,
.tool-callout p,
.tool-page__notes p {
  margin: 0;
  color: var(--ink-1);
  line-height: 1.75;
}

/* ── Forms & Buttons ── */

.subscribe-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--size-2);
  margin: var(--size-4) 0 var(--size-2);
}

.subscribe-form input,
.subscribe-form button,
.contact-form button,
.reaction-pill__button,
.button-link,
.share-bar__link {
  border-radius: 14px;
}

.subscribe-form input {
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-0);
  transition: all 0.2s var(--ease-out);
}

.subscribe-form button {
  width: 100%;
}

.subscribe-form input:focus {
  outline: none;
  border-color: rgba(53, 44, 34, 0.3);
  box-shadow: 0 0 0 3px rgba(53, 44, 34, 0.08);
  background: #fff;
}

.subscribe-form button,
.contact-form button,
.button-link,
.share-bar__link,
.reaction-pill__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 1.2rem;
  min-height: 3rem;
  border: none;
  background: #111;
  color: white;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.25s var(--ease-out);
}

.subscribe-form button:hover,
.contact-form button:hover,
.button-link:hover {
  background: #2a2520;
  box-shadow: 0 4px 16px rgba(43, 33, 20, 0.2);
  transform: translateY(-1px);
}

.subscribe-form button:active,
.contact-form button:active,
.button-link:active {
  transform: translateY(0);
  box-shadow: none;
}

.subscribe-form button:disabled,
.contact-form button:disabled,
.button-link:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.button-link--dark {
  background: #111;
  color: #fff;
}

.button-link--promo {
  flex: 0 0 auto;
  min-width: 13.5rem;
  min-height: 3.65rem;
  padding-inline: 1.35rem;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.button-link--promo:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.subscribe-panel__message {
  margin-top: var(--size-3);
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--ink-0);
}

.subscribe-panel__fineprint {
  margin-top: var(--size-3);
  font-size: 0.88rem;
  color: var(--ink-2);
}

/* ── Sections ── */

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--size-4);
  margin-bottom: var(--size-5);
}

.section-heading a {
  color: var(--ink-2);
  font-size: 0.92rem;
  transition: color 0.2s var(--ease-out);
}

.section-heading a:hover {
  color: var(--ink-0);
}

/* ── Feature & Doc Cards ── */

.feature-card,
.doc-card {
  padding: var(--size-5);
}

.doc-card__thumb {
  display: block;
  margin: calc(-1 * var(--size-5)) calc(-1 * var(--size-5)) var(--size-4);
  overflow: hidden;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.doc-card__thumb img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.35s var(--ease-out);
}

.doc-card:hover .doc-card__thumb img {
  transform: scale(1.03);
}

.feature-card__thumb {
  display: block;
  margin: calc(-1 * clamp(1.5rem, 2vw, 2rem)) calc(-1 * clamp(1.5rem, 2vw, 2rem)) var(--size-4);
  overflow: hidden;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.feature-card__thumb img {
  display: block;
  width: 100%;
  height: clamp(240px, 34vw, 420px);
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s var(--ease-out);
}

.feature-card:hover .feature-card__thumb img {
  transform: scale(1.03);
}

.feature-card__meta,
.doc-card__meta,
.document-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-2);
  color: var(--ink-2);
  font-size: 0.88rem;
}

.document-header__meta {
  margin-top: var(--size-3);
}

.feature-card h3,
.doc-card h3 {
  margin-bottom: var(--size-3);
}

.feature-card h3 a,
.doc-card h3 a {
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

.feature-card h3 a:hover,
.doc-card h3 a:hover {
  color: var(--ink-0);
}

.doc-card h3 a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.doc-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.tool-card__summary {
  margin-top: var(--size-3);
  color: var(--ink-2);
}

.feature-card__actions {
  margin-top: var(--size-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3);
  align-items: center;
  color: var(--ink-2);
}

/* ── Grid & Layout ── */

.stack-list {
  display: grid;
  gap: var(--size-4);
}

.grid-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-8);
  align-items: start;
}

.grid-section > div {
  display: flex;
  flex-direction: column;
}

.grid-section .doc-card {
  display: flex;
  flex-direction: column;
}

.tool-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-5);
}

.tool-promo > div {
  max-width: 48rem;
}

.author-shell,
.listing-hero,
.message-shell,
.tool-page__intro {
  max-width: 760px;
}

.author-card,
.tool-page__intro {
  max-width: 860px;
}

.author-card {
  padding: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.author-card h1 {
  margin: 0 0 0.4rem;
}

.document-header__byline,
.author-card__role,
.author-card__bio {
  color: var(--ink-1);
}

.document-header__byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: var(--size-3) 0 0;
  font-size: 0.96rem;
}

.document-header__byline a {
  color: var(--ink-0);
  text-decoration-color: rgba(17, 17, 17, 0.2);
}

.document-header__byline a:hover {
  text-decoration-color: currentColor;
}

.author-card__role {
  margin: 0 0 var(--size-3);
  font-size: 1rem;
  font-weight: 600;
}

.author-card__bio {
  margin: 0 0 var(--size-5);
  font-size: 1.05rem;
  line-height: 1.7;
}

.author-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.author-card__links a {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  transition:
    transform 0.2s var(--ease-out),
    background 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out);
}

.author-card__links a:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.tool-page__intro h1 {
  max-width: 16ch;
}

/* ── Document Layout ── */

.two-column,
.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--size-8);
  align-items: start;
}

.two-column > *,
.document-grid > *,
.sidebar,
.sidebar > .subscribe-panel {
  min-width: 0;
  max-width: 100%;
}

.sidebar {
  position: sticky;
  top: 96px;
}

.document-hero {
  margin-bottom: var(--size-8);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.document-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.document-header {
  width: min(100%, 720px);
  margin: 0 0 var(--size-8);
}

.document-header h1 {
  max-width: 100%;
}

.document-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--size-4);
}

.document-header .tag-row {
  margin-top: var(--size-3);
}

.document-header__meta span {
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s var(--ease-out);
}

.document-header__meta span:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink-0);
}

.document-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--size-3);
  margin-top: var(--size-5);
}

.document-body {
  width: min(100%, 720px);
  min-width: 0;
  max-width: 100%;
}

/* ── Prose ── */

.prose {
  min-width: 0;
  max-width: 100%;
  font-family: var(--font-serif-custom);
  font-size: 1.18rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.prose > * {
  margin: 0 0 1.35em;
}

.prose h2,
.prose h3 {
  margin-top: 1.9em;
  margin-bottom: 0.6em;
  font-family: var(--font-serif-custom);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.prose h2 {
  font-size: var(--font-size-fluid-2);
}

.prose h3 {
  font-size: var(--font-size-fluid-1);
}

.prose p,
.prose li,
.prose blockquote {
  color: var(--ink-0);
}

.prose ul,
.prose ol {
  padding-left: 1.15em;
}

.prose .table-wrap {
  margin: 1.4rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(43, 33, 20, 0.05);
}

.prose table,
.prose .prose-table {
  width: 100%;
  min-width: 42rem;
  margin: 0;
  border-collapse: collapse;
  font-family: var(--font-sans-custom);
  font-size: 0.98rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.prose thead th {
  background: rgba(43, 33, 20, 0.04);
  color: var(--ink-1);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.prose tbody tr:last-child td,
.prose tbody tr:last-child th {
  border-bottom: 0;
}

.prose blockquote {
  margin-left: 0;
  position: relative;
  padding: 1.35rem 1.4rem 1.1rem 1.4rem;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(43, 33, 20, 0.04);
}

.prose blockquote::before {
  content: "“";
  position: absolute;
  top: 0.55rem;
  left: 0.95rem;
  color: color-mix(in oklab, var(--ink-2) 22%, white);
  font-family: Georgia, serif;
  font-size: 3.1rem;
  line-height: 1;
  opacity: 0.55;
}

.prose blockquote p {
  margin: 0;
}

.prose blockquote p:first-child {
  position: relative;
  z-index: 1;
  padding-top: 0.5rem;
  padding-left: 0.35rem;
  font-family: var(--font-serif-custom);
  font-size: 1.18rem;
  line-height: 1.6;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.prose blockquote p:last-child {
  margin-top: 0.85rem;
  padding-left: 0.35rem;
  color: var(--ink-2);
  font-family: var(--font-sans-custom);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.prose blockquote p:last-child::before {
  content: "— ";
}

.prose code {
  padding: 0.12rem 0.35rem;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.05);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.prose pre {
  overflow-x: auto;
  padding: 1.15rem 1.25rem;
  border-radius: 16px;
  background: #1f1c18;
  color: #f7f1ea;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.prose .instruction-block {
  width: 100%;
  max-width: 100%;
  margin: 1.6rem 0;
  padding: 1.35rem;
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 245, 239, 0.96));
  box-shadow:
    0 18px 40px rgba(43, 33, 20, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  font-family: var(--font-sans-custom);
  box-sizing: border-box;
}

.prose .instruction-block > * {
  margin: 0;
}

.prose .instruction-block__eyebrow {
  margin-bottom: 0.65rem;
  color: var(--brand-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prose .instruction-block__title {
  margin-bottom: 0.8rem;
  font-family: var(--font-sans-custom);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.prose .instruction-block__code {
  margin: 0 0 0.95rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(43, 33, 20, 0.08);
  border-radius: 16px;
  background: #201c18;
  color: #f6efe6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.prose .instruction-block__code code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
}

.prose .instruction-block__steps {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-1);
  font-size: 0.95rem;
  line-height: 1.6;
}

.prose .instruction-block__steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  margin: 0;
}

.prose .instruction-block__step-number {
  min-width: 1.55rem;
  height: 1.55rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in oklab, var(--brand-strong) 14%, white);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.prose .content-figure {
  margin: 1.6rem 0;
}

.prose .content-figure img {
  width: 100%;
  height: auto;
  border-radius: 24px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 18px 40px rgba(43, 33, 20, 0.08);
}

.prose .content-figure figcaption {
  margin-top: 0.7rem;
  color: var(--ink-2);
  font-family: var(--font-sans-custom);
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .prose .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .prose .table-wrap table,
  .prose .table-wrap tbody,
  .prose .table-wrap tr,
  .prose .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .prose .table-wrap thead {
    display: none;
  }

  .prose .table-wrap tr {
    margin-bottom: 0.9rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(43, 33, 20, 0.05);
  }

  .prose .table-wrap td {
    padding: 0.55rem 0;
    border: 0;
    display: block;
  }

  .prose .table-wrap td + td {
    margin-top: 0.45rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(43, 33, 20, 0.08);
  }

  .prose .table-wrap td::before {
    display: block;
    margin-bottom: 0.32rem;
    content: attr(data-label);
    color: var(--ink-2);
    font-family: var(--font-sans-custom);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .prose .table-wrap td:first-child {
    padding-top: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
  }
}

/* ── Tags ── */

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: var(--size-4) 0 0;
  list-style: none;
}

.tag-row li {
  margin: 0;
}

.tag-pill {
  display: block;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

.tag-pill:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink-0);
}

/* ── Reactions & Sharing ── */

.reaction-pill,
.share-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ui-tooltip {
  position: relative;
}

.ui-tooltip::before,
.ui-tooltip::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms var(--ease-out),
    transform 160ms var(--ease-out);
  z-index: 8;
}

.ui-tooltip::after {
  content: attr(aria-label);
  min-width: max-content;
  max-width: min(32ch, calc(100vw - 2rem));
  padding: var(--size-2) calc(var(--size-2) + 0.15rem);
  border-radius: var(--radius-3);
  background: color-mix(in oklab, var(--ink-0) 96%, white);
  color: var(--surface-1);
  border: 1px solid color-mix(in oklab, var(--ink-0) 78%, white);
  box-shadow: var(--shadow-soft);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

.ui-tooltip::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  background: color-mix(in oklab, var(--ink-0) 96%, white);
  border-right: 1px solid color-mix(in oklab, var(--ink-0) 78%, white);
  border-bottom: 1px solid color-mix(in oklab, var(--ink-0) 78%, white);
}

.ui-tooltip.--top::after {
  bottom: calc(100% + 0.9rem);
  transform: translate(-50%, 0.25rem);
}

.ui-tooltip.--top::before {
  bottom: calc(100% + 0.45rem);
  transform: translate(-50%, 0.25rem) rotate(45deg);
}

.ui-tooltip.--right::after {
  top: 50%;
  left: calc(100% + 0.9rem);
  transform: translate(0.25rem, -50%);
}

.ui-tooltip.--right::before {
  top: 50%;
  left: calc(100% + 0.45rem);
  transform: translate(0.25rem, -50%) rotate(135deg);
}

.ui-tooltip.--bottom::after {
  top: calc(100% + 0.9rem);
  transform: translate(-50%, -0.25rem);
}

.ui-tooltip.--bottom::before {
  top: calc(100% + 0.45rem);
  transform: translate(-50%, -0.25rem) rotate(225deg);
}

.ui-tooltip.--left::after {
  top: 50%;
  left: auto;
  right: calc(100% + 0.9rem);
  transform: translate(-0.25rem, -50%);
}

.ui-tooltip.--left::before {
  top: 50%;
  left: auto;
  right: calc(100% + 0.45rem);
  transform: translate(-0.25rem, -50%) rotate(-45deg);
}

.ui-tooltip:is(:hover, :focus-visible, .is-tooltip-visible)::before,
.ui-tooltip:is(:hover, :focus-visible, .is-tooltip-visible)::after {
  opacity: 1;
}

.ui-tooltip.--top:is(:hover, :focus-visible, .is-tooltip-visible)::after,
.ui-tooltip.--top:is(:hover, :focus-visible, .is-tooltip-visible)::before {
  transform: translate(-50%, 0);
}

.ui-tooltip.--right:is(:hover, :focus-visible, .is-tooltip-visible)::after,
.ui-tooltip.--right:is(:hover, :focus-visible, .is-tooltip-visible)::before {
  transform: translate(0, -50%);
}

.ui-tooltip.--bottom:is(:hover, :focus-visible, .is-tooltip-visible)::after,
.ui-tooltip.--bottom:is(:hover, :focus-visible, .is-tooltip-visible)::before {
  transform: translate(-50%, 0);
}

.ui-tooltip.--left:is(:hover, :focus-visible, .is-tooltip-visible)::after,
.ui-tooltip.--left:is(:hover, :focus-visible, .is-tooltip-visible)::before {
  transform: translate(0, -50%);
}

.reaction-pill__button {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-0);
  border: 1px solid var(--border-soft);
}

.reaction-pill__button:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

.reaction-pill__button > *,
.share-bar__link > *,
.button-link > * {
  line-height: 1;
}

.reaction-pill__button strong {
  font-size: 1em;
}

.reaction-pill__button[disabled] {
  opacity: 1;
  cursor: default;
}

.share-bar__link {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-1);
  border: 1px solid var(--border-soft);
}

.share-bar__link:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink-0);
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.share-bar__link svg {
  flex-shrink: 0;
}

/* ── Tool Callout ── */

.tool-callout__header {
  margin-bottom: var(--size-4);
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-4);
}

.calculator-field {
  display: grid;
  gap: 0.65rem;
}

.calculator-field span {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.calculator-field strong {
  font-family: var(--font-serif-custom);
  font-size: 1.55rem;
}

.calculator-field input[type="range"] {
  width: 100%;
  accent-color: #111;
}

.calculator-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--size-3);
  margin-top: var(--size-5);
}

.calculator-results article {
  padding: var(--size-4);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.03);
  transition: all 0.25s var(--ease-out);
}

.calculator-results article:hover {
  background: rgba(0, 0, 0, 0.06);
}

.calculator-results__highlight {
  background: #111 !important;
}

.calculator-results__highlight:hover {
  background: #2a2520 !important;
}

.calculator-results__highlight strong,
.calculator-results__highlight span {
  color: #fff;
}

.tool-callout__footer {
  margin-top: var(--size-4) !important;
  font-size: 0.95rem;
}

.tool-embed--article .tool-callout {
  container-type: inline-size;
  padding: 1.25rem;
}

.tool-embed--article .tool-callout__header {
  gap: var(--size-4);
}

.tool-embed--article .calculator-grid,
.tool-embed--article .calculator-results {
  grid-template-columns: 1fr;
}

/* Rule: keep tool-specific component styles out of base.css.
   Shared layout primitives stay here. Each tool namespace gets its own
   stylesheet and is loaded through the tool registry so standalone pages
   and embedded article/issue shortcodes stay in sync. */

/* ── Message Page ── */

.message-shell {
  display: grid;
  place-items: center;
  min-height: 52vh;
}

.message-card {
  width: min(100%, 640px);
}

/* ── Contact Page ── */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--size-8);
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 0.75rem;
  margin-top: var(--size-4);
}

.contact-form label {
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-0);
  font: inherit;
  font-size: 0.95rem;
  transition: all 0.2s var(--ease-out);
}

.contact-form textarea {
  resize: vertical;
  min-height: 8rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(53, 44, 34, 0.3);
  box-shadow: 0 0 0 3px rgba(53, 44, 34, 0.08);
  background: #fff;
}

.contact-form button {
  justify-self: start;
}

.contact-form__error {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(165, 54, 54, 0.18);
  border-radius: 14px;
  background: rgba(165, 54, 54, 0.08);
  color: #7a1f1f;
}

.contact-form__hint {
  margin: -0.15rem 0 0;
  color: var(--ink-2);
  font-size: 0.88rem;
}

.contact-form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-company__card {
  padding: var(--size-5);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.92);
  margin-bottom: var(--size-4);
}

.contact-company__card h3 {
  margin: var(--size-2) 0 var(--size-3);
  font-family: var(--font-serif-custom);
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.contact-company__card p {
  margin: 0;
  color: var(--ink-1);
  line-height: 1.7;
  font-size: 0.95rem;
}

.contact-company__address {
  font-style: normal;
  color: var(--ink-1);
  line-height: 1.7;
  font-size: 0.95rem;
}

.contact-success {
  text-align: center;
  padding: 2rem 1rem;
}

.contact-success__icon {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.contact-success__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-0);
}

.contact-success__text {
  margin: 0;
  color: var(--ink-1);
  font-size: 0.95rem;
}

/* ── Site Footer ── */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: var(--size-7) 0;
  background: rgba(255, 255, 255, 0.82);
}

.site-footer p {
  margin: 0.5rem 0 0;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3);
}

.site-footer__links a {
  color: var(--ink-2);
  font-size: 0.9rem;
  transition: color 0.2s var(--ease-out);
}

.site-footer__links a:hover {
  color: var(--ink-0);
}

/* ── Tablet Breakpoint ── */

@media (max-width: 1040px) {
  .hero,
  .document-hero,
  .grid-section,
  .two-column,
  .document-grid,
  .contact-grid,
  .tool-promo {
    grid-template-columns: 1fr;
  }

  .tool-promo {
    align-items: flex-start;
  }

  .button-link--promo {
    min-width: 0;
  }

  .sidebar {
    position: static;
  }

  .document-hero .sidebar {
    order: 2;
  }

  .document-hero .document-header {
    order: 1;
  }

  .document-grid .document-body {
    grid-column: auto;
  }

}

/* ── Mobile Breakpoint ── */

@media (max-width: 720px) {
  .prose h3 {
    font-size: 1.25rem;
  }

  .site-header__inner {
    align-items: center;
    padding: 12px 0;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 0;
  }

  .site-nav--desktop {
    display: none;
  }

  .site-header__menu {
    display: block;
    margin-left: auto;
  }

  .site-header__menu-button {
    display: inline-flex;
  }

  .site-header__drawer {
    display: none;
  }

  .site-header__menu[open] .site-header__drawer {
    display: block;
  }

  .site-brand__text {
    display: none;
  }

  main {
    padding-top: var(--size-7);
  }

  .hero {
    padding-top: var(--size-4);
  }

  .hero h1,
  .listing-hero h1,
  .document-header h1,
  .tool-page__intro h1,
  .message-card h1 {
    font-size: var(--font-size-fluid-3);
  }

  .document-header h1 {
    max-width: 100%;
  }

  .subscribe-form,
  .hero__stats,
  .calculator-grid,
  .calculator-results {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .document-header__actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-top: 1.1rem;
  }

  .share-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .document-header__meta {
    gap: 0.45rem;
    margin-top: var(--size-3);
  }

  .document-header__meta span,
  .document-header .tag-pill {
    padding: 0.38rem 0.72rem;
    border-radius: 10px;
  }

  .document-header .tag-row {
    gap: 0.45rem;
    margin-top: 0.7rem;
  }

  .document-header__byline {
    margin-top: 0.95rem;
  }

  .share-bar__link {
    padding: 0.7rem 0.9rem;
    font-size: 0.8rem;
  }

  .subscribe-form {
    display: grid;
  }

  .feature-card,
  .doc-card,
  .tool-page__canvas,
  .tool-page__notes,
  .tool-promo,
  .tool-callout,
  .subscribe-panel,
  .message-card {
    padding: 1.25rem;
  }

  .feature-card:hover,
  .doc-card:hover,
  .tool-promo:hover,
  .tool-callout:hover,
  .hero__stats article:hover {
    transform: none;
  }

  .section-heading {
    flex-wrap: wrap;
    align-items: baseline;
  }

  .section-heading h2 {
    font-size: 1.4rem;
  }

  .grid-section {
    gap: var(--size-fluid-5);
  }

  .tool-promo {
    flex-direction: column;
    align-items: stretch;
  }

  .button-link--promo {
    width: 100%;
    justify-content: center;
  }
}
