/* ===========================================================================
   OSS Academy — clean & bright base + belt-color accent system
   =========================================================================== */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --ink: #15171c;
  --ink-soft: #545a66;
  --line: #e3e6ec;
  --brand: #1d4ed8;
  --brand-dark: #1733a3;
  --accent: #e11d48;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(20, 25, 40, .07);
  --shadow-lg: 0 16px 48px rgba(20, 25, 40, .12);
  --maxw: 1160px;

  /* belt colors */
  --belt-white: #d7d9df;
  --belt-blue: #2563eb;
  --belt-purple: #7c3aed;
  --belt-brown: #78350f;
  --belt-black: #18181b;

  --ff-sans: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-display: "Oswald", "Heebo", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
h1, h2, h3 { line-height: 1.2; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  font-size: 24px; color: #fff; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: var(--shadow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--ff-display); font-size: 20px; letter-spacing: .5px; }
.brand-text small { color: var(--ink-soft); font-size: 12px; }

.main-nav { display: flex; gap: 6px; margin-inline-start: auto; }
.main-nav a {
  padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 15px;
  color: var(--ink-soft); transition: .18s;
}
.main-nav a:hover { color: var(--ink); background: var(--surface-2); }
.main-nav a.active { color: #fff; background: var(--brand); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-lang {
  font-family: var(--ff-display); font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); padding: 8px 14px; border-radius: 999px; cursor: pointer;
  transition: .18s;
}
.btn-lang:hover { border-color: var(--brand); color: var(--brand); }
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; padding: 13px 26px; border-radius: 999px;
  cursor: pointer; border: 2px solid transparent; transition: .18s; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); }

/* ---------- Views ---------- */
.view { display: none; padding: 54px 0 76px; animation: fade .35s ease; }
.view.active { display: block; }
.hero.active { padding-top: 40px; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-title {
  font-family: var(--ff-display); font-size: clamp(28px, 4vw, 40px);
  font-weight: 700; letter-spacing: .5px; margin-bottom: 8px;
}
.section-title::after {
  content: ""; display: block; width: 64px; height: 4px; margin-top: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--belt-white), var(--belt-blue), var(--belt-purple), var(--belt-brown), var(--belt-black));
}
.section-intro { color: var(--ink-soft); max-width: 720px; margin-bottom: 26px; font-size: 17px; }

/* ---------- Hero ---------- */
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding-block: 30px 50px; }
.kicker {
  display: inline-block; font-family: var(--ff-display); letter-spacing: 2px;
  text-transform: uppercase; font-size: 13px; color: var(--brand);
  background: #e7edff; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero-copy h1 { font-family: var(--ff-display); font-size: clamp(34px, 5.2vw, 56px); font-weight: 700; letter-spacing: .5px; }
.hero-copy p { color: var(--ink-soft); font-size: 18px; margin: 18px 0 28px; max-width: 540px; }
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 30px; margin-top: 38px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--ff-display); font-size: 32px; color: var(--brand); }
.hero-stats span { font-size: 14px; color: var(--ink-soft); }

.hero-belts { display: flex; flex-direction: column; gap: 14px; }
.belt-bar {
  height: 46px; border-radius: 12px; display: flex; align-items: center;
  padding-inline: 18px; font-family: var(--ff-display); font-weight: 600;
  letter-spacing: 1px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .2s;
}
.belt-bar:hover { transform: scale(1.02); }
.belt-bar::after {
  content: ""; position: absolute; inset-inline-end: 18px; top: 0; bottom: 0;
  width: 26px; background: rgba(0,0,0,.22);
}

/* ---------- Features ---------- */
.features { margin-top: 24px; }
.features h2 { font-family: var(--ff-display); font-size: 26px; margin-bottom: 20px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--shadow); transition: .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card .fi { font-size: 30px; }
.feature-card h3 { font-size: 18px; margin: 12px 0 6px; }
.feature-card p { color: var(--ink-soft); font-size: 15px; }

