/* ==========================================================================
   Machine Learning is Fun! — static site styles
   Modernist / Bauhaus system adapted from adamgeitgey.com
   ========================================================================== */

@font-face {
  font-family: "GT Standard M";
  src: url(https://static.turquoise.health/static/fonts/GT-Standard-M-Standard-Regular.woff2) format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "GT Standard M";
  src: url(https://static.turquoise.health/static/fonts/GT-Standard-M-Standard-Medium.woff2) format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "GT Standard M";
  src: url(https://static.turquoise.health/static/fonts/GT-Standard-M-Standard-Semibold.woff2) format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "GT Standard L";
  src: url(https://static.turquoise.health/static/fonts/GT-Standard-L-Standard-Medium.woff2) format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --paper:      #F8F7F1;
  --paper-2:    #FFFFFF;
  --ink:        #121313;
  --ink-soft:   #4B595C;

  --teal-deep:  #02363D;
  --teal:       #176F6F;
  --teal-bright:#36C5BA;
  --mint:       #A8E6E1;

  --clay:       #E29578;
  --amber:      #FFA632;

  --rule:       3px;
  --rule-thin:  1px;

  --font:         "GT Standard M", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "GT Standard L", "GT Standard M", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  font-family: var(--font);
  font-weight: 400;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--amber); color: var(--ink); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: var(--rule) solid var(--teal-bright); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Colour bar ---------- */
.colorbar { display: flex; height: 10px; }
.colorbar span { flex: 1; }
.colorbar span:nth-child(1) { background: var(--teal-deep); flex: 3; }
.colorbar span:nth-child(2) { background: var(--clay);      flex: 1; }
.colorbar span:nth-child(3) { background: var(--mint);      flex: 2; }
.colorbar span:nth-child(4) { background: var(--amber);     flex: 1; }
.colorbar span:nth-child(5) { background: var(--teal);      flex: 4; }

/* ---------- Top bar ---------- */
header.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: var(--rule) solid var(--ink);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 66px; }
.brand { font-size: 1.125rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.brand .bang { color: var(--teal); }
nav.top-nav { display: flex; align-items: center; gap: 28px; font-size: 0.875rem; font-weight: 500; }
nav.top-nav a { position: relative; padding-bottom: 2px; transition: box-shadow 0.12s linear; }
nav.top-nav a:hover { box-shadow: inset 0 -3px 0 var(--teal-bright); }
nav.top-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--amber); }

@media (max-width: 640px) {
  .topbar .wrap { height: auto; padding-top: 14px; padding-bottom: 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
  nav.top-nav { gap: 18px; font-size: 0.8125rem; flex-wrap: wrap; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font); font-size: 0.9375rem; font-weight: 500; line-height: 1;
  padding: 16px 22px;
  border: var(--rule) solid var(--ink);
  background: var(--paper); color: var(--ink);
  cursor: pointer;
  transition: background-color 0.12s linear, color 0.12s linear;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-solid { background: var(--teal-deep); border-color: var(--teal-deep); color: #FFFFFF; }
.btn-solid:hover { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }
.btn-mint { background: var(--mint); border-color: var(--mint); color: var(--teal-deep); }
.btn-mint:hover { background: #FFFFFF; border-color: #FFFFFF; color: var(--teal-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0; }
.btn-row .btn + .btn { border-left-width: 0; }

/* ---------- Inline links in body copy ---------- */
.prose a, .desc a, .lede a {
  color: var(--ink);
  font-weight: 500;
  box-shadow: inset 0 -0.5em 0 var(--mint);
  transition: box-shadow 0.12s linear;
}
.prose a:hover, .desc a:hover, .lede a:hover { box-shadow: inset 0 -1.1em 0 var(--mint); }

/* ---------- Hero ---------- */
.hero { border-bottom: var(--rule) solid var(--ink); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  align-items: stretch;
}
.hero-copy { padding: 88px 56px 96px 0; }
.eyebrow { display: block; margin-bottom: 26px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 1rem + 5.2vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 17ch;
}
.rule-word { box-shadow: inset 0 -0.14em 0 var(--amber); }
.rule-word.clay { box-shadow: inset 0 -0.12em 0 var(--clay); }
.hero .lede {
  margin-top: 28px;
  font-size: 1.125rem; line-height: 1.5;
  color: var(--ink-soft);
  max-width: 52ch;
  border-left: var(--rule) solid var(--clay);
  padding-left: 18px;
}
.hero .lede strong { color: var(--ink); font-weight: 600; }
.hero .btn-row { margin-top: 36px; }
.hero-art {
  border-left: var(--rule) solid var(--ink);
  background: var(--mint);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
  border-right: var(--rule) solid var(--ink);
}
.hero-art::before {
  content: ""; position: absolute;
  width: 320px; height: 320px; border-radius: 50%;
  background: var(--teal-bright); opacity: 0.35;
  right: -90px; bottom: -110px;
}
.hero-art::after {
  content: ""; position: absolute;
  left: 0; top: 0; width: 100%; height: 14px; background: var(--amber);
}
.hero-art img { position: relative; z-index: 1; max-height: 460px; width: auto; }
.hero-simple .hero-copy { padding-right: 0; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 56px 0 56px; }
  .hero-art { border-left: 0; border-right: 0; border-top: var(--rule) solid var(--ink); margin: 0 -28px; padding: 44px 28px; }
  .hero-art img { max-height: 380px; }
}

/* ---------- Section scaffold ---------- */
section.block { padding: 84px 0; border-bottom: var(--rule) solid var(--ink); }
.section-head {
  display: grid;
  grid-template-columns: 1fr minmax(0, 46ch);
  gap: 32px;
  align-items: end;
  margin-bottom: 40px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.875rem, 1rem + 2.6vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.section-head p { color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.5; }
.section-head .label { display: block; margin-bottom: 14px; }
@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- Dark (teal) section ---------- */
.dark {
  background: var(--teal-deep);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.dark::before, .dark::after { content: ""; position: absolute; pointer-events: none; }
.dark::before {
  left: -110px; bottom: -120px;
  width: 380px; height: 380px; border-radius: 50%;
  background: var(--teal);
}
.dark::after { right: 0; top: 0; width: 22px; height: 180px; background: var(--amber); }
.dark .wrap { position: relative; z-index: 1; }
.dark .label { color: var(--mint); }
.dark-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: var(--rule) solid var(--mint);
}
.dark-lead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.625rem, 0.9rem + 2vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  padding: 36px 48px 36px 0;
  border-right: var(--rule) solid var(--mint);
}
.dark-lead em { font-style: normal; color: var(--mint); }
.dark-body { padding: 36px 0 36px 48px; }
.dark-body p { color: #CBDEDD; font-size: 1.0625rem; line-height: 1.55; margin-bottom: 18px; }
.dark-body p:last-child { margin-bottom: 0; }
.dark-body p strong { color: #FFFFFF; font-weight: 600; }
.dark-body p a {
  color: #FFFFFF; font-weight: 500;
  box-shadow: inset 0 -2px 0 var(--teal-bright);
  transition: box-shadow 0.12s linear;
}
.dark-body p a:hover { box-shadow: inset 0 -0.7em 0 var(--teal); }
.dark-body h3 {
  font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em;
  color: #FFFFFF; margin-bottom: 14px;
}
.dark figure { margin-top: 32px; border: var(--rule) solid var(--mint); background: var(--paper); }
.dark figcaption {
  font-family: var(--font); letter-spacing: 0; font-weight: 400;
  font-size: 0.9375rem; line-height: 1.45; color: var(--teal-deep);
  padding: 14px 16px; border-top: var(--rule) solid var(--mint); background: var(--mint);
}
@media (max-width: 820px) {
  .dark-grid { grid-template-columns: 1fr; }
  .dark-lead { padding: 28px 0; border-right: 0; border-bottom: var(--rule) solid var(--mint); }
  .dark-body { padding: 28px 0 0; }
}

/* ---------- Article lists ---------- */
.post-list { border-top: var(--rule) solid var(--ink); }
.post {
  display: grid;
  grid-template-columns: 64px 240px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-bottom: var(--rule-thin) solid var(--ink);
  transition: background-color 0.12s linear;
}
.post:last-child { border-bottom: var(--rule) solid var(--ink); }
.post:hover { background: var(--paper-2); }
.post .num {
  font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 500; line-height: 1;
  letter-spacing: -0.03em;
  color: var(--teal);
  padding-top: 2px;
}
.post .thumb {
  display: block;
  aspect-ratio: 16 / 10;
  border: var(--rule-thin) solid var(--ink);
  background: var(--paper-2);
  overflow: hidden;
}
.post .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease; }
.post:hover .thumb img { transform: scale(1.03); }
.post .title {
  font-size: 1.3125rem; font-weight: 600; line-height: 1.22; letter-spacing: -0.015em;
}
.post .title a { transition: box-shadow 0.12s linear; }
.post .title a:hover { box-shadow: inset 0 -0.45em 0 var(--mint); }
.post .date { display: block; margin-bottom: 8px; }
.post .desc { margin-top: 10px; color: var(--ink-soft); font-size: 1rem; line-height: 1.55; max-width: 68ch; }
.post .more {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  font-size: 0.875rem; font-weight: 500;
  box-shadow: inset 0 -3px 0 var(--teal-bright);
  transition: box-shadow 0.12s linear;
}
.post .more:hover { box-shadow: inset 0 -0.8em 0 var(--mint); }
.post .more svg { width: 14px; height: 14px; }

@media (max-width: 900px) {
  .post { grid-template-columns: 200px 1fr; gap: 24px; }
  .post .num { display: none; }
}
@media (max-width: 600px) {
  .post { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- Book page: feature rows ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  border-top: var(--rule) solid var(--ink);
}
.feature + .feature { border-top-width: var(--rule-thin); }
.feature .art {
  padding: 40px 48px 40px 0;
  border-right: var(--rule) solid var(--ink);
  display: flex; align-items: flex-start; justify-content: center;
}
.feature .art img { max-height: 520px; width: auto; }
.feature .copy { padding: 40px 0 40px 48px; }
.feature .copy h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 1rem + 1.4vw, 2.125rem);
  line-height: 1.05; letter-spacing: -0.025em;
  margin-bottom: 18px;
}
.feature .copy h3 em { font-style: normal; box-shadow: inset 0 -0.14em 0 var(--amber); }
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; }
  .feature .art { padding: 32px 0; border-right: 0; border-bottom: var(--rule-thin) solid var(--ink); }
  .feature .art img { max-height: 380px; }
  .feature .copy { padding: 32px 0 8px; }
}

/* ---------- Prose ---------- */
.prose { max-width: 72ch; }
.prose p, .prose li { font-size: 1.0625rem; line-height: 1.6; color: var(--ink-soft); }
.prose p + p, .prose p + ul, .prose p + ol, .prose ul + p, .prose ol + p { margin-top: 16px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose h3 { font-size: 1.1875rem; font-weight: 600; color: var(--ink); margin: 28px 0 10px; letter-spacing: -0.01em; }
.prose ul, .prose ol { list-style: none; border-top: var(--rule-thin) solid var(--ink); }
.prose ul > li, .prose ol > li {
  position: relative;
  padding: 12px 0 12px 40px;
  border-bottom: var(--rule-thin) solid var(--ink);
}
.prose ul > li::before {
  content: ""; position: absolute; left: 4px; top: 21px;
  width: 10px; height: 10px; background: var(--teal);
}
.prose ul > li:nth-child(3n+2)::before { background: var(--clay); border-radius: 50%; }
.prose ul > li:nth-child(3n)::before { background: var(--amber); }
.prose ol { counter-reset: n; }
.prose ol > li { counter-increment: n; }
.prose ol > li::before {
  content: counter(n, decimal-leading-zero);
  position: absolute; left: 0; top: 13px;
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em;
  color: var(--teal);
}
.prose ul ul { border-top: 0; margin-top: 8px; }
.prose ul ul > li { padding: 6px 0 6px 26px; border-bottom: 0; font-size: 1rem; }
.prose ul ul > li::before { width: 6px; height: 6px; top: 16px; left: 6px; background: var(--ink-soft) !important; border-radius: 0 !important; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: var(--rule) solid var(--ink);
}
.two-col > div { padding: 36px 48px 36px 0; }
.two-col > div + div { padding: 36px 0 36px 48px; border-left: var(--rule) solid var(--ink); }
.two-col h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.5rem, 1rem + 1.4vw, 2.125rem);
  line-height: 1.05; letter-spacing: -0.025em; margin-bottom: 18px;
}
@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col > div { padding: 32px 0; }
  .two-col > div + div { padding: 32px 0; border-left: 0; border-top: var(--rule-thin) solid var(--ink); }
}

/* ---------- Pricing ---------- */
.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--rule);
  border: var(--rule) solid var(--ink);
  background: var(--ink);
}
.plan { display: flex; flex-direction: column; background: var(--paper-2); }
.plan .plan-art { border-top: 12px solid var(--mint); border-bottom: var(--rule) solid var(--ink); background: #FFFFFF; }
.plan:nth-child(2) .plan-art { border-top-color: var(--amber); }
.plan:nth-child(3) .plan-art { border-top-color: var(--clay); }
.plan .plan-art img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.plan .plan-body { padding: 28px 28px 32px; display: flex; flex-direction: column; flex: 1; }
.plan h3 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; }
.plan .price {
  font-family: var(--font-display); font-weight: 500;
  font-size: 3rem; line-height: 1; letter-spacing: -0.04em;
  margin: 14px 0 22px;
}
.plan .price small { font-size: 1rem; letter-spacing: 0; color: var(--ink-soft); font-family: var(--font); font-weight: 500; margin-left: 4px; }
.plan .prose { flex: 1; }
.plan .prose li { font-size: 0.9375rem; }
.plan .btn { margin-top: 28px; justify-content: space-between; }
.plan-featured .plan-body { background: var(--paper); }
@media (max-width: 900px) {
  .pricing { grid-template-columns: 1fr; }
  .plan .plan-art img { aspect-ratio: 4 / 3; }
}

