/* Embla training — mobile-first design.
   Palette: dark slate base + warm accent. Optimized for phone-in-gym viewing. */

:root {
  --bg: #0f1419;
  --bg-elev: #1a2029;
  --bg-card: #1f2630;
  --bg-card-hover: #252d38;
  --border: #2a3441;
  --border-strong: #3a4452;
  --text: #e8ecef;
  --text-dim: #94a0ac;
  --text-faint: #5d6770;
  --accent: #f3a847;
  --accent-soft: rgba(243, 168, 71, 0.15);
  --accent-stronger: rgba(243, 168, 71, 0.25);
  --rest: #5d6770;
  --strength: #7eb8e8;
  --shooting: #f3a847;
  --skill: #b87ee8;
  --recovery: #7ee8ad;
  --conditioning: #e87e7e;
  --pickup: #e8d27e;
  --team: #7ee8e0;
  --game: #ff6b6b;
  --success: #7ee8ad;
  --warning: #e8d27e;
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --gap: 16px;
  --max-w: 720px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(14px + var(--safe-top)) 20px 14px;
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.app-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.app-title .dim {
  color: var(--text-faint);
  font-weight: 400;
}

.app-main {
  padding: 20px;
  padding-bottom: calc(96px + var(--safe-bottom));
  max-width: var(--max-w);
  margin: 0 auto;
}

.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-around;
  padding: 8px 4px calc(8px + var(--safe-bottom));
  background: rgba(15, 20, 25, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}

.nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  font-size: 11px;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-icon {
  font-size: 16px;
  line-height: 1;
}
.nav-label {
  font-size: 11px;
  letter-spacing: 0.02em;
}
.nav-link.active {
  color: var(--accent);
}
.nav-link.active .nav-icon {
  text-shadow: 0 0 8px rgba(243, 168, 71, 0.5);
}

/* === Typography ===
   Headings get generous breathing room from neighboring content.
   Don't smush sections together — that reads cramped/amateur. */
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
h2 { font-size: 22px; font-weight: 600; margin-top: 40px; margin-bottom: 16px; }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
h4 { font-size: 13px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 32px; margin-bottom: 14px; }
p  { margin: 0 0 12px; }

/* When first heading sits at top of <main>, lower its top margin */
.app-main > h1:first-child,
.app-main > h2:first-of-type,
.app-main > h4:first-child { margin-top: 0; }

.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 10px;
}

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.center { text-align: center; }

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card-tight { padding: 12px 14px; }

a.card:active, a.card:hover { background: var(--bg-card-hover); }

/* === Session card === */
.session {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  border-left: 3px solid var(--rest);
  transition: background 0.15s;
}
a.session:active, a.session:hover { background: var(--bg-card-hover); }

.session.kind-strength,    .session.kind-strength_individual { border-left-color: var(--strength); }
.session.kind-team_strength { border-left-color: var(--strength); }
.session.kind-shooting,    .session.kind-skill_shooting     { border-left-color: var(--shooting); }
.session.kind-skill,       .session.kind-skill_handle,
.session.kind-skill_finishing, .session.kind-skill_passing,
.session.kind-skill_decision { border-left-color: var(--skill); }
.session.kind-recovery     { border-left-color: var(--recovery); }
.session.kind-conditioning { border-left-color: var(--conditioning); }
.session.kind-pickup, .session.kind-scrimmage { border-left-color: var(--pickup); }
.session.kind-team, .session.kind-team_practice, .session.kind-team_video { border-left-color: var(--team); }
.session.kind-game         { border-left-color: var(--game); }
.session.kind-rest         { border-left-color: var(--rest); opacity: 0.65; }
.session.kind-camp         { border-left-color: var(--team); }
.session.kind-mental       { border-left-color: var(--recovery); }

.session.done { opacity: 0.7; }
.session.done .session-title::after { content: " ✓"; color: var(--success); }

