@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #07100c;
  --panel: #0d1813;
  --panel-raised: #122119;
  --panel-hover: #182d20;
  --border: #233b2c;
  --text: #f3f8f4;
  --muted: #a4b3a9;
  --faint: #708278;
  --accent: #a6ff4d;
  --accent-dark: #7fd62f;
  --html: #ffad62;
  --python: #ffdf69;
  --c: #7be0d1;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 75% -5%, rgba(41, 94, 53, .28), transparent 38%), var(--bg);
  font: 16px/1.65 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  min-height: 76px; padding: 0 clamp(18px, 6vw, 86px);
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  border-bottom: 1px solid rgba(35, 59, 44, .9);
  background: rgba(7, 16, 12, .9); backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.brand img { display: block; width: 39px; height: 39px; object-fit: contain; border-radius: 10px; }
nav { display: flex; align-items: center; gap: 5px; }
nav a { color: var(--muted); padding: 9px 15px; border-radius: 9px; font-size: 14px; font-weight: 650; transition: background .2s, color .2s; }
nav a:hover, nav a.active { color: var(--text); background: var(--panel-raised); }
.wrap { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.hero { min-height: 620px; padding-block: 72px 86px; display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(34px, 7vw, 90px); align-items: center; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
.hero h1 { margin: 14px 0 24px; font-size: clamp(48px, 6.8vw, 82px); line-height: .99; letter-spacing: -.065em; }
.hero h1 span { color: var(--accent); }
.lead { max-width: 690px; margin: 0; color: var(--muted); font-size: clamp(16px, 1.8vw, 19px); }
.button-row, .card-actions, .toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 10px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 750; transition: transform .18s, border-color .18s, background .18s; }
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: #50784b; }
.button.primary { background: var(--accent); color: #0a1409; border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: #baff7e; border-color: #baff7e; }
.button.secondary { background: var(--panel-raised); color: var(--text); }
.button:disabled { cursor: not-allowed; opacity: .38; }
.hero .button-row { margin-top: 28px; }
.hero-stats { display: flex; gap: 28px; margin-top: 38px; }
.hero-stats div { display: grid; gap: 0; }
.hero-stats strong { font-size: 19px; letter-spacing: -.4px; }
.hero-stats span { color: var(--faint); font-size: 12px; }
.card { border: 1px solid var(--border); border-radius: 24px; background: linear-gradient(145deg, rgba(18, 33, 25, .96), rgba(13, 24, 19, .98)); box-shadow: var(--shadow); }
.hero-art { position: relative; min-height: 390px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 38px 30px; overflow: hidden; text-align: center; }
.hero-art::before { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: rgba(166, 255, 77, .06); filter: blur(10px); }
.logo-halo { position: relative; display: grid; place-items: center; width: 145px; height: 145px; border: 1px solid rgba(166, 255, 77, .28); border-radius: 42px; background: #0b1b10; box-shadow: 0 0 65px rgba(166, 255, 77, .08); transform: rotate(-4deg); }
.logo-halo img { width: 112px; max-height: 112px; object-fit: contain; transform: rotate(4deg); }
.hero-art h2 { margin: 27px 0 4px; font-size: 23px; letter-spacing: -.6px; }
.hero-art p { max-width: 370px; margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.floating-tag { position: absolute; z-index: 2; padding: 6px 10px; background: #09120c; border: 1px solid var(--border); border-radius: 9px; font: 700 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; box-shadow: 0 12px 30px #0004; }
.tag-html { top: 48px; left: 20px; color: var(--html); }
.tag-python { top: 87px; right: 22px; color: var(--python); }
.tag-c { bottom: 42px; left: 50%; transform: translateX(-50%); color: var(--c); white-space: nowrap; }
.section { padding-block: 35px 70px; }
.section-bottom { padding-bottom: 100px; }
.section-heading { margin-bottom: 27px; }
.section-heading h2, .page-heading h1 { margin: 6px 0 9px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.05em; line-height: 1.15; }
.section-heading p, .page-heading p { margin: 0; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.feature-card { padding: 25px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(13, 24, 19, .82); }
.feature-number { color: var(--accent); font-size: 12px; font-weight: 800; }
.feature-card h3 { margin: 13px 0 5px; font-size: 18px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 14px; }
.split-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.text-link { color: var(--accent); font-size: 13px; font-weight: 750; white-space: nowrap; }
.course-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.preview-card { min-height: 245px; padding: 24px; border-radius: 18px; border: 1px solid var(--border); background: var(--panel); transition: transform .2s, border-color .2s; }
.preview-card:hover { transform: translateY(-4px); border-color: #52704e; }
.course-symbol { display: grid; place-items: center; width: 55px; height: 55px; margin-bottom: 22px; border-radius: 15px; background: rgba(166, 255, 77, .12); color: var(--accent); font-size: 20px; font-weight: 850; letter-spacing: -.8px; }
.html-card .course-symbol { color: var(--html); background: rgba(255, 173, 98, .12); }
.python-card .course-symbol { color: var(--python); background: rgba(255, 223, 105, .12); }
.c-card .course-symbol { color: var(--c); background: rgba(123, 224, 209, .12); }
.preview-kicker { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
.preview-card h3 { margin: 5px 0 4px; font-size: 22px; }
.preview-card p { min-height: 49px; margin: 0 0 17px; color: var(--muted); font-size: 13px; }
.preview-link { color: var(--accent); font-size: 13px; font-weight: 750; }
.site-footer { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px max(24px, calc((100% - 1240px) / 2)); border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; }
.site-footer a:hover { color: var(--accent); }

/* Courses page */
.page-main { padding-top: 62px; padding-bottom: 90px; }
.page-heading { max-width: 800px; margin-bottom: 38px; }
.page-heading h1 { font-size: clamp(36px, 5.5vw, 60px); }
.page-heading p { max-width: 680px; font-size: 16px; }
.course-grid-full { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.course-card { display: flex; flex-direction: column; padding: 25px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(150deg, rgba(18, 33, 25, .9), rgba(13, 24, 19, .96)); box-shadow: var(--shadow); }
.course-card-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.course-card .course-symbol { flex: 0 0 auto; }
.course-level { margin-top: 10px; color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: 1px; text-align: right; }
.course-card h2 { margin: 5px 0 5px; font-size: 26px; }
.course-card > p { flex: 1; margin: 3px 0 22px; color: var(--muted); font-size: 14px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 0; margin-bottom: 17px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--faint); font-size: 11px; }
.course-meta strong { color: var(--text); font-size: 13px; }
.card-actions { margin-top: auto; }
.card-actions .button { flex: 1 1 auto; }
.notice-panel { display: flex; align-items: start; gap: 15px; margin-top: 30px; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: rgba(13, 24, 19, .72); }
.notice-icon { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--panel-hover); color: var(--accent); font-weight: 800; }
.notice-panel h2 { margin: 0 0 4px; font-size: 16px; }
.notice-panel p { margin: 0; color: var(--muted); font-size: 13px; }

/* PDF course reader */
.course-shell { min-height: calc(100vh - 146px); display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.topic-sidebar { position: sticky; top: 76px; align-self: start; height: calc(100vh - 76px); min-height: 500px; overflow: auto; padding: 20px 16px 24px; border-right: 1px solid var(--border); background: rgba(9, 19, 13, .88); }
.back-link, .back-small { color: var(--muted); font-size: 12px; }
.back-link:hover, .back-small:hover { color: var(--accent); }
.sidebar-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 4px 18px; }
.sidebar-title-row h2 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.5px; }
.topic-total { display: grid; place-items: center; min-width: 32px; height: 30px; padding-inline: 6px; border-radius: 9px; background: var(--panel-raised); color: var(--accent); font-size: 12px; font-weight: 800; }
.search-label { display: block; margin: 0 4px 6px; color: var(--faint); font-size: 11px; font-weight: 700; }
.topic-search { display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; outline: 0; background: #08120c; color: var(--text); font-size: 12px; }
.topic-search:focus { border-color: var(--accent-dark); }
.topic-search::placeholder { color: #66786c; }
.search-status { min-height: 16px; margin: 6px 4px; color: var(--faint); font-size: 10px; }
.topic-list { display: grid; gap: 3px; }
.topic-button { display: flex; align-items: start; gap: 9px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; font-size: 11px; line-height: 1.45; }
.topic-button:hover { background: var(--panel-raised); color: var(--text); }
.topic-button.active { background: rgba(166, 255, 77, .1); color: var(--text); box-shadow: inset 3px 0 var(--accent); }
.topic-page-number { flex: 0 0 28px; color: var(--faint); font: 700 10px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.topic-button.active .topic-page-number { color: var(--accent); }
.topic-title { flex: 1; }
.topic-empty { padding: 15px 10px; color: var(--muted); font-size: 12px; }
.reader-main { width: min(1450px, 100%); min-width: 0; margin-inline: auto; padding: 38px clamp(18px, 3vw, 46px) 60px; }
.reader-heading { margin-bottom: 24px; }
.reader-title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 6px; }
.reader-title-row h1 { margin: 4px 0 6px; font-size: clamp(32px, 4vw, 48px); line-height: 1.12; letter-spacing: -.05em; }
#courseBreadcrumb { color: var(--muted); font-size: 12px; }
.page-badge { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); font-size: 11px; }
.reader-description { max-width: 850px; margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.toolbar-label { display: flex; align-items: center; gap: 11px; }
.toolbar-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px rgba(166, 255, 77, .3); }
.toolbar-label div { display: grid; line-height: 1.4; }
.toolbar-label strong { font-size: 12px; }
.toolbar-label span:not(.toolbar-dot) { color: var(--faint); font-size: 10px; }
.toolbar-actions .button { min-height: 37px; padding: 8px 12px; font-size: 11px; }
.tutor-panel { display: flex; align-items: center; gap: 14px; margin-block: 17px; padding: 17px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(100deg, #11251a, #0d1813); }
.tutor-avatar { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid rgba(166, 255, 77, .23); border-radius: 12px; background: rgba(166, 255, 77, .1); color: var(--accent); font-size: 22px; }
.tutor-copy { flex: 1; min-width: 0; }
.tutor-copy h2 { margin: 2px 0 3px; font-size: 14px; }
.tutor-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.tutor-copy .tutor-note { margin-top: 3px; color: var(--faint); font-size: 10px; }
.tutor-panel .button { flex: 0 0 auto; min-height: 37px; font-size: 11px; }
.pdf-section { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.pdf-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.pdf-heading h2 { margin: 2px 0 2px; font-size: 18px; letter-spacing: -.4px; }
.pdf-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.selected-page { flex: 0 0 auto; padding: 6px 9px; border-radius: 8px; background: var(--panel-raised); color: var(--accent); font-size: 10px; font-weight: 750; }
.pdf-frame-wrap { position: relative; min-height: 700px; background: #e8ebe8; }
#pdfViewer { display: block; width: 100%; height: min(82vh, 1000px); min-height: 700px; border: 0; background: #fff; }
.pdf-fallback { min-height: 350px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; background: #f1f4f1; color: #172019; text-align: center; }
.pdf-fallback p { color: #435247; }
.reader-footer-note { display: flex; justify-content: space-between; gap: 15px; padding: 10px 15px; border-top: 1px solid var(--border); color: var(--faint); font-size: 10px; }
.reader-bottom-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }

@media (max-width: 1050px) {
  .course-grid-full { grid-template-columns: 1fr 1fr; }
  .course-shell { grid-template-columns: 255px minmax(0, 1fr); }
  .reader-toolbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 780px) {
  .site-header { min-height: 68px; padding-inline: 18px; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-block: 54px 66px; }
  .hero-art { min-height: 330px; }
  .feature-grid, .course-preview-grid, .course-grid-full { grid-template-columns: 1fr; }
  .section { padding-block: 25px 55px; }
  .split-heading { align-items: flex-start; flex-direction: column; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .course-shell { display: block; }
  .topic-sidebar { position: relative; top: auto; height: auto; min-height: 0; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); padding: 17px 18px; }
  .sidebar-title-row { margin-top: 13px; margin-bottom: 12px; }
  .topic-list { max-height: 260px; overflow-y: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reader-main { padding: 26px 16px 42px; }
  .reader-title-row { align-items: flex-start; }
  .reader-title-row h1 { font-size: 34px; }
  .page-badge { max-width: 100px; text-align: center; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .button { flex: 1; }
  .tutor-panel { align-items: flex-start; flex-wrap: wrap; }
  .tutor-copy { flex-basis: calc(100% - 60px); }
  .tutor-panel .button { margin-left: 56px; }
  .pdf-heading { align-items: flex-start; flex-direction: column; }
  #pdfViewer { height: 70vh; min-height: 500px; }
  .pdf-frame-wrap { min-height: 500px; }
  .reader-footer-note { flex-direction: column; gap: 4px; }
}
@media (max-width: 420px) {
  .brand { font-size: 18px; }
  .brand img { width: 34px; height: 34px; }
  nav a { padding: 8px 10px; font-size: 12px; }
  .hero-stats { gap: 20px; }
  .topic-list { grid-template-columns: 1fr; }
  .reader-bottom-nav .button { flex: 1; padding-inline: 8px; }
  .card-actions { flex-direction: column; align-items: stretch; }
}
