/* ===================================================================
   coachindie — design system
   editorial / indie studio aesthetic
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..900,0..100,0..1&family=DM+Sans:opsz,wght@9..40,300..700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* paper palette */
  --paper:        #F4EFE6;
  --paper-soft:   #ECE5D5;
  --paper-deep:   #E0D7C2;
  --ink:          #1F1B16;
  --ink-soft:     #4A433C;
  --muted:        #8B847B;
  --line:         #D8D0BF;
  --line-soft:    #E4DCC9;

  /* signature */
  --clay:         #B8553A;
  --clay-deep:    #913F28;
  --clay-soft:    #E8C5B5;
  --clay-wash:    #F5E2D5;

  --sage:         #6B7A5A;
  --sage-soft:    #C5CDB5;
  --sage-wash:    #E0E4D2;

  --amber:        #B8893A;
  --amber-soft:   #E8D5A5;
  --amber-wash:   #F2E6C5;

  --rose:         #9B4458;
  --rose-soft:    #D9B5BE;
  --rose-wash:    #EFD8DD;

  /* type */
  --font-display: 'Fraunces', 'PingFang TC', 'Noto Serif TC', 'Songti TC', serif;
  --font-sans:    'DM Sans', -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* rhythm */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 16px;
  --r-5: 24px;
  --r-6: 32px;
  --r-7: 48px;
  --r-8: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(184,85,58,0.025) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(107,122,90,0.025) 0%, transparent 50%);
  min-height: 100vh;
}

/* grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

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

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ===================================================================
   layout shell — coach app pages
   =================================================================== */

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: var(--r-6) var(--r-5);
  display: flex;
  flex-direction: column;
  background: var(--paper-soft);
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 2px;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
}
.brand em {
  font-style: italic;
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  color: var(--clay);
}
.brand-mark {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: var(--r-6);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--r-6);
}
.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--r-3) var(--r-3) var(--r-2);
}
.nav a {
  display: flex;
  align-items: center;
  gap: var(--r-3);
  padding: 9px var(--r-3);
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--line-soft); color: var(--ink); }
.nav a.active {
  background: var(--ink);
  color: var(--paper);
}
.nav a.active .nav-icon { color: var(--paper); }
.nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav a.active .nav-icon { color: var(--paper); }
.nav-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.nav a.active .nav-count { color: var(--paper-soft); }

.coach-card {
  margin-top: auto;
  padding-top: var(--r-5);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--r-3);
}
.coach-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clay) 0%, var(--clay-deep) 100%);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
.coach-meta { line-height: 1.2; }
.coach-name { font-weight: 600; font-size: 13px; }
.coach-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* ===================================================================
   main column
   =================================================================== */

.main {
  padding: var(--r-7) var(--r-7) var(--r-8);
  max-width: 1100px;
  position: relative;
}

@media (max-width: 720px) {
  .main { padding: var(--r-5) var(--r-4); }
}

.page-header {
  margin-bottom: var(--r-7);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--r-5);
  flex-wrap: wrap;
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--r-3);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}
.page-title em {
  font-style: italic;
  color: var(--clay);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}

.page-meta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.page-meta strong { color: var(--ink); font-weight: 500; }

/* ===================================================================
   section header (display serif + mono badge)
   =================================================================== */

.section {
  margin-bottom: var(--r-7);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--r-4);
  margin-bottom: var(--r-5);
  padding-bottom: var(--r-3);
  border-bottom: 1px solid var(--line);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0;
  font-variation-settings: 'opsz' 60, 'SOFT' 40;
}
.section-title em {
  font-style: italic;
  color: var(--clay);
  font-variation-settings: 'opsz' 60, 'SOFT' 100, 'WONK' 1;
}
.section-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}
.section-action {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.section-action:hover { color: var(--clay); border-color: var(--clay); }

/* ===================================================================
   cards
   =================================================================== */

.card {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: var(--r-5);
  transition: border-color 0.2s, transform 0.2s;
}
.card.is-clickable { cursor: pointer; }
.card.is-clickable:hover {
  border-color: var(--ink-soft);
  transform: translateY(-1px);
}

/* ===================================================================
   utility
   =================================================================== */

.mono { font-family: var(--font-mono); }
.display { font-family: var(--font-display); }
.muted { color: var(--muted); }
.ink-soft { color: var(--ink-soft); }
.serif-em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--clay);
  font-variation-settings: 'opsz' 60, 'SOFT' 100, 'WONK' 1;
}

.row { display: flex; align-items: center; }
.gap-1 { gap: var(--r-1); }
.gap-2 { gap: var(--r-2); }
.gap-3 { gap: var(--r-3); }
.gap-4 { gap: var(--r-4); }
.gap-5 { gap: var(--r-5); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.tag-clay   { background: var(--clay-wash);  color: var(--clay-deep); }
.tag-sage   { background: var(--sage-wash);  color: var(--sage); }
.tag-amber  { background: var(--amber-wash); color: #8a6829; }
.tag-rose   { background: var(--rose-wash);  color: var(--rose); }
.tag-ink    { background: var(--ink); color: var(--paper); }
.tag-line   { background: transparent; color: var(--muted); border: 1px solid var(--line); }

/* avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}
.avatar.sz-32 { width: 32px; height: 32px; font-size: 13px; }
.avatar.sz-40 { width: 40px; height: 40px; font-size: 15px; }
.avatar.sz-44 { width: 44px; height: 44px; font-size: 16px; }
.avatar.sz-56 { width: 56px; height: 56px; font-size: 20px; }

.avatar-1 { background: #DDD2BA; color: #4A4030; }
.avatar-2 { background: #CCB8A0; color: #4A3520; }
.avatar-3 { background: #B5C5C8; color: #2E4448; }
.avatar-4 { background: #D8B5B0; color: #523028; }
.avatar-5 { background: #C2C8B5; color: #3A4530; }
.avatar-6 { background: #D5C2B0; color: #4A3320; }
.avatar-7 { background: #B8B0C0; color: #3A3045; }
.avatar-8 { background: #C5B8A8; color: #3D3220; }

/* number display */
.bignum {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variation-settings: 'opsz' 144;
}

/* footnote / page mark */
.page-mark {
  position: absolute;
  bottom: var(--r-5);
  right: var(--r-7);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* horizontal divider with text */
.div-label {
  display: flex;
  align-items: center;
  gap: var(--r-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--r-5) 0;
}
.div-label::before, .div-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
