/* Design option B: Welcome. Warm and friendly, like meeting him: a warm off-white page, deep
   ink for words, his teal for buttons and the close (the deeper shade, #006E82, wherever white
   words sit on it), rounded corners, and Rethink Sans throughout. */
@font-face { font-family: 'Rethink Sans'; src: url(/fonts/rethink-sans-400-700.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #F5F3EF; --white: #FFFFFF; --ink: #0B2A33; --soft: #4A5C61; --teal: #0197B2; --teal-deep: #006E82; --line: #D9D4CA;
  --ease: cubic-bezier(.23, 1, .32, 1); --r: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.55 'Rethink Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.025em; line-height: 1.04; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(36px, 4.6vw, 60px); }
p { margin: 0; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }
:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 3px; border-radius: 6px; }
.close :focus-visible { outline-color: #fff; }
.ic { flex: none; }
.sub { font-size: 20px; color: var(--soft); max-width: 40ch; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 24px; border-radius: 999px; font: 600 17px/1.1 'Rethink Sans', system-ui, sans-serif; text-decoration: none; border: 2px solid transparent; transition: transform .16s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease); }
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translateY(-1px); } .play:hover .play-dot { transform: scale(1.08); } }
.btn:active { transform: scale(.97); }
.btn-teal { background: var(--teal-deep); color: #fff; }
.btn-teal:hover { background: var(--ink); }
.btn-plain { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-plain:hover { border-color: var(--ink); }
.btn-white { background: #fff; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(245, 243, 239, .94); backdrop-filter: blur(8px); }
.top-row { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; min-height: 48px; }
.brand img { width: 76px; }
.nav { display: none; gap: 8px; margin-left: auto; }
.nav a { padding: 10px 14px; border-radius: 999px; font-weight: 500; text-decoration: none; transition: background-color .2s var(--ease); }
.nav a:hover { background: var(--white); }
.top-cta { display: none; }
.menu { margin-left: auto; position: relative; }
.menu summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 999px; background: var(--white); font-weight: 600; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border-radius: 16px; min-width: 220px; border: 1px solid var(--line); }
.menu-panel ul { list-style: none; margin: 0; padding: 8px; }
.menu-panel a { display: block; padding: 12px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.menu-panel a:hover { background: var(--paper); }
@media (min-width: 960px) { .nav, .top-cta { display: flex; } .menu { display: none; } }

/* Hero: one rounded frame with his photo, the words in a box at its foot */
.hero { padding: 8px 0 16px; }
.frame { position: relative; border-radius: var(--r); overflow: hidden; background: var(--teal); display: grid; }
.frame-img { width: 100%; height: 360px; object-fit: cover; object-position: 50% 22%; }
.frame-box { background: var(--white); padding: 28px 20px 24px; }
.frame-box h1 { font-size: clamp(38px, 5.4vw, 68px); margin-bottom: 16px; }
.frame-box .lead { font-size: 18px; color: var(--soft); margin-bottom: 24px; max-width: 46ch; }
.play { position: absolute; left: 16px; top: 296px; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--white); text-decoration: none; font-weight: 600; font-size: 16px; }
.play-dot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--teal-deep); color: #fff; transition: transform .2s var(--ease); }
@media (min-width: 900px) {
  .frame { display: block; height: calc(100svh - 128px); min-height: 600px; max-height: 900px; }
  .frame-img { position: absolute; top: 0; right: 0; bottom: 0; width: 52%; height: 100%; object-position: 50% 20%; }
  .frame-box { position: absolute; left: 32px; bottom: 32px; width: calc(48% + 40px); max-width: 640px; padding: 40px; border-radius: 16px; }
  .play { top: auto; left: auto; right: 32px; bottom: 32px; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .frame-img { animation: settle 1.2s var(--ease) both; }
  .js .frame-box { animation: rise .7s var(--ease) .15s both; }
  .js .play { animation: rise .7s var(--ease) .3s both; }
}
@keyframes settle { from { transform: scale(1.04); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* Training: the list on the left, each one's photo on the right as you point at it */
.train { padding: 96px 0; }
.train-grid { display: grid; gap: 40px; }
.train-list h2 { margin-bottom: 16px; }
.train-list .sub { margin-bottom: 40px; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row a { display: grid; gap: 6px; padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.row a > span { transition: transform .25s var(--ease); }
.row-name { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.row-line { color: var(--soft); max-width: 48ch; }
.row a:hover .row-name, .row a:focus-visible .row-name { color: var(--teal-deep); }
.train-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tp { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }
@media (min-width: 900px) {
  .train-grid { grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: start; }
  .row a:hover > span, .row a:focus-visible > span { transform: translateX(12px); }
  .train-photos { display: block; position: sticky; top: 100px; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--line); }
  .tp { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; border-radius: 0; opacity: 0; transition: opacity .35s var(--ease); }
  .tp-0 { opacity: 1; }
  .train-grid:has(.row:nth-child(2) a:is(:hover, :focus-visible)) .tp-1,
  .train-grid:has(.row:nth-child(3) a:is(:hover, :focus-visible)) .tp-2 { opacity: 1; }
  .train-grid:has(.row:nth-child(2) a:is(:hover, :focus-visible)) .tp-0,
  .train-grid:has(.row:nth-child(3) a:is(:hover, :focus-visible)) .tp-0 { opacity: 0; }
}

/* Hey, I'm David */
.about { padding: 96px 0; background: var(--white); }
.about-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.1fr .9fr; gap: 64px; } }
.about-text h2 { margin-bottom: 24px; }
.about blockquote { margin: 0 0 24px; font-size: clamp(26px, 2.8vw, 36px); line-height: 1.2; font-weight: 500; letter-spacing: -.02em; color: var(--teal-deep); }
.about-text p + p { margin-top: 16px; }
.about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.about-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r); }

/* Getting started: three steps joined by a line */
.steps { padding: 96px 0; }
.steps h2 { margin-bottom: 48px; }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; position: relative; }
@media (min-width: 760px) {
  .step-list { grid-template-columns: repeat(3, 1fr); }
  .step-list::before, .step-list::after { content: ''; position: absolute; left: 28px; right: 33%; top: 27px; height: 4px; border-radius: 2px; background: var(--line); }
  .step-list::after { background: var(--teal-deep); transform-origin: 0 50%; }
}
.step-list li { position: relative; }
.step-no { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--teal-deep); color: #fff; font-weight: 700; font-size: 22px; margin-bottom: 20px; position: relative; }
.step-list h3 { font-size: 26px; margin-bottom: 8px; }
.step-list p { color: var(--soft); max-width: 34ch; }

/* Like a workout tracker, once as it arrives (options.js adds .in; only with motion allowed): the
   bar fills, and each step ticks off as the fill reaches it, with a little bounce */
.mo .step-list::after { transition: transform 1.3s cubic-bezier(.65, 0, .35, 1) .2s; }
.mo .step-list:not(.in)::after { transform: scaleX(0); }
.mo .step-list .step-no { transition: background-color .25s ease calc(.2s + var(--i) * .6s), color .25s ease calc(.2s + var(--i) * .6s), box-shadow .25s ease calc(.2s + var(--i) * .6s), transform .45s cubic-bezier(.34, 1.56, .64, 1) calc(.2s + var(--i) * .6s); }
.mo .step-list:not(.in) .step-no { background: var(--white); color: var(--teal-deep); box-shadow: inset 0 0 0 2px var(--line); transform: scale(.86); }

/* Circuits */
.circuits { padding: 0 0 96px; }
.circ-grid { display: grid; gap: 40px; align-items: center; background: var(--white); border-radius: var(--r); padding: 32px 20px; }
@media (min-width: 900px) { .circ-grid { grid-template-columns: 1fr 1fr; gap: 56px; padding: 48px; } }
.circ-text h2 { margin-bottom: 16px; }
.facts { margin: 28px 0 32px; }
.facts div { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--soft); }
.circ-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; }

