/* Learn AI From Scratch: Series Map */

:root {
  --cream: #F2EDE4;
  --ink: #1C1A17;
  --coral: #E2583E;
  --card: #FFFFFF;
  --muted: #6E665C;      /* 4.8:1 on cream, AA for body text */
  --line: #D6CDBF;       /* rules and future path line */
  --line-strong: #B3A999;
  --coral-halo: rgba(226, 88, 62, 0.2);

  --serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 26, 23, 0.05), 0 6px 20px rgba(28, 26, 23, 0.06);
  --gutter: 20px;
  --measure: 720px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { overflow-wrap: break-word; }
p { overflow-wrap: break-word; }

a { color: inherit; }

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

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

.page {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Small labels: MODULE 1, LESSON 03 */
.label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 1.5px solid var(--coral);
  transition: background-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Ink on coral: 4.7:1, readable at button size */
.btn-primary {
  background: var(--coral);
  color: var(--ink);
}
.btn-primary:hover { background: #D94F35; border-color: #D94F35; }

.btn-secondary {
  background: transparent;
  color: var(--ink);
}
.btn-secondary:hover { background: rgba(226, 88, 62, 0.08); }

.btn[aria-disabled="true"] {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--muted);
  cursor: default;
}

/* ---------- Hero ---------- */

.hero {
  padding: 56px 0 48px;
}

.hero h1 {
  margin-top: 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.875rem, 13vw, 5rem);
  line-height: 1;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
  max-width: 11ch;
}

.lede {
  margin-top: 20px;
  font-size: 1.1875rem;
  line-height: 1.5;
  max-width: 34ch;
}

.actions {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 560px) {
  .actions { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Path ---------- */

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

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

.path {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.stop { position: relative; }

/* Line from this stop's dot to the next stop's dot */
.stop:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 23px;
  bottom: -23px;
  width: 2px;
  background: var(--line);
}
.stop.is-done::before { background: var(--ink); }

.stop a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 16px;
  padding: 14px 0;
  min-height: 44px;
  text-decoration: none;
  color: inherit;
}

.stop-marker {
  position: relative;
  z-index: 1;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stop-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--line-strong);
}
.is-done .stop-dot {
  background: var(--ink);
  border-color: var(--ink);
}
.is-current .stop-dot {
  width: 16px;
  height: 16px;
  background: var(--coral);
  border-color: var(--coral);
  box-shadow: 0 0 0 5px var(--coral-halo);
}

.stop-text { min-width: 0; }

.stop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-height: 18px;
}

.stop-name {
  display: block;
  margin-top: 4px;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
}

.is-future .stop-name { color: var(--muted); font-weight: 400; }
.is-current .stop-name { font-weight: 600; }

.stop a:hover .stop-name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* "You are here" marker */
.here {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--coral);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.6875rem;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Modules ---------- */

.module {
  padding: 48px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.module-head .label + .module-title,
.module-label-row + .module-title { margin-top: 12px; }

.module-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.module-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.module-about {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.0625rem;
  max-width: 52ch;
}

/* Current module: coral rule on the left of its header */
.module.is-current .module-head {
  border-left: 3px solid var(--coral);
  padding-left: 16px;
  margin-left: -19px;
}
@media (max-width: 759px) {
  .module.is-current .module-head { margin-left: 0; }
}

.lessons {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.lesson {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px 22px;
  scroll-margin-top: 16px;
  transition: box-shadow 0.2s ease;
}

.lesson:target,
.lesson.is-target {
  box-shadow: 0 0 0 2px var(--coral), var(--shadow);
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.lesson-title {
  margin-top: 12px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lesson-about {
  margin-top: 10px;
  color: #45403A;
  max-width: 58ch;
}

.lesson .btn {
  margin-top: 20px;
  width: 100%;
}

@media (min-width: 560px) {
  .lesson { padding: 28px 28px 26px; }
  .lesson .btn { width: auto; }
}

.coming {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 12px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Modules with nothing posted yet sit tighter so the page stays short on phones */
.module.is-future { padding: 36px 0; }
.module.is-future .module-title { font-size: clamp(1.5rem, 6vw, 1.875rem); }

.notice {
  padding: 32px 0;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* ---------- Desktop ---------- */

@media (min-width: 760px) {
  .hero { padding: 104px 0 72px; }
  .lede { font-size: 1.3125rem; }
  .path-section { padding: 56px 0 64px; }
  .module { padding: 64px 0; }
  .module.is-future { padding: 44px 0; }
  .section-title { font-size: 2rem; }
}

/* ---------- Gentle fade-in (only when motion is welcome) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .can-reveal .reveal {
    opacity: 0;
    transition: opacity 0.6s ease;
  }
  .can-reveal .reveal.is-visible { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
