/* Maudric site pages (home, course lists, about, privacy). Lesson pages keep their own inline styles. */
:root {
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --fg: #1A1E26;
  --muted: #5E6573;
  --line: #DCE1E8;
  --rt: #6A7282;
  --ginza: #E08A00;
  --marunouchi: #D7121F;
  --chiyoda: #00A676;
  --hanzomon: #7D63C9;
  --hibiya: #8C9AA3;
  --tozai: #009BCF;
  --yurakucho: #B0904F;
  --namboku: #00A09B;
  --fukutoshin: #A9581B;
  --accent: #1F5FB8;
  --accent-fg: #FFFFFF;
  --chip: #EEF2F8;
  --font-jp: "BIZ UDPGothic", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-display: "Zen Kaku Gothic New", "BIZ UDPGothic", "Hiragino Sans", sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11141A; --surface: #1A1E26; --fg: #E9ECF2; --muted: #A0A7B5; --line: #2C323D; --rt: #9AA3B3;
    --ginza: #F5A12A; --marunouchi: #FF4D57; --chiyoda: #2CCB97; --hanzomon: #A48CF0;
    --hibiya: #B4C1C9; --tozai: #3DC1F0; --yurakucho: #D6B672; --namboku: #2CCBC5; --fukutoshin: #E0834A;
    --accent: #6EA6FF; --accent-fg: #0C1220; --chip: #242A35; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11141A; --surface: #1A1E26; --fg: #E9ECF2; --muted: #A0A7B5; --line: #2C323D; --rt: #9AA3B3;
  --ginza: #F5A12A; --marunouchi: #FF4D57; --chiyoda: #2CCB97; --hanzomon: #A48CF0;
  --hibiya: #B4C1C9; --tozai: #3DC1F0; --yurakucho: #D6B672; --namboku: #2CCBC5; --fukutoshin: #E0834A;
  --accent: #6EA6FF; --accent-fg: #0C1220; --chip: #242A35; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 17px; line-height: 1.6;
}
a { color: var(--accent); }
img, picture { max-width: 100%; display: block; }
.jp { font-family: var(--font-jp); }
ruby rt { font-size: 0.55em; color: var(--rt); font-weight: 400; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; line-height: 1.35; margin: 0; }
p { margin: 0; }
.wrap {
  max-width: 960px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-family: var(--font-display); font-weight: 900; font-size: 1.25rem; }
.roundel {
  flex: none; width: 40px; height: 40px; letter-spacing: -0.02em; border-radius: 50%; border: 5px solid var(--c, var(--accent));
  display: grid; place-items: center; font-weight: 700; font-size: 0.95rem; color: var(--fg); background: var(--surface);
  font-family: var(--font-body);
}
.site-nav { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.site-nav a { color: var(--fg); text-decoration: none; font-weight: 700; font-size: 0.95rem; padding: 6px 0; border-bottom: 3px solid transparent; }
.site-nav a[aria-current="page"], .site-nav a:hover { border-bottom-color: var(--accent); }

/* Hero */
.hero { position: relative; color: #fff; background: #3c4a5c; }
.hero picture, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,26,36,0.15) 0%, rgba(20,26,36,0.65) 100%); }
.hero .wrap { position: relative; z-index: 1; min-height: min(70vh, 520px); display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding-block: 40px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 900; }
.hero p { max-width: 36em; font-size: 1.1rem; }
.hero .eyebrow { color: rgba(255,255,255,0.85); }
.banner { aspect-ratio: 2000 / 764; max-height: 340px; width: 100%; border-radius: 14px; overflow: hidden; background: var(--chip); }
.banner img, .banner picture { width: 100%; height: 100%; object-fit: cover; }
.crumb { color: var(--muted); font-weight: 700; text-decoration: none; font-size: 0.9rem; }
.subtitle { font-family: var(--font-display); font-weight: 700; color: var(--muted); }
.group { gap: 14px; }
.group-banner { display: block; }
.group-head { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; }
.group-head h2 { font-size: 1.6rem; }
.group-head h2 a { color: inherit; text-decoration: none; }

.btn {
  display: inline-block; font: inherit; font-weight: 700; padding: 12px 20px; border-radius: 10px; border: 0;
  background: var(--accent); color: var(--accent-fg); text-decoration: none; align-self: flex-start;
}
.btn.ghost { background: transparent; color: inherit; border: 2px solid currentColor; }

/* Sections */
main { display: flex; flex-direction: column; gap: 48px; padding-block: 40px 56px; }
.sec-head { display: flex; align-items: center; gap: 12px; }
.sec-head h2 { font-size: 1.5rem; }

.cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.course-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; color: inherit; text-decoration: none;
  border-top: 5px solid var(--c);
}
.course-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; height: 100%; }
.course-card .card-head { display: flex; gap: 12px; align-items: center; }
.course-card h3 { font-size: 1.2rem; }
.course-card .subtitle { font-size: 0.95rem; }
.course-card .count { margin-top: auto; }
.course-card .count { font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.course-card:hover h3 { text-decoration: underline; }

.points { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .points { grid-template-columns: repeat(3, 1fr); } }
.points li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.points strong { font-family: var(--font-display); font-size: 1.1rem; }

/* Lesson list */
.lesson-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lesson-list a, .lesson-list .planned {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; color: inherit; text-decoration: none;
}
.lesson-list a:hover strong { text-decoration: underline; }
.stn {
  grid-row: span 2; border: 3px solid var(--c); border-radius: 8px; width: 50px; text-align: center;
  line-height: 1.1; padding: 4px 0; font-weight: 700; font-variant-numeric: tabular-nums;
}
.stn small { display: block; font-size: 0.7rem; color: var(--muted); }
.lesson-list strong { font-size: 1.1rem; }
.lesson-list .sum { color: var(--muted); font-size: 0.95rem; }
.lesson-list .planned { opacity: 0.6; border-style: dashed; }
.lesson-list .planned .stn { border-color: var(--line); }
.soon { font-size: 0.75rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; vertical-align: 2px; }

.prose { max-width: 40em; display: flex; flex-direction: column; gap: 14px; }
.prose h2 { font-size: 1.3rem; margin-top: 12px; }
.prose ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }

.support { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--hanzomon); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }

/* Advert slots: only rendered when ads are configured in .env */
.site-ad { min-height: 100px; display: flex; flex-direction: column; gap: 4px; }
.site-ad::before { content: "Advertisement"; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; color: var(--muted); }
.site-footer nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

.notfound { min-height: 70vh; background: var(--bg) url("/assets/img/gravel-800.jpg") center / cover; display: grid; place-items: center; }
.notfound .box { background: var(--surface); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 12px; max-width: 26em; margin: 16px; }

a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
