@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

:root {
  --blue: #0057b8;
  --blue-dark: #073f84;
  --blue-soft: #eaf4ff;
  --green: #97d700;
  --pink: #f65275;
  --yellow: #ffcd00;
  --orange: #ff8f1c;
  --ink: #18304d;
  --muted: #62738a;
  --cream: #fffdf8;
  --line: #dfeaf4;
  --shadow: 0 14px 34px rgba(29, 72, 117, 0.12);
  --radius: 26px;
  --max: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(255, 205, 0, .13) 0 58px, transparent 59px),
    radial-gradient(circle at 95% 10%, rgba(151, 215, 0, .12) 0 80px, transparent 81px),
    linear-gradient(180deg, #fff 0%, var(--cream) 100%);
  font-family: "Nunito", Arial, sans-serif;
  font-weight: 600;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(0, 87, 184, .09);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(var(--max), calc(100% - 40px));
  min-height: 78px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; min-height: 52px; }
.brand img { width: 218px; max-width: 44vw; height: auto; display: block; }

.home-link, .back-link, .icon-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #cfe2f5;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  padding: 0 18px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(0, 87, 184, .08);
}

.home-icon { display: inline-flex; width: 21px; height: 21px; }
.home-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.page-shell { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 34px 0 76px; }
.breadcrumb { color: var(--muted); font-size: 14px; font-weight: 800; margin-bottom: 22px; }
.breadcrumb a { color: var(--blue); }
.breadcrumb span { margin: 0 8px; color: #9cafc2; }

.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 32px;
  padding: 38px 42px;
  border-radius: 34px;
  background: linear-gradient(125deg, #eaf5ff, #fff8e4);
  border: 1px solid #e3eef8;
}

.hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -48px;
  top: -60px;
  border-radius: 50%;
  background: rgba(151, 215, 0, .18);
}

