:root {
  --oxblood: #8C2F39;
  --oxblood-deep: #6E222B;
  --oxblood-soft: #F3E2E4;
  --ink: #2B2226;
  --ink-soft: #5C4F54;
  --cream: #FAF5EC;
  --cream-deep: #F1E9DB;
  --paper: #FFFDF8;
  --sage: #5A7160;
  --sage-soft: #E7EDE8;
  --gold: #B98A2F;
  --line: #E4D9C8;
  --radius: 10px;
  --shadow-1: 0 1px 2px rgba(43, 34, 38, .05), 0 4px 14px rgba(43, 34, 38, .06);
  --shadow-2: 0 2px 4px rgba(43, 34, 38, .07), 0 12px 32px rgba(43, 34, 38, .10);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream) url('/assets/textures/cream-paper.png');
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }

a { color: var(--oxblood); }

img { max-width: 100%; display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 245, 236, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #A63E49, var(--oxblood-deep));
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.25), 0 2px 6px rgba(140,47,57,.35);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: url('/assets/textures/light-wool.png'); opacity: .25; border-radius: 50%;
}
.brand-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }
.brand-name small { display: block; font-family: var(--sans); font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--oxblood); }

.nav { display: none; }
.nav a { text-decoration: none; color: var(--ink-soft); font-size: .92rem; font-weight: 500; padding: 6px 11px; border-radius: 7px; }
.nav a:hover { color: var(--oxblood); background: var(--oxblood-soft); }
.nav a.active { color: var(--oxblood); background: var(--oxblood-soft); font-weight: 600; }

.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-around;
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(43,34,38,.07);
}
.mobile-nav a { text-decoration: none; color: var(--ink-soft); font-size: .68rem; font-weight: 600; text-align: center; padding: 3px 8px; border-radius: 8px; }
.mobile-nav a span { display: block; font-size: 1.05rem; line-height: 1.3; font-family: var(--serif); }
.mobile-nav a.active { color: var(--oxblood); background: var(--oxblood-soft); }

main.wrap { padding-top: 36px; padding-bottom: 96px; }

.page-title { font-size: 1.7rem; margin-bottom: 4px; }
.page-sub { color: var(--ink-soft); font-size: .95rem; margin-bottom: 22px; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 20px;
}
.card + .card { margin-top: 16px; }
.grid > .card { margin-top: 0; }
.card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.card-label { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--oxblood); margin-bottom: 8px; }

.grid { display: grid; gap: 16px; }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-weight: 600; font-size: .95rem;
  padding: 12px 22px; border-radius: 8px;
  background: linear-gradient(180deg, #9A363F, var(--oxblood-deep));
  color: #fff; box-shadow: 0 2px 8px rgba(110,34,43,.35), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(110,34,43,.4), inset 0 1px 0 rgba(255,255,255,.18); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--oxblood); box-shadow: none; border: 1.5px solid var(--oxblood); }
.btn-ghost:hover { background: var(--oxblood-soft); box-shadow: none; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 8px;
  font: inherit; color: var(--ink); background: var(--paper);
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(140,47,57,.35); border-color: var(--oxblood); }
label { font-size: .84rem; font-weight: 600; color: var(--ink-soft); display: block; margin-bottom: 5px; }
.field { margin-bottom: 15px; }
.error { color: var(--oxblood); font-size: .82rem; margin-top: 4px; }

.progress-track { height: 10px; border-radius: 99px; background: var(--cream-deep); overflow: hidden; border: 1px solid var(--line); }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--oxblood), #B4525C); transition: width .5s ease; }

.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; letter-spacing: .04em; }
.badge-sage { background: var(--sage-soft); color: var(--sage); }
.badge-oxblood { background: var(--oxblood-soft); color: var(--oxblood); }
.badge-gold { background: #F5EBD6; color: #8A6620; }
.badge-muted { background: var(--cream-deep); color: var(--ink-soft); }

.waypoint-list { list-style: none; position: relative; }
.waypoint-list::before {
  content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px;
  width: 2px; background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 12px);
}
.waypoint { display: flex; gap: 16px; padding: 10px 0; position: relative; }
.waypoint-dot {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 1rem;
  background: var(--paper); border: 2px solid var(--line); color: var(--ink-soft);
  z-index: 1;
}
.waypoint.done .waypoint-dot { background: var(--sage); border-color: var(--sage); color: #fff; }
.waypoint.current .waypoint-dot { background: var(--oxblood); border-color: var(--oxblood); color: #fff; box-shadow: 0 0 0 5px var(--oxblood-soft); }
.waypoint.locked { opacity: .55; }
.waypoint-body { flex: 1; padding-top: 2px; min-width: 0; }
.waypoint-body h3 { font-size: 1.02rem; }
.waypoint-body p { font-size: .86rem; color: var(--ink-soft); }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-1); }
.stat b { font-family: var(--serif); font-size: 1.5rem; display: block; line-height: 1.15; }
.stat span { font-size: .74rem; color: var(--ink-soft); font-weight: 600; }

