/* ==========================================================================
   CodeM Academy — public site
   Typography → layout → content → whitespace → interaction → colour.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* colour */
  --ink-950: #0c0d0b;
  --ink-900: #131411;
  --ink-850: #191a17;
  --ink-800: #20221e;
  --ink-700: #2d2f2a;
  --ink-500: #62665e;
  --ink-400: #8a8e85;
  --ink-300: #b4b7ae;
  --paper: #f4f2ec;
  --paper-50: #faf9f5;
  --paper-200: #ebe8df;
  --paper-300: #dedad0;
  --accent: #c6f24e;
  --accent-hover: #d4f770;
  --accent-deep: #4a6500;
  --danger: #b42318;
  --success: #2e6b0f;

  --line: rgba(12, 13, 11, 0.12);
  --line-strong: rgba(12, 13, 11, 0.22);
  --line-dark: rgba(244, 242, 236, 0.1);
  --line-dark-strong: rgba(244, 242, 236, 0.2);

  /* type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.3125rem;
  --text-xl: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
  --text-2xl: clamp(1.875rem, 1.3rem + 2vw, 2.875rem);
  --text-3xl: clamp(2.375rem, 1.4rem + 3.6vw, 4.25rem);
  --leading-tight: 1.05;
  --leading-snug: 1.25;
  --leading-body: 1.6;
  --tracking-tight: -0.035em;
  --tracking-snug: -0.02em;
  --tracking-label: 0.08em;

  /* spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --section-y: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --gutter: clamp(1.25rem, 0.6rem + 2.6vw, 2.5rem);
  --container: 1240px;
  --header-h: 64px;

  /* shape */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-panel: 0 1px 0 rgba(12, 13, 11, 0.04), 0 24px 60px -24px rgba(12, 13, 11, 0.35);
  --shadow-terminal: 0 40px 80px -40px rgba(0, 0, 0, 0.8);

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 600ms;

  --focus: var(--ink-950);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--ink-950);
  background: var(--paper);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.92em; }
::selection { background: var(--accent); color: var(--ink-950); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--ink-950);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--space-3); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(3rem, 2rem + 4vw, 5rem); }
.section--bordered { border-top: 1px solid var(--line); }
.section--sunk { background: var(--paper-200); }

.on-dark,
.section--dark {
  --focus: var(--accent);
  background: var(--ink-950);
  color: var(--paper);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-6) var(--gutter);
}

/* fine engineering grid used behind dark hero/CTA */
.bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line-dark) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-dark) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  opacity: 0.45;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
}

/* ---------- Type ---------- */
.label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-500);
}
.label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent-deep);
  flex: none;
}
.on-dark .label,
.section--dark .label { color: var(--ink-400); }
.on-dark .label::before,
.section--dark .label::before { background: var(--accent); }
.label--plain::before { display: none; }

.display {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
  text-wrap: balance;
}
.h1 {
  font-size: var(--text-2xl);
  line-height: 1.08;
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
  text-wrap: balance;
}
.h2 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
  font-weight: 600;
}
.h3 {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
  font-weight: 600;
}
.lead {
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--ink-500);
  max-width: 38em;
  text-wrap: pretty;
}
.on-dark .lead,
.section--dark .lead { color: var(--ink-300); }
.muted { color: var(--ink-500); }
.on-dark .muted,
.section--dark .muted { color: var(--ink-400); }
.mono { font-family: var(--font-mono); }
.accent-text { color: var(--accent-deep); }
.on-dark .accent-text,
.section--dark .accent-text { color: var(--accent); }

.prose { max-width: 70ch; color: var(--ink-700); }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { font-size: var(--text-lg); letter-spacing: var(--tracking-snug); color: var(--ink-950); margin-top: var(--space-7); }
.prose ul { list-style: disc; padding-left: 1.25rem; }
.prose ul li + li { margin-top: var(--space-2); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.prose a:hover { text-decoration-color: currentColor; }
.prose code { background: var(--paper-200); padding: 0.1em 0.35em; border-radius: var(--radius-sm); }

/* ---------- Utilities ---------- */
.block-title { margin: var(--space-3) 0 var(--space-6); }
.mt-5 { margin-top: var(--space-5); }
.mt-9 { margin-top: var(--space-9); }
.mb-5 { margin-bottom: var(--space-5); }
.text-sm { font-size: var(--text-sm); }
.link-button { background: none; border: 0; border-bottom: 1px solid var(--line-strong); padding: 0 0 2px; cursor: pointer; }

/* ---------- Section header ---------- */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-5) var(--space-6);
  margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4rem);
}
.section-head__text { display: grid; gap: var(--space-4); max-width: 46rem; }
.section-head .lead { margin-top: var(--space-1); }
@media (max-width: 720px) {
  .section-head { grid-template-columns: 1fr; align-items: start; }
}