.eyebrow { margin: 0 0 8px; color: var(--pink); font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; color: var(--blue-dark); font-size: clamp(34px, 5vw, 58px); font-weight: 900; line-height: 1.08; letter-spacing: -.035em; }
.lead { max-width: 690px; margin: 13px 0 0; color: var(--muted); font-size: clamp(16px, 2vw, 19px); font-weight: 600; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 22px; }
.section-head h2 { margin: 0; color: var(--blue-dark); font-size: clamp(25px, 3vw, 36px); font-weight: 900; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-weight: 600; }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.category-card {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 42% 1fr;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.category-card:hover { transform: translateY(-5px); box-shadow: 0 20px 42px rgba(29, 72, 117, .17); }
.category-card:focus-visible, .resource-card:focus-visible, .unit-card:focus-visible { outline: 4px solid rgba(0, 87, 184, .25); outline-offset: 4px; }
.category-card.featured { grid-column: span 2; grid-template-columns: 34% 1fr; }
.category-art { min-height: 100%; display: grid; place-items: center; position: relative; overflow: hidden; }
.category-art::before, .category-art::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); }
.category-art::before { width: 110px; height: 110px; left: -35px; top: -30px; }
.category-art::after { width: 70px; height: 70px; right: -18px; bottom: -15px; }
.category-art.blue { background: #d9edff; color: var(--blue); }
.category-art.green { background: #ecf9d0; color: #578d00; }
.category-art.pink { background: #ffe1e8; color: #d9345a; }
.category-art.yellow { background: #fff2bb; color: #b87900; }
.category-art.orange { background: #ffe7cc; color: #c85e00; }
.art-mark { z-index: 1; font-size: clamp(36px, 6vw, 68px); font-weight: 950; letter-spacing: -.08em; }
.category-copy { padding: 28px 30px; align-self: center; }
.category-copy h2, .category-copy h3 { margin: 0; color: var(--blue-dark); font-size: clamp(25px, 3vw, 36px); font-weight: 900; line-height: 1.1; }
.category-copy p { margin: 11px 0 20px; color: var(--muted); font-weight: 600; }
.cta { color: var(--blue); font-size: 15px; font-weight: 900; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.choice-grid .category-card { min-height: 330px; }
.choice-grid .category-art { min-height: 190px; }

.filters {
  display: grid;
  grid-template-columns: 170px minmax(220px, 1fr) minmax(270px, 1.5fr) auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 9px 25px rgba(29, 72, 117, .08);
}
.field { display: grid; gap: 7px; }
.field label { color: var(--blue-dark); font-size: 13px; font-weight: 900; }
.field input, .field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cdddeb;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-family: "Nunito", Arial, sans-serif;
}
.reset-button, .primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0 20px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.resource-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.resource-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); transition: transform .2s ease; }
.resource-card:hover { transform: translateY(-4px); }
.resource-thumb { position: relative; overflow: hidden; display: grid; place-items: center; background: #eef6ff; }
.resource-thumb.landscape { aspect-ratio: 16 / 9; }
.resource-thumb.portrait { aspect-ratio: 3 / 4; }
.thumb-scene { position: absolute; inset: 0; background: linear-gradient(145deg, var(--thumb-a, #d9edff), var(--thumb-b, #fff1bc)); }
.thumb-scene::before { content: ""; position: absolute; width: 40%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.75); right: 8%; top: 12%; }
.thumb-label { z-index: 2; width: 78%; color: var(--blue-dark); font-size: clamp(18px, 2.1vw, 29px); font-weight: 950; line-height: 1.08; text-align: center; text-wrap: balance; }
.play-badge { position: absolute; z-index: 3; right: 14px; bottom: 12px; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--pink); box-shadow: 0 7px 16px rgba(246,82,117,.32); }
.resource-copy { padding: 17px 18px 20px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.badge { display: inline-flex; align-items: center; min-height: 27px; border-radius: 999px; padding: 0 10px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 900; }
.badge.unit { background: #fff4cd; color: #8c6200; }
.resource-copy h3 { min-height: 2.55em; margin: 0; color: #192d45; font-size: 18px; font-weight: 900; line-height: 1.28; }
.resource-copy p { margin: 10px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }

.video-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .7fr); gap: 28px; align-items: start; }
.video-frame { aspect-ratio: 16 / 9; display: grid; place-items: center; border-radius: 28px; overflow: hidden; color: #fff; background: linear-gradient(145deg, var(--blue-dark), var(--blue)); box-shadow: var(--shadow); }
.video-frame .play-badge { position: static; width: 78px; height: 78px; font-size: 25px; }
.detail-panel { padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.detail-panel h1 { font-size: clamp(29px, 4vw, 42px); }
.detail-list { display: grid; gap: 14px; margin: 24px 0; }
.detail-item { padding: 13px 0; border-bottom: 1px dashed #d7e5f1; }
.detail-item small { display: block; color: var(--muted); font-weight: 600; }
.detail-item strong { color: var(--blue-dark); }

.reader-shell { width: min(1450px, calc(100% - 28px)); margin: 18px auto; }
.reader-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 16px; border-radius: 18px 18px 0 0; background: var(--blue-dark); color: #fff; }
.reader-title { font-size: 17px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-actions { display: flex; gap: 9px; }
.reader-actions .icon-button { min-height: 44px; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; box-shadow: none; }
.iframe-mock { min-height: calc(100vh - 125px); display: grid; place-items: center; border: 8px solid var(--blue-dark); border-top: 0; border-radius: 0 0 22px 22px; background: linear-gradient(145deg, #edf5ff, #fff7dc); text-align: center; }
.book-mock { width: min(760px, 82%); aspect-ratio: 16 / 10; display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 28px 50px rgba(29,72,117,.22); }
.book-page { display: grid; place-items: center; padding: 25px; border-right: 1px solid #dbe7f1; color: var(--blue-dark); font-size: clamp(20px, 4vw, 44px); font-weight: 950; }

.unit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.unit-card { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); transition: transform .2s ease; }
.unit-card:hover { transform: translateY(-4px); }
.unit-art { aspect-ratio: 16 / 10; display: grid; place-items: center; position: relative; overflow: hidden; background: linear-gradient(145deg, var(--unit-a, #d9edff), var(--unit-b, #f4ffd8)); }
.month-mark { z-index: 2; color: var(--blue-dark); font-size: 54px; font-weight: 950; }
.unit-copy { padding: 20px; }
.unit-copy h3 { margin: 10px 0 16px; color: var(--blue-dark); font-size: 22px; line-height: 1.25; }

.empty-demo { margin-top: 28px; padding: 34px; border: 2px dashed #cfe0ef; border-radius: 22px; color: var(--muted); background: #fff; text-align: center; }

@media (max-width: 980px) {
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .header-inner, .page-shell { width: min(100% - 24px, var(--max)); }
  .header-inner { min-height: 68px; }
  .brand img { width: 166px; }
  .home-link { width: 46px; padding: 0; }
  .home-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .page-shell { padding-top: 22px; }
  .hero { padding: 28px 23px; border-radius: 26px; }
  .category-grid, .choice-grid, .unit-grid { grid-template-columns: 1fr; }
  .category-card, .category-card.featured { grid-column: auto; grid-template-columns: 36% 1fr; min-height: 205px; }
  .choice-grid .category-card { min-height: 240px; }
  .choice-grid .category-art { min-height: 100%; }
  .category-copy { padding: 22px 19px; }
  .category-copy p { font-size: 14px; }
  .filters { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-grid.portrait-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .portrait-grid .resource-copy { padding: 13px; }
  .portrait-grid .resource-copy h3 { font-size: 15px; }
  .portrait-grid .badge.unit { display: none; }
  .reader-shell { width: calc(100% - 12px); margin: 6px auto; }
  .reader-bar { border-radius: 14px 14px 0 0; padding: 8px; }
  .reader-title { font-size: 14px; }
  .reader-actions .icon-button { width: 44px; padding: 0; }
  .reader-actions .button-label { position: absolute; width: 1px; height: 1px; overflow: hidden; }
  .iframe-mock { min-height: calc(100vh - 78px); border-width: 4px; }
}

@media (max-width: 430px) {
  .category-card, .category-card.featured { grid-template-columns: 1fr; }
  .category-art { min-height: 145px; }
  .category-copy { padding: 20px; }
  .section-head { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