/* ---------- FAQ ---------- */
.faq { border-top: var(--rule) solid var(--ink); }
.faq-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 48px;
  padding: 32px 0;
  border-bottom: var(--rule-thin) solid var(--ink);
}
.faq-item:last-child { border-bottom: var(--rule) solid var(--ink); }
.faq-item h3 { font-size: 1.1875rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
@media (max-width: 820px) {
  .faq-item { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  border-top: var(--rule) solid var(--ink);
}
.about-photo { padding: 40px 48px 40px 0; border-right: var(--rule) solid var(--ink); }
.about-photo .frame { position: relative; }
.about-photo .frame::before {
  content: ""; position: absolute; inset: 16px -16px -16px 16px;
  background: var(--mint); z-index: 0;
}
.about-photo img { position: relative; z-index: 1; width: 100%; border: var(--rule) solid var(--ink); }
.about-copy { padding: 40px 0 40px 48px; }
.about-copy .prose p { font-size: 1.1875rem; line-height: 1.55; }
.about-copy .btn-row { margin-top: 36px; }
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { padding: 32px 16px 48px 0; border-right: 0; border-bottom: var(--rule) solid var(--ink); max-width: 420px; }
  .about-copy { padding: 32px 0 0; }
}

/* ---------- Callout ---------- */
.callout {
  margin-top: 40px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  padding: 24px 28px;
  border: var(--rule) solid var(--ink);
  background: var(--paper-2);
}
.callout p { font-size: 1.0625rem; color: var(--ink-soft); max-width: 60ch; }
.callout p strong { color: var(--ink); }

/* ---------- Footer ---------- */
footer.foot { background: var(--ink); color: var(--paper); }
.foot .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 28px; padding-bottom: 28px;
}
.foot .copy { font-size: 0.875rem; color: #9BA3A3; }
.foot .social { display: flex; flex-wrap: wrap; gap: 0; font-size: 0.875rem; font-weight: 500; }
.foot .social a {
  padding: 6px 14px;
  box-shadow: inset 0 0 0 1px #3A3D3D;
  transition: background-color 0.12s linear, color 0.12s linear;
}
.foot .social a + a { margin-left: -1px; }
.foot .social a:hover { background: var(--mint); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01s !important; }
}