/* ---------- Buttons & links ---------- */
.btn {
  --btn-bg: var(--ink-950);
  --btn-fg: var(--paper);
  --btn-border: var(--btn-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-5);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--text-sm);
  font-weight: 550;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { --btn-bg: var(--ink-800); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.btn:hover svg { transform: translateX(2px); }

.btn--accent { --btn-bg: var(--accent); --btn-fg: var(--ink-950); }
.btn--accent:hover { --btn-bg: var(--accent-hover); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink-950); --btn-border: var(--line-strong); }
.btn--ghost:hover { --btn-bg: transparent; --btn-border: var(--ink-950); }
.on-dark .btn--ghost,
.section--dark .btn--ghost { --btn-fg: var(--paper); --btn-border: var(--line-dark-strong); }
.on-dark .btn--ghost:hover,
.section--dark .btn--ghost:hover { --btn-border: var(--paper); }

.btn--sm { min-height: 38px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.btn--block { width: 100%; }
.btn[disabled],
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 550;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color var(--dur-fast) var(--ease);
}
.link-arrow svg { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.link-arrow:hover { border-color: currentColor; }
.link-arrow:hover svg { transform: translateX(3px); }
.on-dark .link-arrow,
.section--dark .link-arrow { border-color: var(--line-dark-strong); }
.on-dark .link-arrow:hover,
.section--dark .link-arrow:hover { border-color: var(--paper); }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--ink-700);
  background: var(--paper-50);
  white-space: nowrap;
}
.on-dark .tag,
.section--dark .tag { border-color: var(--line-dark); color: var(--ink-300); background: transparent; }

.tech-line {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.01em;
  color: var(--ink-500);
}
.tech-line__item + .tech-line__item::before { content: " · "; color: var(--ink-300); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink-950) 92%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line-dark); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-weight: 650;
  font-size: 1.125rem;
  letter-spacing: -0.04em;
}
.logo__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink-950);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.06em;
}
.logo__word span { color: var(--ink-400); font-weight: 450; }

.nav { display: flex; align-items: center; gap: var(--space-1); }
.nav__link {
  position: relative;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--ink-300);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease);
}
.nav__link:hover { color: var(--paper); }
.nav__link[aria-current="page"] { color: var(--paper); }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: 2px;
  height: 2px;
  background: var(--accent);
}

.site-header__cta { display: flex; align-items: center; gap: var(--space-3); }
.site-header .btn { min-height: 38px; }

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  background: transparent;
  border: 0;
  color: var(--paper);
}
.menu-toggle__bars { position: relative; width: 20px; height: 12px; }
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur) var(--ease), top var(--dur) var(--ease);
}
.menu-toggle__bars::before { top: 2px; }
.menu-toggle__bars::after { top: 9px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { top: 5.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { top: 5.5px; transform: rotate(-45deg); }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line-dark);
  padding: var(--space-3) var(--gutter) var(--space-6);
  background: var(--ink-950);
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a.mobile-nav__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: 1.375rem;
  letter-spacing: var(--tracking-snug);
  color: var(--paper);
}
.mobile-nav__link small { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-500); }
.mobile-nav .btn { margin-top: var(--space-5); width: 100%; }

@media (max-width: 960px) {
  .nav, .site-header__cta .btn { display: none; }
  .menu-toggle { display: inline-flex; }
}
@media (min-width: 961px) {
  .mobile-nav, .mobile-nav.is-open { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 2rem + 6vw, 7.5rem) clamp(4rem, 2rem + 6vw, 7rem);
}
.hero__grid { position: relative; align-items: center; }
.hero__copy { grid-column: 1 / span 6; display: grid; gap: var(--space-5); }
.hero__visual { grid-column: 8 / span 5; }
.hero .display { max-width: 12ch; }
.hero .lead { max-width: 30em; }
.hero__cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.82em;
  margin-left: 0.08em;
  background: var(--accent);
  vertical-align: -0.04em;
  animation: blink 1.1s steps(1) infinite;
}
.hero .btn-row { margin-top: var(--space-2); }

.facts {
  display: flex;
  flex-wrap: wrap;
  margin-top: var(--space-6);
  border-top: 1px solid var(--line-dark);
}
.facts > div {
  padding: var(--space-4) var(--space-5) 0 0;
  margin-right: var(--space-5);
}
.facts dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-500);
}
.facts dd { font-size: var(--text-sm); color: var(--paper); margin-top: 2px; }

