/* ==========================================================
   まなび舎 ノート — 学習塾 制作サンプル
   ========================================================== */

/* ---------- 0. 変数・土台 ---------- */
:root {
  --white: #ffffff;
  --navy: #17325c;
  --yellow: #ffc93c;
  --pale: #f1f6fd;
  --ink: #1c2433;
  --teal: #3fa7a3;
  --line: rgba(23, 50, 92, 0.1);
  --f-head: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif;
  --f-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --f-num: "Poppins", "Noto Sans JP", sans-serif;
  --gutter: clamp(20px, 5vw, 56px);
  --sec: clamp(96px, 12vw, 168px);
  --grid: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 2;
  overflow-x: hidden;
}
@media (min-width: 768px) { body { font-size: 16px; } }
img { display: block; max-width: 100%; height: auto; object-fit: cover; }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 700; color: var(--navy); line-height: 1.5; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd, figure, blockquote { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.nb { display: inline-block; }
.wrap { width: min(1160px, 100% - var(--gutter) * 2); margin-inline: auto; }

.eyebrow {
  font-family: var(--f-num);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* 方眼の面（区切りの技法2） */
.grid-paper {
  background-color: var(--white);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
}
.grid-paper--strong {
  background-color: #fbfdff;
  background-image:
    linear-gradient(rgba(23, 50, 92, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 50, 92, 0.14) 1px, transparent 1px);
}

/* ボタン */
.btn {
  display: inline-block;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  padding: 16px 30px;
  border-radius: 18px 18px 18px 8px;
  border: 2px solid var(--navy);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn--yellow { background: var(--yellow); color: var(--navy); box-shadow: 4px 4px 0 var(--navy); }
.btn--line { background: var(--white); color: var(--navy); }
.btn:hover { transform: translate(-2px, -2px); }
.btn--yellow:hover { box-shadow: 6px 6px 0 var(--navy); }

/* 節の見出し */
.sec-head { position: relative; margin-bottom: clamp(48px, 6vw, 80px); }
.sec-head h2 { font-size: clamp(28px, 4.2vw, 46px); }
.sec-head__sub { margin-top: 12px; font-size: 14px; color: #4a5568; }
.doodle { display: block; margin-top: 10px; }
.doodle--arrow { position: absolute; right: 4%; top: -4px; }
@media (max-width: 767px) { .doodle--arrow { display: none; } }

/* ---------- 1. ナビ（浮いた白い帯） ---------- */
.nav { position: fixed; top: 16px; left: 0; right: 0; z-index: 50; padding-inline: 16px; pointer-events: none; }
.nav__bar {
  pointer-events: auto;
  position: relative;
  max-width: 1120px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--white);
  border-radius: 999px;
  padding: 10px 12px 10px 22px;
  box-shadow: 0 6px 22px rgba(23, 50, 92, 0.1);
  transition: box-shadow 0.3s ease;
}
.nav.is-scrolled .nav__bar { box-shadow: 0 8px 28px rgba(23, 50, 92, 0.16); }
.nav__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.nav__name { font-family: var(--f-head); font-weight: 700; font-size: 18px; white-space: nowrap; }
.nav__name b { font-family: var(--f-num); font-weight: 700; letter-spacing: 0.08em; font-size: 14px; margin-left: 2px; }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 36px); }
.nav__links a { text-decoration: none; font-weight: 500; font-size: 14px; color: var(--ink); padding: 4px 2px; position: relative; }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; border-radius: 3px;
  background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nav__links a:not(.nav__cta):hover::after { transform: scaleX(1); }
.nav__cta {
  background: var(--yellow); color: var(--navy) !important; font-family: var(--f-head); font-weight: 700; font-size: 14px;
  text-decoration: none; padding: 11px 22px !important; border-radius: 16px 16px 16px 6px; white-space: nowrap;
}
.nav__cta--in-menu { display: none; }
.nav__toggle { display: none; }

@media (max-width: 899px) {
  .nav__bar { padding: 8px 10px 8px 18px; }
  .nav__cta--bar { display: none; }
  .nav__toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 12px; border: 0; border-radius: 50%;
    background: var(--yellow); cursor: pointer;
  }
  .nav__toggle span { display: block; height: 2.5px; background: var(--navy); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
  .nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
  /* 付箋が降りてくるメニュー（JSなしでは常に出している） */
  .nav__links {
    position: absolute; top: calc(100% + 12px); right: 4px; width: min(300px, 86vw);
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff3c4; padding: 26px 24px 22px;
    border-radius: 6px 6px 22px 6px; box-shadow: 0 14px 30px rgba(23, 50, 92, 0.18);
    transform-origin: 80% 0;
  }
  .nav__links::before {
    content: ""; position: absolute; top: -9px; right: 34px; width: 54px; height: 18px;
    background: var(--yellow); border-radius: 3px; transform: rotate(-4deg); opacity: 0.9;
  }
  .nav__links a:not(.nav__cta) { font-family: var(--f-head); font-weight: 700; font-size: 17px; padding: 12px 4px; border-bottom: 1.5px dashed rgba(23, 50, 92, 0.25); color: var(--navy); }
  .nav__links a:not(.nav__cta)::after { display: none; }
  .nav__cta--in-menu { display: block; text-align: center; margin-top: 16px; background: var(--navy); color: var(--white) !important; }
  .js .nav__links {
    visibility: hidden; opacity: 0; transform: translateY(-40px) rotate(-5deg);
    transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.25s ease, visibility 0s linear 0.45s;
  }
  .js .nav__links.is-open { visibility: visible; opacity: 1; transform: translateY(0) rotate(-1.2deg); transition-delay: 0s; }
}

/* ---------- 2. Hero ---------- */
.hero { padding: clamp(120px, 14vw, 156px) 0 clamp(56px, 7vw, 96px); min-height: min(100svh, 960px); display: flex; align-items: center; }
.hero__inner {
  width: min(1240px, 100% - var(--gutter) * 2); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; align-items: center;
}
@media (min-width: 960px) { .hero__inner { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 40px; } }
.hero__text { position: relative; }
.hero__title { font-size: clamp(44px, 7.4vw, 92px); line-height: 1.3; letter-spacing: 0.02em; margin: 6px 0 28px; }
.hero__title .mark { display: inline-block; background: linear-gradient(transparent 68%, var(--yellow) 68% 90%, transparent 90%); padding-right: 0.08em; }
.hero__lead { max-width: 30em; font-size: clamp(15px, 1.4vw, 17px); }
.hero__btns { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }
.doodle--hero { position: absolute; right: 8%; bottom: -70px; display: none; }
@media (min-width: 960px) { .doodle--hero { display: block; } }

/* コラージュ */
.collage { position: relative; width: 100%; max-width: 720px; margin-inline: auto; aspect-ratio: 1 / 1.06; }
.collage img { position: absolute; border: 6px solid var(--white); box-shadow: 0 10px 28px rgba(23, 50, 92, 0.16); }
.collage__a { left: 0; top: 6%; width: 68%; aspect-ratio: 1200 / 1400; border-radius: 40px; transform: rotate(-3.5deg); z-index: 2; }
.collage__b { right: 0; top: 0; width: 33%; aspect-ratio: 1; border-radius: 50%; transform: rotate(5deg); z-index: 3; }
.collage__c { right: 3%; bottom: 0; width: 33%; aspect-ratio: 900 / 1300; border-radius: 44px; transform: rotate(3deg); z-index: 4; }
.collage__sun { position: absolute; right: 8%; top: 20%; width: 60%; aspect-ratio: 1; border-radius: 50%; background: var(--yellow); z-index: 1; }
.collage__dots {
  position: absolute; left: -2%; bottom: 2%; width: 46%; aspect-ratio: 1.2; z-index: 0;
  background-image: radial-gradient(var(--teal) 3px, transparent 3.5px); background-size: 22px 22px;
}
.collage__note {
  position: absolute; left: 8%; bottom: 6%; z-index: 5; background: #fff3c4; color: var(--navy);
  font-family: var(--f-head); font-weight: 700; font-size: clamp(13px, 1.6vw, 17px); line-height: 1.6;
  padding: 16px 20px 14px; transform: rotate(-6deg); border-radius: 4px 4px 14px 4px; box-shadow: 0 8px 18px rgba(23, 50, 92, 0.18);
}
.collage__note::before { content: ""; position: absolute; top: -8px; left: 50%; width: 44px; height: 14px; margin-left: -22px; background: var(--teal); opacity: 0.75; border-radius: 2px; transform: rotate(3deg); }

/* ---------- 3. 数字の帯 ---------- */
.stats { background: var(--navy); color: var(--white); padding: clamp(40px, 5vw, 64px) 0; }
.stats__list { width: min(1160px, 100% - var(--gutter) * 2); margin-inline: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 20px; }
@media (min-width: 900px) { .stats__list { grid-template-columns: repeat(4, 1fr); } .stats__list li + li { border-left: 1.5px dashed rgba(255, 255, 255, 0.28); } }
.stats__list li { text-align: center; padding-inline: 8px; }
.stats__num { display: block; font-family: var(--f-num); color: var(--yellow); line-height: 1.1; }
.stats__num b { font-weight: 700; font-size: clamp(44px, 6vw, 76px); letter-spacing: -0.01em; }
.stats__num small { font-family: var(--f-head); font-weight: 700; font-size: clamp(15px, 1.6vw, 20px); margin-left: 4px; color: var(--white); }
.stats__label { display: block; margin-top: 8px; font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, 0.88); }

