/* Editorial refresh overrides — retargeted to the homepage "Tidepool" system
   (deep teal-ink + brand teal + sea-glass ground + one coral accent).
   Token names kept; values + fonts now mirror home.css so inner pages match. */
:root {
  --bg: #F0F5F3;            /* mist — cool aqua page ground */
  --bg-alt: #E4EEEA;        /* alternate band */
  --surface: #FFFFFF;
  --surface-2: #E9F1ED;     /* sea-glass-tinted chips / graphic ground */
  --border: #D4E0DC;        /* line */
  --border-soft: #E2EAE7;
  --ink: #15393C;           /* pine: dominant text */
  --ink-soft: #3D5A5A;
  --ink-muted: #5C7472;
  --primary: #1E5F62;       /* brand teal (AA on white) */
  --primary-hover: #2E7A77; /* teal-soft */
  --primary-ink: #FFFFFF;
  --accent: #2E7A77;        /* secondary teal accent */
  --accent-soft: #CFE3DE;   /* sea-glass */
  --accent-brown: #A3492E;  /* coral-deep — warm at text sizes */
  --warm: #DE7356;          /* coral — the one accent */
  --leaf: #2E7A77;
  /* Typography now matches home: Bricolage Grotesque display + Source Serif 4 body */
  --font-display: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(14, 42, 45, 0.06);
  --shadow-md: 0 16px 36px -20px rgba(14, 42, 45, 0.30);
  --shadow-lg: 0 32px 64px -30px rgba(14, 42, 45, 0.38);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1A18;
  --bg-alt: #11302F;
  --surface: #152421;
  --surface-2: #1C3733;
  --border: #28403B;
  --border-soft: #1E322E;
  --ink: #E8EFEB;
  --ink-soft: #C2CFC9;
  --ink-muted: #8CA09A;
  --primary: #6FBCAF;
  --primary-hover: #8FD0C4;
  --primary-ink: #07211E;
  --accent: #8FD0C4;
  --accent-soft: #1C3733;
  --accent-brown: #E78D6F;
  --warm: #E78D6F;
  --leaf: #6FBCAF;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.5);
}

h1,
h2,
h3,
h4,
.brand,
.hero__title,
.hero__pillars strong,
.card__title,
.how-card__num,
.how-card__title,
.product-card__title,
.diff-item h3,
.modules h3,
.module-card h3,
.trust-list strong,
.mission__title,
.tool-card__title,
.featured-tool__title,
.article-card__title,
.philosophy-list strong,
.tracker-brief__title {
  letter-spacing: 0;
}

.site-header {
  background: color-mix(in oklab, var(--bg) 92%, transparent);
}

.brand__mark {
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid var(--border-soft);
  background: color-mix(in oklab, var(--surface) 86%, var(--bg));
  padding: 5px;
}

.nav__link[aria-current="page"] {
  color: var(--ink);
  background: color-mix(in oklab, var(--primary) 10%, transparent);
}

.btn {
  border-radius: var(--radius);
  letter-spacing: 0;
  min-height: 44px;
}

.btn--primary {
  box-shadow: 0 8px 18px -14px color-mix(in oklab, var(--primary) 70%, black);
}

.btn--primary:hover {
  box-shadow: 0 12px 22px -14px color-mix(in oklab, var(--primary) 80%, black);
}

.hero {
  padding-block: clamp(4.75rem, 8vw, 7rem);
}

.hero__inner {
  align-items: end;
}

.hero__eyebrow {
  color: var(--primary);
}

.hero__title {
  max-width: 17ch;
}

.hero__lede {
  max-width: 50ch;
}

.hero__credential {
  max-width: 52ch;
  padding-left: var(--space-5);
  border-left: 2px solid var(--accent);
  font-style: normal;
  line-height: 1.55;
}

.hero__media {
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid var(--border);
  aspect-ratio: 1 / 1;
}

.proof-strip {
  padding-block: 0 var(--space-16);
}

.proof-strip__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.proof-strip__item {
  padding: var(--space-5) var(--space-6);
  border-right: 1px solid var(--border-soft);
}

