/* Design option C: Mindset. Dark and editorial, from his line "change isn't just physical,
   it's a mindset": deep teal-black (#0B2A33, the shadows of his own photos) with a light teal
   (#5FD0E3) for the words in italics, Instrument Serif for headings and Instrument Sans for
   reading. Buttons use the deeper teal (#006E82) so white words on them read easily. */
@font-face { font-family: 'Instrument Serif'; src: url(/fonts/instrument-serif-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url(/fonts/instrument-serif-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url(/fonts/instrument-sans-400-600.woff2) format('woff2'); font-weight: 400 600; font-display: swap; }

:root {
  --night: #0B2A33; --night-2: #12343E; --paper: #F3F6F6; --white: #FFFFFF; --ink: #0B2A33; --soft: #4A5C61; --mute: #B9C9CD;
  --teal: #0197B2; --teal-deep: #006E82; --teal-light: #5FD0E3; --line: #D3DEE0; --line-dark: rgba(255, 255, 255, .18);
  --ease: cubic-bezier(.23, 1, .32, 1);
  --serif: 'Instrument Serif', Georgia, serif; --sans: 'Instrument Sans', system-ui, sans-serif;
}
* { 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.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(44px, 6vw, 84px); }
h2 em, h1 em { color: var(--teal-deep); }
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; }
.top :focus-visible, .hero :focus-visible, .quote :focus-visible, .close :focus-visible { outline-color: var(--teal-light); }
.ic { flex: none; }
.sub { font-size: 19px; color: var(--soft); max-width: 40ch; margin: 16px 0 28px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 24px; border-radius: 4px; font: 600 16px/1.1 var(--sans); text-decoration: none; border: 1px solid transparent; transition: transform .16s var(--ease), background-color .2s var(--ease), color .2s var(--ease); }
.btn:active { transform: scale(.97); }
.btn-teal { background: var(--teal-deep); color: #fff; }
.btn-teal:hover { background: var(--teal); color: var(--night); }
.btn-line { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-line:hover { background: #fff; color: var(--night); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header, on the dark */
.top { position: sticky; top: 0; z-index: 20; background: var(--night); color: #fff; border-bottom: 1px solid var(--line-dark); }
.top-row { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; min-height: 48px; align-items: center; }
.brand img { width: 72px; }
.nav { display: none; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; padding: 12px 0; font-size: 16px; background: linear-gradient(var(--teal-light), var(--teal-light)) 0 calc(100% - 10px) / 0 1px no-repeat; transition: background-size .25s var(--ease); }
.nav a:hover { background-size: 100% 1px; }
.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 12px; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--night-2); border: 1px solid var(--line-dark); min-width: 220px; }
.menu-panel ul { list-style: none; margin: 0; padding: 8px 0; }
.menu-panel a { display: block; padding: 12px 20px; text-decoration: none; }
.menu-panel a:hover { background: var(--night); }
@media (min-width: 960px) { .nav, .top-cta { display: flex; } .menu { display: none; } }

/* Hero: three photos of him training, then the words */
.hero { background: var(--night); color: #fff; padding: 16px 0 64px; }
.trip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.trip img { width: 100%; height: 34svh; min-height: 220px; object-fit: cover; object-position: 50% 30%; }
@media (min-width: 900px) { .trip { gap: 16px; } .trip img { height: 46svh; } }
.hero-words { display: grid; gap: 24px; padding-top: 32px; }
.hero h1 { font-size: clamp(48px, 7.4vw, 116px); line-height: .95; }
.tag { font: italic 400 clamp(34px, 4.6vw, 64px)/1 var(--serif); color: var(--teal-light); }
.hero .lead { color: #E3ECEE; font-size: 18px; margin-bottom: 24px; max-width: 44ch; }
@media (min-width: 900px) {
  .hero-words { grid-template-columns: 1.5fr 1fr; align-items: end; column-gap: 64px; }
  .hero h1 { grid-column: 1; }
  .tag { grid-column: 1; }
  .hero-side { grid-column: 2; grid-row: 1 / span 2; align-self: end; }
}
/* The photos come into colour once as the page opens */
@media (prefers-reduced-motion: no-preference) {
  .js .trip img { animation: develop 1.6s var(--ease) both; }
  .js .trip img:nth-child(2) { animation-delay: .12s; }
  .js .trip img:nth-child(3) { animation-delay: .24s; }
  .js .hero-words > * { animation: rise .8s var(--ease) .2s both; }
  /* Mind, body and strength: three reps, each word pushed up and locked out in turn */
  .js .tag em { display: inline-block; animation: rep .75s cubic-bezier(.7, 0, .2, 1) both; }
  .js .tag em:nth-child(1) { animation-delay: .55s; }
  .js .tag em:nth-child(2) { animation-delay: .8s; }
  .js .tag em:nth-child(3) { animation-delay: 1.05s; }
}
@keyframes rep { 0% { opacity: 0; transform: translateY(.6em); } 65% { opacity: 1; transform: translateY(-.06em); } 100% { transform: none; } }
@keyframes develop { from { filter: grayscale(1) brightness(.7); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Three ways to train: a numbered list with lines between */
.train { padding: 96px 0; }
.train h2 { margin-bottom: 40px; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.list a { display: grid; grid-template-columns: 48px 1fr; gap: 4px 16px; padding: 28px 0; border-bottom: 1px solid var(--line); text-decoration: none; align-items: center; }
.l-no { font: italic 28px/1 var(--serif); color: var(--teal-deep); grid-row: 1 / span 2; align-self: start; padding-top: 6px; }
.l-name { font: 400 clamp(34px, 4vw, 52px)/1 var(--serif); }
.l-line { color: var(--soft); max-width: 52ch; }
.l-img { display: none; }
.list a:hover .l-name { color: var(--teal-deep); }
@media (min-width: 900px) {
  .list a { grid-template-columns: 72px 1fr 1fr 160px; gap: 32px; }
  .l-no { grid-row: auto; }
  .l-img { display: block; width: 160px; height: 112px; overflow: hidden; }
  .l-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .list a:hover .l-img img { transform: scale(1.03); }
}

/* His line, set large on the dark, beside a photo that comes into colour as it arrives */
.quote { background: var(--night); color: #fff; padding: 96px 0; }
.quote-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .quote-grid { grid-template-columns: .7fr 1.3fr; gap: 72px; } }
.quote-photo img { width: 100%; max-height: 640px; object-fit: cover; }
.develop { transition: filter 1.4s var(--ease); }
.develop.grey { filter: grayscale(1) brightness(.8); }
.statement { font: 400 clamp(48px, 7vw, 104px)/.98 var(--serif); letter-spacing: -.02em; }
.statement em { color: var(--teal-light); }

/* Circuits: a timetable */
.circuits { padding: 96px 0; }
.circ-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .circ-grid { grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; } }
.table { margin: 0; border-top: 1px solid var(--ink); }
.table div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.table dt { font: italic 22px/1.2 var(--serif); color: var(--teal-deep); }
.table dd { margin: 0; font-size: 19px; }
/* The times flip in like a gym scoreboard, once as they arrive (options.js adds .in) */
.mo .table > div { transform-origin: 50% 0; transition: transform .5s var(--ease) calc(var(--i) * 90ms), opacity .3s ease calc(var(--i) * 90ms); }
.mo .table:not(.in) > div { opacity: 0; transform: perspective(600px) rotateX(-80deg); }

/* Meet David, and how it starts */
.about { padding: 0 0 96px; }
.about-grid { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) { .about-grid { grid-template-columns: .9fr 1.1fr; gap: 72px; } }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about-text h2 { margin-bottom: 24px; }
.about-text > p + p { margin-top: 16px; }
.about-text h3 { font-size: 36px; margin: 40px 0 16px; }
.step-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.step-list li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.step-no { font: italic 26px/1.1 var(--serif); color: var(--teal-deep); }

/* Where to train */
.where { padding: 0 0 96px; }
.where h2 { margin-bottom: 32px; }
.where-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.where-list li { display: grid; gap: 4px; padding: 20px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .where-list li { grid-template-columns: 1.4fr 1fr 1fr; align-items: baseline; } }
.w-name { font: 400 30px/1.1 var(--serif); }
.w-town { color: var(--soft); }
.w-what { color: var(--teal-deep); font-weight: 600; }

/* The close, on the dark */
.close { background: var(--night); color: #fff; padding: 96px 0; }
.close h2 { color: #fff; margin-bottom: 32px; }
.close h2 em { color: var(--teal-light); }
.close-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .close-grid { grid-template-columns: 1.3fr 1fr; align-items: end; } }
.contact { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-dark); }
.contact a { display: flex; align-items: center; gap: 14px; min-height: 56px; border-bottom: 1px solid var(--line-dark); text-decoration: none; overflow-wrap: anywhere; }
.contact a:hover span { color: var(--teal-light); }

.foot { background: var(--night); color: #fff; padding: 0 0 112px; }
.foot-row { display: grid; gap: 12px; border-top: 1px solid var(--line-dark); padding-top: 32px; }
@media (min-width: 960px) { .foot { padding-bottom: 40px; } }
.foot img { width: 96px; }
.foot .by { color: var(--mute); 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(--night); border-top: 1px solid var(--line-dark); }
.bar .btn { min-height: 48px; padding: 8px 12px; font-size: 15px; }
@media (min-width: 960px) { .bar { display: none; } }
