/* OSEKOO Academy — UI/UX Pro Max design system */
:root {
  --ds-primary: #2563eb;
  --ds-primary-hover: #1d4ed8;
  --ds-primary-soft: #dbeafe;
  --ds-secondary: #d97706;
  --ds-accent: #be185d;
  --ds-bg: #f8faff;
  --ds-surface: #ffffff;
  --ds-surface-muted: #eff6ff;
  --ds-text: #0f172a;
  --ds-text-muted: #526077;
  --ds-border: #dbe4f2;
  --ds-success: #047857;
  --ds-danger: #b91c1c;
  --ds-ring: #2563eb;
  --ds-radius-sm: 10px;
  --ds-radius-md: 16px;
  --ds-radius-lg: 24px;
  --ds-shadow-sm: 0 2px 8px rgb(15 23 42 / .06);
  --ds-shadow-md: 0 16px 40px rgb(37 99 235 / .10);
  --ds-shadow-lg: 0 28px 70px rgb(15 23 42 / .16);
  --ds-transition: 180ms ease;
}

html { scroll-padding-top: 88px; }
body { color: var(--ds-text); background: var(--ds-bg); font-family: "Source Sans 3", system-ui, sans-serif; font-size: 1rem; line-height: 1.6; }
h1, h2, h3, h4, h5, h6, .brand { color: var(--ds-text); font-family: Lexend, system-ui, sans-serif; letter-spacing: -.025em; }
p, li { text-wrap: pretty; }
a, button, input, select, textarea, summary { touch-action: manipulation; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--ds-ring) !important; outline-offset: 3px; }
.shell { width: min(100% - 40px, 1180px); }
.section { padding-block: clamp(64px, 8vw, 104px); }
.section.alt { background: var(--ds-surface-muted); }
.eyebrow { color: var(--ds-primary-hover); font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
.lead { color: var(--ds-text-muted); font-size: clamp(1.06rem, 1.8vw, 1.25rem); line-height: 1.65; }

.site-header { border-bottom: 1px solid rgb(219 228 242 / .9); background: rgb(255 255 255 / .94); backdrop-filter: blur(14px); }
.nav { min-height: 76px; }
.links .primary-nav-item { min-height: 44px; padding: 10px 12px; color: #334155; font-family: "Source Sans 3", sans-serif; font-size: .92rem; font-weight: 600; }
.links .primary-nav-item.active { color: var(--ds-primary-hover); }
.btn { min-height: 46px; border-radius: 12px; background: var(--ds-primary); box-shadow: 0 8px 20px rgb(37 99 235 / .18); font-family: "Source Sans 3", sans-serif; font-weight: 700; transition: color var(--ds-transition), background var(--ds-transition), border-color var(--ds-transition), box-shadow var(--ds-transition); }
.btn:hover, .btn:focus-visible { background: var(--ds-primary-hover); box-shadow: 0 12px 28px rgb(37 99 235 / .24); transform: none; }
.btn.ghost { border-color: #b9c8df; color: #1e3a5f; background: var(--ds-surface); box-shadow: none; }
.btn.ghost:hover, .btn.ghost:focus-visible { border-color: var(--ds-primary); color: var(--ds-primary-hover); background: var(--ds-primary-soft); }
.btn.small { min-height: 44px; }
.card { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface); box-shadow: var(--ds-shadow-sm); }
.pill { border-color: #bfdbfe; color: #1e40af; background: #eff6ff; }
.bar { overflow: hidden; border-radius: 999px; accent-color: var(--ds-primary); }
.pagehead { border-bottom: 1px solid var(--ds-border); background: linear-gradient(145deg, #eff6ff 0%, #f8faff 56%, #fff7ed 140%); }
.pagehead h1 { max-width: 780px; }

/* Landing */
.academy-hero { position: relative; overflow: hidden; min-height: auto; padding-block: clamp(68px, 9vw, 118px); background: linear-gradient(135deg, #eff6ff 0%, #f8faff 52%, #fff7ed 100%); }
.academy-hero::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 520px; aspect-ratio: 1; border: 1px solid rgb(37 99 235 / .12); border-radius: 50%; box-shadow: 0 0 0 80px rgb(37 99 235 / .035), 0 0 0 160px rgb(217 119 6 / .025); }
.academy-hero-grid { position: relative; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: clamp(44px, 7vw, 92px); align-items: center; }
.academy-hero-copy { max-width: 730px; }
.academy-hero h1 { max-width: 720px; margin: 18px 0 24px; font-size: clamp(2.75rem, 6vw, 5.25rem); line-height: .99; }
.academy-hero h1 em { color: var(--ds-primary); font-style: normal; }
.academy-hero .lead { max-width: 630px; }
.academy-hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 0; margin: 42px 0 0; padding: 0; list-style: none; }
.hero-proof li { display: grid; gap: 0; min-width: 128px; padding: 0 24px; border-left: 1px solid var(--ds-border); }
.hero-proof li:first-child { padding-left: 0; border-left: 0; }
.hero-proof strong { color: var(--ds-text); font-family: Lexend, sans-serif; font-size: 1rem; }
.hero-proof span { color: var(--ds-text-muted); font-size: .84rem; }
.learning-path-preview { padding: 30px; border: 1px solid rgb(255 255 255 / .8); border-radius: var(--ds-radius-lg); color: #e2e8f0; background: linear-gradient(150deg, #0f2557, #172554); box-shadow: var(--ds-shadow-lg); }
.preview-label { display: block; margin-bottom: 24px; color: #93c5fd; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.learning-path-preview ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.learning-path-preview li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; min-height: 86px; padding-bottom: 20px; }
.learning-path-preview li > span { position: relative; display: grid; place-items: center; align-self: start; width: 40px; height: 40px; border: 1px solid rgb(147 197 253 / .4); border-radius: 12px; color: #bfdbfe; font-size: .75rem; font-weight: 700; background: rgb(37 99 235 / .22); }
.learning-path-preview li:not(:last-child) > span::after { content: ""; position: absolute; top: 40px; width: 1px; height: 45px; background: rgb(147 197 253 / .28); }
.learning-path-preview strong, .learning-path-preview small { display: block; }
.learning-path-preview strong { color: #fff; font-family: Lexend, sans-serif; font-size: .96rem; }
.learning-path-preview small { margin-top: 4px; color: #bac8e3; font-size: .84rem; }
.learning-path-preview > a { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding-top: 18px; border-top: 1px solid rgb(255 255 255 / .14); color: #fff; font-weight: 700; text-decoration: none; }
.section-heading, .catalog-results-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 36px; }
.section-heading h2, .catalog-results-heading h2 { margin-bottom: 0; }
.section-heading > p, .catalog-results-heading > p { max-width: 520px; margin: 0; color: var(--ds-text-muted); }

/* Catalogue */
.course-directory-head { padding-block: clamp(56px, 7vw, 86px); }
.course-directory-intro { align-items: end; }
.catalog-filter { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(170px, 220px) auto auto; gap: 14px; align-items: end; margin-top: 34px; padding: 18px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: rgb(255 255 255 / .92); box-shadow: var(--ds-shadow-md); }
.catalog-filter .search-field { display: grid; gap: 6px; }
.catalog-filter label { color: #334155; font-size: .8rem; font-weight: 700; }
.catalog-filter input, .catalog-filter select { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid #b8c5d8; border-radius: 10px; color: var(--ds-text); background: #fff; font: inherit; }
.catalog-filter input:hover, .catalog-filter select:hover { border-color: #7f94b4; }
.clear-filter { display: grid; place-items: center; min-height: 46px; color: var(--ds-primary-hover); font-weight: 700; }
.catalog-results-heading { margin-bottom: 30px; }
.cards { gap: 22px; }
.course-card { position: relative; display: flex; flex-direction: column; min-height: 330px; padding: 26px; overflow: hidden; transition: border-color var(--ds-transition), box-shadow var(--ds-transition); }
.course-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--ds-primary), #60a5fa, var(--ds-secondary)); }
.course-card:hover { border-color: #b8cbeb; box-shadow: var(--ds-shadow-md); transform: none; }
.course-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.course-number { color: var(--ds-text-muted); font-family: Lexend, sans-serif; font-size: 1.25rem; font-weight: 600; }
.course-card h3 { margin-top: 28px; font-size: 1.35rem; }
.course-card p { color: var(--ds-text-muted); }
.course-card-footer { margin-top: auto; padding-top: 24px; }
.course-card-link { min-height: 44px; }
.empty { grid-column: 1 / -1; padding: 48px 28px; border: 1px dashed #a9b9d0; border-radius: var(--ds-radius-md); text-align: center; background: var(--ds-surface); }

/* Learner dashboard */
.dashboard-head .shell { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; }
.dashboard-head .lead { margin-bottom: 0; }
.dashboard-alert { grid-column: 1 / -1; }
.dashboard-section { padding-top: 48px; }
.dashboard-grid { gap: 20px; }
.dashboard-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-summary .dashboard-continue { grid-column: span 2; color: #dce7ff; background: linear-gradient(145deg, #0f2557, #1e3a8a); box-shadow: var(--ds-shadow-lg); }
.dashboard-summary .dashboard-continue h2, .dashboard-summary .dashboard-continue .eyebrow { color: #fff; }
.dashboard-summary .dashboard-continue p { color: #c6d5f2; }
.dashboard-summary .dashboard-continue .bar { background: rgb(255 255 255 / .2); }
.dashboard-card { min-height: 220px; padding: 24px; }
.dashboard-card > h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
.dashboard-card > p { color: var(--ds-text-muted); }
.dashboard-continue > p { color: #c6d5f2; }
.dashboard-card a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; margin-top: auto; color: var(--ds-primary-hover); font-weight: 700; }
.dashboard-summary .dashboard-continue a:not(.btn) { color: #fff; }
.dashboard-section > .section-title-row { margin-top: 62px; margin-bottom: 20px; }
.learning-signals { border-color: var(--ds-border); background: var(--ds-surface-muted); }

/* Reader accessibility and focus hierarchy */
.reader-page .site-header, .reader-page footer { display: none; }
.reader { background: var(--ds-bg); }
.reader-sidebar { background: #0f2557; }
.reader-sidebar .reader-back { width: 44px; height: 44px; }
.reader-unit summary { min-height: 48px; cursor: pointer; }
.reader-unit .reader-lesson { min-height: 46px; }
.reader-main { max-width: 900px; padding-inline: clamp(24px, 5vw, 72px); }
.lesson-heading { padding-bottom: 32px; border-bottom: 1px solid var(--ds-border); }
.lesson-heading h1 { max-width: 780px; font-size: clamp(2.1rem, 4vw, 3.5rem); line-height: 1.08; }
.lesson-pager-top { min-height: 54px; border-bottom: 1px solid var(--ds-border); }
.lesson-pager-top a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 8px; font-weight: 700; }
.lesson-content { max-width: 74ch; color: #1e293b; font-size: 1.08rem; line-height: 1.75; }
.lesson-content h2 { margin-top: 2.3em; padding-top: .3em; font-size: clamp(1.55rem, 3vw, 2rem); }
.lesson-content h3 { margin-top: 1.9em; }
.lesson-content pre, .lesson-content .highlight { border-radius: var(--ds-radius-md); }
.lesson-action-badge { min-height: 44px; padding-inline: 16px; border-radius: 10px; }
.lesson-notes { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface-muted); }

@media (max-width: 1024px) {
  .academy-hero-grid { grid-template-columns: 1fr; }
  .learning-path-preview { max-width: 720px; }
  .catalog-filter { grid-template-columns: 1fr 200px auto; }
  .catalog-filter .clear-filter { grid-column: 1 / -1; justify-self: start; }
  .dashboard-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 1180px); }
  .section { padding-block: 58px; }
  .academy-hero { padding-block: 56px 68px; }
  .academy-hero h1 { font-size: clamp(2.55rem, 13vw, 3.8rem); }
  .academy-hero .actions { display: grid; }
  .academy-hero .actions .btn { width: 100%; }
  .hero-proof { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .hero-proof li, .hero-proof li:first-child { min-width: 0; padding: 0 0 0 14px; border-left: 2px solid #bfdbfe; }
  .learning-path-preview { padding: 24px 20px; }
  .section-heading, .catalog-results-heading, .course-directory-intro { display: block; }
  .section-heading > p, .catalog-results-heading > p, .course-directory-intro > p { margin-top: 14px; }
  .catalog-filter { grid-template-columns: 1fr; }
  .catalog-filter .clear-filter { grid-column: auto; }
  .dashboard-head .shell { grid-template-columns: 1fr; }
  .dashboard-head .btn { justify-self: start; }
  .dashboard-summary { grid-template-columns: 1fr; }
  .dashboard-summary .dashboard-continue { grid-column: auto; }
  .reader-main { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (forced-colors: active) {
  *, *::before, *::after { box-shadow: none !important; }
  a, button, input, select, textarea, [tabindex] { forced-color-adjust: auto; }
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid Highlight !important; outline-offset: 3px; }
  .btn, .pill, .status-badge, .card, .panel, .sidebox, .learning-path-preview, .reader-sidebar { border: 1px solid CanvasText; }
  .btn, .course-menu-icon, .person-icon { color: ButtonText; background: ButtonFace; }
  progress { border: 1px solid CanvasText; }
}

@media (prefers-color-scheme: dark) {
  /* Reader follows a light document surface for long-form readability; controls remain contrast-safe. */
  .reader-page { color-scheme: light; }
}