/* Where to find David */
.where { padding: 0 0 96px; }
.where h2 { margin-bottom: 32px; }
.where-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 32px; }
@media (min-width: 760px) { .where-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .where-list { grid-template-columns: repeat(4, 1fr); } }
.where-list li { display: grid; gap: 4px; padding: 20px 0; border-top: 2px solid var(--ink); align-content: start; }
.w-name { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.w-town { color: var(--soft); }
.w-what { color: var(--teal-deep); font-weight: 600; }

/* The close, on his teal */
.close { padding: 0 0 96px; }
.close-in { background: var(--teal-deep); color: #fff; border-radius: var(--r); padding: 56px 20px; text-align: center; display: grid; justify-items: center; gap: 20px; }
.close h2 { font-size: clamp(40px, 6vw, 80px); }
.close .lead { max-width: 44ch; font-size: 20px; }
.contact { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; }
.contact a { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.contact a:hover span { text-decoration: underline; }

.foot { padding: 32px 0 112px; border-top: 1px solid var(--line); }
@media (min-width: 960px) { .foot { padding-bottom: 40px; } }
.foot-row { display: grid; gap: 12px; }
.foot img { width: 96px; }
.foot .by { color: var(--soft); font-size: 15px; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.bar .btn { min-height: 48px; padding: 8px 12px; font-size: 15px; }
@media (min-width: 960px) { .bar { display: none; } }
