/* Judo Grading Syllabus Portal — Styling
   Design language based on XTen Charter onboarding, infused with martial arts typography and belt color accents. */

:root {
  --bg: #F0F4F3;
  --bg-alt: #E3EBE9;
  --surface: #F8FAF9;
  --surface-2: #FFFFFF;

  --accent: #1B2A4A;          /* Deep Traditional Judo Navy */
  --accent-mid: #2C3E6B;
  --accent-light: #4A6FA5;
  --accent-ghost: rgba(27,42,74,0.06);
  --accent-border: rgba(27,42,74,0.14);

  --gold: #D4AF37;
  --gold-bg: rgba(212,175,55,0.12);

  --text-1: #0F172A;
  --text-2: #334155;
  --text-3: #64748B;
  --border: rgba(15,23,42,0.09);

  --ok: #1E7A3D;
  --ok-bg: #E3F3E6;
  --warn: #97640C;
  --warn-bg: #FBEFDA;
  --err: #A3382A;
  --err-bg: #FBE6E2;

  --shadow: 0 1px 3px rgba(15,23,42,0.04), 0 8px 24px rgba(15,23,42,0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  padding-inline: max(20px, calc((100vw - 1120px) / 2));
  padding-block: 0 72px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
a { color: var(--accent-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
code { background: var(--accent-ghost); padding: 1px 6px; border-radius: 4px; }
small { font-size: 13px; }
.small { font-size: 14px; }
.muted { color: var(--text-3); }
svg { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.12em; }

/* Top Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.wordmark {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wordmark:hover { text-decoration: none; }
.wordmark .kanji-mark {
  font-family: 'Noto Serif JP', serif;
  font-size: 18px;
  color: var(--accent);
  background: var(--accent-ghost);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--accent-border);
}
.wordmark .dot { color: var(--accent-mid); }
.wordmark .sub { color: var(--text-3); font-weight: 500; }
.club-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-mid);
  background: var(--accent-ghost);
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid var(--accent-border);
}

.topbar nav {
  font-size: 14px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.topbar nav a { color: var(--text-2); font-weight: 500; }
.topbar nav a.active { color: var(--accent); font-weight: 700; }
.topbar nav .pill {
  background: var(--accent-ghost);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  padding: 3px 12px;
  border-radius: 100px;
  font-weight: 600;
}
.topbar nav .who {
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.rank-tag {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
}
form.inline { display: inline; }
button.link { background: none; border: 0; padding: 0; color: var(--text-3); font: inherit; cursor: pointer; }
button.link:hover { color: var(--err); text-decoration: underline; }

/* Flash Messages */
.flash {
  padding: 12px 18px;
  border-radius: 10px;
  margin: -12px 0 24px;
  font-size: 14.5px;
  border: 1px solid var(--accent-border);
  background: var(--accent-ghost);
  color: var(--text-2);
}
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(30,122,61,0.25); }
.flash.error { background: var(--err-bg); color: var(--err); border-color: rgba(163,56,42,0.25); }
.flash.info { background: var(--warn-bg); color: var(--warn); border-color: rgba(151,100,12,0.25); }

/* Typography */
.eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-mid);
  font-weight: 700;
  margin-bottom: 8px;
}
h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 14px; font-weight: 700; }
h2 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 8px; }
h3 { font-size: 18px; margin: 0 0 6px; }
.lede { font-size: 17px; color: var(--text-2); max-width: 60ch; margin: 0 0 20px; line-height: 1.5; }
.section-note { color: var(--text-3); margin: 0 0 24px; max-width: 65ch; }