.proof-strip__item:last-child {
  border-right: 0;
}

.proof-strip__label,
.library-intro__label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.proof-strip__item strong,
.library-intro strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.25;
}

.section--alt {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg-alt) 78%, var(--surface)) 0%, var(--bg-alt) 100%);
}

.card,
.how-card,
.product-card,
.module-card,
.tool-card,
.featured-tool,
.faq details,
.notice,
.signup__form,
.tracker-frame-wrap {
  box-shadow: none;
}

.card:hover,
.product-card:hover,
.tool-card:hover {
  box-shadow: 0 12px 28px rgba(28, 34, 31, 0.07);
}

.how-card {
  background: transparent;
  border-color: var(--border);
}

.how-card__icon,
.card__icon,
.product-card__media,
.topic-nav a {
  border-radius: var(--radius);
}

.classes {
  background: var(--bg);
}

.product-card {
  border-color: var(--border-soft);
}

.product-card--featured {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--accent-soft) 18%, var(--surface)) 0%, var(--surface) 58%);
  border-color: color-mix(in oklab, var(--primary) 46%, var(--border));
  box-shadow: none;
}

.product-card--featured:hover {
  box-shadow: 0 16px 34px rgba(28, 34, 31, 0.08);
}

.mission {
  background: #15393C;
  color: #EDF4F1;
}

.mission .eyebrow,
.mission .check-list li,
.mission__quote p {
  color: color-mix(in oklab, #EDF4F1 88%, transparent);
}

.mission__title,
.mission .check-list li::before {
  color: #FFFFFF;
}

.mission__quote {
  background: color-mix(in oklab, #FFFFFF 8%, transparent);
  border-left-color: var(--accent-soft);
}

.page-hero {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--accent-soft) 24%, var(--bg)) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border-soft);
}

.page-hero .container {
  position: relative;
}

.page-hero--visual .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.54fr);
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  align-items: center;
}

.class-hero--visual .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.54fr);
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  align-items: center;
}

.page-hero__copy {
  min-width: 0;
}

.page-hero__title {
  max-width: 24ch;
}

.page-hero__visual {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
}

.page-hero__visual img,
.life-card img,
.image-callout__media img,
.tool-mosaic img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.page-hero__visual--graphic {
  background: var(--surface-2);
}

.page-hero__visual--graphic img {
  object-fit: contain;
}

/* Shared warm photo grade + brand-tint wash — unifies site photography.
   Scoped to photo heroes only (not the line-art graphic variant). */
.page-hero__visual:not(.page-hero__visual--graphic) {
  position: relative;
}
.page-hero__visual:not(.page-hero__visual--graphic) img {
  filter: saturate(0.94) contrast(1.03) brightness(1.02) sepia(0.05);
}
.page-hero__visual:not(.page-hero__visual--graphic)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(222,115,86,0.06) 0%, rgba(21,57,60,0.04) 45%, rgba(21,57,60,0.12) 100%);
  pointer-events: none;
}

.life-strip {
  padding-block: var(--space-16);
  background: var(--bg);
}

.life-strip__head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: clamp(var(--space-6), 5vw, var(--space-12));
  align-items: end;
  margin-bottom: var(--space-8);
}

.life-strip__head h2 {
  margin-bottom: 0;
}

.life-strip__head p {
  color: var(--ink-soft);
  margin: 0;
}

.life-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 1fr;
  gap: var(--space-5);
  align-items: stretch;
}

.life-card {
  min-height: 340px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
}

.life-card--small {
  min-height: 260px;
  align-self: end;
}

.life-card figcaption {
  position: absolute;
  inset: auto var(--space-4) var(--space-4) var(--space-4);
  color: #FFFFFF;
  background: rgba(33, 31, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.45;
  backdrop-filter: blur(8px);
}

.image-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.78fr);
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  align-items: center;
}

.image-callout__media {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
}

.image-callout__caption {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: clamp(var(--space-8), 5vw, var(--space-12));
  align-items: start;
}

