/* Shared design tokens. Keep layout and visual changes here. */
@font-face { font-family: Poppins; src: url('fonts/Poppins-Regular.ttf'); font-weight: 400; font-display: swap; }
@font-face { font-family: Poppins; src: url('fonts/Poppins-Medium.ttf'); font-weight: 500; font-display: swap; }
@font-face { font-family: Poppins; src: url('fonts/Poppins-SemiBold.ttf'); font-weight: 600; font-display: swap; }
@font-face { font-family: Poppins; src: url('fonts/Poppins-Bold.ttf'); font-weight: 700; font-display: swap; }
:root {
  --ink: #0d1228;
  --muted: #565656;
  --paper: #fffffe;
  --catalog: #f7f7f7;
  --footer: #f6f4ff;
  --panel: #fff;
  --service: #f7f7f9;
  --line: #e5e5ec;
  --quiet-line: #eaeaf0;
  --copyright-line: #d5d5d5;
  --accent: #4c0ee9;
  --disabled: #777;
  color-scheme: light;
  --text: clamp(16px, 1.8vw, 18px);
  --small: clamp(14px, 1.6vw, 16px);
  --space: var(--text);
  --gap: calc(var(--space) * 1.5);
  --section: calc(var(--space) * 4);
  --content: 1170px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--text)/1.6 Poppins, sans-serif; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
a { color: inherit; text-underline-offset: .18em; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
img { display: block; max-width: 100%; height: auto; }
.container { width: min(var(--content), calc(100% - var(--space) * 2)); margin-inline: auto; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 12px; z-index: 5; background: var(--panel); }
.skip-link:focus { top: 12px; }

/* Homepage banner matches the original cover and its narrow text column. */
.hero { min-height: 680px; display: grid; place-items: center; padding: 40px var(--space); color: white; text-align: center; background: linear-gradient(#151f50b3, #151f50b3), url('images/hero.png') center / cover; }
.hero-copy { width: 64%; max-width: 820px; }
.hero h1 { font-size: clamp(48px, 7.2vw, 72px); font-weight: 700; line-height: 1.3; letter-spacing: -1px; }
.hero .mission { margin-top: var(--gap); line-height: 1.8; }
.hero blockquote { margin-top: var(--space); }
.hero blockquote footer { margin-top: var(--space); }

/* Auto-fit keeps the three-column desktop grid responsive without stretching cards. */
.catalog-section { padding: var(--section) 0; background: var(--catalog); }
.section-title { font-size: clamp(36px, 4.8vw, 48px); font-weight: 600; letter-spacing: -1px; line-height: 1.1; text-align: center; margin-bottom: calc(var(--space) * 3); }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: var(--gap); }
.course-card { min-width: 0; padding: var(--space); border: 2px dashed transparent; border-radius: 15px; background: var(--panel); }
.course-card img { width: 100%; border-radius: 15px; }
.course-card h3 { margin-top: var(--space); font-size: var(--text); font-weight: 400; line-height: 1.6; }
.course-card a { text-decoration: none; }
.course-card a:hover { text-decoration: underline; }

.about-section { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: var(--section); padding-block: calc(var(--space) * 3); }
.about-section > img { width: 100%; border-radius: 15px; }
.about-copy h2 { font-size: clamp(36px, 4.8vw, 48px); font-weight: 600; letter-spacing: -1px; line-height: 1.2; margin-bottom: var(--space); }
.about-copy p { font-size: var(--small); color: var(--muted); line-height: 1.5; }
.about-copy p + p { margin-top: calc(var(--space) / 2); }
.services-section { padding-block: var(--section); }
.services-section .section-title { margin-bottom: calc(var(--space) * 2); }
.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space); }
.service-card { background: var(--service); border-radius: 8px; padding: 24px; text-align: center; }
.service-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; margin-bottom: 24px; }
.service-card h3 { font-size: 16px; font-weight: 700; line-height: 1.5; }
.service-card p { font-size: 16px; color: var(--muted); line-height: 1.5; }

