@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/CormorantGaramond-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/CormorantGaramond-Italic-Variable.ttf") format("truetype");
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Edebiyat Sans";
  src: url("assets/fonts/NotoSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #eef0eb;
  --paper-2: #dfe3dc;
  --ink: #17221e;
  --muted: #59645f;
  --line: rgba(23, 34, 30, .2);
  --forest: #183f35;
  --coral: #8f2f24;
  --blue: #356271;
  --gold: #76501f;
  --green: #52735c;
  --cream: #f9faf6;
  --shadow: 0 18px 50px rgba(26, 38, 33, .11);
  --display: "Cormorant Garamond", serif;
  --sans: "Edebiyat Sans", sans-serif;
}

body {
  overflow-x: visible;
  text-rendering: optimizeLegibility;
}
main { overflow-x: clip; }

body.dark {
  --paper: #17201d;
  --paper-2: #222e29;
  --ink: #edf0e9;
  --muted: #bbc4bd;
  --line: rgba(237, 240, 233, .2);
  --cream: #202b27;
  --shadow: 0 20px 54px rgba(0, 0, 0, .24);
}

::selection { color: #fff; background: var(--coral); }
html { scrollbar-color: var(--coral) var(--paper-2); scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { border: 3px solid var(--paper-2); border-radius: 8px; background: var(--coral); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--coral) 72%, white);
  outline-offset: 4px;
}