@media (max-width: 1080px) {
  .hero__copy { grid-column: 1 / -1; }
  .hero__visual { grid-column: 1 / -1; max-width: 560px; }
  .hero .display { max-width: 14ch; }
}

/* ---------- Terminal visual ---------- */
.terminal {
  border: 1px solid var(--line-dark-strong);
  border-radius: var(--radius-lg);
  background: var(--ink-900);
  box-shadow: var(--shadow-terminal);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--paper);
}
.terminal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-dark);
  font-size: 11px;
  color: var(--ink-500);
}
.terminal__tabs { display: flex; gap: var(--space-4); }
.terminal__tab--active { color: var(--paper); }
.terminal__body {
  min-height: 336px;
  padding: 18px 20px 22px;
  white-space: pre;
  overflow-x: auto;
}
.terminal__line { display: block; min-height: 1.75em; }
@media (prefers-reduced-motion: no-preference) {
  .js .terminal__line { visibility: hidden; }
}
.t-prompt { color: var(--accent); }
.t-dim { color: var(--ink-500); }
.t-ok { color: var(--accent); }
.t-bar { color: var(--accent); letter-spacing: -0.04em; }
.t-caret {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  vertical-align: -0.2em;
  background: var(--paper);
  animation: blink 1.1s steps(1) infinite;
}
.terminal__caption {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 0.02em;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Workflow strip ---------- */
.workflow { border-bottom: 1px solid var(--line); }
.workflow__inner { align-items: start; }
.workflow__head { grid-column: 1 / span 4; display: grid; gap: var(--space-4); }
.workflow__steps {
  grid-column: 5 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  counter-reset: step;
}
.workflow__step {
  position: relative;
  padding: var(--space-5) var(--space-4) 0 0;
  border-top: 1px solid var(--line-strong);
}
.workflow__step::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--paper);
  border: 1px solid var(--ink-950);
}
.workflow__step:last-child::before { background: var(--accent); border-color: var(--ink-950); }
.workflow__num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-500); }
.workflow__title { font-weight: 600; letter-spacing: var(--tracking-snug); margin-top: var(--space-1); }
.workflow__text { font-size: var(--text-sm); color: var(--ink-500); margin-top: var(--space-2); line-height: 1.5; }

@media (max-width: 1080px) {
  .workflow__head, .workflow__steps { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .workflow__steps { grid-template-columns: 1fr; }
  .workflow__step {
    border-top: 0;
    border-left: 1px solid var(--line-strong);
    padding: 0 0 var(--space-5) var(--space-5);
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    column-gap: var(--space-2);
  }
  .workflow__step::before { top: 6px; left: -4px; }
  .workflow__num { grid-row: span 2; padding-top: 3px; }
  .workflow__text { margin-top: 2px; }
}

/* ---------- Course rows ---------- */
.course-filters {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-6);
  scrollbar-width: none;
}
.course-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--ink-700);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.filter-chip small { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); }
.filter-chip:hover { border-color: var(--ink-950); }
.filter-chip[aria-pressed="true"],
.filter-chip[aria-current="true"] { background: var(--ink-950); border-color: var(--ink-950); color: var(--paper); }
.filter-chip[aria-pressed="true"] small,
.filter-chip[aria-current="true"] small { color: var(--accent); }