/* Motto Showcase (Kanji Calligraphy) */
.motto-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.motto-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  border-top: 3px solid var(--accent);
  position: relative;
}
.motto-card.motto-fukuda { border-top-color: var(--gold); }
.motto-kanji {
  font-family: 'Noto Serif JP', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.motto-romaji { font-size: 13.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.motto-trans { font-size: 16px; font-weight: 600; color: var(--text-1); margin: 4px 0 2px; }
.motto-sub { font-size: 12.5px; color: var(--text-3); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 36px;
  align-items: start;
  margin-bottom: 44px;
}
.user-status-strip {
  display: flex;
  gap: 20px;
  background: var(--surface-2);
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.status-item { display: flex; flex-direction: column; gap: 2px; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

.hero-side {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.hanko-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.hanko-seal { border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.pathway-box { margin-bottom: 14px; font-size: 14px; color: var(--text-2); }
.pathway-box strong { color: var(--text-1); }
.pathway-box ul { margin: 6px 0 0; padding-left: 18px; }
.pathway-box li { margin: 3px 0; }

/* Progress Bar */
.progress-wrap { margin: 16px 0 12px; }
.progress {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-mid));
  border-radius: 100px;
  transition: width .4s ease;
}
.progress-label {
  font-size: 13.5px;
  color: var(--text-3);
  margin-top: 6px;
  font-weight: 500;
}
.progress-label .pct { font-weight: 700; color: var(--text-1); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--accent-border);
  background: var(--surface-2);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: var(--accent-ghost); text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-mid); }
.btn-sm {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--accent-border);
  background: var(--surface-2);
  color: var(--accent);
  display: inline-block;
}
.btn-sm:hover { text-decoration: none; background: var(--accent-ghost); }

/* Grade Cards Grid */
.modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}
.belt-bar {
  padding: 12px 18px;
  background: var(--belt-color);
  color: var(--belt-text);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.belt-bar .kanji { font-family: 'Noto Serif JP', serif; font-size: 16px; }
.card .body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card .num {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card h3 { margin: 0; font-size: 19px; }
.card h3 a { color: var(--text-1); }
.card p { margin: 0; font-size: 14px; color: var(--text-2); flex: 1; }
.card-meta { display: flex; gap: 14px; font-size: 13px; }
.card-progress { margin-top: 4px; }
.card .links {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Status Badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--bg-alt);
  color: var(--text-2);
}
.status.done { background: var(--ok-bg); color: var(--ok); }
.status.active { background: var(--warn-bg); color: var(--warn); }
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-ghost);
  color: var(--accent);
}
.badge.sensei-badge {
  background: #FFF4E5;
  color: #B45309;
  border: 1px solid rgba(180,83,9,0.2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.badge.self-badge { background: var(--bg-alt); color: var(--text-2); }

/* Library Grid */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.lib-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: transform .15s ease;
  box-shadow: var(--shadow);
}
.lib-card:hover { transform: translateY(-2px); text-decoration: none; }
.lib-icon { font-size: 28px; line-height: 1; }
.lib-content h3 { font-size: 16px; margin: 0 0 4px; color: var(--text-1); }
.lib-content p { font-size: 13.5px; color: var(--text-2); margin: 0; line-height: 1.4; }

/* Grade Page Layout */
.crumbs { font-size: 13.5px; color: var(--text-3); margin-bottom: 16px; }
.crumbs a { color: var(--text-2); }
.grade-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.belt-pill {
  background: var(--belt-color);
  color: var(--belt-text);
  font-weight: 700;
  font-size: 13px;
  padding: 3px 12px;
  border-radius: 100px;
}
.kanji-title { font-family: 'Noto Serif JP', serif; font-size: 18px; color: var(--accent); font-weight: 700; }
.two-col { display: grid; grid-template-columns: 1.55fr 1fr; gap: 32px; align-items: start; }
.panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.callout {
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  background: var(--accent-ghost);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
  font-size: 14px;
  margin-top: 14px;
}

/* Ticklist */
.ticklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tick-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: all .2s ease;
}
.tick-row.ok { background: var(--ok-bg); border-color: rgba(30,122,61,0.2); }
.tick-row.sensei-verified { border-left: 3px solid var(--gold); }
.inline-tick-form { margin: 0; }
button.tick {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid rgba(15,23,42,0.25);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: all .15s ease;
  flex-shrink: 0;
  margin-top: 1px;
}
button.tick.ticked { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tick-text strong { font-size: 15px; color: var(--text-1); }
.sub-text { color: var(--text-2); font-size: 13.5px; }
.tick-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.prog-notes { font-size: 12px; font-style: italic; color: var(--text-2); }

/* Video Player */
.video-container { margin-bottom: 24px; }
.player {
  background: #0F172A;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 16/9;
}
.player iframe, .player video { width: 100%; height: 100%; display: block; border: 0; }
.video-caption { font-size: 13.5px; color: var(--text-3); margin-top: 8px; text-align: center; }

/* Tables */
.throw-table-wrap { overflow-x: auto; margin-top: 10px; }
.throw-table { width: 100%; border-collapse: collapse; font-size: 14.5px; text-align: left; }
.throw-table th {
  background: var(--surface);
  color: var(--text-3);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.throw-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.throw-table tr:last-child td { border-bottom: 0; }
.throw-table tr:hover td { background: var(--surface); }
.kanji-col { font-family: 'Noto Serif JP', serif; font-size: 17px; }
.type-tag {
  font-size: 11.5px;
  font-weight: 600;
  background: var(--accent-ghost);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent-mid);
}
.time-jump-link {
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-ghost);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}
.time-jump-link:hover { text-decoration: none; background: rgba(27,42,74,0.12); }