.chat { display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 85%; padding: 12px 16px; border-radius: 14px; font-size: .94rem; }
.bubble.user { align-self: flex-end; background: var(--oxblood); color: #fff; border-bottom-right-radius: 4px; }
.bubble.coach { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; box-shadow: var(--shadow-1); }
.bubble.coach .who { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--oxblood); margin-bottom: 4px; }

.block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 22px; margin-bottom: 18px; }
.block-kind { font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.block h3 { font-size: 1.15rem; margin-bottom: 10px; }
.block .prose { color: var(--ink-soft); font-size: .96rem; }
.block .prose p + p { margin-top: 10px; }
.prose ol, .prose ul { padding-left: 1.45em; margin: 10px 0; }
.prose li + li { margin-top: 6px; }
.block .prose strong { color: var(--ink); }
.block img { border-radius: 8px; margin: 12px 0 4px; }
.required-star { color: var(--oxblood); font-weight: 700; }
.save-hint { font-size: .76rem; color: var(--sage); font-weight: 600; }

.video-shell { position: relative; border-radius: 8px; overflow: hidden; background: var(--ink); aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; margin: 12px 0 4px; }
.video-shell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; margin: 0; border-radius: 0; }
.video-play { position: relative; z-index: 1; width: 62px; height: 62px; border-radius: 50%; background: rgba(250,245,236,.94); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-2); }
.video-play::after { content: ""; border-style: solid; border-width: 11px 0 11px 19px; border-color: transparent transparent transparent var(--oxblood); margin-left: 5px; }

.sparkline { width: 100%; height: 84px; }

.report-sheet { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 28px 24px; }
.report-rule { border: 0; border-top: 2px solid var(--ink); margin: 18px 0; }
.report-grid { display: grid; gap: 14px; }

.hero { position: relative; overflow: hidden; border-radius: 14px; box-shadow: var(--shadow-2); margin-top: 8px; }
.hero img { width: 100%; height: 400px; object-fit: cover; }
.hero-veil { position: absolute; inset: 0; background: linear-gradient(12deg, rgba(43,34,38,.82) 22%, rgba(43,34,38,.25) 62%, rgba(43,34,38,.05)); }
.hero-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 22px; color: #fff; }
.hero-copy h1 { font-size: 1.9rem; margin-bottom: 8px; color: #fff; }
.hero-copy p { font-size: .98rem; max-width: 46ch; opacity: .92; }

.landing-dark { background: var(--ink) url('/assets/textures/dark-wall.png'); color: #EFE7DA; border-radius: 14px; padding: 34px 24px; margin: 36px 0; box-shadow: var(--shadow-2); }
.landing-dark h2 { color: #fff; font-size: 1.4rem; margin-bottom: 14px; }
.landing-dark p { opacity: .85; }

.pillar { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed rgba(239,231,218,.2); }
.pillar:last-child { border-bottom: 0; }
.pillar-num { font-family: var(--serif); font-size: 1.2rem; color: var(--gold); font-weight: 700; flex: 0 0 34px; }

.flash { background: var(--sage-soft); border: 1px solid var(--sage); color: var(--sage); padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: .92rem; font-weight: 500; }
.flash.warn { background: var(--oxblood-soft); border-color: var(--oxblood); color: var(--oxblood-deep); }

.milestone-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--cream-deep); }
.milestone-row:last-child { border-bottom: 0; }
.milestone-check {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--paper); cursor: pointer; position: relative;
}
.milestone-check.done { background: var(--sage); border-color: var(--sage); }
.milestone-check.done::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(40deg); }
.milestone-row p { flex: 1; font-size: .9rem; min-width: 0; }
.milestone-row .plabel { font-size: .72rem; font-weight: 700; color: var(--ink-soft); flex: 0 0 62px; }

.reading-row { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--cream-deep); }
.reading-row:last-child { border-bottom: 0; }
.reading-val { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; flex: 0 0 96px; }
.reading-meta { font-size: .8rem; color: var(--ink-soft); flex: 1; }

.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 110px; color: var(--ink-soft); font-size: .84rem; }

.player, .coach-col { max-width: 860px; margin-inline: auto; }
.coach-col { max-width: 780px; }
.report-col { max-width: 920px; margin-inline: auto; }

:focus-visible { outline: 3px solid rgba(140, 47, 57, .45); outline-offset: 2px; border-radius: 4px; }

@media (min-width: 760px) {
  .nav { display: flex; gap: 2px; }
  .mobile-nav { display: none; }
  main.wrap { padding-top: 52px; padding-bottom: 48px; }
  .footer { padding-bottom: 30px; }
  .page-title { font-size: 2.1rem; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-main { grid-template-columns: 1.6fr 1fr; align-items: start; }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .hero img { height: 460px; }
  .hero-copy { padding: 40px 38px; }
  .hero-copy h1 { font-size: 2.6rem; }
  .landing-dark { padding: 44px 40px; }
  .report-sheet { padding: 40px 44px; }
  .report-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  .topbar, .mobile-nav, .footer, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .report-sheet { box-shadow: none; border: 0; padding: 0; }
}