.course-list { border-top: 1px solid var(--ink-950); }
.course-row { border-bottom: 1px solid var(--line); }
.course-row[hidden] { display: none; }
.course-row__link {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 15rem) 2.75rem;
  gap: var(--space-5);
  align-items: start;
  padding: var(--space-6) var(--space-4) var(--space-6) 0;
  transition: background var(--dur) var(--ease), padding var(--dur) var(--ease);
}
.course-row__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  height: 2px;
  width: 0;
  background: var(--accent-deep);
  transition: width var(--dur-slow) var(--ease);
}
.course-row__link:hover::before,
.course-row__link:focus-visible::before { width: 100%; }
.course-row__num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-400); padding-top: 0.45rem; }
.course-row__main { display: grid; gap: var(--space-2); }
.course-row__title { font-size: var(--text-xl); letter-spacing: var(--tracking-snug); line-height: 1.15; font-weight: 600; transition: transform var(--dur) var(--ease); }
.course-row__summary { color: var(--ink-500); max-width: 40em; }
.course-row__main .tech-line { margin-top: var(--space-2); }
.course-row__meta { display: grid; gap: 6px; padding-top: 0.45rem; font-size: var(--text-sm); }
.course-row__meta div { display: flex; justify-content: space-between; gap: var(--space-3); border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.course-row__meta dt { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--ink-400); padding-top: 2px; }
.course-row__meta dd { text-align: right; }
.course-row__go {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-top: 0.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.course-row__go svg { width: 16px; height: 16px; }
.course-row__link:hover .course-row__go { background: var(--accent); border-color: var(--accent); transform: rotate(-45deg); }
.course-row__link:hover .course-row__title { transform: translateX(4px); }

@media (max-width: 900px) {
  .course-row__link { grid-template-columns: 2.25rem minmax(0, 1fr) 2.5rem; gap: var(--space-4); padding-block: var(--space-5); }
  .course-row__meta { grid-column: 2 / 3; grid-row: 2; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding-top: 0; }
  .course-row__meta div { border: 0; padding: 0; gap: var(--space-2); }
  .course-row__go { grid-column: 3; grid-row: 1; width: 2.5rem; height: 2.5rem; }
}
@media (max-width: 520px) {
  .course-row__link { grid-template-columns: minmax(0, 1fr) 2.5rem; }
  .course-row__num { grid-column: 1 / -1; padding: 0; }
  .course-row__main { grid-column: 1; grid-row: 2; }
  .course-row__go { grid-column: 2; grid-row: 2; }
  .course-row__meta { grid-column: 1 / -1; grid-row: 3; }
  .course-row__meta dd { text-align: left; }
}

.empty-note {
  padding: var(--space-7) 0;
  border-top: 1px solid var(--line);
  color: var(--ink-500);
}

/* ---------- Technology wall ---------- */
.tech-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  border-top: 1px solid var(--line-dark);
  border-left: 1px solid var(--line-dark);
}
.tech-cell {
  position: relative;
  border-right: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  display: grid;
  align-content: space-between;
  gap: var(--space-6);
  min-height: 132px;
  padding: var(--space-5);
  background: var(--ink-950);
  transition: background var(--dur) var(--ease);
}
.tech-cell__name { font-size: var(--text-lg); font-weight: 550; letter-spacing: var(--tracking-snug); transition: color var(--dur) var(--ease); }
.tech-cell__count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); letter-spacing: 0.02em; }
.tech-cell__courses {
  position: absolute;
  inset: auto var(--space-5) var(--space-5) var(--space-5);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-300);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  pointer-events: none;
}
@media (hover: hover) and (min-width: 721px) {
  .tech-cell:hover { background: var(--ink-850); }
  .tech-cell:hover .tech-cell__name { color: var(--accent); }
  .tech-cell:hover .tech-cell__count { opacity: 0; }
  .tech-cell:hover .tech-cell__courses { opacity: 1; transform: none; }
}
.tech-note { margin-top: var(--space-5); font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }

@media (max-width: 520px) {
  .tech-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-cell { min-height: 76px; padding: var(--space-3) var(--space-4); gap: var(--space-2); }
  .tech-cell__name { font-size: var(--text-base); }
}

/* ---------- Why CodeM (editorial) ---------- */
.why__statement { grid-column: 1 / span 5; }
.why__statement-inner { position: sticky; top: calc(var(--header-h) + 40px); display: grid; gap: var(--space-5); }
.why__list { grid-column: 7 / -1; border-top: 1px solid var(--ink-950); }
.principle {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--line);
}
.principle__num { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--accent-deep); padding-top: 3px; }
.principle__title { font-size: var(--text-lg); letter-spacing: var(--tracking-snug); font-weight: 600; line-height: 1.3; }
.principle__text { grid-column: 2; color: var(--ink-500); max-width: 36em; }
.principle__text a { color: var(--ink-950); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }

@media (max-width: 960px) {
  .why__statement, .why__list { grid-column: 1 / -1; }
  .why__statement-inner { position: static; }
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}
.project {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-50);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.project:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.project--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.project__visual { position: relative; background: var(--ink-950); min-height: 260px; }
.project__visual img { width: 100%; height: 100%; object-fit: cover; }
.project__build {
  padding: var(--space-6) var(--space-5);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-300);
  white-space: nowrap;
  overflow: hidden;
}
.project__build .t-prompt { color: var(--accent); }
.project__build li { overflow: hidden; text-overflow: ellipsis; }
.project__build li.is-final { color: var(--paper); margin-top: var(--space-2); }
.project__body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); flex: 1; }
.project--wide .project__body { padding: var(--space-7) var(--space-6); justify-content: center; }
.project__course { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-500); letter-spacing: 0.02em; }
.project__title { font-size: var(--text-xl); letter-spacing: var(--tracking-snug); line-height: 1.15; font-weight: 600; }
.project__text { color: var(--ink-500); }
.project__links { display: flex; flex-wrap: wrap; gap: var(--space-5); margin-top: auto; padding-top: var(--space-4); }
.projects-note { margin-top: var(--space-5); font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }

@media (max-width: 860px) {
  .projects-grid { grid-template-columns: minmax(0, 1fr); }
  .project--wide { grid-template-columns: minmax(0, 1fr); }
  .project__visual { min-height: 0; }
}

/* ---------- Learning journey ---------- */
.journey {
  --progress: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
}
.journey::before,
.journey::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  height: 1px;
  background: var(--line-strong);
  right: 0;
}
.journey::after {
  background: var(--ink-950);
  right: auto;
  width: calc(var(--progress) * 100%);
  transition: width 1.6s var(--ease);
}
.journey__step { position: relative; padding: var(--space-6) var(--space-4) 0 0; }
.journey__dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border: 1px solid var(--ink-950);
  background: var(--paper);
  z-index: 1;
  transition: background var(--dur) var(--ease);
}
.journey__step:last-child .journey__dot { background: var(--accent); }
.journey__step:hover .journey__dot { background: var(--ink-950); }
.journey__num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-400); }
.journey__title { font-weight: 600; letter-spacing: var(--tracking-snug); margin-top: var(--space-1); line-height: 1.3; }
.journey__text { font-size: var(--text-sm); color: var(--ink-500); margin-top: var(--space-2); line-height: 1.5; }

@media (max-width: 960px) {
  .journey { grid-template-columns: 1fr; }
  .journey::before, .journey::after { top: 0; bottom: 0; left: 5px; right: auto; width: 1px; height: auto; }
  .journey::after { height: calc(var(--progress) * 100%); bottom: auto; width: 1px; }
  .journey__step { padding: 0 0 var(--space-6) var(--space-7); }
  .journey__step:last-child { padding-bottom: 0; }
  .journey__dot { top: 4px; }
}

/* ---------- People: instructors & testimonials ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--gutter); }
.instructor__photo { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; border-radius: var(--radius); background: var(--paper-200); filter: grayscale(0.15); }
.instructor__name { margin-top: var(--space-4); font-weight: 600; font-size: var(--text-md); }
.instructor__role { color: var(--ink-500); font-size: var(--text-sm); }
.instructor .tag-list { margin-top: var(--space-3); }

.quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--space-7) var(--gutter); }
.quote { border-top: 1px solid var(--ink-950); padding-top: var(--space-5); display: grid; gap: var(--space-5); align-content: start; }
.quote blockquote { font-size: var(--text-md); line-height: 1.55; letter-spacing: -0.01em; }
.quote figcaption { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.quote figcaption img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.quote figcaption span { display: block; color: var(--ink-500); font-family: var(--font-mono); font-size: 11px; }

/* ---------- Interview prep band ---------- */
.prep__grid { align-items: start; }
.prep__head { grid-column: 1 / span 5; display: grid; gap: var(--space-4); }
.prep__list { grid-column: 7 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); border-top: 1px solid var(--line-dark-strong); }
.prep__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line-dark);
  transition: color var(--dur-fast) var(--ease), padding var(--dur) var(--ease);
}
.prep__link small { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }
.prep__link:hover { color: var(--accent); padding-left: 4px; }
@media (max-width: 960px) {
  .prep__head, .prep__list { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .prep__list { grid-template-columns: 1fr; }
}

/* ---------- FAQ ---------- */
.faq__head { grid-column: 1 / span 4; }
.faq__head-inner { position: sticky; top: calc(var(--header-h) + 40px); display: grid; gap: var(--space-4); }
.faq__list { grid-column: 6 / -1; border-top: 1px solid var(--ink-950); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-5) 0;
  font-size: var(--text-md);
  font-weight: 550;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item__icon { position: relative; flex: none; width: 14px; height: 14px; margin-top: 6px; }
.faq-item__icon::before,
.faq-item__icon::after { content: ""; position: absolute; left: 0; right: 0; top: 6.5px; height: 1.5px; background: currentColor; transition: transform var(--dur) var(--ease); }
.faq-item__icon::after { transform: rotate(90deg); }
.faq-item[open] .faq-item__icon::after { transform: rotate(0deg); }
.faq-item__answer { padding: 0 var(--space-7) var(--space-5) 0; color: var(--ink-500); max-width: 44em; }
.faq-item__answer p + p, .faq-item__answer ul { margin-top: var(--space-3); }
.faq-item__answer ul { list-style: disc; padding-left: 1.25rem; }
.faq-item__answer code { background: var(--paper-200); color: var(--ink-950); padding: 0.1em 0.35em; border-radius: var(--radius-sm); font-size: 0.85em; }
.faq-item__answer strong { color: var(--ink-950); font-weight: 600; }

@media (max-width: 960px) {
  .faq__head, .faq__list { grid-column: 1 / -1; }
  .faq__head-inner { position: static; }
}

/* ---------- CTA ---------- */
.cta { position: relative; overflow: hidden; }
.cta .bg-grid { -webkit-mask-image: radial-gradient(ellipse 60% 80% at 85% 50%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse 60% 80% at 85% 50%, #000 10%, transparent 70%); }
.cta__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-7); align-items: end; }
.cta__copy { display: grid; gap: var(--space-4); max-width: 40rem; }
.cta__contact { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-3); font-family: var(--font-mono); font-size: var(--text-sm); color: var(--ink-400); }
.cta__contact a:hover { color: var(--paper); }
@media (max-width: 860px) {
  .cta__inner { grid-template-columns: 1fr; align-items: start; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(3rem, 2rem + 3vw, 4.5rem); }
.page-hero__inner { position: relative; display: grid; gap: var(--space-5); max-width: 52rem; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: var(--space-2); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-500); }
.breadcrumb a:hover { color: var(--paper); }
.breadcrumb li + li::before { content: "/"; margin-right: var(--space-2); color: var(--ink-700); }
.page-hero .facts { margin-top: var(--space-3); }