.faq-side {
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
  display: grid;
  gap: var(--space-4);
}

.faq-side figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
}

.faq-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.faq-side p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.tool-mosaic {
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: var(--space-4);
  align-items: stretch;
}

.tool-mosaic figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.tool-mosaic figure:first-child {
  min-height: 320px;
}

.tool-mosaic__stack {
  display: grid;
  gap: var(--space-4);
}

.tool-mosaic__stack figure {
  min-height: 150px;
}

.tool-hero .hero-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.9fr);
  align-items: stretch;
}

.tool-hero__image {
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
  min-height: 280px;
}

.tool-hero__image img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
}

.summary-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

.library-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr);
  gap: var(--space-6);
  margin: var(--space-8) 0;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: 760px;
}

.featured-tool {
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--accent-soft) 18%, var(--surface)) 0%, var(--surface) 54%);
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
}

.featured-tool--ai {
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--warm) 20%, var(--surface)) 0%, var(--surface) 58%);
}

.featured-tool__panel {
  background: color-mix(in oklab, var(--bg-alt) 72%, var(--surface));
}

.featured-tool .hero__ctas .btn {
  white-space: normal;
}

.tool-card:has(.btn--primary) {
  border-color: color-mix(in oklab, var(--primary) 42%, var(--border));
  background: color-mix(in oklab, var(--accent-soft) 10%, var(--surface));
}

.tool-card:has(.btn--primary) .tool-card__eyebrow::after {
  content: "Available";
  display: inline-flex;
  margin-left: var(--space-2);
  padding: 0.12rem 0.42rem;
  border: 1px solid color-mix(in oklab, var(--primary) 35%, transparent);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.tool-card .muted {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.article-card {
  border-top: 1px solid var(--border);
  padding: var(--space-5) 0 0;
}

.faq details[open] {
  background: color-mix(in oklab, var(--accent-soft) 10%, var(--surface));
}

.ai-hero {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--accent-soft) 22%, var(--bg)) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border-soft);
  padding-block: clamp(4.75rem, 8vw, 7rem);
}

.ai-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.78fr);
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  align-items: center;
}

.ai-hero__copy {
  min-width: 0;
}

.ai-chat-preview {
  border: 1px solid color-mix(in oklab, var(--primary) 35%, var(--border));
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(28, 34, 31, 0.08);
  overflow: hidden;
}

.ai-chat-preview__top {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.ai-chat-preview__top strong {
  color: var(--ink);
  font-size: var(--text-sm);
}

.ai-chat-preview__dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--primary);
}

.ai-chat-preview__body {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
}

.ai-chat-preview--live .ai-chat-preview__body {
  max-height: 680px;
  overflow-y: auto;
}

.ai-message {
  max-width: 88%;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: var(--space-4);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.ai-message--user {
  justify-self: end;
  background: color-mix(in oklab, var(--primary) 10%, var(--surface));
  border-color: color-mix(in oklab, var(--primary) 28%, var(--border));
  color: var(--ink);
}

.ai-message--assistant {
  justify-self: start;
  background: var(--surface-2);
}

.ai-source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.ai-source-strip span {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--bg-alt) 72%, var(--surface));
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.2;
  padding: 0.35rem 0.5rem;
}

.ai-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.62fr);
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  align-items: start;
}

.ai-chat-form {
  display: grid;
  gap: var(--space-3);
  border-top: 1px solid var(--border-soft);
  padding-top: var(--space-4);
}

.ai-chat-form__input {
  min-height: 8.5rem;
  resize: vertical;
}

.ai-chat-form__actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
}

