/* Tristan Foo Chiropractic
   Palette taken from the logo: pine green, a pale lichen green, and the sunrise yellow. */
:root {
  --pine: #17351c;
  --pine-2: #234a29;
  --lichen: #dfe6cf;
  --white: #ffffff;
  --sun: #f0b429;
  --ink: #142016;
  --stone: #5d675e;
  --rule: #c5cfb4;

  --display: "Archivo", "Arial Narrow", sans-serif;
  --text: "Archivo", system-ui, sans-serif;

  /* Type scale: one family, six steps, fluid between ~360px and ~1440px screens */
  --fs-sm:    clamp(0.9375rem, 0.91rem + 0.12vw, 1rem);      /* 15 → 16  labels, footer */
  --fs-body:  clamp(1.0625rem, 1.03rem + 0.14vw, 1.125rem);  /* 17 → 18  reading text */
  --fs-lead:  clamp(1.1875rem, 1.1rem + 0.35vw, 1.4375rem);  /* 19 → 23  intros */
  --fs-h3:    clamp(1.5rem, 1.29rem + 0.93vw, 2.125rem);     /* 24 → 34  list titles */
  --fs-num:   clamp(1.875rem, 1.6rem + 1.2vw, 2.75rem);      /* 30 → 44  phone numbers, quote */
  --fs-h2:    clamp(2.25rem, 1.5rem + 3.33vw, 4.5rem);       /* 36 → 72  section headings */
  /* h1 is sized to its own column (container units) so it is always the largest thing on screen */

  --space-section: clamp(72px, 4rem + 4.5vw, 128px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h, 80px) + 12px); }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
@media (min-width: 1600px) { .wrap { max-width: 1400px; padding: 0 48px; } }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--sun); color: var(--ink); padding: 8px 12px; }

/* Display type: tall and narrow, like race signage */
h1, h2, h3, .call-num, .clinic-phone, .code-text, .conditions dt {
  font-family: var(--display);
  font-variation-settings: "wdth" 68;
  font-weight: 800;
  letter-spacing: -0.005em;
  line-height: .95;
}
h2 { font-size: var(--fs-h2); margin: 0 0 .55em; text-wrap: balance; }
h3 { font-size: var(--fs-h3); margin: 0 0 .4em; line-height: 1; }

.prose p { text-wrap: pretty; max-width: 35em; }
.lead { font-size: var(--fs-lead); line-height: 1.5; text-wrap: pretty; }