/* ---------- Toolbar / search ---------- */
.toolbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.search-input {
  width: 100%; max-width: 420px; font-family: inherit; font-size: 16px;
  padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); transition: .18s;
}
.search-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px #e7edff; }
.search-wide { max-width: 480px; margin-bottom: 24px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 14px; font-weight: 500; padding: 7px 15px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); transition: .15s;
}
.chip:hover { border-color: var(--brand); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips-belt .chip.active { color: #fff; }

/* ---------- Card grid (techniques) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.tech-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: .2s; border-top: 4px solid var(--line);
}
.tech-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tech-head { padding: 18px 20px 12px; }
.tech-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.badge {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft);
}
.badge-belt { color: #fff; }
.tech-card h3 { font-size: 19px; }
.tech-pt { color: var(--accent); font-size: 13px; font-weight: 500; font-style: italic; }
.tech-summary { color: var(--ink-soft); font-size: 15px; padding: 0 20px 14px; flex: 1; }
.tech-toggle {
  margin: 0 20px 18px; background: var(--surface-2); border: none; border-radius: var(--radius-sm);
  padding: 10px; font-family: inherit; font-weight: 600; font-size: 14px; color: var(--brand);
  cursor: pointer; transition: .15s;
}
.tech-toggle:hover { background: #e7edff; }
.tech-detail { padding: 0 20px 18px; display: none; }
.tech-detail.open { display: block; animation: fade .25s; }
.tech-detail h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); margin-bottom: 8px; }
.tech-detail ol { padding-inline-start: 20px; margin-bottom: 14px; }
.tech-detail ol li { margin-bottom: 6px; font-size: 15px; }
.tech-tip {
  background: #fff7ed; border-inline-start: 4px solid #f59e0b; border-radius: 8px;
  padding: 10px 14px; font-size: 14px; color: #7c4a03;
}

/* ---------- Learning path ---------- */
.progress-overall { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); margin-bottom: 30px; }
.progress-row { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 10px; font-family: var(--ff-display); }
.progress-track { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; transition: width .5s ease;
  background: linear-gradient(90deg, var(--belt-blue), var(--belt-purple), var(--belt-brown)); }

.path-list { display: flex; flex-direction: column; gap: 18px; }
.path-stage {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; border-inline-start: 6px solid var(--line);
}
.stage-head { display: flex; align-items: center; gap: 16px; padding: 20px 22px; cursor: pointer; }
.stage-belt {
  width: 54px; height: 54px; flex: none; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--ff-display); font-weight: 700; font-size: 13px; color: #fff;
  box-shadow: var(--shadow);
}
.stage-info { flex: 1; }
.stage-info h3 { font-family: var(--ff-display); font-size: 21px; }
.stage-info .belt-name { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.stage-count { font-family: var(--ff-display); font-weight: 700; color: var(--brand); font-size: 15px; white-space: nowrap; }
.stage-chevron { transition: transform .25s; color: var(--ink-soft); font-size: 18px; }
.path-stage.open .stage-chevron { transform: rotate(180deg); }
.stage-body { display: none; padding: 0 22px 22px; }
.path-stage.open .stage-body { display: block; animation: fade .25s; }
.stage-desc { color: var(--ink-soft); margin-bottom: 16px; }
.goal-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.goal-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm); cursor: pointer; transition: .15s; }
.goal-item:hover { background: #e7edff; }
.goal-item input { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; flex: none; }
.goal-item.done span { text-decoration: line-through; color: var(--ink-soft); }

/* ---------- Glossary ---------- */
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.glossary-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); transition: .2s; border-inline-start: 4px solid var(--brand);
}
.glossary-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.glossary-card h3 { font-family: var(--ff-display); font-size: 19px; color: var(--brand-dark); margin-bottom: 6px; }
.glossary-card p { color: var(--ink-soft); font-size: 15px; }

/* ---------- Journal ---------- */
.journal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.jstat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.jstat b { display: block; font-family: var(--ff-display); font-size: 34px; color: var(--brand); }
.jstat span { font-size: 13px; color: var(--ink-soft); }

.journal-form {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 34px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: span 2; }
.field-submit { grid-column: 1 / -1; align-items: flex-start; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #e7edff; }

.log-title { font-family: var(--ff-display); font-size: 22px; margin-bottom: 16px; }
.journal-log { display: flex; flex-direction: column; gap: 12px; }
.log-entry {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow); border-inline-start: 5px solid var(--brand);
}
.log-entry.type-gi { border-inline-start-color: var(--belt-blue); }
.log-entry.type-nogi { border-inline-start-color: var(--accent); }
.log-entry.type-open { border-inline-start-color: var(--belt-purple); }
.log-date { font-family: var(--ff-display); font-size: 15px; font-weight: 600; text-align: center; min-width: 70px; }
.log-date small { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.log-body h4 { font-size: 16px; margin-bottom: 2px; }
.log-body .log-meta { font-size: 13px; color: var(--ink-soft); }
.log-body .log-notes { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.log-del { background: none; border: none; color: var(--ink-soft); font-size: 18px; cursor: pointer; padding: 6px; border-radius: 8px; transition: .15s; }
.log-del:hover { background: #fee2e2; color: var(--accent); }

.empty-msg { color: var(--ink-soft); font-size: 16px; padding: 30px 0; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 30px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 22px; flex-wrap: wrap; }
.footer-inner span { color: var(--ink-soft); font-size: 14px; }
.btn-reset { background: none; border: 1px solid var(--line); color: var(--ink-soft); padding: 7px 14px; border-radius: 999px; font-family: inherit; font-size: 13px; cursor: pointer; transition: .15s; }
.btn-reset:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-belts { flex-direction: row; flex-wrap: wrap; }
  .belt-bar { flex: 1; min-width: 110px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .journal-stats { grid-template-columns: repeat(2, 1fr); }
  .journal-form { grid-template-columns: repeat(2, 1fr); }
  .field-wide { grid-column: span 2; }
}
@media (max-width: 620px) {
  .main-nav {
    position: absolute; top: 66px; inset-inline: 0; background: var(--surface);
    flex-direction: column; gap: 0; padding: 8px; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg); display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 16px; border-radius: var(--radius-sm); }
  .nav-toggle { display: block; }
  .feature-grid { grid-template-columns: 1fr; }
  .journal-stats { grid-template-columns: repeat(2, 1fr); }
  .journal-form { grid-template-columns: 1fr; }
  .field-wide { grid-column: span 1; }
  .log-entry { grid-template-columns: auto 1fr; }
  .log-del { grid-column: 2; justify-self: end; }
  .hero-stats { gap: 20px; }
}