/* ---------- 4. 特長（ジグザグ） ---------- */
.features { padding: var(--sec) 0; }
.zig { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: center; margin-bottom: clamp(64px, 9vw, 120px); }
.zig:last-child { margin-bottom: 0; }
@media (min-width: 900px) {
  .zig { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(48px, 7vw, 96px); }
  .zig--rev { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .zig--rev .zig__photo { order: 2; }
}
.zig__photo { position: relative; margin: 0 0 14px 14px; }
.zig__photo::before { content: ""; position: absolute; inset: 0; transform: translate(-16px, 16px); border-radius: 32px; z-index: 0; }
.zig__photo--1::before { background: var(--yellow); }
.zig__photo--2::before { background: var(--pale); border: 2px solid var(--navy); }
.zig__photo--3::before { background: var(--teal); opacity: 0.85; }
.zig__photo img { position: relative; z-index: 1; width: 100%; aspect-ratio: 4 / 3; border-radius: 32px; }
.zig__no { display: inline-block; font-family: var(--f-num); font-weight: 700; font-size: 15px; color: var(--navy); background: var(--yellow); padding: 2px 16px; border-radius: 999px 999px 999px 4px; margin-bottom: 18px; letter-spacing: 0.08em; }
.zig__body h3 { font-size: clamp(22px, 2.8vw, 30px); margin-bottom: 20px; }
.zig__body p { max-width: 36em; }

/* ---------- 5. コース（方眼＋付箋タブ） ---------- */
.courses { padding: var(--sec) 0; }
.panel__title { font-size: 20px; margin-bottom: 20px; }
.js .panel__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabs__list { display: none; gap: 6px; padding-left: 8px; }
.js .tabs__list { display: flex; }
.tab {
  font-family: var(--f-head); font-weight: 700; font-size: clamp(15px, 1.8vw, 18px); color: var(--navy);
  background: #fff3c4; border: 0; cursor: pointer; padding: 20px clamp(20px, 3.4vw, 44px) 12px;
  clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 100%); transition: background 0.2s ease, transform 0.2s ease;
  margin-bottom: -1px;
}
.tab:hover { transform: translateY(-3px); }
.tab[aria-selected="true"] { background: var(--yellow); padding-top: 26px; }
.tab:focus-visible { clip-path: none; outline-offset: -3px; }
.tabs__panel { background: var(--white); border: 2px solid var(--navy); border-radius: 8px 28px 28px 28px; padding: clamp(24px, 4vw, 48px); margin-bottom: 28px; box-shadow: 8px 8px 0 rgba(23, 50, 92, 0.08); }
.js .tabs__panel { margin-bottom: 0; border-top-left-radius: 8px; }
.js .tabs__panel[hidden] { display: none; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; } }
.card { background: var(--pale); border-radius: 22px; padding: clamp(24px, 3vw, 36px); position: relative; }
.card__tag { display: inline-block; font-family: var(--f-head); font-weight: 700; font-size: 13px; color: var(--navy); background: var(--yellow); padding: 3px 14px; border-radius: 999px 999px 999px 4px; margin-bottom: 14px; }
.card h4 { font-size: clamp(19px, 2vw, 23px); margin-bottom: 16px; }
.card dl { display: grid; grid-template-columns: 5.5em 1fr; gap: 8px 12px; font-size: 14.5px; line-height: 1.9; }
.card dt { font-weight: 700; color: var(--teal); }