/* Header */
.top { background: var(--pine); color: var(--white); position: sticky; top: 0; z-index: 40; transition: box-shadow .3s; }
.top.is-stuck { box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 10px 30px -18px rgba(0,0,0,.6); }
.top-inner { transition: padding .3s; }
.top.is-stuck .top-inner { padding-top: 10px; padding-bottom: 10px; }
.brand img { transition: width .3s, height .3s; }
.top.is-stuck .brand img { width: 44px; height: 44px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; font-weight: 600; font-size: var(--fs-body); line-height: 1.2; }
.brand img { width: 64px; height: 64px; }
.menu { display: flex; gap: clamp(20px, 2.4vw, 36px); font-size: var(--fs-body); }
.menu a { text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.menu a:hover { border-color: var(--sun); }
.menu .menu-book, .book-btn {
  background: var(--sun); color: var(--ink); font-weight: 700; text-decoration: none;
  padding: 9px 20px; border: 0; border-radius: 2px;
}
.menu .menu-book:hover, .book-btn:hover { background: #ffc94d; }
.book-btn { display: none; }
.menu-btn { display: none; }

/* Hero */
.hero { background: var(--pine); color: var(--white); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 56px; align-items: end; padding-top: 48px; }
.hero-text { padding-bottom: 72px; container-type: inline-size; }
.hero h1 { font-size: 11vw; font-size: min(17.5cqi, 12.5vh, 8.5rem); line-height: .9; margin: 0 0 .32em; font-weight: 900; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero h1 .line > span { display: block; white-space: nowrap; animation: rise .9s cubic-bezier(.2, .7, .1, 1) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: .08s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .16s; }
.hero h1 .line:nth-child(4) > span { animation-delay: .24s; }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }

.hero-sub { font-size: var(--fs-lead); line-height: 1.5; max-width: 28em; color: var(--lichen); margin-bottom: 40px; text-wrap: pretty; }
.hero-call { display: flex; flex-wrap: wrap; gap: 14px 48px; margin-bottom: 24px; }
.call { text-decoration: none; display: block; }
.call-where { display: block; font-size: var(--fs-sm); color: var(--lichen); margin-bottom: 6px; }
.call-num { display: block; font-size: var(--fs-num); color: var(--sun); font-weight: 700; }
.call:hover .call-num { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.hero-mobile { color: var(--lichen); font-size: var(--fs-sm); }
.hero-mobile a { color: var(--white); }

.hero-photo { margin: 0; align-self: end; }
.hero-photo img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 999px 999px 0 0;   /* the rising-sun arch from the logo */
  background: var(--pine-2);
}

/* Story */
.story { padding: var(--space-section) 0 0; }
.story-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 56px; }
.wide-photo { margin: 96px 0 0; }
.wide-photo img { width: 100%; max-height: 78vh; object-fit: cover; background: var(--lichen); }
.pull { margin: 0; padding: clamp(56px, 7vw, 104px) 0 var(--space-section); }
.pull p {
  text-wrap: balance;
  font-family: var(--display); font-variation-settings: "wdth" 68; font-weight: 700;
  font-size: var(--fs-num); line-height: 1.05; color: var(--pine);
  max-width: 22em; margin: 0;
}
.pull p::before { content: "“"; color: var(--sun); }
.pull p::after { content: "”"; color: var(--sun); }

/* What I treat */
.treat { padding: 0 0 var(--space-section); }
.treat-head { display: grid; grid-template-columns: 1fr 2fr; gap: 56px; margin-bottom: 40px; }
.treat-head p { font-size: var(--fs-lead); line-height: 1.5; color: var(--stone); max-width: 30em; margin-top: .3em; text-wrap: pretty; }
.conditions { margin: 0; border-bottom: 2px solid var(--pine); }
.conditions > div { display: grid; grid-template-columns: 1fr 2fr; gap: 56px; padding: 26px 0; border-top: 2px solid var(--pine); align-items: baseline; }
.conditions dt { font-size: var(--fs-h3); line-height: 1; color: var(--pine); }
.conditions dd { margin: 0; color: var(--stone); max-width: 32em; }

/* How I work */
.how { background: var(--lichen); padding: var(--space-section) 0; }
.how-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 72px; align-items: start; }
.techniques { background: var(--white); padding: 36px 36px 28px; }
.techniques h3 { font-family: var(--text); font-variation-settings: "wdth" 100; font-weight: 600; font-size: var(--fs-body); line-height: 1.4; color: var(--pine); }
.techniques ul { list-style: none; margin: 20px 0 0; padding: 0; columns: 2; column-gap: 28px; }
.techniques li { break-inside: avoid; padding: 9px 0; border-top: 1px solid var(--rule); line-height: 1.35; }

/* Sport */
.sport { background: var(--pine); color: var(--white); padding: var(--space-section) 0; }
.sport-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 72px; align-items: start; }
.sport-intro { color: var(--lichen); font-size: var(--fs-lead); line-height: 1.5; margin: -.2em 0 clamp(32px, 4vw, 56px); max-width: 30em; }
.tiers { display: grid; gap: clamp(32px, 4vw, 48px); }
.tier h3 { color: var(--sun); font-size: var(--fs-h3); margin-bottom: .5em; }
.tier ul { list-style: none; margin: 0; padding: 0; }
.tier li { padding: 14px 0; border-top: 1px solid rgba(255,255,255,.18); display: grid; gap: 2px; }
.t-name { font-weight: 600; color: var(--white); line-height: 1.35; }
.t-when { font-size: var(--fs-sm); color: var(--lichen); }
.tier-world .t-name { font-size: var(--fs-lead); }
.sport-photos { position: sticky; top: calc(var(--header-h, 80px) + 24px); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sport-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--pine-2); }
.sport-photos img:last-child { margin-top: 72px; }

/* Barefoot */
.feet { padding: var(--space-section) 0; }
.feet-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 72px; align-items: center; }
.code {
  font: inherit; cursor: pointer; border: 0; text-align: left;
  background: var(--pine); color: var(--white); padding: 32px 36px;
  display: grid; gap: 10px;
}
.code-text { font-size: var(--fs-h2); color: var(--sun); letter-spacing: .02em; }
.code-hint { color: var(--lichen); font-size: var(--fs-sm); }
.code:hover .code-hint { color: var(--white); text-decoration: underline; }

