:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-soft: #efefeb;
  --text: #1d211f;
  --muted: #656b67;
  --line: #dcded9;
  --accent: #4f625a;
  --accent-strong: #33423c;
  --max: 1120px;
  --shadow: 0 14px 40px rgba(29, 33, 31, 0.07);
}

:root[data-theme="dark"] {
  --bg: #181b19;
  --surface: #202421;
  --surface-soft: #262b27;
  --text: #f0f2ef;
  --muted: #aeb5b0;
  --line: #363c38;
  --accent: #a6b8ae;
  --accent-strong: #d2ddd6;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  transition: background-color .25s ease, color .25s ease;
}

.container {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
}

.header-inner,
.footer-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.brand-code {
  font-weight: 800;
  letter-spacing: .08em;
}

.brand-name {
  color: var(--muted);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

.hero {
  padding: 96px 0 84px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 72px;
  align-items: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .78rem;
  font-weight: 800;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.055em;
  max-width: 960px;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.06rem;
}

.lead {
  max-width: 720px;
  font-size: 1.25rem;
  color: var(--muted);
}

.hero-actions {
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 750;
  transition: transform .2s ease, background-color .2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent-strong);
  color: var(--bg);
}

.hero-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  padding: 20px 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.metric:last-child {
  border-bottom: 0;
}

.metric-value {
  font-size: 1.45rem;
  font-weight: 800;
}

.metric-label {
  text-align: right;
  color: var(--muted);
  font-size: .9rem;
}

.section {
  padding: 76px 0;
  border-top: 1px solid var(--line);
}

.section-muted {
  background: var(--surface-soft);
}

.two-column,
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
}

.prose {
  color: var(--muted);
  font-size: 1.04rem;
}

.journey,
.practice-grid,
.grading-grid {
  margin-top: 34px;
  display: grid;
  gap: 16px;
}

.journey {
  grid-template-columns: repeat(4, 1fr);
}

.journey-step,
.practice-card,
.grade-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.journey-step {
  padding: 24px;
}

.step-number {
  display: block;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.journey-step p,
.practice-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  margin-bottom: 30px;
}

.section-note {
  max-width: 420px;
  margin-bottom: 6px;
  color: var(--muted);
}

.schedule-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.schedule-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.schedule-table th {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.schedule-table tbody tr:last-child td {
  border-bottom: 0;
}

.schedule-table td:first-child {
  width: 72px;
  font-weight: 800;
  color: var(--accent);
}

.practice-grid {
  grid-template-columns: repeat(3, 1fr);
}

.practice-card {
  padding: 25px;
}

.pill {
  display: inline-block;
  margin-bottom: 22px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.grading-grid {
  grid-template-columns: repeat(3, 1fr);
}

.grade-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grade-value {
  font-size: 2.8rem;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -.04em;
}

.grade-label {
  color: var(--muted);
}

.book-title {
  margin-bottom: 4px;
  font-weight: 800;
}

.final-note {
  text-align: center;
}

.final-note blockquote {
  margin: 0 auto 18px;
  max-width: 900px;
  font-size: clamp(1.6rem, 4vw, 3.1rem);
  line-height: 1.18;
  letter-spacing: -.035em;
  font-weight: 700;
}

.final-note p {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

.footer-inner > div:first-child {
  display: flex;
  gap: 10px;
}

@media (max-width: 900px) {
  .hero {
    padding-top: 70px;
  }

  .hero-grid,
  .two-column,
  .info-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .journey {
    grid-template-columns: repeat(2, 1fr);
  }

  .practice-grid,
  .grading-grid {
    grid-template-columns: 1fr;
  }

  .section-heading-row {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(calc(100% - 28px), var(--max));
  }

  .brand-name {
    display: none;
  }

  .hero {
    padding: 54px 0 58px;
  }

  .section {
    padding: 56px 0;
  }

  .journey {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    padding: 18px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-inner > div:first-child {
    flex-direction: column;
    gap: 0;
  }
}

/* Accessibility additions; the CENG 215 visual design is preserved. */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
a:not(.button) { color: var(--accent-strong); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.theme-toggle { min-width: 44px; min-height: 44px; flex-shrink: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 20; padding: 10px 18px; background: var(--surface); }
.skip-link:focus { top: 12px; }
#main-content { scroll-margin-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body, .button { transition: none; }
}
