:root {
  color-scheme: light dark;
  --bg: #f7fbfb;
  --surface: #ffffff;
  --surface-2: #eef7f6;
  --text: #10201f;
  --muted: #5d7370;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --accent: #f59e0b;
  --border: rgba(15, 118, 110, .16);
  --shadow: 0 22px 70px rgba(9, 63, 59, .12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071312;
    --surface: #0d1d1b;
    --surface-2: #122824;
    --text: #e9fffb;
    --muted: #a8c9c4;
    --brand: #2dd4bf;
    --brand-2: #5eead4;
    --accent: #fbbf24;
    --border: rgba(94, 234, 212, .18);
    --shadow: 0 22px 70px rgba(0, 0, 0, .35);
  }
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7fbfb;
  --surface: #ffffff;
  --surface-2: #eef7f6;
  --text: #10201f;
  --muted: #5d7370;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --accent: #f59e0b;
  --border: rgba(15, 118, 110, .16);
  --shadow: 0 22px 70px rgba(9, 63, 59, .12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071312;
  --surface: #0d1d1b;
  --surface-2: #122824;
  --text: #e9fffb;
  --muted: #a8c9c4;
  --brand: #2dd4bf;
  --brand-2: #5eead4;
  --accent: #fbbf24;
  --border: rgba(94, 234, 212, .18);
  --shadow: 0 22px 70px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 35rem),
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28rem),
    var(--bg);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button, input { font: inherit; }
::selection { background: transparent; color: inherit; }

.container { width: min(var(--max), calc(100% - 32px)); margin-inline: auto; }
.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -80px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  z-index: 99;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 900;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--brand) 30%, transparent);
}
.brand-text { display: grid; line-height: 1.3; }
.brand-text strong { font-size: 1.02rem; }
.brand-text small { color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
}
.nav-links a:hover { background: var(--surface-2); color: var(--brand); }
.icon-btn,
.floating-actions button,
.floating-actions a {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
}
.icon-btn { width: 44px; height: 44px; }
.icon-btn:hover,
.floating-actions button:hover,
.floating-actions a:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(280px, .62fr);
  gap: 28px;
  padding: 72px 0 34px;
  align-items: stretch;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-weight: 800;
  margin: 0 0 8px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--brand);
  border-radius: 999px;
}
h1 {
  font-size: clamp(2.15rem, 6vw, 5.1rem);
  line-height: 1.05;
  letter-spacing: -.05em;
  margin: 0 0 20px;
}
.hero-lead {
  font-size: clamp(1.03rem, 2vw, 1.35rem);
  color: var(--muted);
  max-width: 760px;
  margin: 0 0 26px;
}
.search-card,
.hero-panel,
.features article,
.course-card,
.about,
.empty-state {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.search-card {
  max-width: 720px;
  padding: 22px;
  border-radius: var(--radius-xl);
}
.search-card label { display: block; font-weight: 800; margin-bottom: 10px; }
.search-row { display: flex; gap: 10px; }
.search-row input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 16px;
  outline: none;
}
.search-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.search-row button,
.course-card .read-link {
  border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.hint { color: var(--muted); margin: 10px 0 0; font-size: .92rem; }

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
}
.panel-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-2) 24%, transparent);
  filter: blur(22px);
  inset-inline-start: -70px;
  top: -70px;
}
.hero-panel > *:not(.panel-glow) { position: relative; }
.hero-panel p { margin: 0; color: var(--muted); font-weight: 800; }
.hero-panel strong {
  font-size: clamp(4.6rem, 10vw, 7rem);
  line-height: 1;
  letter-spacing: -.06em;
  color: var(--brand);
}
.hero-panel span { color: var(--muted); }
.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.mini-stats div {
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.mini-stats b { display: block; color: var(--brand); font-size: 1.3rem; }
.mini-stats small { color: var(--muted); }

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 0 42px;
}
.features article {
  border-radius: var(--radius-lg);
  padding: 22px;
}
.features span { font-size: 2rem; }
.features h2 { margin: 10px 0 8px; font-size: 1.15rem; }
.features p { margin: 0; color: var(--muted); }

.guides-section { padding: 26px 0 70px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-head h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.4rem); }
.result-count { color: var(--muted); margin: 0; font-weight: 800; }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.course-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 24px;
  min-height: 278px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  isolation: isolate;
}
.course-card::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  inset-inline-start: -52px;
  bottom: -58px;
  z-index: -1;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.category {
  color: var(--brand);
  font-weight: 900;
  font-size: .9rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: color-mix(in srgb, var(--accent) 72%, var(--text));
  font-weight: 900;
  white-space: nowrap;
}
.course-card h3 {
  font-size: 1.36rem;
  line-height: 1.35;
  margin: 0;
}
.course-card p { margin: 0; color: var(--muted); }
.course-card .card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.updated { color: var(--muted); font-size: .9rem; }
.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.course-card .read-link,
.course-card .pdf-link { display: inline-flex; align-items: center; justify-content: center; }
.course-card .pdf-link {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, #ef4444 35%, var(--border));
  background: color-mix(in srgb, #ef4444 10%, var(--surface));
  color: color-mix(in srgb, #ef4444 82%, var(--text));
  border-radius: 16px;
  padding: 10px 13px;
  font-weight: 900;
  letter-spacing: .02em;
}
.course-card .pdf-link:hover { transform: translateY(-1px); border-color: #ef4444; }

.course-card .read-link:hover { color: #fff; filter: saturate(1.15); transform: translateY(-1px); }
.empty-state {
  text-align: center;
  padding: 32px;
  border-radius: var(--radius-xl);
}
.empty-state h3 { margin-top: 0; }
.empty-state code {
  direction: ltr;
  unicode-bidi: plaintext;
  color: var(--brand);
}

.about {
  margin-bottom: 70px;
  border-radius: var(--radius-xl);
  padding: 28px;
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 24px;
}
.about h2 { margin: 0; }
.about p:last-child { margin: 0; color: var(--muted); }

.floating-actions {
  position: fixed;
  inset-inline-start: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
}
.floating-actions button,
.floating-actions a {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: .82rem;
}
.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 24px;
  margin-inline: auto;
  width: fit-content;
  max-width: calc(100% - 34px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  opacity: 0;
  transform: translateY(18px);
  transition: .2s ease;
  pointer-events: none;
  z-index: 70;
}
.toast.show { opacity: 1; transform: translateY(0); }

.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
}
.footer-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--brand); font-weight: 900; }
.noscript { padding: 18px; text-align: center; background: #fee2e2; color: #7f1d1d; }

@media (max-width: 940px) {
  .hero,
  .about { grid-template-columns: 1fr; }
  .features,
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .container { width: min(100% - 22px, var(--max)); }
  .topbar { min-height: 66px; }
  .brand-text small,
  .nav-links { display: none; }
  .hero { padding-top: 42px; }
  .search-row { flex-direction: column; }
  .features,
  .cards-grid { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .footer-inner { align-items: start; flex-direction: column; padding: 18px 0; }
  .floating-actions { inset-inline-start: 12px; bottom: 12px; }
}

@media print {
  .site-header,
  .floating-actions,
  .search-card,
  .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .course-card,
  .features article,
  .about,
  .hero-panel { box-shadow: none; break-inside: avoid; }
}

#platformVisits {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.nav-links a[href="/call/"] {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
}

code {
  direction: ltr;
  display: inline-block;
  background: color-mix(in srgb, var(--surface-2) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 6px;
}