/* ---------- 6. 合格実績（波形の淡い青：区切りの技法1） ---------- */
.results { position: relative; }
.wave { display: block; width: 100%; height: clamp(40px, 6vw, 90px); }
.wave--top { margin-bottom: -1px; }
.wave--bottom { margin-top: -1px; }
.results__body { background: var(--pale); padding: clamp(24px, 4vw, 48px) 0; }
.results__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; }
@media (min-width: 960px) { .results__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 72px; align-items: start; } }
.big-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
.big-nums li { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; column-gap: 6px; border-top: 3px solid var(--navy); padding-top: 14px; }
.big-nums__n { font-family: var(--f-num); font-weight: 700; font-size: clamp(60px, 8vw, 104px); line-height: 1; color: var(--navy); }
.big-nums__u { font-family: var(--f-head); font-weight: 700; font-size: clamp(16px, 1.8vw, 22px); color: var(--navy); }
.big-nums__l { grid-column: 1 / -1; margin-top: 8px; font-size: 14px; line-height: 1.6; }
.voices { display: grid; gap: 36px; }
.bubble { position: relative; background: var(--white); border-radius: 26px; padding: 28px 28px 24px; box-shadow: 0 6px 16px rgba(23, 50, 92, 0.08); }
.bubble::after { content: ""; position: absolute; bottom: -16px; left: 44px; width: 30px; height: 30px; background: var(--white); transform: skewX(-24deg) rotate(30deg); border-radius: 0 0 8px 0; z-index: 0; }
.bubble--b { margin-left: clamp(0px, 4vw, 40px); background: var(--yellow); }
.bubble--b::after { background: var(--yellow); left: auto; right: 44px; transform: skewX(24deg) rotate(-30deg); }
.bubble blockquote { position: relative; z-index: 1; font-size: 15px; line-height: 1.95; }
.bubble figcaption { position: relative; z-index: 1; margin-top: 12px; font-family: var(--f-head); font-weight: 700; font-size: 13px; color: var(--navy); }