/* ---------- Course detail ---------- */
.course-detail { align-items: start; }
.course-detail__main { grid-column: 1 / span 7; display: grid; gap: var(--space-8); }
.course-detail__aside { grid-column: 9 / -1; position: sticky; top: calc(var(--header-h) + 24px); }
.syllabus { border-top: 1px solid var(--ink-950); }
.syllabus li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.syllabus li span { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-400); }
.syllabus li.is-project { font-weight: 600; }
.syllabus li.is-project span { color: var(--accent-deep); }
.glance { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-50); padding: var(--space-5); display: grid; gap: var(--space-5); }
.glance dl { display: grid; gap: 0; }
.glance dl div { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px dashed var(--line); font-size: var(--text-sm); }
.glance dl div:last-child { border-bottom: 0; }
.glance dt { color: var(--ink-500); }
.glance dd { text-align: right; font-weight: 500; }
.glance .btn-row { display: grid; }
@media (max-width: 960px) {
  .course-detail__main, .course-detail__aside { grid-column: 1 / -1; }
  .course-detail__aside { position: static; order: -1; }
}

/* ---------- About ---------- */
.statement-grid { align-items: start; }
.statement-grid > :first-child { grid-column: 1 / span 4; }
.statement-grid > :last-child { grid-column: 6 / -1; display: grid; gap: var(--space-5); }
.statement-grid .big { font-size: var(--text-xl); line-height: 1.35; letter-spacing: var(--tracking-snug); font-weight: 500; text-wrap: pretty; }
.audiences { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink-950); }
.audience { padding: var(--space-5) var(--space-5) var(--space-5) 0; border-right: 1px solid var(--line); }
.audience + .audience { padding-left: var(--space-5); }
.audience:last-child { border-right: 0; }
.audience h3 { font-size: var(--text-md); font-weight: 600; letter-spacing: var(--tracking-snug); margin-top: var(--space-2); }
.audience p { color: var(--ink-500); font-size: var(--text-sm); margin-top: var(--space-2); }
@media (max-width: 960px) {
  .statement-grid > :first-child, .statement-grid > :last-child { grid-column: 1 / -1; }
  .audiences { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audience:nth-child(2) { border-right: 0; }
  .audience:nth-child(3) { padding-left: 0; }
  .audience:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .audiences { grid-template-columns: 1fr; }
  .audience, .audience + .audience { padding: var(--space-5) 0; border-right: 0; border-top: 1px solid var(--line); }
  .audience:first-child { border-top: 0; }
}

/* ---------- Contact ---------- */
.contact-grid { align-items: start; }
.contact-grid__form { grid-column: 1 / span 7; }
.contact-grid__info { grid-column: 9 / -1; }
.info-list { border-top: 1px solid var(--ink-950); }
.info-list > div { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.info-list dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-500); }
.info-list dd { margin-top: var(--space-1); font-size: var(--text-md); }
.info-list a { border-bottom: 1px solid var(--line-strong); }
.info-list a:hover { border-color: currentColor; }
@media (max-width: 960px) {
  .contact-grid__form, .contact-grid__info { grid-column: 1 / -1; }
}

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--space-5); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: var(--space-2); }
.field__label { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); font-weight: 550; }
.field__label small { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.06em; }
.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-50);
  font-size: 16px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.textarea { min-height: 128px; padding: var(--space-3) var(--space-4); resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%230c0d0b' stroke-width='1.5'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-500); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink-950); box-shadow: 0 0 0 3px rgba(12, 13, 11, 0.12); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input-prefix { display: flex; }
.input-prefix > span { display: grid; place-items: center; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--paper-200); font-family: var(--font-mono); font-size: var(--text-sm); color: var(--ink-500); }
.input-prefix .input { border-radius: 0 var(--radius) var(--radius) 0; }
.field__error { font-size: var(--text-sm); color: var(--danger); }
.field__hint { font-size: var(--text-xs); color: var(--ink-500); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-4); }
.form__foot p { font-size: var(--text-xs); color: var(--ink-500); max-width: 30em; }