/* Shared footer and the compact header used on course and lesson pages. */
.site-footer { padding: calc(var(--space) * 3) 0 24px; background: var(--footer); }
.footer-grid { display: grid; grid-template-columns: 30fr 21fr 21fr 28fr; gap: var(--space); }
.brand { display: flex; align-items: center; gap: 8px; font-size: clamp(24px, 3vw, 28px); font-weight: 500; letter-spacing: -2px; text-decoration: none; line-height: 1.5; }
.brand img { width: 40px; height: 35px; object-fit: contain; flex-shrink: 0; }
.footer-mission { margin-top: 18px; padding-right: var(--gap); font-size: var(--small); color: var(--muted); }
.site-footer h2 { font-size: var(--small); font-weight: 500; margin-bottom: var(--space); line-height: 1.5; }
.site-footer ul { margin: 0; padding-left: 24px; font-size: var(--small); }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.contact-details h2 { text-transform: uppercase; }
.contact-details address { font-size: 14px; font-style: normal; color: var(--muted); line-height: 1.8; }
.copyright { border-top: 1px solid var(--copyright-line); margin-top: 36px; padding-top: 24px; font-size: var(--small); }
.page-header { background: var(--footer); border-bottom: 1px solid var(--line); padding: 20px 0; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-header nav { display: flex; gap: 20px; font-size: var(--small); }

/* Course and lesson layouts share the same typography and navigation. */
.reading-page { max-width: 850px; min-height: 60vh; padding-block: 48px 72px; }
.reading-page h1 { font-size: clamp(36px, 5vw, 56px); margin: 24px 0; }
.reading-page h2 { font-size: 28px; margin: 32px 0 16px; }
.breadcrumbs { font-size: var(--small); color: var(--muted); }
.lead { font-size: 20px; }
.lesson-list { padding-left: 28px; }
.lesson-list li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.library-list { list-style: none; padding: 0; margin: 32px 0 0; }
.library-list li { border-top: 1px solid var(--line); }
.library-list li:last-child { border-bottom: 1px solid var(--line); }
.library-list a { display: block; padding: 24px 8px; text-decoration: none; }
.library-list a:hover { background: var(--catalog); }
.library-title { display: block; font-size: 24px; font-weight: 500; }
.library-description { display: block; color: var(--muted); font-size: var(--small); margin-top: 8px; }
.library-action { display: block; font-size: var(--small); margin-top: 12px; text-decoration: underline; }
.lesson-content > * + * { margin-top: 20px; }
.lesson-content pre { overflow-x: auto; background: var(--catalog); padding: 20px; }
.lesson-content img, .lesson-content video { max-width: 100%; height: auto; }
.lesson-navigation { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; border-top: 1px solid var(--line); margin-top: 48px; padding-top: 24px; }
@media (max-width: 781px) {
  .hero-copy { width: 100%; }
  .about-section, .services-grid, .footer-grid { grid-template-columns: 1fr; }
  .about-section { gap: 32px; }
  .footer-grid { gap: 40px; }
  .site-footer .container { width: calc(100% - 80px); }
  .service-card { padding: 24px; }
  .hero { padding-block: 60px; }
  .contact-details address { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Shared with all course pages; system preference updates live. */
:root[data-theme="dark"] { --paper:#171925; --ink:#eff0f8; --muted:#bcc0d1; --catalog:#11131d; --footer:#222036; --panel:#1c1f2c; --service:#1c1f2c; --line:#36394c; --quiet-line:#303446; --copyright-line:#36394c; --accent:#c0a4ff; --disabled:#a5a8b6; color-scheme:dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper:#171925; --ink:#eff0f8; --muted:#bcc0d1; --catalog:#11131d; --footer:#222036; --panel:#1c1f2c; --service:#1c1f2c; --line:#36394c; --quiet-line:#303446; --copyright-line:#36394c; --accent:#c0a4ff; --disabled:#a5a8b6; color-scheme:dark; }
}
/* Search and topic discovery use the shared site palette. */
.seo-intro { padding-block:48px; }
.seo-intro h2 { font-size:clamp(24px,3vw,36px); margin-bottom:18px; }
.seo-intro p { margin:16px 0; max-width:850px; }
.seo-intro ul { display:flex; flex-wrap:wrap; gap:14px 32px; list-style:none; padding:0; }
.site-search-form { margin:28px 0; display:grid; gap:10px; }
.site-search-form input,.site-search-form select,.search-page button { font:inherit; color:var(--ink); background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:12px; min-height:44px; }
.search-input-row { display:flex; gap:12px; }.search-input-row input { min-width:0; flex:1; }.search-page button { cursor:pointer; }.search-page #result-status { margin:20px 0; font-size:14px; color:var(--muted); }
.search-page .library-title { font-size:18px; }.browse-search { margin-top:32px; }
.topic-group { margin-top:32px; }.topic-group li { margin-block:10px; }
[hidden] { display:none!important; }
input:focus-visible,button:focus-visible,select:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
@media(max-width:600px){.page-header nav{flex-wrap:wrap;gap:12px 18px}.search-input-row{flex-wrap:wrap}.search-input-row input{flex-basis:100%}}
