/* xTrain shared styles: tokens, type, controls, the top bar, the footer, dialogs.
   One ground (driveway concrete), one ink (asphalt), one kit colour (saucer-cone orange).
   Depth comes from flat layers overlapping. No shadows, gradients, or glass. */

@font-face {
  font-family: 'Anybody';
  src: url('/assets/fonts/Anybody-VF.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/assets/fonts/HankenGrotesk-VF.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: oklch(0.928 0.004 150);
  --ground-deep: oklch(0.895 0.005 150);
  --paper: oklch(0.978 0.002 150);
  --joint: oklch(0.86 0.005 150);
  --slab: oklch(0.885 0.005 150);
  --slab-joint: oklch(0.8 0.007 150);
  --ink: oklch(0.2 0.008 255);
  --ink-2: oklch(0.42 0.008 255);
  --ink-3: oklch(0.49 0.006 255);
  --cone: oklch(0.69 0.19 44);
  --cone-top: oklch(0.77 0.16 56);
  --cone-deep: oklch(0.6 0.18 38);
  --ball: oklch(0.985 0.002 100);

  --f: 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --d: 'Anybody', 'Hanken Grotesk', ui-sans-serif, sans-serif;
  --wide: 112%;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px; --s11: 176px;
  --gut: clamp(20px, 3.4vw, 56px);

  --r-ctl: 999px;
  --r-obj: 18px;

  --out: cubic-bezier(0.23, 1, 0.32, 1);
  --in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 440;
  font-stretch: 100%;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
/* concrete tooth: a static grain over everything, never animated */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 40; pointer-events: none;
  opacity: 0.07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.3 0 0 0 0 0.3 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
input { caret-color: var(--ink); }
html { scrollbar-color: var(--ink-3) var(--ground); scrollbar-width: thin; }
img, svg { display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

.vh, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; }
.ic { width: 1em; height: 1em; flex: none; }

.skip {
  position: fixed; left: var(--gut); top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-ctl);
  text-decoration: none; font-weight: 600; transition: top 0.2s var(--out);
}
.skip:focus { top: 12px; }

/* ---------- buttons, chips, inputs ---------- */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 24px; border: 0; border-radius: var(--r-ctl);
  font-weight: 620; font-size: 16px; letter-spacing: 0;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.16s var(--out), background-color 0.2s var(--out), color 0.2s var(--out);
}
.btn:active { transform: scale(0.97); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink .ic { width: 15px; height: 15px; transition: transform 0.25s var(--out); }
@media (hover: hover) {
  .btn-ink:hover { background: oklch(0.28 0.01 255); }
  .btn-ink:hover .ic { transform: translateX(3px); }
}
.btn-ghost { background: transparent; color: var(--ink); outline: 1.5px solid color-mix(in oklch, var(--ink) 24%, transparent); outline-offset: -1.5px; }
.btn-ghost .ic { width: 15px; height: 15px; }
@media (hover: hover) { .btn-ghost:hover { outline-color: var(--ink); } }
.btn-sm { --h: 40px; padding: 0 18px; font-size: 14px; }
.btn[disabled], .btn[aria-busy='true'] { cursor: progress; }
.btn-text { background: none; border: 0; padding: 12px 8px; cursor: pointer; font-weight: 560; color: var(--ink-2); text-decoration: underline; text-underline-offset: 0.25em; }

.chip {
  height: 44px; padding: 0 18px; border-radius: var(--r-ctl);
  border: 1.5px solid color-mix(in oklch, var(--ink) 22%, transparent);
  background: transparent; font-weight: 560; font-size: 15px; cursor: pointer;
  transition: background-color 0.2s var(--out), color 0.2s var(--out), border-color 0.2s var(--out), transform 0.16s var(--out);
}
.chip:active { transform: scale(0.97); }
.chip.is-on, .chip[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (hover: hover) { .chip:not(.is-on):hover { border-color: var(--ink); } }

.signup { width: 100%; max-width: 480px; }
.signup-row {
  display: flex; align-items: center; gap: 6px; padding: 6px;
  background: var(--paper); border-radius: var(--r-ctl);
  border: 1.5px solid color-mix(in oklch, var(--ink) 14%, transparent);
  transition: border-color 0.2s var(--out);
}
.signup-row:focus-within { border-color: var(--ink); }
.signup input[type='email'] {
  flex: 1; min-width: 0; height: 48px; padding: 0 12px 0 18px; border: 0; background: transparent;
  font: inherit; font-size: 16px; font-weight: 500; color: var(--ink); outline: none;
}
.signup input::placeholder { color: var(--ink-3); }
.signup .btn { --h: 48px; }
.signup-msg { min-height: 1.5em; margin-top: 10px; padding-left: 20px; font-size: 14px; font-weight: 520; color: var(--ink-2); }
.signup-msg[data-tone='bad'] { color: oklch(0.5 0.17 30); }
.signup.is-done .signup-row { border-color: var(--ink); }

/* ---------- top bar ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 var(--gut);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.top::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ground);
  opacity: 0; transition: opacity 0.3s var(--out);
}
.top.is-stuck::before { opacity: 1; }
.top.is-stuck { border-bottom: 1px solid var(--joint); }
.top.on-cone::before { background: var(--cone); }
.top.on-cone { border-bottom-color: color-mix(in oklch, var(--ink) 14%, transparent); }
.mark { font-family: var(--d);
  font-weight: 820; font-size: 22px; font-stretch: 122%; letter-spacing: -0.02em; text-decoration: none;
  display: inline-flex; align-items: baseline;
}
.mark-x { font-weight: 520; margin-right: 0.02em; }

/* nav: the page links share one paper pill that slides to whatever you point at,
   and between pages it travels with the view transition */
.nav { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: flex; align-items: center; gap: 2px; }
.nav-a {
  position: relative; z-index: 1; display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
  border-radius: var(--r-ctl); text-decoration: none; font-size: 15px; font-weight: 600; color: var(--ink-2);
  transition: color 0.2s var(--out);
}
.nav-a[aria-current='page'], .nav-a.is-hot { color: var(--ink); }
.nav-pill {
  position: absolute; left: 0; top: 50%; z-index: 0; height: 40px; width: 0; margin-top: -20px;
  border-radius: var(--r-ctl); background: var(--paper); opacity: 0; pointer-events: none;
  view-transition-name: nav-pill;
}
.top-end { display: flex; align-items: center; gap: var(--s2); }
.menu-btn {
  display: none; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 18px; border: 0; border-radius: var(--r-ctl);
  background: var(--ink); color: var(--paper); font-weight: 620; font-size: 14px; cursor: pointer;
}
.menu-btn i { position: relative; width: 14px; height: 8px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.menu-btn:active { transform: scale(0.97); }

/* the mobile menu: a full-screen sheet of big page names */
.menu {
  width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--ground); color: var(--ink); overscroll-behavior: contain;
}
.menu::backdrop { background: transparent; }
.menu-in { min-height: 100%; display: flex; flex-direction: column; padding: 0 var(--gut) calc(var(--s6) + env(safe-area-inset-bottom)); }
.menu-top { display: flex; align-items: center; justify-content: space-between; height: 60px; flex: none; }
.menu-x { height: 40px; padding: 0 18px; border-radius: var(--r-ctl); border: 1.5px solid color-mix(in oklch, var(--ink) 22%, transparent); background: transparent; font-weight: 620; font-size: 14px; cursor: pointer; }
.menu-nav { display: flex; flex-direction: column; margin: var(--s6) 0 var(--s7); border-top: 1px solid var(--joint); }
.menu-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 76px;
  border-bottom: 1px solid var(--joint); text-decoration: none; overflow: hidden;
}
.menu-nav a > span {
  display: block; font-family: var(--d); font-weight: 800; font-stretch: var(--wide); letter-spacing: -0.03em;
  font-size: clamp(34px, 10vw, 48px); line-height: 1;
}
.menu-nav a[aria-current='page'] > span::after { content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 12px; border-radius: 50%; background: var(--ink); vertical-align: middle; }
.menu-glyph { width: 52px; height: 52px; flex: none; }
.menu .signup { margin-top: auto; max-width: none; }

/* ---------- footer ---------- */
.foot { padding: var(--s8) var(--gut) var(--s6); overflow: hidden; }
.foot-mark { font-family: var(--d);
  font-weight: 840; font-stretch: 118%; letter-spacing: -0.035em; line-height: 0.9;
  font-size: clamp(48px, 9vw, 96px); white-space: nowrap;
}
.foot-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s5); margin-top: var(--s6); font-size: 14px; color: var(--ink-2); font-weight: 500; }
.foot-privacy summary { cursor: pointer; list-style: none; text-decoration: underline; text-underline-offset: 0.25em; }
.foot-privacy summary::-webkit-details-marker { display: none; }
.foot-privacy p { margin-top: var(--s3); max-width: 46ch; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-nav a { text-decoration: none; color: var(--ink); font-weight: 600; }
@media (hover: hover) { .foot-nav a:hover { text-decoration: underline; } }

/* ---------- step two dialog ---------- */
.more {
  border: 0; padding: 0; border-radius: 28px; background: var(--paper); color: var(--ink);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
}
.more::backdrop { background: color-mix(in oklch, var(--ink) 55%, transparent); }
.more-in { padding: var(--s6) var(--s6) var(--s5); display: grid; gap: var(--s5); }
.more h2 { font-family: var(--d); font-size: 40px; font-weight: 820; font-stretch: var(--wide); letter-spacing: -0.03em; line-height: 1; }
.more-line { color: var(--ink-2); margin-top: calc(var(--s3) * -1); }
.more fieldset { border: 0; padding: 0; margin: 0; }
.more legend { font-weight: 660; font-size: 15px; margin-bottom: var(--s3); padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.more-actions { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); }
.more[open] { animation: more-in 0.4s var(--out); }
@keyframes more-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

/* ---------- segmented control (same build as the home page's minutes) ---------- */
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: var(--ground-deep); }
.seg button {
  min-width: 40px; height: 38px; padding: 0 12px; border-radius: var(--r-ctl); border: 0; background: transparent;
  font-weight: 640; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; color: var(--ink-2);
  transition: background-color 0.2s var(--out), color 0.2s var(--out);
}
.seg button[aria-checked='true'] { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .seg button[aria-checked='false']:hover { color: var(--ink); } }