.notice {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-deep);
  border-radius: var(--radius-sm);
  background: var(--paper-50);
}
.notice--error { border-left-color: var(--danger); }
.notice strong { font-weight: 600; }
.notice p { color: var(--ink-500); font-size: var(--text-sm); }

/* ---------- Resources ---------- */
.topic-list { border-top: 1px solid var(--ink-950); }
.topic-list a {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto 2rem;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--line);
  transition: padding var(--dur) var(--ease);
}
.topic-list a:hover { padding-left: var(--space-2); }
.topic-list a:hover svg { transform: translateX(3px); }
.topic-list svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.topic-list .num, .topic-list .count { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-400); }
.topic-list .name { font-size: var(--text-lg); font-weight: 550; letter-spacing: var(--tracking-snug); }

.qa-layout { align-items: start; }
.qa-layout__nav { grid-column: 1 / span 3; position: sticky; top: calc(var(--header-h) + 24px); }
.qa-layout__nav ul { display: grid; gap: 2px; }
.qa-layout__nav a { display: block; padding: 6px 0; font-size: var(--text-sm); color: var(--ink-500); }
.qa-layout__nav a:hover { color: var(--ink-950); }
.qa-layout__nav a[aria-current="page"] { color: var(--ink-950); font-weight: 600; }
.qa-layout__nav a[aria-current="page"]::before { content: "→ "; color: var(--accent-deep); }
.qa-layout__main { grid-column: 5 / -1; }
.qa-layout .faq-item summary { font-size: var(--text-base); }
.qa-num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-400); min-width: 2.25rem; padding-top: 3px; }
.qa-q { display: flex; gap: var(--space-3); flex: 1; }
@media (max-width: 960px) {
  .qa-layout__nav { display: none; }
  .qa-layout__main { grid-column: 1 / -1; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-950); color: var(--ink-300); border-top: 1px solid var(--line-dark); padding-top: var(--space-9); --focus: var(--accent); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: var(--space-7) var(--gutter); }
.footer-brand { display: grid; gap: var(--space-4); align-content: start; max-width: 22rem; }
.footer-brand p { font-size: var(--text-sm); line-height: 1.6; }
.footer-col h2 { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-500); margin-bottom: var(--space-4); }
.footer-col ul { display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.footer-col a { color: var(--ink-300); transition: color var(--dur-fast) var(--ease); }
.footer-col a:hover { color: var(--paper); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-9);
  padding-block: var(--space-5) calc(var(--space-5) + 72px);
  border-top: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
}
.footer-bottom nav { display: flex; gap: var(--space-5); }
.footer-bottom a:hover { color: var(--paper); }
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Error pages ---------- */
.error-page { min-height: calc(100dvh - var(--header-h)); display: grid; align-items: center; }
.error-page__code { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); transition-delay: var(--delay, 0ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Chat — CodeM Career Assistant
   ========================================================================== */
.chat-launcher {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 20px 0 16px;
  border: 1px solid var(--line-dark-strong);
  border-radius: 999px;
  background: var(--ink-950);
  color: var(--paper);
  font-size: var(--text-sm);
  font-weight: 550;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.55);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), background var(--dur-fast) var(--ease);
  --focus: var(--accent);
}
.chat-launcher:hover { background: var(--ink-800); }
.chat-launcher svg { width: 18px; height: 18px; }
.chat-launcher__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(198, 242, 78, 0.18); }
.chat-launcher[aria-expanded="true"] { opacity: 0; transform: translateY(8px) scale(0.96); pointer-events: none; }

