/* Public landing pages: the signed-out home (athletes) and /for-coaches. Direction A, "Readout": light, product-first. */
@layer pages {
  .mk {
    --wrap: 1160px;
    overflow-x: hidden;
  }

  .mk .skip {
    position: absolute;
    left: -9999px;
    &:focus { left: 16px; top: 12px; z-index: 10; background: var(--panel); padding: 8px 12px; border-radius: var(--r-ctl); }
  }

  .mk-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

  .mk .btn.lg { padding: 14px 24px; font-size: 16px; border-radius: var(--r-pill); }
  .mk .btn.primary.lg { box-shadow: 0 10px 24px -12px var(--accent); }

  /* Nav */
  .mk-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  }
  .mk-nav-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
  .mk-nav nav { display: flex; align-items: center; gap: 22px; }
  .mk-link { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; &:hover { color: var(--accent-text); } }
  .mk-nav .btn { border-radius: var(--r-pill); padding: 8px 16px; }

  /* Hero */
  .mk-hero {
    padding: 72px 0 64px;
    background:
      radial-gradient(60% 70% at 85% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
      radial-gradient(40% 50% at 70% 90%, color-mix(in srgb, var(--actual) 12%, transparent), transparent 70%);
  }
  .mk-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
  .mk-hero h1 { font-size: clamp(44px, 7vw, 84px); font-weight: 800; letter-spacing: -.045em; line-height: .98; margin: 14px 0 22px; }
  .mk-hero.coach h1 { font-size: clamp(40px, 5.6vw, 68px); }
  .mk h1 em, .mk h2 em { font-style: normal; color: var(--accent-text); }
  .mk-lede { color: var(--muted); font-size: 19px; line-height: 1.55; max-width: 34em; }
  .mk-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; &.center { justify-content: center; } }
  .mk-fine { color: var(--muted); font-size: 14px; margin-top: 16px; }

  .mk-hero-art { position: relative; min-height: 520px; }
  .mk-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 24px 60px -32px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  .mk-sentence { font-size: 15.5px; line-height: 1.5; margin-top: 10px; & b { font-weight: 700; } }

  .mk-form { padding: 24px 24px 20px; width: min(420px, 100%); margin-left: auto; position: relative; z-index: 1; }
  .mk-form-head { display: flex; justify-content: space-between; align-items: center; }
  .mk-big { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; color: var(--good);
    & b { font-size: 56px; letter-spacing: -.04em; margin-right: 6px; font-family: var(--display); } }
  .mk-chart { width: 100%; margin-top: 16px; }
  .mk-legend { display: flex; justify-content: flex-end; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 8px;
    & i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; } }

  .mk-review { position: absolute; left: 0; bottom: 0; transform: rotate(-1.5deg); width: min(300px, 80%); padding: 18px 20px; z-index: 2; }
  .mk-bars { display: flex; gap: 10px; align-items: end; height: 64px; margin-top: 12px; }
  .mk-bars .bar { flex: 1; height: 100%; position: relative; }
  .mk-bars .bar i, .mk-day-bar i { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 6px; }
  .mk-bars .plan { height: 100%; background: var(--accent-wash); }
  .mk-bars .actual { left: 25%; right: 25%; background: var(--actual); }

  /* Works-with strip */
  .mk-works { border-block: 1px solid var(--line); background: var(--panel); }
  .mk-works-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-block: 18px; font-weight: 600; color: var(--muted); font-size: 15px; }

  /* Sections */
  .mk-section { padding: 96px 0; }
  .mk-head { max-width: 720px; margin-bottom: 44px; }
  .mk h2 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 800; letter-spacing: -.04em; margin: 10px 0 14px; }
  .mk h3 { font-size: 21px; }

  .mk-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .mk-feature { padding: 20px 20px 26px; display: flex; flex-direction: column; gap: 10px; box-shadow: none;
    & p { color: var(--muted); } }
  .mk-feature-art { background: var(--bg); border-radius: 14px; padding: 16px; min-height: 140px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px;
    & b { font-family: var(--display); font-size: 19px; }
    & svg { width: 100%; margin-top: auto; }
    &.review p { font-size: 15px; line-height: 1.5; font-weight: 500; color: var(--ink); } }
  .mk-whatif { margin-top: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
    & span { font-size: 14px; color: var(--muted); }
    & b { font-family: var(--mono); font-size: 16px; color: var(--fatigue); } }

  .mk-split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
  .mk-split { background: var(--panel); border-block: 1px solid var(--line); }
  .mk-split .mk-card { box-shadow: 0 24px 60px -36px color-mix(in srgb, var(--ink) 40%, transparent); }
  .mk-ticks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px;
    & li { padding-left: 28px; position: relative; }
    & li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--good-wash); }
    & li::after { content: ""; position: absolute; left: 6px; top: 8px; width: 5px; height: 8px; border: solid var(--good); border-width: 0 2px 2px 0; transform: rotate(45deg); } }

  .mk-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 18px; background: var(--bg); }
  .mk-day { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: center;
    &.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); } }
  .mk-day-bar { position: relative; width: 60%; height: 120px; }
  .mk-day-bar .plan { background: var(--accent-wash); border: 1.5px dashed var(--accent); }
  .mk-day-bar .actual { background: var(--actual); left: 20%; right: 20%; }
  .mk-day-title { font-size: 12.5px; font-weight: 600; line-height: 1.25; min-height: 2.5em; }

  .mk-split-grid.reverse > :first-child { order: 0; }
  .mk-import { padding: 24px; display: grid; gap: 12px; }
  .mk-import-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 10px; & b { font-size: 18px; } }
  .mk-progress { height: 8px; border-radius: 99px; background: var(--accent-wash); overflow: hidden; & i { display: block; height: 100%; background: var(--good); border-radius: inherit; } }

  /* Coach band */
  .mk-coach-band { background: #15132A; color: #EDEBF7; padding: 72px 0; position: relative; overflow: hidden;
    &::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 60%; height: 180%; background: radial-gradient(closest-side, rgba(156, 134, 255, .35), transparent); }
    & .eyebrow { color: #A7A3C0; }
    & h2 { color: #fff; margin-top: 8px; }
    & p { color: #CFCBE3; font-size: 18px; max-width: 36em; }
    & .mk-fine { color: #A7A3C0; font-size: 14px; } }
  .mk-coach-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; position: relative; }
  .mk-coach-ctas { justify-self: end; text-align: right; }
  .mk-coach-band .btn.primary { background: #9C86FF; color: #110F1E; }

  .mk-final { padding: 110px 0; text-align: center;
    & .mk-lede { margin: 0 auto; } }

  /* Coach page */
  .mk-queue { padding: 18px; width: min(460px, 100%); margin-left: auto; }
  .mk-queue-head { display: flex; justify-content: space-between; padding: 2px 4px 12px; }
  .mk-q-row { display: grid; grid-template-columns: 38px 1fr 10px; gap: 12px; align-items: center; padding: 10px; border-radius: 12px;
    &.open { background: var(--accent-wash); } }
  .mk-q-text { display: flex; flex-direction: column; line-height: 1.3; & span { color: var(--muted); font-size: 14px; } }
  .mk-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font: 700 15px var(--display); }
  .mk-dot { width: 10px; height: 10px; border-radius: 50%;
    &.fatigue { background: var(--fatigue); } &.muted { background: var(--muted); } &.accent { background: var(--accent); } &.good { background: var(--good); } }
  .mk-draft { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg);
    & p { margin: 8px 0 12px; font-size: 15px; } }
  .mk-draft-actions { display: flex; gap: 6px; }

  .mk-grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .mk-tile { padding: 24px; box-shadow: none; display: flex; flex-direction: column; gap: 10px; & p { color: var(--muted); } }
  .mk-num { color: var(--accent-text); font-size: 13px; }

  .mk-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: none;
    & li { padding: 24px; box-shadow: none; display: flex; flex-direction: column; gap: 8px; }
    & .mk-num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 15px; }
    & p { color: var(--muted); } }

  .mk-note { padding: 24px; & p { font-size: 18px; margin: 10px 0 16px; line-height: 1.5; } }
  .mk-note-foot { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
  .mk-split .btn.secondary { margin-top: 24px; }

  .mk-faq-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; }
  .mk-faq details { border-bottom: 1px solid var(--line); padding: 18px 0;
    & summary { cursor: pointer; font: 600 18px var(--display); letter-spacing: -.02em; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
    & summary::after { content: "+"; color: var(--accent-text); font-size: 22px; line-height: 1; }
    &[open] summary::after { content: "−"; }
    & p { color: var(--muted); margin-top: 10px; } }

  /* Footer */
  .mk-foot { border-top: 1px solid var(--line); padding: 32px 0 48px; }
  .mk-foot-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    & nav { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
    & nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; &:hover { color: var(--ink); } } }
  .mk .brand.small { font-size: 17px; & svg { width: 24px; height: 24px; } }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .mk-coach-band { background: #1A1830; border-block: 1px solid var(--line); }
  }
  :root[data-theme="dark"] .mk-coach-band { background: #1A1830; border-block: 1px solid var(--line); }

  /* Tablet and phone */
  @media (max-width: 960px) {
    .mk-hero-grid, .mk-split-grid, .mk-coach-grid, .mk-faq-grid { grid-template-columns: 1fr; gap: 40px; }
    .mk-features, .mk-grid6, .mk-steps { grid-template-columns: 1fr 1fr; }
    .mk-coach-ctas { justify-self: start; text-align: left; }
    .mk-hero-art { min-height: 0; }
    .mk-form { margin: 0 auto; }
    .mk-queue { margin: 0 auto; }
    .mk-review { position: relative; margin: -28px 0 0 auto; width: min(320px, 88%); }
  }

  @media (max-width: 640px) {
    .mk-wrap { padding: 0 16px; }
    .mk-nav-row { height: 60px; }
    .mk-nav nav { gap: 14px; }
    .mk .hide-sm { display: none; }
    .mk-hero { padding: 40px 0 48px; }
    .mk-lede { font-size: 17px; }
    .mk-ctas .btn.lg { flex: 1 1 100%; }
    .mk-section { padding: 64px 0; }
    .mk-features, .mk-grid6, .mk-steps { grid-template-columns: 1fr; }
    .mk-week { gap: 4px; padding: 10px; }
    .mk-day { padding: 8px 2px; }
    .mk-day-bar { height: 80px; width: 70%; }
    .mk-day-title { font-size: 10.5px; }
    .mk-big b { font-size: 46px; }
    .mk-foot-row nav { margin-left: 0; }
    .mk-final { padding: 72px 0; }
  }
}