.session-body { flex: 1; min-width: 0; }
.session-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.session-meta {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.session-meta span { display: inline-flex; align-items: center; }
.session-notes { font-size: 14px; color: var(--text-dim); }

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.session-badge.note::before { content: "✎"; }

/* === Day === */
.day {
  margin-bottom: 18px;
}
.day-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.day-header.is-today {
  border-bottom: 1px solid var(--accent);
}
.day-name { font-weight: 600; font-size: 15px; }
.day-name.is-today { color: var(--accent); }
.day-date { font-size: 13px; color: var(--text-faint); }
.day-empty { color: var(--text-faint); font-size: 14px; font-style: italic; padding: 4px 0; }

/* === Phase / block === */
.phase-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 24px;
  display: inline-block;
}

.phase {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.phase.current { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-card) 40%); }
.phase-dates {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.phase-focus {
  color: var(--accent);
  font-size: 14px;
  margin: 6px 0 10px;
  font-weight: 500;
}
.phase-desc { font-size: 14px; color: var(--text-dim); margin-bottom: 10px; }
.phase ul { margin: 8px 0; padding-left: 18px; }
.phase li { font-size: 14px; color: var(--text-dim); margin-bottom: 4px; }

/* === Exercises === */
.exercise {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.exercise.checked { opacity: 0.65; border-left: 3px solid var(--success); }
.exercise-cat {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 600;
}
.exercise-cues { margin: 8px 0; padding-left: 18px; }
.exercise-cues li { font-size: 14px; color: var(--text-dim); margin-bottom: 3px; }
.exercise-meta {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.exercise-meta strong { color: var(--text); font-weight: 500; }
.exercise-target {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.checkbox {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
}
.checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg);
}
.checkbox.checked::after {
  content: "✓";
  font-weight: 700;
}

/* === Filter pills === */
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  text-transform: capitalize;
}
.pill.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* === Empty / placeholder === */
.placeholder {
  text-align: center;
  color: var(--text-faint);
  padding: 32px 16px;
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin: 4px 0 18px;
}

/* === Goals === */
.goal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.goal-primary {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-card) 60%);
  border-color: var(--accent);
}
.goal-title { font-size: 18px; font-weight: 600; }
.goal-target { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.goal-numbers {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 8px;
}
.goal-current {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.goal-of {
  font-size: 16px;
  color: var(--text-dim);
}
.goal-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 6px;
}
.goal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
  border-radius: 999px;
  transition: width 0.4s;
}
.goal-bar-fill.muted { background: var(--text-dim); }
.goal-projection {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}
.goal-projection.positive { color: var(--success); }

/* === Profile === */
.profile-hero {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  align-items: center;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--strength) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: var(--bg);
  flex-shrink: 0;
}
.profile-name { font-size: 20px; font-weight: 600; }
.profile-sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  font-size: 18px;
  font-weight: 600;
  margin-top: 2px;
}

.directive {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.directive-title { font-weight: 600; font-size: 15px; }
.directive-source { font-size: 12px; color: var(--text-faint); margin-bottom: 6px; }
.directive-body { font-size: 14px; color: var(--text-dim); }
.directive-dates { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.link-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-weight: 500;
}
.link-row:active { background: var(--bg-card-hover); }
.link-row::after { content: "→"; color: var(--text-dim); }

/* === Session detail === */
.session-detail-header {
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.feeling-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.feeling-cell {
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}
.feeling-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.feeling-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 2px;
}

.note-bubble {
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 60%);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.note-source {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.note-body { font-size: 14px; }

/* === History === */
.history-day-header {
  font-size: 13px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}

/* === Buttons === */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.button-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

@media (min-width: 720px) {
  .app-header { padding: 18px 32px; }
  .app-main { padding: 32px; }
}

/* === Welcome / first-run === */
.welcome {
  padding-top: 8px;
}
.welcome-eyebrow {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.welcome-title {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin: 0 0 16px;
}
.welcome-tagline {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 32px;
}

.welcome-rails {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 32px 0 40px;
}
@media (min-width: 520px) {
  .welcome-rails { grid-template-columns: 1fr 1fr; }
}

.rail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.rail-icon {
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 8px;
  line-height: 1;
}
.rail-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
.rail-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}

.welcome-cta {
  margin-top: 40px;
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.welcome-cta h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}
.welcome-cta p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.welcome-cta-step {
  margin-top: 16px !important;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--text) !important;
  font-size: 14px;
}
.welcome-cta-step em {
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
}

.welcome-cta-button {
  margin-top: 8px;
}