.ai-chat-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ai-suggested {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ai-suggested button {
  appearance: none;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.2;
  min-height: 2.25rem;
  padding: 0.45rem 0.65rem;
}

.ai-suggested button:hover {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
  color: var(--ink);
}

.ai-live-note {
  max-width: 760px;
}

.site-footer {
  background: #0E2A2D;
  color: #EDF4F1;
}

.site-footer .brand,
.site-footer .brand:hover,
.site-footer h4,
.site-footer a:hover {
  color: #FFFFFF;
}

.site-footer p,
.site-footer .footer-list a,
.site-footer .footer-bottom,
.site-footer .footer-elsewhere,
.site-footer .footer-elsewhere a {
  color: color-mix(in oklab, #EDF4F1 72%, transparent);
}

.site-footer,
.site-footer .footer-bottom {
  border-color: color-mix(in oklab, #EDF4F1 14%, transparent);
}

@media (max-width: 880px) {
  .hero__media {
    aspect-ratio: 4 / 3;
  }

  .page-hero--visual .container,
  .ai-hero__inner,
  .ai-split,
  .class-hero--visual .container,
  .life-strip__head,
  .life-grid,
  .image-callout,
  .faq-layout,
  .tool-mosaic,
  .tool-hero .hero-grid {
    grid-template-columns: 1fr;
  }

  .page-hero__visual {
    aspect-ratio: 16 / 10;
  }

  .life-card,
  .life-card--small,
  .tool-mosaic figure:first-child,
  .tool-mosaic__stack figure,
  .tool-hero__image {
    min-height: 230px;
  }

  .faq-side {
    position: static;
  }

  .faq-side figure {
    aspect-ratio: 16 / 9;
  }

  .featured-tool .hero__ctas .btn {
    width: 100%;
  }

  .ai-chat-form__actions {
    grid-template-columns: 1fr;
  }

  .ai-chat-form__actions .btn {
    width: 100%;
  }

  .ai-chat-preview--live .ai-chat-preview__body {
    max-height: none;
    overflow-y: visible;
  }

  .proof-strip {
    padding-block: 0 var(--space-12);
  }

  .proof-strip__inner,
  .library-intro {
    grid-template-columns: 1fr;
  }

  .proof-strip__item {
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .proof-strip__item:last-child {
    border-bottom: 0;
  }
}

/* ---------- 4-column "What's here" grid ---------- */
.how-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.how-card {
  display: flex;
  flex-direction: column;
}

.how-card__link {
  margin-top: auto;
  padding-top: var(--space-5);
}

@media (max-width: 1024px) {
  .how-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .how-grid--four {
    grid-template-columns: 1fr;
  }
}

/* ---------- About preview with photo on homepage ---------- */
.about-preview {
  align-items: center;
}

/* ---------- Cleaner footer links ---------- */
.footer-list a {
  transition: color var(--transition);
}

/* ---------- Page-hero layout for 2-col pages ---------- */
.page-hero--visual .container {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  align-items: center;
}

.page-hero__copy {
  min-width: 0;
}

.page-hero__visual {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
}

.page-hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 880px) {
  .page-hero--visual .container {
    grid-template-columns: 1fr;
  }

  .page-hero__visual {
    order: -1;
    aspect-ratio: 16 / 9;
  }
}

/* =========================================================
   Visual upgrade pass — warmth, contrast, rhythm
   ========================================================= */

/* 1. Hero — warm amber-sage gradient wash */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%,
      color-mix(in oklab, var(--warm) 28%, var(--bg)) 0%,
      transparent 70%),
    linear-gradient(160deg,
      color-mix(in oklab, var(--bg-alt) 50%, var(--bg)) 0%,
      var(--bg) 100%);
}

/* Hero headline — italic serif on the emotive word */
.hero__title em {
  font-style: italic;
  color: var(--primary);
}

/* Hero credential — warmer left-border */
.hero__credential {
  border-left-color: var(--warm);
}

/* Hero media — warmer frame */
.hero__media {
  border-color: var(--border-soft);
}

/* 2. Proof strip — flip dark for instant contrast and rhythm */
.proof-strip {
  background: #15393C;
  padding-block: var(--space-10);
}

.proof-strip .proof-strip__inner {
  border-color: rgba(255, 255, 255, 0.1);
}

.proof-strip .proof-strip__item {
  border-color: rgba(255, 255, 255, 0.1);
}

.proof-strip .proof-strip__label {
  color: rgba(255, 255, 255, 0.48);
}

.proof-strip .proof-strip__item strong {
  color: #EDF4F1;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-md);
  line-height: 1.3;
}

@media (max-width: 880px) {
  .proof-strip .proof-strip__item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  .proof-strip .proof-strip__item:last-child {
    border-bottom: none;
  }
}

/* 3. Section eyebrows — pill badge style */
.section-head__eyebrow,
.page-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  background: color-mix(in oklab, var(--primary) 10%, var(--surface));
  color: var(--primary);
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in oklab, var(--primary) 20%, transparent);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: var(--space-4);
}