/* ---------- kit chips (what have you got?) ---------- */
.kit-q { width: 100%; font-size: 14px; font-weight: 640; font-stretch: 104%; margin-bottom: var(--s1); }
.kit-item {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 15px 0 5px; border-radius: var(--r-ctl);
  border: 1.5px dashed color-mix(in oklch, var(--ink) 38%, transparent);
  background: transparent; color: var(--ink-2);
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background-color 0.22s var(--out), border-color 0.22s var(--out), color 0.22s var(--out), transform 0.16s var(--out);
}
.kit-item:active { transform: scale(0.96); }
.kit-item .kit-glyph { width: 32px; height: 32px; flex: none; transition: opacity 0.22s var(--out); opacity: 0.55; }
.kit-item.is-on { background: var(--paper); border: 1.5px solid var(--ink); color: var(--ink); }
.kit-item.is-on .kit-glyph { opacity: 1; }
.kit-item.is-fixed { cursor: default; }
.kit-item.is-fixed:active { transform: none; }
@media (hover: hover) { .kit-item:not(.is-on):hover { border-color: var(--ink); color: var(--ink); } }
.kg-wall { fill: var(--ink); }
.kg-joint { stroke: var(--paper); stroke-width: 1.5; opacity: 0.5; }
.kg-goal { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.kg-net { fill: none; stroke: var(--ink); stroke-width: 1; opacity: 0.45; }
.kg-mate { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }
.kg-nose { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- join (the one flooded field on every page) ---------- */
.join { background: var(--cone); padding: 120px 56px 96px; }
.join-in { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); grid-template-rows: auto 1fr; column-gap: var(--s8); align-items: start; }
.join-plan { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; display: flex; flex-direction: column; padding-top: 10px; }
.join-plan-t { font-size: 15px; font-weight: 700; margin-bottom: var(--s3); }
.join-lane { list-style: none; margin: 0; padding: 0 0 0 9px; flex: 1; display: flex; flex-direction: column; }
.join-lane li { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); min-height: 48px; padding: 0 0 0 28px; font-weight: 600; font-size: 16px; }
.join-lane li:last-child { flex-grow: 0 !important; }
.join-lane li::before { content: ''; position: absolute; left: -9px; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle, var(--cone) 0 3px, var(--paper) 3.5px 6.5px, var(--ink) 7px); }
.join-lane li::after { content: ''; position: absolute; left: -1px; top: 11px; bottom: -11px; width: 2px; background: var(--ink); }
.join-lane li:last-child::after { display: none; }
.join-lane .m { font-variant-numeric: tabular-nums; font-weight: 520; }
.join h2 { font-family: var(--d);
  font-size: clamp(40px, 6vw, 88px); line-height: 0.94; font-weight: 820; font-stretch: var(--wide); letter-spacing: -0.035em;
  max-width: 11em;
}
.join .signup { margin-top: var(--s7); }
.join .signup-row { background: var(--paper); border-color: transparent; }
.join .signup-row:focus-within { border-color: var(--ink); }
.join .signup-msg { color: var(--ink); }
.join .signup input::placeholder { color: var(--ink-2); }
.faq { grid-column: 1; grid-row: 2; margin-top: var(--s8); max-width: 760px; padding-top: 8px; border-top: 1.5px solid color-mix(in oklch, var(--ink) 30%, transparent); }
.faq details { border-bottom: 1.5px solid color-mix(in oklch, var(--ink) 30%, transparent); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  padding: 20px 0; font-size: 19px; font-weight: 660; font-stretch: 104%;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; width: 14px; height: 14px; flex: none;
  background: linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat;
  transition: transform 0.3s var(--out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; max-width: 58ch; font-size: 17px; line-height: 1.5; }
.faq details::details-content { block-size: 0; overflow: hidden; transition: block-size 0.35s var(--out), content-visibility 0.35s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
:root { interpolate-size: allow-keywords; }
.join-in-solo { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1023px) {
  .join { padding: 88px 20px 72px; }
  .join-in { grid-template-columns: 1fr; }
  .join-plan { grid-column: 1; grid-row: auto; margin-top: var(--s7); }
  .faq { grid-row: auto; }
  .join-lane li { flex-grow: 0 !important; min-height: 44px; }
}

/* ---------- close pill for full-screen dialogs (drill detail, saved tray, session runner) ---------- */
.dd-x { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: var(--r-ctl); border: 1.5px solid color-mix(in oklch, var(--ink) 20%, transparent); background: transparent; cursor: pointer; font-weight: 620; font-size: 14px; }
.dd-x .ic { width: 14px; height: 14px; }

/* ---------- round icon buttons (deck controls, session runner) ---------- */
.dk-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1.5px solid color-mix(in oklch, var(--ink) 20%, transparent); background: transparent; color: var(--ink);
  transition: border-color 0.2s var(--out), background-color 0.2s var(--out), transform 0.16s var(--out);
}
.dk-btn .ic { width: 18px; height: 18px; }
.dk-btn:active { transform: scale(0.94); }
.dk-btn-lg { width: 60px; height: 60px; }
.dk-btn-lg .ic { width: 22px; height: 22px; }
.dk-btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dk-btn-open { width: auto; height: 52px; padding: 0 26px; border-radius: var(--r-ctl); font-weight: 660; font-size: 15px; }
.dk-btn[disabled] { opacity: 0.35; cursor: default; }
@media (hover: hover) { .dk-btn:not(.dk-btn-ink):not([disabled]):hover { border-color: var(--ink); } }
.dk-btn-ink .ic { color: var(--paper); }

/* ---------- 404: out of bounds ---------- */
.nf { min-height: 72svh; padding: 132px var(--gut) var(--s9); display: flex; flex-direction: column; gap: var(--s8); }
.nf-title { font-family: var(--d); font-weight: 820; font-stretch: var(--wide); letter-spacing: -0.035em; line-height: 0.92; font-size: clamp(56px, min(9vw, 16svh), 148px); }
.nf-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); }
.nf-links a { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s5) var(--s4) var(--s5) 0; text-decoration: none; font-family: var(--d); font-weight: 780; font-stretch: 108%; letter-spacing: -0.02em; font-size: clamp(20px, 1.9vw, 28px); }
.nf-links a + a { padding-left: var(--s4); border-left: 1px solid var(--joint); }
.nf-links .ic { width: 18px; height: 18px; transition: transform 0.25s var(--out); }
@media (hover: hover) { .nf-links a:hover .ic { transform: translateX(4px); } }
@media (max-width: 760px) {
  .nf { padding-top: 104px; }
  .nf-links { grid-template-columns: minmax(0, 1fr); }
  .nf-links a, .nf-links a + a { padding: var(--s4) 0; border-left: 0; border-bottom: 1px solid var(--joint); }
}

/* ---------- page transitions ---------- */
/* Same-site navigations cross-fade, the new page lifts in, and the nav pill
   slides from the old page's link to the new one. Browsers without
   cross-document view transitions just navigate. */
@view-transition { navigation: auto; }
.top { view-transition-name: top; }
::view-transition-old(root) { animation: vt-out 0.16s var(--out) both; }
::view-transition-new(root) { animation: vt-in 0.42s var(--out) both; }
::view-transition-group(nav-pill) { animation-duration: 0.42s; animation-timing-function: var(--out); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- nav on small screens ---------- */
@media (max-width: 900px) {
  .nav, .top-end .btn { display: none; }
  .menu-btn { display: inline-flex; }
}

/* ---------- small screens ---------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .top { height: 60px; }
  .signup-row { flex-direction: column; align-items: stretch; border-radius: 26px; }
  .signup input[type='email'] { height: 50px; }
  .signup .btn { width: 100%; }
  .more-in { padding: var(--s5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  @view-transition { navigation: none; }
}