.chat {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: 384px;
  height: min(640px, calc(100dvh - 40px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.chat.is-open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }

.chat__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
  background: var(--ink-950);
  color: var(--paper);
  --focus: var(--accent);
}
.chat__title { font-size: var(--text-base); font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: var(--space-2); }
.chat__title::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.chat__subtitle { font-size: var(--text-sm); color: var(--ink-400); margin-top: 2px; }
.chat__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-300);
}
.chat__close:hover { background: var(--ink-800); color: var(--paper); }
.chat__close svg { width: 18px; height: 18px; }
.chat__progress { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-500); letter-spacing: 0.04em; }
.chat__progress-bar { flex: 1; height: 2px; background: var(--ink-800); position: relative; overflow: hidden; }
.chat__progress-bar span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width var(--dur-slow) var(--ease); }

.chat__log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5) var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  scroll-behavior: smooth;
}
.msg { max-width: 86%; font-size: var(--text-sm); line-height: 1.5; animation: msg-in var(--dur) var(--ease) both; white-space: pre-line; overflow-wrap: anywhere; }
.msg--bot { align-self: flex-start; padding: 10px 14px; background: var(--paper-50); border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; }
.msg--user { align-self: flex-end; padding: 10px 14px; background: var(--ink-950); color: var(--paper); border-radius: 12px 12px 3px 12px; }
.msg--meta { align-self: flex-start; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-400); letter-spacing: 0.04em; padding-left: 2px; max-width: none; }
.msg--success { border-left: 3px solid var(--accent-deep); }
.msg--error { border-color: rgba(180, 35, 24, 0.35); color: var(--danger); }
.msg a { text-decoration: underline; text-underline-offset: 2px; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--paper-50); border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; }
.typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-400); animation: typing 1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }

.chat__compose { border-top: 1px solid var(--line); padding: var(--space-3) var(--space-4) var(--space-4); background: var(--paper); }
.chat__field-label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-500); margin-bottom: var(--space-2); }
.chat__field-label b { color: var(--ink-950); font-weight: 500; }
.chat__form { display: flex; gap: var(--space-2); }
.chat__input-wrap { flex: 1; display: flex; min-width: 0; }
.chat__prefix { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--paper-200); font-family: var(--font-mono); font-size: 13px; color: var(--ink-500); }
.chat__input { flex: 1; min-width: 0; height: 46px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper-50); font-size: 16px; }
.chat__prefix + .chat__input { border-radius: 0 var(--radius) var(--radius) 0; }
.chat__input:focus { outline: none; border-color: var(--ink-950); box-shadow: 0 0 0 3px rgba(12, 13, 11, 0.12); }
.chat__input[aria-invalid="true"] { border-color: var(--danger); }
.chat__send { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: var(--radius); background: var(--ink-950); color: var(--paper); transition: background var(--dur-fast) var(--ease); }
.chat__send:hover { background: var(--ink-800); }
.chat__send svg { width: 18px; height: 18px; }
.chat__send[disabled] { opacity: 0.5; cursor: progress; }
.chat__error { margin-top: var(--space-2); font-size: 12.5px; color: var(--danger); min-height: 0; }
.chat__error:empty { display: none; }
.chat__options { display: flex; flex-wrap: wrap; gap: 6px; }
.chat__option {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-50);
  font-size: 13.5px;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.chat__option:hover { border-color: var(--ink-950); }
.chat__option--primary { background: var(--accent); border-color: var(--accent); color: var(--ink-950); font-weight: 550; }
.chat__option--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.chat__option[disabled] { opacity: 0.5; cursor: progress; }
.chat__skip { margin-top: var(--space-2); background: none; border: 0; padding: 4px 0; font-size: 12.5px; color: var(--ink-500); text-decoration: underline; text-underline-offset: 2px; }
.chat__privacy { margin-top: var(--space-3); font-size: 11px; color: var(--ink-400); }
.chat__privacy a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 520px) {
  .chat {
    inset: 0;
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    transform: translateY(24px);
  }
  .chat__head { padding-top: max(var(--space-4), env(safe-area-inset-top)); }
  .chat__compose { padding-bottom: max(var(--space-4), env(safe-area-inset-bottom)); }
  .chat-launcher { height: 48px; padding: 0 16px 0 14px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .msg { max-width: 90%; }
}
body.chat-locked { overflow: hidden; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero__cursor, .t-caret { animation: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .chat, .chat-launcher, .site-footer, .cta { display: none !important; }
  body { background: #fff; }
}