/* 4. Four-pillar cards — each with a distinct top accent */
.how-grid--four .how-card {
  border-top: 3px solid transparent;
}

.how-grid--four .how-card:nth-child(1) {
  border-top-color: var(--primary);
}
.how-grid--four .how-card:nth-child(1) .how-card__icon {
  background: color-mix(in oklab, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

.how-grid--four .how-card:nth-child(2) {
  border-top-color: var(--warm);
}
.how-grid--four .how-card:nth-child(2) .how-card__icon {
  background: color-mix(in oklab, var(--warm) 22%, var(--surface));
  color: #A3492E;
}

.how-grid--four .how-card:nth-child(3) {
  border-top-color: var(--accent);
}
.how-grid--four .how-card:nth-child(3) .how-card__icon {
  background: color-mix(in oklab, var(--accent) 18%, var(--surface));
  color: #1E5F62;
}

.how-grid--four .how-card:nth-child(4) {
  border-top-color: var(--ink-muted);
}
.how-grid--four .how-card:nth-child(4) .how-card__icon {
  background: color-mix(in oklab, var(--ink) 8%, var(--surface));
  color: var(--ink);
}

/* 5. How-it-works cards (3-col) — transparent on alt bg */
.section--alt .how-grid--three .how-card {
  background: transparent;
  border-color: var(--border-soft);
}

/* 6. Belief quote section */
.belief {
  background: #15393C;
  padding-block: clamp(var(--space-16), 10vw, var(--space-24));
}

.belief__inner {
  text-align: center;
  max-width: 52ch;
  margin-inline: auto;
}

.belief__quote {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1rem + 3vw, 3rem);
  font-weight: 400;
  line-height: 1.18;
  color: #EDF4F1;
  letter-spacing: 0;
  font-style: italic;
}

.belief__attr {
  margin: var(--space-8) 0 0;
  font-size: var(--text-sm);
  color: rgba(242, 237, 227, 0.48);
  letter-spacing: 0.06em;
}

/* 7. About Matthew — warm section background */
#about {
  background:
    linear-gradient(180deg,
      color-mix(in oklab, var(--warm) 14%, var(--bg)) 0%,
      var(--bg) 100%);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

/* 8. Classes section — slightly warmer bg */
.classes {
  background:
    linear-gradient(180deg,
      var(--bg) 0%,
      color-mix(in oklab, var(--bg-alt) 35%, var(--bg)) 100%);
}

/* 9. Bigger, bolder section headings */
.section-head__title {
  font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.2rem);
}

/* 10. Hero headline scale bump */
.hero__title {
  font-size: clamp(2.6rem, 1.4rem + 4.8vw, 4.5rem);
  max-width: 16ch;
  line-height: 1.06;
}

/* 11. Credential box — slightly more styled */
.hero__credential {
  background: color-mix(in oklab, var(--warm) 8%, var(--surface));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-3) var(--space-4);
  border-left-width: 3px;
}

/* 12. Featured class card — richer gradient */
.product-card--featured {
  background:
    linear-gradient(135deg,
      color-mix(in oklab, var(--primary) 8%, var(--surface)) 0%,
      var(--surface) 55%);
}

/* 13. Waitlist section — stronger warm gradient */
.signup {
  background:
    linear-gradient(160deg,
      color-mix(in oklab, var(--warm) 28%, var(--bg-alt)) 0%,
      color-mix(in oklab, var(--primary) 8%, var(--bg-alt)) 100%);
}