/* Pager */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pager a { display: flex; flex-direction: column; gap: 3px; max-width: 48%; }
.pager a:hover { text-decoration: none; }
.pager a small { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 600; }
.pager a span { font-weight: 700; color: var(--text-1); }
.pager a.next { text-align: right; align-items: flex-end; margin-left: auto; }

/* Kata Cards */
.kata-sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.kata-set-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.set-num { font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--accent); letter-spacing: 0.05em; }
.kata-set-card h3 { font-size: 15.5px; margin: 4px 0 10px; }
.kata-tech-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); }
.kata-tech-list li { margin: 4px 0; }

/* Documents Grid */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.doc-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.doc-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.doc-card h3 { font-size: 17px; margin: 0 0 8px; }
.doc-card p { font-size: 14px; color: var(--text-2); flex: 1; margin: 0 0 16px; }

/* Printable Certificate Slip */
.cert-card {
  background: #FFFDF9;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 820px;
  margin: 0 auto;
  padding: 20px;
}
.cert-border {
  border: 2px solid #8C7355;
  border-radius: 10px;
  padding: 36px 40px;
  position: relative;
}
.cert-head { text-align: center; margin-bottom: 28px; }
.cert-kanji-banner {
  font-family: 'Noto Serif JP', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}
.cert-head h2 { font-size: 26px; margin: 0; color: #1E293B; letter-spacing: -0.01em; }
.cert-subhead { font-size: 15px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-top: 4px; }
.cert-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.cert-field label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 600; margin-bottom: 3px; }
.cert-field .val { font-size: 16px; color: var(--text-1); }
.cert-field .val.highlight { font-size: 22px; font-weight: 700; color: var(--accent); }
.cert-summary-box {
  background: rgba(27,42,74,0.03);
  border: 1px solid rgba(27,42,74,0.1);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
}
.cert-summary-box h3 { font-size: 15px; margin: 0 0 6px; }
.cert-summary-box p { font-size: 14.5px; margin: 0; color: var(--text-2); }
.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 36px;
  padding-top: 20px;
}
.cert-sig-block { width: 240px; }
.sig-line { border-bottom: 1px solid #1E293B; height: 36px; margin-bottom: 6px; }
.sig-label { font-size: 13px; font-weight: 600; color: var(--text-1); }
.sig-title { font-size: 12px; color: var(--text-3); }
.cert-hanko-block { text-align: center; }
.hanko-seal-stamp {
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(163,56,42,0.15);
}
.hanko-label { font-size: 11.5px; color: var(--text-3); margin-top: 4px; font-weight: 600; }
.print-actions { display: flex; justify-content: flex-end; gap: 12px; margin-bottom: 20px; }

/* Auth Pages */
.auth { display: grid; place-items: center; padding: 24px 0 40px; }
.auth-card {
  width: min(460px, 100%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 30px 28px;
  box-shadow: var(--shadow);
}
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-seal { margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid rgba(15,23,42,0.18);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-1);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-light);
  outline-offset: 1px;
  border-color: var(--accent);
}
input.copy { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* Site Footer */
.site-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-mottos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.motto-item { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; }
.motto-item .kanji { font-family: 'Noto Serif JP', serif; font-size: 16px; font-weight: 700; color: var(--accent); }
.motto-item .romaji { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; }
.motto-item .en { font-size: 12px; color: var(--text-2); font-weight: 500; }
.motto-divider { color: var(--border); }
.footer-legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-hanko { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); font-weight: 600; }

/* Print Media */
@media print {
  body { padding: 0; background: #fff; }
  .topbar, .site-footer, .no-print, .crumbs, .pager { display: none !important; }
  .cert-card { box-shadow: none; padding: 0; }
  .cert-border { border: 2px solid #000; }
}

@media (max-width: 820px) {
  .hero, .two-col { grid-template-columns: 1fr; }
  .cert-border { padding: 20px; }
}
