/* ============================================================
   コモリ進学塾 — standalone academic theme
   Indigo/navy scholarly palette + chalkboard hero accents.
   ============================================================ */

:root {
    --navy: #16214d;        /* deep scholarly navy */
    --indigo: #2b3a8f;      /* primary indigo */
    --indigo-d: #1e2a6e;
    --board: #1d3350;       /* chalkboard blue-slate */
    --board-edge: #8a6a3f;  /* wooden frame */
    --chalk: #f3f6ef;       /* chalk white */
    --chalk-yellow: #f5dd90;
    --gold: #c9a227;        /* academic gold accent */
    --ink: #232840;
    --muted: #626a85;
    --paper: #f6f6f2;       /* notebook paper background */
    --surface: #ffffff;
    --line: #e3e4ec;
    --rule: #d9def0;        /* ruled-line blue */
    --sans: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --serif: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--indigo); text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── topbar ─────────────────────────────────────────────── */
.topbar { background: var(--navy); color: #cdd4ee; font-size: 12.5px; }
.topbar-inner { display: flex; justify-content: space-between; gap: 16px; padding: 6px 20px; }
.topbar a { color: #cdd4ee; }
.topbar a:hover { color: #fff; }

/* ── header / nav ───────────────────────────────────────── */
.site-header {
    background: var(--surface);
    border-bottom: 3px solid var(--indigo);
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 1px 8px rgba(22, 33, 77, .08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-mark {
    width: 48px; height: 48px; flex: 0 0 48px;
    display: grid; place-items: center;
    background: var(--indigo);
    color: var(--chalk);
    font-family: var(--serif); font-weight: 900; font-size: 26px;
    border-radius: 6px;
    border: 2px solid var(--navy);
    box-shadow: inset 0 0 0 2px rgba(243, 246, 239, .25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--serif); font-weight: 900; font-size: 20px; letter-spacing: .04em; color: var(--navy); }
.brand-sub { font-size: 11px; color: var(--muted); }
.header-end { display: flex; align-items: center; gap: 14px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
    padding: 8px 13px; font-size: 14.5px; font-weight: 500; color: var(--ink);
    border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--indigo); }
.nav a.on { color: var(--indigo); border-bottom-color: var(--gold); font-weight: 700; }
.nav .nav-cta {
    margin-left: 8px; background: var(--gold); color: var(--navy);
    border-radius: 4px; font-weight: 700; border-bottom: none;
    padding: 9px 16px;
}
.nav .nav-cta:hover { background: #b8921f; color: #fff; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; font-size: 12px; }
.lang-switch a { padding: 5px 10px; color: var(--muted); font-weight: 700; }
.lang-switch a.on { background: var(--navy); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--navy); display: block; }

/* ── chalkboard hero ────────────────────────────────────── */
.hero-board {
    position: relative;
    background:
        /* chalk dust smudges */
        radial-gradient(ellipse 480px 160px at 18% 82%, rgba(243, 246, 239, .06), transparent 70%),
        radial-gradient(ellipse 380px 140px at 85% 24%, rgba(243, 246, 239, .05), transparent 70%),
        radial-gradient(ellipse 300px 220px at 60% 90%, rgba(243, 246, 239, .04), transparent 70%),
        /* fine grain texture */
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 4px),
        /* board surface */
        linear-gradient(160deg, #24406a 0%, var(--board) 45%, #16273f 100%);
    color: var(--chalk);
    border-top: 6px solid var(--board-edge);
    border-bottom: 10px solid var(--board-edge);
    box-shadow: inset 0 0 90px rgba(0, 0, 0, .35);
    overflow: hidden;
}
.hero-board-inner {
    display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px;
    align-items: center; padding: 72px 20px 88px;
}
.hero-kicker {
    display: inline-block; font-size: 13px; letter-spacing: .12em;
    color: var(--chalk-yellow); border: 1px dashed rgba(245, 221, 144, .55);
    padding: 4px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero-title {
    font-family: var(--serif); font-weight: 900;
    font-size: clamp(30px, 4.6vw, 46px); line-height: 1.35;
    letter-spacing: .03em;
    text-shadow: 0 0 14px rgba(243, 246, 239, .25);
}
.hero-lead { margin-top: 18px; font-size: 15.5px; color: #dbe2d9; max-width: 34em; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.btn {
    display: inline-block; background: var(--indigo); color: #fff;
    padding: 13px 28px; border-radius: 5px; font-weight: 700; font-size: 15px;
    border: 0; cursor: pointer; font-family: inherit;
    transition: background .15s, transform .15s;
}
.btn:hover { background: var(--indigo-d); transform: translateY(-1px); }
.btn-chalk { background: var(--gold); color: var(--navy); }
.btn-chalk:hover { background: #e0b93a; color: var(--navy); }
.ghost-chalk {
    display: inline-block; padding: 12px 26px; border-radius: 5px;
    font-weight: 700; font-size: 15px; color: var(--chalk);
    border: 1.5px dashed rgba(243, 246, 239, .6);
}
.ghost-chalk:hover { background: rgba(243, 246, 239, .12); color: #fff; }

/* handwritten chalk note panel */
.hero-chalknote {
    position: relative; display: flex; flex-direction: column; gap: 16px;
    padding: 26px 8px; font-family: var(--serif);
    transform: rotate(-1.2deg);
}
.chalk-line {
    color: rgba(243, 246, 239, .92); font-size: 18px; letter-spacing: .05em;
    text-shadow: 0 0 8px rgba(243, 246, 239, .35);
}
.chalk-big { font-size: 26px; font-weight: 700; }
.chalk-jp { font-size: 15px; color: rgba(243, 246, 239, .8); }
.chalk-underline {
    width: 72%; height: 3px; border-radius: 2px;
    background: linear-gradient(90deg, rgba(245, 221, 144, .9), rgba(245, 221, 144, .15));
    box-shadow: 0 0 8px rgba(245, 221, 144, .5);
}
.chalk-circle {
    align-self: flex-start; margin-top: 6px;
    color: var(--chalk-yellow); font-weight: 700; font-size: 17px;
    border: 2.5px solid rgba(245, 221, 144, .8); border-radius: 50% 46% 52% 48% / 58% 52% 48% 42%;
    padding: 12px 22px; transform: rotate(2deg);
    text-shadow: 0 0 10px rgba(245, 221, 144, .4);
}
/* chalk tray */
.chalk-tray {
    position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
    display: flex; gap: 10px; background: var(--board-edge);
    padding: 5px 22px 3px; border-radius: 4px 4px 0 0;
}
.chalk-tray span { width: 34px; height: 7px; border-radius: 3px; background: var(--chalk); opacity: .9; }
.chalk-tray span:nth-child(2) { background: var(--chalk-yellow); width: 26px; }
.chalk-tray span:nth-child(3) { background: #f0b8c4; width: 18px; }

/* ── results stats bar ──────────────────────────────────── */
.results-bar {
    background: var(--navy);
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .02) 0 2px, transparent 2px 8px);
    color: #fff; border-bottom: 4px solid var(--gold);
}
.results-inner { display: flex; align-items: center; gap: 36px; padding: 26px 20px; flex-wrap: wrap; }
.results-label { display: flex; flex-direction: column; min-width: 170px; border-left: 4px solid var(--gold); padding-left: 14px; }
.results-label strong { font-family: var(--serif); font-size: 19px; letter-spacing: .06em; }
.results-label small { font-size: 11.5px; color: #aeb8dd; margin-top: 2px; }
.results-stats { display: flex; gap: 40px; flex: 1; justify-content: space-around; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { font-family: var(--serif); font-weight: 900; font-size: 38px; color: var(--chalk-yellow); line-height: 1.1; display: block; }
.stat-num em { font-style: normal; font-size: 17px; margin-left: 3px; color: #e5d8a5; }
.stat-cap { font-size: 12.5px; color: #c3cbe8; }

/* ── generic sections ───────────────────────────────────── */
.section { padding: 64px 0; }
.section-head { margin-bottom: 34px; }
.section-kicker {
    display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .22em;
    text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.section-h {
    font-family: var(--serif); font-weight: 900; font-size: clamp(24px, 3.2vw, 32px);
    color: var(--navy); letter-spacing: .04em;
    padding-bottom: 10px; position: relative;
}
.section-h::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 56px; height: 4px; background: var(--indigo); border-radius: 2px;
    box-shadow: 64px 0 0 -1px var(--gold);
}
.section-sub { color: var(--muted); margin-top: 12px; font-size: 15px; max-width: 46em; }
.sub-h { font-family: var(--serif); font-size: 20px; color: var(--navy); margin-bottom: 12px; }

.page-head {
    background: linear-gradient(160deg, var(--navy), var(--indigo-d));
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 3px),
        linear-gradient(160deg, var(--navy), var(--indigo-d));
    color: #fff; padding: 46px 0 40px;
    border-bottom: 4px solid var(--gold);
}
.page-head .section-h { color: #fff; }
.page-head .section-h::after { background: var(--gold); box-shadow: 64px 0 0 -1px rgba(255, 255, 255, .5); }
.page-head .section-sub { color: #c9d1ee; }

/* ── timetable (courses) ────────────────────────────────── */
.timetable-scroll { overflow-x: auto; }
.timetable {
    width: 100%; min-width: 720px; border-collapse: collapse;
    background: var(--surface);
    border: 2px solid var(--navy);
    box-shadow: 6px 6px 0 rgba(22, 33, 77, .12);
    font-size: 14.5px;
}
.timetable thead th {
    background: var(--navy); color: var(--chalk);
    font-family: var(--serif); font-weight: 700; letter-spacing: .08em;
    padding: 13px 16px; text-align: left; font-size: 13.5px;
    border-right: 1px solid rgba(243, 246, 239, .15);
}
.timetable thead th:last-child { border-right: 0; }
.timetable tbody td {
    padding: 15px 16px; border-bottom: 1px solid var(--rule);
    border-right: 1px dashed var(--rule); vertical-align: middle;
}
.timetable tbody td:last-child { border-right: 0; }
.timetable tbody tr:nth-child(even) { background: #f4f6fc; }
.timetable tbody tr:hover { background: #ecf0fb; }
.timetable tbody tr:last-child td { border-bottom: 0; }
.tt-course { font-weight: 700; color: var(--navy); }
.tt-grade, .tt-schedule { color: var(--muted); white-space: nowrap; }
.tt-fee { white-space: nowrap; text-align: right; }
.tt-fee strong { font-family: var(--serif); font-size: 17px; color: var(--indigo-d); }
.tt-fee small { color: var(--muted); margin-left: 2px; }
.tt-empty { text-align: center; color: var(--muted); padding: 30px; }
.subject-chip {
    display: inline-block; background: var(--indigo); color: #fff;
    font-family: var(--serif); font-weight: 700; font-size: 13px;
    padding: 5px 12px; border-radius: 3px; letter-spacing: .1em;
    white-space: nowrap;
    box-shadow: 2px 2px 0 rgba(22, 33, 77, .25);
}
.timetable-note { margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ── pillars ────────────────────────────────────────────── */
.section-pillars {
    background:
        repeating-linear-gradient(0deg, transparent 0 30px, var(--rule) 30px 31px),
        #fbfbf7;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pillar {
    background: var(--surface); border: 1.5px solid var(--navy);
    border-radius: 6px; padding: 26px 22px 22px; position: relative;
    box-shadow: 4px 4px 0 rgba(22, 33, 77, .1);
}
.pillar-num {
    position: absolute; top: -16px; left: 18px;
    width: 36px; height: 36px; display: grid; place-items: center;
    background: var(--gold); color: var(--navy); border-radius: 50%;
    font-family: var(--serif); font-weight: 900; font-size: 18px;
    border: 2px solid var(--navy);
}
.pillar h3 { font-family: var(--serif); font-size: 17px; color: var(--navy); margin: 6px 0 8px; }
.pillar p { font-size: 13.8px; color: var(--muted); }

/* ── consultation CTA ───────────────────────────────────── */
.consult-cta {
    background:
        radial-gradient(ellipse 400px 150px at 80% 20%, rgba(243, 246, 239, .05), transparent 70%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .015) 0 1px, transparent 1px 3px),
        linear-gradient(150deg, #24406a, var(--board) 55%, #16273f);
    color: var(--chalk);
    border-top: 5px solid var(--board-edge);
    border-bottom: 8px solid var(--board-edge);
    box-shadow: inset 0 0 70px rgba(0, 0, 0, .3);
}
.consult-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 32px; padding: 52px 20px; flex-wrap: wrap;
}
.consult-kicker { font-size: 12.5px; letter-spacing: .18em; color: var(--chalk-yellow); }
.consult-copy h2 {
    font-family: var(--serif); font-weight: 900; font-size: clamp(21px, 3vw, 28px);
    margin: 8px 0 10px; text-shadow: 0 0 12px rgba(243, 246, 239, .2);
}
.consult-copy p { color: #d5dcd2; max-width: 38em; font-size: 14.5px; }
.consult-action { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.consult-tel a { color: var(--chalk); font-family: var(--serif); font-size: 18px; font-weight: 700; }

/* ── about page ─────────────────────────────────────────── */
.profile-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 2px solid var(--navy); box-shadow: 6px 6px 0 rgba(22, 33, 77, .12); font-size: 14.5px; }
.profile-table th, .profile-table td { padding: 14px 18px; border-bottom: 1px solid var(--rule); text-align: left; }
.profile-table tr:last-child th, .profile-table tr:last-child td { border-bottom: 0; }
.profile-table th {
    width: 200px; background: #eef1fa; color: var(--navy);
    font-family: var(--serif); font-weight: 700; border-right: 1px dashed var(--rule);
}
.principal-note {
    margin-top: 40px; background: var(--surface);
    border-left: 5px solid var(--gold); border-radius: 0 6px 6px 0;
    padding: 24px 26px; box-shadow: 0 2px 10px rgba(22, 33, 77, .07);
}
.principal-note p { color: #454d6b; font-size: 14.8px; }
.about-results { margin-top: 40px; }
.pass-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pass-list li {
    background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
    padding: 13px 16px 13px 42px; position: relative; font-size: 14.5px; font-weight: 500;
}
.pass-list li::before {
    content: '合'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; display: grid; place-items: center;
    background: var(--indigo); color: #fff; border-radius: 50%;
    font-family: var(--serif); font-size: 12px; font-weight: 700;
}

/* ── contact page ───────────────────────────────────────── */
.contact-layout { display: grid; grid-template-columns: 320px 1fr; gap: 36px; align-items: start; }
.contact-aside {
    background: var(--surface); border: 1.5px solid var(--navy); border-radius: 6px;
    padding: 24px; display: flex; flex-direction: column; gap: 10px;
    box-shadow: 4px 4px 0 rgba(22, 33, 77, .1);
}
.contact-aside h2 { font-family: var(--serif); font-size: 17px; color: var(--navy); }
.contact-aside a { font-weight: 700; }
.aside-hours { font-size: 12.5px; color: var(--muted); }
.map-placeholder {
    margin-top: 8px; height: 150px; display: grid; place-items: center;
    background: repeating-linear-gradient(45deg, #eef1fa 0 10px, #e6eaf7 10px 20px);
    border: 1px dashed var(--indigo); border-radius: 5px;
    color: var(--indigo); font-size: 13px; font-weight: 700;
}
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--navy); }
.form input, .form textarea {
    font: inherit; padding: 11px 13px; border: 1.5px solid var(--line);
    border-radius: 5px; background: var(--surface);
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(43, 58, 143, .12); }
.form .btn { align-self: flex-start; }
.notice { padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 18px; }
.notice.ok { background: #eaf1e6; color: #33591f; border: 1px solid #c4d8b6; }

/* ── footer ─────────────────────────────────────────────── */
.site-footer {
    background: var(--navy); color: #b9c2e2; margin-top: 0;
    border-top: 4px solid var(--gold);
    background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .015) 0 1px, transparent 1px 4px);
}
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr 1fr; gap: 32px; padding: 44px 20px 30px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-brand { font-family: var(--serif); font-weight: 900; font-size: 18px; color: #fff; display: flex; align-items: center; gap: 8px; }
.footer-mark {
    width: 30px; height: 30px; display: inline-grid; place-items: center;
    background: var(--indigo); border-radius: 4px; font-size: 16px; color: var(--chalk);
    border: 1px solid rgba(243, 246, 239, .35);
}
.footer-tag, .footer-note, .footer-hours { font-size: 12.5px; color: #8e99c4; }
.footer-h { font-family: var(--serif); font-weight: 700; color: #fff; font-size: 14px; margin-bottom: 4px; letter-spacing: .1em; }
.footer-col a { color: #b9c2e2; }
.footer-col a:hover { color: #fff; }
.footer-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, .12); padding: 14px 20px; font-size: 12.5px; color: #8e99c4;
}
.footer-bar strong { color: #c9d1ee; }
.admin-link { color: #6f7aa8; }
.admin-link:hover { color: #fff; }

/* ── reveal animation ───────────────────────────────────── */
.reveal { animation: rise .7s ease both; }
.reveal-d1 { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero-board-inner { grid-template-columns: 1fr; padding: 52px 20px 70px; }
    .hero-chalknote { display: none; }
    .pillars { grid-template-columns: 1fr; }
    .contact-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .results-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
    .results-stats { width: 100%; justify-content: space-between; gap: 18px; }
}
@media (max-width: 820px) {
    .nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--surface); flex-direction: column; align-items: stretch;
        border-bottom: 3px solid var(--indigo); padding: 10px 16px 16px;
        box-shadow: 0 12px 24px rgba(22, 33, 77, .14);
    }
    .nav.is-open { display: flex; }
    .nav a { border-bottom: 1px solid var(--line); padding: 12px 6px; }
    .nav .nav-cta { margin: 10px 0 0; text-align: center; }
    .nav-toggle { display: flex; }
    .topbar-inner { flex-direction: column; gap: 2px; align-items: flex-start; }
    .profile-table th { width: 120px; }
    .pass-list { grid-template-columns: 1fr; }
    .stat-num { font-size: 30px; }
}
