:root {
  --ink: #17324d;
  --muted: #62758a;
  --cream: #fffaf1;
  --paper: #ffffff;
  --coral: #ef6a5b;
  --coral-dark: #db5547;
  --line: #e9e5dc;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Yu Gothic", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  height: 82px;
  padding: 0 clamp(24px, 7vw, 108px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 250, 241, 0.92);
  border-bottom: 1px solid rgba(23, 50, 77, 0.08);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.brand strong {
  font-weight: 900;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--coral);
  color: white;
  font-family: Georgia, serif;
  font-weight: 800;
  font-size: 23px;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.08);
  transform: rotate(-3deg);
}

nav {
  display: flex;
  gap: 34px;
  font-size: 14px;
  font-weight: 700;
}

nav a {
  padding: 9px 2px;
  color: var(--muted);
  position: relative;
}

nav a:hover,
nav a.active {
  color: var(--ink);
}

nav a.active::after {
  content: "";
  position: absolute;
  height: 3px;
  border-radius: 9px;
  background: var(--coral);
  left: 0;
  right: 0;
  bottom: 1px;
}

.hero {
  min-height: 550px;
  padding: 72px clamp(24px, 8vw, 120px) 84px;
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  align-items: center;
  gap: 60px;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: #f9ddc7;
  filter: blur(1px);
  opacity: 0.36;
  left: -260px;
  bottom: -280px;
}