/* dark mode adjustments for belief section */
[data-theme="dark"] .belief {
  background: #0E2A2D;
}
[data-theme="dark"] .belief__quote {
  color: #EDF4F1;
}
[data-theme="dark"] #about {
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--warm) 8%, var(--bg)) 0%,
    var(--bg) 100%);
}

/* =========================================================
   Image & frame polish pass
   ========================================================= */

/* Hero photo is portrait (tall) inside a square frame —
   shift focus upward so the parent/child faces are visible */
.hero__media img {
  object-position: center 18%;
}

/* Matthew's portrait — show face, not midriff */
.about-preview__media img {
  object-position: center 12%;
}

/* Scrolled header: stronger shadow for clear elevation */
.site-header.is-scrolled {
  background: color-mix(in oklab, var(--bg) 96%, transparent);
  box-shadow: 0 1px 0 var(--border-soft), 0 4px 20px rgba(28, 34, 31, 0.07);
}

/* Page-hero visual frame: slight warm tint as background while image loads */
.page-hero__visual {
  background: color-mix(in oklab, var(--warm) 18%, var(--surface-2));
}

/* Hero media placeholder — prevents jarring blank white while loading */
.hero__media {
  background: color-mix(in oklab, var(--warm) 12%, var(--surface-2));
}

/* About photo placeholder */
.about-preview__media {
  background: color-mix(in oklab, var(--warm) 10%, var(--surface-2));
}

/* Smooth image fade-in once loaded — prevents hard pop */
img {
  transition: opacity 0.25s ease;
}

/* Brand mark in header: slightly larger and with a more polished pad */
.site-header .brand__mark {
  width: 38px;
  height: 38px;
}

/* Dark mode: swap to transparent logo so the white fill doesn't show */
[data-theme="dark"] .brand__mark {
  background: transparent;
  border-color: transparent;
  content: url("/assets/img/original-logo-mark-no-words-transparent.png");
}

/* Tools SVG graphic — constrain and center it nicely inside its frame */
.page-hero__visual--graphic img {
  padding: clamp(8px, 4%, 24px);
  object-fit: contain;
  object-position: center;
}

/* Print: ensure images print at proper scale */
@media print {
  img { max-width: 100%; }
  .hero__media { aspect-ratio: 4 / 3; }
}

/* =========================================================
   Scroll animations — animate.js companion styles
   ========================================================= */

@media (prefers-reduced-motion: no-preference) {

  /* Base hidden state — fade up */
  [data-animate] {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity  0.55s cubic-bezier(0.25, 0.1, 0.25, 1),
      transform 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
    transition-delay: var(--anim-delay, 0ms);
  }

  /* Fade-only variant: data-animate="fade" */
  [data-animate="fade"] {
    transform: none;
  }

  /* Revealed state — JS adds .is-visible */
  [data-animate].is-visible {
    opacity: 1;
    transform: none;
  }

}

/* =========================================================
   Hover transitions — cards
   ========================================================= */