/* Book */
.book { padding: var(--space-section) 0; border-top: 2px solid var(--pine); }
.book h2 { color: var(--pine); margin-bottom: 12px; }
.book-intro { font-size: var(--fs-lead); color: var(--stone); margin-bottom: clamp(36px, 4vw, 56px); }
.clinics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.clinic { border-top: 6px solid var(--pine); padding-top: 24px; }
.clinic h3 { color: var(--stone); font-family: var(--text); font-variation-settings: "wdth" 100; font-weight: 600; font-size: var(--fs-sm); line-height: 1.3; margin-bottom: .6em; }
.clinic-phone { display: inline-block; font-size: var(--fs-num); color: var(--pine); text-decoration: none; margin-bottom: 18px; }
.clinic-phone:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.clinic-email { font-size: var(--fs-lead); font-family: var(--text); font-variation-settings: "wdth" 100; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.clinic p { color: var(--stone); }
.clinic-links { display: flex; gap: 24px; flex-wrap: wrap; }
.clinic-links a { color: var(--pine); font-weight: 600; text-underline-offset: 4px; }

/* Footer: closes the page the way the hero opens it, with the sun on the horizon */
.foot { background: var(--pine); color: var(--lichen); padding-top: var(--space-section); overflow: hidden; }
.foot a { color: var(--white); text-decoration: none; }
.foot a:hover { color: var(--sun); }
.foot-top {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px 72px; align-items: end;
  padding-bottom: clamp(48px, 6vw, 80px); border-bottom: 1px solid rgba(255,255,255,.16);
}
.foot-line {
  margin: 0; color: var(--white); text-wrap: balance;
  font-family: var(--display); font-variation-settings: "wdth" 68; font-weight: 800;
  font-size: var(--fs-h2); line-height: .95;
}
.foot-calls { display: grid; gap: 18px; }
.foot-calls a {
  display: grid; color: var(--sun);
  font-family: var(--display); font-variation-settings: "wdth" 68; font-weight: 700;
  font-size: var(--fs-num); line-height: 1;
}
.foot-calls span { font-family: var(--text); font-variation-settings: "wdth" 100; font-weight: 400; font-size: var(--fs-sm); color: var(--lichen); margin-bottom: 6px; }
.foot-calls a:hover { color: #ffc94d; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }

.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding: clamp(48px, 6vw, 72px) 0 clamp(24px, 3vw, 40px); font-size: var(--fs-sm); line-height: 1.55; }
.foot-brand img { width: 120px; height: 120px; margin-bottom: 18px; }
.foot-brand p { margin: 0; }
.foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.foot-col h4 { margin: 0 0 4px; font-family: var(--text); font-variation-settings: "wdth" 100; font-weight: 700; font-size: var(--fs-sm); color: var(--sun); line-height: 1.3; }
.foot-col p { margin: 0; max-width: 22em; }
.foot-col strong { color: var(--white); letter-spacing: .04em; }

.horizon { display: flex; justify-content: center; }
.foot-sun { width: min(640px, 92%); height: auto; display: block; overflow: visible; }
.sun-disc { fill: var(--sun); }
.foot-sun line {
  stroke: var(--sun); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
}
.foot.is-seen .foot-sun line { animation: ray .7s cubic-bezier(.3, .7, .2, 1) forwards; animation-delay: calc(var(--i) * 40ms); }
.foot-base { background: #10261a; border-top: 3px solid var(--sun); font-size: var(--fs-sm); }
.foot-base-inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.foot-base p { margin: 0; }

@media (max-width: 960px) {
  .foot-top { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; display: flex; gap: 20px; align-items: center; }
  .foot-brand img { width: 88px; height: 88px; margin: 0; }
}
@media (max-width: 520px) {
  .foot-grid { grid-template-columns: 1fr; gap: 32px; }
  .foot-calls { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .foot-sun line { stroke-dashoffset: 0; }
  .foot.is-seen .foot-sun line { animation: none; }
}

/* ---------- Illustrations ---------- */

/* Hero: the portrait arch becomes the rising sun from the logo */
.hero-photo { position: relative; }
.hero-photo img { position: relative; z-index: 1; }
.rays { position: absolute; top: 0; left: -25%; width: 150%; margin-top: -25%; overflow: visible; }
.rays line {
  stroke: var(--sun); stroke-width: 3.2; stroke-linecap: round;
  stroke-dasharray: 30; stroke-dashoffset: 30;
  animation: ray .7s cubic-bezier(.3, .7, .2, 1) forwards;
  animation-delay: calc(.45s + var(--i) * 45ms);
}
@keyframes ray { to { stroke-dashoffset: 0; } }

/* What I treat: body map */
.treat-body { display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: start; }
.map-wrap {
  position: sticky; top: calc(var(--header-h, 80px) + 20px);
  background: var(--lichen); padding: 28px 20px 20px;
  border-radius: 999px 999px 0 0;
}

.body-map { width: 100%; height: auto; max-height: calc(100vh - var(--header-h, 80px) - 140px); display: block; margin: 0 auto; }
.body-map .outline { fill: #f4f7ec; stroke: var(--pine); stroke-width: 1.8; stroke-linejoin: round; }
.body-map .detail * { fill: none; stroke: var(--pine); stroke-width: 1.3; stroke-linecap: round; opacity: .5; }
.body-map .spine * { fill: var(--lichen); stroke: var(--pine); stroke-width: 1.2; }
.body-map pattern line { stroke: #d48f12; stroke-width: 2.4; }
.body-map .zone * { fill: url(#hatch); }
.body-map .zone { opacity: 0; transition: opacity .3s; }
.body-map .zone.on { opacity: 1; }
.conditions > div { cursor: default; transition: background .25s; outline-offset: -3px; }
.conditions > div.is-active dt { color: var(--ink); }
.conditions > div.is-active dt::before { content: ""; display: inline-block; width: .5em; height: .5em; border-radius: 50%; background: var(--sun); margin-right: .35em; vertical-align: .12em; }


/* Barefoot: footprints walking up to the code */
.feet-side { display: grid; gap: 8px; justify-items: center; }
.prints { width: 150px; height: auto; fill: var(--pine); }
.prints g { opacity: .14; }
.prints g:nth-child(2) { opacity: .22; }
.prints g:nth-child(3) { opacity: .32; }
.prints g:nth-child(4) { opacity: .45; }
.feet-side .code { width: 100%; }

@media (max-width: 960px) {
  .sport-photos { position: static; max-width: 560px; }
  .treat-body { grid-template-columns: 200px 1fr; gap: 32px; }
}
@media (max-width: 720px) {
  .treat-body { grid-template-columns: 104px 1fr; gap: 18px; }
  .body-map pattern line { stroke-width: 4; }
  .map-wrap { padding: 14px 6px 8px; }
  .prints { width: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  .rays line { animation: none; stroke-dashoffset: 0; }
}

/* Tablet */
@media (max-width: 960px) {
  .hero-grid, .story-grid, .treat-head, .how-grid, .sport-grid, .feet-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-text { padding-bottom: 0; }
  .hero-photo { max-width: 420px; justify-self: center; width: 100%; margin-top: clamp(64px, 16vw, 120px); }
  .conditions > div { grid-template-columns: 1fr; gap: 8px; }
  .clinics { grid-template-columns: 1fr; gap: 40px; }
  .story-grid h2 { margin-bottom: 0; }
}

/* Tablet portrait: hero is single-column, so keep the headline from dominating the screen */
@media (min-width: 721px) and (max-width: 960px) {
  .hero h1 { font-size: min(13.5cqi, 6.5rem); }
}

/* Phone */
@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  .brand img { width: 48px; height: 48px; }
  .top-inner { gap: 10px; }
  .brand { margin-right: auto; }
  .brand span { max-width: 9em; }
  .book-btn { display: inline-block; padding: 8px 16px; }
  .menu .menu-book { display: none; }
  .menu-btn {
    display: block; font: inherit; font-weight: 600; color: var(--white);
    background: none; border: 1.5px solid rgba(255,255,255,.5); padding: 8px 14px; cursor: pointer;
  }
  .menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
    background: var(--pine); flex-direction: column; gap: 0; padding: 8px 20px 24px;
  }
  .menu.is-open { display: flex; }
  .menu a { padding: 14px 0; font-size: var(--fs-lead); border-bottom: 1px solid rgba(255,255,255,.15); }
  .hero-grid { padding-top: 28px; }
  .hero h1 { font-size: min(17.5cqi, 8.5rem); }
  .wide-photo { margin-top: 64px; }
  .techniques { padding: 26px 22px 18px; }
  .techniques ul { columns: 1; }  .sport-photos img:last-child { margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1 .line > span { animation: none; }
}