/* ---------- 7. 料金 ---------- */
.price { padding: var(--sec) 0; }
.price__cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
@media (min-width: 900px) { .price__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; align-items: end; } }
.pcard { position: relative; border: 2px solid var(--navy); border-radius: 26px; padding: 36px 28px 28px; background: var(--white); }
.pcard--main { background: var(--navy); color: var(--white); padding-top: 52px; padding-bottom: 40px; }
.pcard--main h3 { color: var(--white); }
.pcard__flag { position: absolute; top: -16px; left: 28px; background: var(--yellow); color: var(--navy); font-family: var(--f-head); font-weight: 700; font-size: 13px; padding: 5px 16px; border-radius: 6px 6px 6px 0; transform: rotate(-3deg); }
.pcard h3 { font-size: 22px; margin-bottom: 16px; }
.pcard dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1.5px dashed currentColor; }
.pcard dl div { border-color: rgba(23, 50, 92, 0.3); }
.pcard--main dl div { border-color: rgba(255, 255, 255, 0.4); }
.pcard dt { font-weight: 700; font-size: 15px; }
.pcard dd { font-family: var(--f-head); font-weight: 700; font-size: 15px; }
.pcard dd b { font-family: var(--f-num); font-weight: 700; font-size: clamp(30px, 3.4vw, 40px); margin-right: 2px; }
.pcard--main dd b { color: var(--yellow); }
.pcard p { margin-top: 10px; font-size: 13px; line-height: 1.7; opacity: 0.85; }
.price__note { margin-top: 36px; font-size: 13.5px; line-height: 1.9; max-width: 46em; color: #3d4a60; }

/* ---------- 8. 通うまでの流れ ---------- */
.flow { padding: var(--sec) 0; }
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; counter-reset: s; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.step { position: relative; text-align: left; padding-left: 84px; }
.step__no {
  position: absolute; left: 0; top: 0; width: 64px; height: 64px; display: grid; place-items: center;
  background: var(--yellow); color: var(--navy); border: 2px solid var(--navy); border-radius: 50%;
  font-family: var(--f-num); font-weight: 700; font-size: 26px; line-height: 1; z-index: 1;
}
.step::before { content: ""; position: absolute; left: 31px; top: 66px; bottom: -34px; border-left: 3px dotted var(--navy); }
.step:last-child::before { display: none; }
.step h3 { font-size: 19px; margin-bottom: 6px; padding-top: 12px; }
.step p { font-size: 14px; line-height: 1.9; }
@media (min-width: 900px) {
  .step { padding-left: 0; padding-top: 88px; }
  .step::before { left: 66px; right: -24px; top: 31px; bottom: auto; border-left: 0; border-top: 3px dotted var(--navy); }
  .step h3 { padding-top: 0; }
}

/* ---------- 9. 教室案内 ---------- */
.access { padding: var(--sec) 0; }
.access__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center; }
@media (min-width: 900px) { .access__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 80px; } }
.access__photo { position: relative; }
.access__photo::before { content: ""; position: absolute; inset: 0; transform: translate(18px, 18px); background: var(--yellow); border-radius: 40px; }
.access__photo img { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 40px; }
.access__body h2 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 28px; }
.info { display: grid; grid-template-columns: 6em 1fr; gap: 0; margin-bottom: 36px; font-size: 15px; }
.info dt, .info dd { padding: 12px 0; border-bottom: 1.5px dashed rgba(23, 50, 92, 0.3); line-height: 1.7; }
.info dt { font-weight: 700; color: var(--navy); }
.access__small { margin-top: 14px; font-size: 12.5px; color: #4a5568; }

/* ---------- 10. Footer ---------- */
.footer { background: var(--navy); color: var(--white); padding: 64px 0 48px; }
.footer__inner { display: grid; gap: 24px; }
@media (min-width: 900px) { .footer__inner { grid-template-columns: 1fr auto; align-items: end; } .footer__sample { grid-column: 1 / -1; } }
.footer__name { font-family: var(--f-head); font-weight: 700; font-size: 24px; }
.footer__name b { font-family: var(--f-num); letter-spacing: 0.08em; font-size: 17px; color: var(--yellow); }
.footer__copy { color: var(--yellow); font-family: var(--f-head); font-weight: 700; margin-top: 4px; }
.footer__sample { font-size: 12.5px; line-height: 1.8; color: rgba(255, 255, 255, 0.8); border-top: 1px solid rgba(255, 255, 255, 0.2); padding-top: 24px; }
.footer__credit { font-size: 13px; }
.footer__credit a { color: var(--yellow); }

/* ---------- 動き（JSが動くときだけ隠す） ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .nav__links, .btn, .tab { transition: none; }
}