.how-card,
.product-card,
.tool-card,
.article-card,
.featured-tool {
  transition:
    transform  0.22s cubic-bezier(0.25, 0.1, 0.25, 1),
    box-shadow 0.22s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.how-card:hover,
.tool-card:hover,
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Product cards: more subtle lift (featured card is large) */
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* =========================================================
   Hover transitions — buttons
   ========================================================= */

.btn {
  transition:
    background-color 0.18s ease,
    color            0.18s ease,
    border-color     0.18s ease,
    box-shadow       0.18s ease,
    transform        0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.btn:hover {
  transform: translateY(-1px) scale(1.015);
}

.btn:active {
  transform: translateY(0) scale(0.985);
  transition-duration: 0.08s;
}

/* =========================================================
   Hover transitions — nav links (sliding underline)
   ========================================================= */

.nav__link {
  position: relative;
  transition: color 0.18s ease;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nav__link:hover::after {
  transform: scaleX(1);
}

/* Keep the active-page underline visible but static */
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* =========================================================
   Hover transitions — footer & inline links
   ========================================================= */

.footer-list a,
.footer-elsewhere a {
  transition: color 0.15s ease;
}

/* =========================================================
   Tidepool accent motifs — injected by decor.js into the
   site's dead spaces, with gentle scroll-linked motion
   ========================================================= */

/* Hosts get a stacking context so motifs can sit behind the
   content (z-index: -1) but above the section's background */
.page-hero,
.class-hero,
.article-hero,
.tool-hero,
.signup,
.cta-strip,
.article-cta {
  position: relative;
  z-index: 0;
  overflow: hidden;
}

.gms-decor {
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
.gms-decor svg { display: block; width: 100%; height: auto; }

/* Placement per dead space */
.gms-decor--hero-rings { top: -90px; right: -80px; width: min(38vw, 430px); }
.gms-decor--hero-sprig { left: 2px; bottom: 7%; width: clamp(60px, 7vw, 96px); }
.gms-decor--band-rings { left: -90px; bottom: -120px; width: min(36vw, 360px); }
.gms-decor--card-seeds { top: 8px; right: 12px; width: 76px; opacity: 0.55; }

@media (max-width: 1240px) {
  .gms-decor--hero-sprig { display: none; }
}
@media (max-width: 860px) {
  .gms-decor--hero-rings { width: 270px; top: -70px; right: -70px; opacity: 0.65; }
  .gms-decor--band-rings { width: 230px; left: -70px; bottom: -90px; opacity: 0.6; }
}

/* Shape colors follow the theme tokens, so dark mode is automatic */
.gms-c-ring1 { stroke: var(--accent-soft); }
.gms-c-ring2 { stroke: color-mix(in oklab, var(--accent-soft) 70%, var(--accent)); }
.gms-c-dash  { stroke: var(--accent); stroke-opacity: 0.28; }
.gms-c-arc   { stroke: var(--warm); stroke-opacity: 0.32; }
.gms-c-seed  { fill: var(--warm); fill-opacity: 0.6; }
.gms-c-seed2 { fill: var(--accent); fill-opacity: 0.5; }
.gms-c-stem  { stroke: var(--accent); stroke-opacity: 0.55; }
.gms-c-leaf1 { fill: var(--accent-soft); }
.gms-c-leaf2 { fill: color-mix(in oklab, var(--accent-soft) 70%, var(--accent)); }

[data-theme="dark"] .gms-decor { opacity: 0.55; }
[data-theme="dark"] .gms-decor--card-seeds { opacity: 0.35; }

/* ---- Motion (html.gms-motion = JS present + motion welcome) ---- */

[data-drift] { will-change: transform; }

/* Draw-in: shapes surface one by one the first time a motif is seen */
.gms-motion .gms-reveal :where(circle, path) {
  opacity: 0;
  transition: opacity 0.9s ease;
}
.gms-motion .gms-reveal.is-visible :where(circle, path) { opacity: 1; }
.gms-motion .gms-reveal :where(circle, path):nth-child(2) { transition-delay: 100ms; }
.gms-motion .gms-reveal :where(circle, path):nth-child(3) { transition-delay: 200ms; }
.gms-motion .gms-reveal :where(circle, path):nth-child(4) { transition-delay: 300ms; }
.gms-motion .gms-reveal :where(circle, path):nth-child(5) { transition-delay: 400ms; }
.gms-motion .gms-reveal :where(circle, path):nth-child(6) { transition-delay: 500ms; }
.gms-motion .gms-reveal :where(circle, path):nth-child(7) { transition-delay: 600ms; }
.gms-motion .gms-reveal :where(circle, path):nth-child(8) { transition-delay: 700ms; }

/* Slow floating bob; the dashed ring turns almost imperceptibly */
@keyframes gms-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-16px); }
}
@keyframes gms-spin {
  to { transform: rotate(360deg); }
}
.gms-motion .gms-float { animation: gms-float 5.5s ease-in-out infinite alternate; }
.gms-motion .gms-float--slow { animation-duration: 8s; }
.gms-motion .gms-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: gms-spin 50s linear infinite;
}