.eyebrow {
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8291a1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.eyebrow span {
  width: 22px;
  height: 2px;
  background: var(--coral);
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1.24;
  letter-spacing: -0.055em;
  font-weight: 850;
}

.hero h1 em {
  color: var(--coral);
  font-style: normal;
  position: relative;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  height: 7px;
  left: 3px;
  right: -2px;
  bottom: -7px;
  border-bottom: 3px solid #f7b6a9;
  border-radius: 50%;
  transform: rotate(-1deg);
}

.hero-description {
  margin: 28px 0 30px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.search-box {
  width: min(100%, 465px);
  height: 58px;
  padding: 0 14px 0 19px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  box-shadow: 0 12px 35px rgba(67, 56, 40, 0.08);
}

.search-box > span {
  color: var(--coral);
  font-size: 26px;
  transform: rotate(-15deg);
}

.search-box input {
  border: 0;
  outline: 0;
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-box input::placeholder {
  color: #9aa6b1;
}

kbd {
  color: #9aa6b1;
  background: #f6f5f2;
  border: 1px solid #ece9e2;
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 11px;
  box-shadow: 0 1px 0 #e4e0d7;
}

.hero-visual {
  min-height: 380px;
  position: relative;
  display: grid;
  place-items: center;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(239, 106, 91, 0.2);
  border-radius: 50%;
}

.orbit-one {
  width: 410px;
  height: 275px;
  transform: rotate(-12deg);
}

.orbit-two {
  width: 350px;
  height: 350px;
  border-color: rgba(23, 50, 77, 0.1);
  transform: rotate(24deg);
}

.book {
  width: 300px;
  height: 218px;
  display: flex;
  position: relative;
  transform: rotate(-5deg);
  filter: drop-shadow(0 24px 22px rgba(63, 47, 37, 0.18));
}

.book::after {
  content: "";
  width: 12px;
  position: absolute;
  top: 8px;
  bottom: 7px;
  left: calc(50% - 6px);
  background: linear-gradient(90deg, rgba(0,0,0,.1), rgba(255,255,255,.7), rgba(0,0,0,.08));
  border-radius: 50%;
}

.book-page {
  width: 50%;
  padding: 37px 26px;
  background: #fffefa;
  border: 3px solid var(--ink);
}

.page-left {
  border-radius: 15px 4px 8px 18px;
  background: #f28a78;
  color: white;
}

.page-left b {
  display: block;
  font-family: Georgia, serif;
  font-size: 50px;
  line-height: 1;
}

.page-left span {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.page-left span + span {
  margin-top: 2px;
}

.page-right {
  border-radius: 4px 15px 18px 8px;
  border-left-width: 1px;
  display: flex;
  flex-direction: column;
  gap: 19px;
}

.page-right i {
  height: 8px;
  border-radius: 9px;
  background: #e5e8e6;
}

.page-right i:nth-child(2) {
  width: 76%;
  background: #f3aaa0;
}

.page-right i:nth-child(4) {
  width: 58%;
}

.floating-card {
  position: absolute;
  z-index: 2;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 7px 8px 0 rgba(23, 50, 77, 0.12);
}

.card-left {
  width: 106px;
  padding: 14px;
  left: 4%;
  top: 24%;
  transform: rotate(7deg);
}

.card-left span {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--coral);
}

.card-left i {
  display: block;
  height: 5px;
  margin-top: 7px;
  border-radius: 9px;
  background: #dde3e5;
}

.card-left i:last-child {
  width: 62%;
}

.card-right {
  right: 1%;
  bottom: 23%;
  padding: 11px 15px 11px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  transform: rotate(4deg);
  font-size: 13px;
  font-weight: 800;
}

.card-right b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #64b89a;
  color: white;
}

.spark {
  position: absolute;
  color: var(--coral);
}

.spark-one { right: 17%; top: 8%; font-size: 24px; }
.spark-two { left: 20%; bottom: 7%; font-size: 15px; }
.spark-three { right: 5%; top: 30%; color: #79afc8; font-size: 24px; transform: rotate(15deg); }

.library {
  padding: 82px clamp(24px, 8vw, 120px) 100px;
  background: #f7f5ef;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2,
.guide h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.section-heading > p {
  margin: 0;
  color: #8a97a4;
  font-size: 12px;
}

.filter-row {
  margin: 28px 0 34px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-row button,
.empty-state button {
  border: 1px solid #deddd9;
  border-radius: 99px;
  padding: 10px 18px;
  white-space: nowrap;
  background: white;
  color: #66798b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s ease;
}

.filter-row button:hover {
  transform: translateY(-2px);
  border-color: var(--coral);
}

.filter-row button.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.question-card {
  min-width: 0;
  overflow: hidden;
  background: white;
  border: 1px solid rgba(23, 50, 77, 0.08);
  border-radius: 18px;
  box-shadow: 0 13px 35px rgba(43, 52, 59, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.question-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 38px rgba(43, 52, 59, 0.12);
}

.card-art {
  height: 128px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.card-art.coral { background: #f9e1d9; }
.card-art.blue { background: #dcecf0; }
.card-art.green { background: #dcece3; }
.card-art.amber { background: #f5e8c9; }
.card-art.violet { background: #e8e0f1; }

.subject-icon {
  width: 67px;
  height: 67px;
  display: grid;
  place-items: center;
  z-index: 1;
  border: 2px solid var(--ink);
  border-radius: 21px 13px 20px 14px;
  background: white;
  color: var(--ink);
  box-shadow: 5px 6px 0 rgba(23, 50, 77, 0.14);
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 28px;
  font-weight: 800;
  transform: rotate(-4deg);
}

.art-ring {
  width: 150px;
  height: 74px;
  border: 1px solid rgba(23, 50, 77, 0.16);
  border-radius: 50%;
  position: absolute;
  transform: rotate(-12deg);
}

.new-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--coral);
  color: white;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.card-body {
  padding: 19px 19px 18px;
}

.card-tags {
  display: flex;
  gap: 6px;
}

.card-tags span {
  padding: 4px 8px;
  border-radius: 6px;
  background: #f3f5f5;
  color: #71808e;
  font-size: 9px;
  font-weight: 700;
}

.card-body h3 {
  margin: 13px 0 9px;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.card-body > p {
  min-height: 51px;
  margin: 0;
  color: #71808e;
  font-size: 11px;
  line-height: 1.6;
}

.card-meta {
  margin: 18px 0 14px;
  padding-top: 13px;
  display: flex;
  gap: 14px;
  border-top: 1px solid #efeee9;
  color: #8794a0;
  font-size: 10px;
}

.card-body > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 800;
}

.card-body > a span {
  font-size: 19px;
  transition: transform 0.2s ease;
}

.card-body > a:hover span {
  transform: translateX(4px);
}

.empty-state {
  padding: 70px 20px;
  text-align: center;
  border: 1px dashed #d8d5cd;
  border-radius: 18px;
  background: rgba(255,255,255,.55);
}

.empty-state > span {
  color: var(--coral);
  font-size: 42px;
}

.empty-state h3 {
  margin: 8px 0;
}

.empty-state p {
  color: var(--muted);
  font-size: 13px;
}

.empty-state button {
  margin-top: 12px;
  background: var(--ink);
  color: white;
}

.guide {
  padding: 74px clamp(24px, 8vw, 120px);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 70px;
  background: var(--ink);
  color: white;
}

.guide > div > p:last-child {
  max-width: 540px;
  color: #becbd5;
  font-size: 13px;
  line-height: 1.8;
}

.guide code {
  color: #ffd2ca;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.guide-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
}

.guide-steps span {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #d5dfe6;
  font-size: 12px;
  font-weight: 700;
}

.guide-steps b {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: #ff9b8e;
  font-family: Georgia, serif;
  font-size: 20px;
}

.guide-steps i {
  color: #72879a;
  font-style: normal;
}

footer {
  padding: 34px clamp(24px, 8vw, 120px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #10283f;
  color: white;
  border-top: 1px solid rgba(255,255,255,.08);
}

footer p {
  margin: 0;
  color: #8ca0b2;
  font-size: 11px;
}

@media (max-width: 1050px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr 0.8fr; }
  .book { width: 260px; height: 190px; }
  .guide { grid-template-columns: 1fr; }
}

@media (max-width: 740px) {
  .site-header { height: 68px; }
  nav { gap: 18px; }
  nav a:last-child { display: none; }
  .hero {
    padding-top: 54px;
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .hero-visual {
    min-height: 290px;
    transform: scale(.85);
    margin: -20px -40px;
  }
  .library { padding-top: 62px; }
  .card-grid { grid-template-columns: 1fr; }
  .card-art { height: 150px; }
  .section-heading { align-items: start; }
  .guide-steps { flex-wrap: wrap; justify-content: center; }
  .guide-steps i { display: none; }
  footer { flex-direction: column; gap: 18px; text-align: center; }
}

@media (max-width: 430px) {
  .brand { font-size: 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .hero h1 { font-size: 40px; }
  kbd { display: none; }
  .hero-visual { transform: scale(.72); margin: -45px -70px; }
}