.site-header { height: 72px; }
.site-header.scrolled { background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px); }
.brand strong { font-family: var(--display); font-size: 1.25rem; font-weight: 650; }
.brand-mark { border-radius: 8px 16px 8px 14px; background: var(--coral); transform: rotate(-4deg); }
.main-nav a { font-size: .82rem; letter-spacing: 0; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-button { min-height: 44px; padding: .7rem 1rem; border-radius: 8px; font-size: .82rem; }
.mobile-menu { border-radius: 10px; }

.world-sky { background: radial-gradient(circle at 72% 22%, rgba(255,255,255,.8), transparent 25%), linear-gradient(150deg, #f2f3ee 0%, #dfe4dc 60%, #cad4ca 100%); }
.grain { display: none; }
.scene-copy h1, .scene-copy h2, .section-heading h2, .classroom-intro h2, .quiz-copy h2, .presentation-copy h2, .sources-heading h2 {
  max-width: 12ch;
  font-size: clamp(3.25rem, 6.5vw, 6rem);
  line-height: .9;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.scene-copy h1 { max-width: 10ch; }
.scene-label { margin: 0 0 1.2rem; color: var(--coral); font-size: .84rem; font-weight: 700; letter-spacing: .01em; }
.scene-four .scene-label, .scene-four em { color: #e7be66; }
.hero-lead, .scene-copy > p:not(.scene-label) { max-width: 62ch; color: #44514b; }
.scene-chip { border-radius: 6px; background: rgba(255,255,255,.2); }
.primary-button { min-height: 48px; min-width: 0; gap: 1rem; border-radius: 5px; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 11px 24px rgba(30,35,32,.18); }
.lamp::before { box-shadow: 0 10px 24px rgba(28, 34, 31, .22); }

.section { padding-block: clamp(6rem, 10vw, 10rem); }
.section-heading, .section-heading.compact { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); border-top: 1px solid var(--line); padding-top: 2rem; }
.section-heading > p:last-child { align-self: end; max-width: 58ch; font-size: 1rem; line-height: 1.75; }

.route-grid { display: block; border-bottom: 1px solid var(--line); }
.route-card {
  min-height: 0;
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: .55rem clamp(1.5rem, 4vw, 5rem);
  padding: 2.25rem 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  overflow: visible;
  color: inherit;
  text-decoration: none;
}
.route-card::before { display: none; }
.route-card:hover { transform: none; box-shadow: none; }
.route-number { grid-row: 1 / 4; width: auto; height: auto; margin: .15rem 0 0; place-items: start; border-radius: 0; color: var(--card-color); background: transparent; font: 600 1rem var(--sans); }
.route-card h3 { grid-column: 2; margin: 0; font: 600 clamp(2rem, 3.3vw, 3.25rem)/.95 var(--display); letter-spacing: -.025em; }
.route-entry { grid-column: 3; font-size: .84rem; font-weight: 700; }
.route-entry b { display: inline-block; margin-left: .6rem; color: var(--card-color); transition: transform .2s ease; }
.route-card:hover .route-entry b { transform: translateX(.35rem); }
.route-card > p:not(.route-type) { grid-column: 2; margin: .3rem 0; max-width: 46ch; color: var(--muted); font-size: .94rem; }
.route-card ul { grid-column: 3; grid-row: 1 / 3; margin: 0; font-size: .86rem; }
.route-card li { padding: .55rem 0; }
.route-card li::before { content: ""; display: inline-block; width: 8px; height: 1px; margin: 0 .65rem .25em 0; background: var(--card-color); }
.route-card .text-button { grid-column: 3; grid-row: 3; justify-self: start; min-height: 44px; }
.route-detail-link { grid-column: 2; grid-row: 3; align-self: center; font-size: .8rem; text-underline-offset: .35em; }

.section-classroom { background: var(--forest); }
.section-classroom em { color: #e7be66; }
.classroom-intro { align-items: end; }
.progress-card { max-width: 340px; padding: 0; border: 0; background: transparent; }
.progress-card p { color: #d4ddd7; }
.progress-ring { width: auto; height: auto; border-radius: 0; background: none; }
.progress-ring::after { display: none; }
.progress-ring span { position: static; color: #fff; font: 600 2.2rem var(--display); }
.lesson-shell { border: 0; box-shadow: 0 24px 60px rgba(0,0,0,.15); }
.lesson-tab { min-height: 54px; }
.lesson-tab span { border: 0; border-radius: 0; color: #64706a; }
.lesson-tab.active span { color: #fff; }
.sidebar-title { color: #48524d; }
.lesson-meta { color: #873b2d; }
.lesson-block { border-color: rgba(24,34,31,.22); background: transparent; }
.lesson-deep-link { background: #183f35; }
.lesson-deep-link span { color: #f2c66b; font-size: .78rem; letter-spacing: 0; }

.library-tabs { gap: 0; border-bottom: 1px solid var(--line); }
.library-tab { min-height: 46px; padding: .75rem 1.1rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.library-tab.active { color: var(--coral); border-bottom-color: var(--coral); background: transparent; }
.author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.author-card { min-height: 460px; }
.author-card::before { display: none; }
.author-card::after { background: linear-gradient(180deg, transparent 24%, color-mix(in srgb, var(--author-color) 88%, #101c18) 94%); }
.author-era { top: 1.5rem; left: 1.5rem; padding: 0; border: 0; border-radius: 0; font-size: .76rem; letter-spacing: .01em; }
.author-overlay { padding: 8rem 1.75rem 1.75rem; }
.author-card h3 { max-width: 12ch; font-size: clamp(2.3rem, 4vw, 3.5rem); }
.author-card p { max-width: 52ch; font-size: .86rem; }
.author-work { border-top-color: rgba(255,255,255,.28); }
.author-work span { font-size: .75rem; }
.term-grid { grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--line); }
.term-card { padding: 1.25rem 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.term-card:nth-child(odd) { padding-right: 2rem; }
.term-card:nth-child(even) { padding-left: 2rem; border-left: 1px solid var(--line); }

.section-exams { color: var(--ink); background: #e7eae5; }
.section-exams .section-heading > p:last-child { color: #4d574f; }
.exam-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid rgba(35,48,43,.25); }
.exam-card { min-height: 220px; padding: 1.5rem 0; border: 0; border-top: 1px solid rgba(35,48,43,.25); background: transparent; }
.exam-card:nth-child(odd):not(.featured) { padding-right: 2rem; }
.exam-card:nth-child(even):not(.featured) { padding-left: 2rem; border-left: 1px solid rgba(35,48,43,.25); }
.exam-card:hover { transform: none; box-shadow: none; }
.exam-card > span { color: #563713; font-size: .78rem; letter-spacing: 0; }
.exam-card h3 { margin: 1.25rem 0 .5rem; font-size: 2.25rem; }
.exam-card > b { font-size: .8rem; }
.exam-card.featured { grid-column: 1 / -1; min-height: 260px; margin-top: 1.5rem; padding: 2rem; color: #f5f4ed; background: #183f35; }
.exam-card.featured > span { color: #f2c66b; }
.exam-workspace { border: 1px solid rgba(35,48,43,.24); background: #f4f6f2; box-shadow: none; }
.exam-close { min-height: 44px; border-radius: 6px; }
.exam-option { min-height: 56px; background: #fffef9; }
.exam-dots button { width: 34px; height: 34px; }
.frq-hint { color: #555c58; }
.perfect-note, .review-unavailable, .priority-box { border-left-width: 1px; }

.section-pool { background: var(--paper); }
.pool-intro h2 { max-width: 11ch; font-size: clamp(3rem, 5vw, 5.5rem); letter-spacing: -.035em; }
.source-pill { padding: 0 0 .18rem; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; }
.pool-builder { border-width: 1px 0; background: transparent; box-shadow: none; }
.scenario-summary { border-left-width: 1px; }
.scenario-summary b { border-radius: 6px; }

.search-dialog { border-radius: 10px; }
.toast { border-radius: 6px; }
.reveal { opacity: 1; transform: none; transition: opacity .45s, transform .45s; }
.reveal:not(.visible) { opacity: .01; transform: translateY(18px); }

.site-footer { border-top: 1px solid var(--line); }

body.dark .world-sky { background: radial-gradient(circle at 72% 22%, rgba(115,143,128,.18), transparent 28%), linear-gradient(150deg, #1a2521, #202e28 60%, #25392f); }
body.dark .hero-lead, body.dark .scene-copy > p:not(.scene-label) { color: #c5cec7; }
body.dark .section-exams { color: var(--ink); background: #25342e; }
body.dark .section-exams .section-heading > p:last-child { color: var(--muted); }
body.dark .section-exams em { color: #e7be66; }
body.dark .exam-card { border-color: var(--line); }
body.dark .exam-card > span { color: #e7be66; }
body.dark .exam-card:not(.featured) p { color: var(--muted); }
body.dark .exam-workspace, body.dark .lesson-shell { color: #17221e; background: #f1f3ef; }
body.dark .pool-builder select { color: var(--ink); background: var(--paper-2); }

@media (max-width: 900px) {
  .route-card { grid-template-columns: 3rem 1fr auto; }
  .route-card ul, .route-card .text-button { grid-column: 2; grid-row: auto; }
  .route-detail-link { grid-column: 2; grid-row: auto; }
}

@media (max-width: 760px) {
  .site-header { height: 66px; }
  .scene-copy h1, .scene-copy h2 { font-size: clamp(3.2rem, 15vw, 5.25rem); }
  .hero-lead, .scene-copy > p:not(.scene-label) { font-size: 1rem; }
  .section-heading, .section-heading.compact { grid-template-columns: 1fr; }
  .route-card { grid-template-columns: 2.25rem 1fr; gap: .7rem 1rem; padding-block: 2rem; }
  .route-card h3 { font-size: 2.35rem; }
  .route-entry { grid-column: 2; }
  .route-card ul { margin-top: .5rem; }
  .route-card .text-button, .route-detail-link { min-height: 44px; display: flex; align-items: center; }
  .lesson-sidebar { scrollbar-width: thin; }
  .author-grid, .term-grid, .exam-cards { grid-template-columns: 1fr; }
  .author-card { min-height: 420px; }
  .term-card:nth-child(odd), .term-card:nth-child(even) { padding-inline: 0; border-left: 0; }
  .exam-card:nth-child(odd):not(.featured), .exam-card:nth-child(even):not(.featured) { padding-inline: 0; border-left: 0; }
  .exam-card.featured { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal:not(.visible) { opacity: 1; transform: none; }
}
