/* ==========================================================================
   Learn, Fast — design system
   All colors/spacing/type live in these custom properties. Change them here.

   Type: Bricolage Grotesque (display), JetBrains Mono (technical voice),
   system sans (body). Both font files are vendored in fonts/.

   Themes: Python + hub use the default light indigo. Agentic AI is light
   teal (.theme-agentic) — deliberately close to Python, same audience.
   Terraform (.theme-terraform) is a full dark editor theme for engineers.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* color */
  --bg: #fbfaf8;
  --bg-alt: #f4f3ef;
  --surface: #ffffff;
  --ink: #1c1f26;
  --ink-soft: #4c5262;
  --line: #e6e4de;
  --line-strong: #d3d1c9;
  --accent: #2f4fd8;
  --accent-hover: #2440b8;
  --accent-soft: #eceffb;
  --on-accent: #ffffff;
  --spark: #d9480f;            /* the comma */
  --error: #b42318;
  --success: #17693a;
  --code-bg: #ffffff;
  --footer-bg: #1c1f26;
  --footer-ink: #eceef3;
  --footer-ink-soft: #a9b0c0;

  /* type */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas,
               monospace;

  /* layout */
  --container: 70rem;
  --radius: 12px;
  --section-pad: clamp(4rem, 9vw, 7rem);
}

/* Agentic AI: same light world as Python, teal identity */
.theme-agentic {
  --accent: #0f766e;
  --accent-hover: #0b5d57;
  --accent-soft: #e7f2f0;
}

/* Terraform: dark editor theme for an engineering audience */
.theme-terraform {
  --bg: #1b2233;
  --bg-alt: #222b3e;
  --surface: #29334c;
  --ink: #e9ecf4;
  --ink-soft: #a7afc2;
  --line: #354056;
  --line-strong: #465270;
  --accent: #a08fff;
  --accent-hover: #b8aaff;
  --accent-soft: #262040;
  --on-accent: #16112b;
  --spark: #ff8a5c;
  --error: #ff9088;
  --success: #6fd39a;
  --code-bg: #141a28;
  --footer-bg: #141b29;
}

/* ---------------------------------------------------------------- reset-ish */

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

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

img { max-width: 100%; height: auto; }

::selection { background: var(--accent-soft); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 660; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); font-weight: 620; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; }

p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

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

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; color: var(--bg); }

/* ------------------------------------------------------------------ shared */

/* Eyebrows are code comments — # is the comment character in both Python
   and HCL, the two languages this brand teaches in. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 450;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 450;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: var(--ink-soft);
}

.section { padding-block: var(--section-pad); }

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.section-lead {
  max-width: 44rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.15s ease;
}
.button:active { transform: translateY(1px); }

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.button-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.button-primary[disabled] { opacity: 0.6; cursor: default; }

.button-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.button-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* -------------------------------------------------------------------- nav */

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.9rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  margin: 0;
}
.brand:hover { color: var(--ink); }
.brand-comma { color: var(--spark); }
.brand-subject { color: var(--accent); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-menu > a:not(.button) {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-menu > a:not(.button):hover { color: var(--ink); }
.nav-cta { padding: 0.45rem 1.1rem; font-size: 0.9rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--ink);
  position: relative;
}
.nav-toggle-bar::before, .nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
}
.nav-toggle-bar::before { top: -5px; }
.nav-toggle-bar::after { top: 5px; }

@media (max-width: 47rem) {
  .nav-toggle { display: block; }
  .nav { flex-wrap: wrap; }
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-block: 0.75rem 1.25rem;
    border-top: 1px solid var(--line);
  }
  .nav-menu.is-open { display: flex; }
}

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  padding-block: clamp(4.5rem, 10vw, 7.5rem);
  overflow: hidden;
  background-image:
    radial-gradient(42rem 26rem at 88% -12%, var(--accent-soft) 0%, transparent 68%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, 3rem 3rem, 3rem 3rem;
}

/* fade the grid out toward the bottom so the hero settles into the page */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 8rem;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

.hero-inner { max-width: 46rem; position: relative; }

/* Course pages: text + artifact, side by side */
.hero-split {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 56rem) {
  .hero-split { grid-template-columns: 1fr; }
}

.hero h1 { margin-bottom: 1.25rem; }
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 38rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.hero-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}
.hero-chips code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
}

/* ---------------------------------------------------- artifact (signature) */

/* The hero artifact: a small editor card showing the real thing this course
   teaches you to make. Same component on every page; the content differs. */

.artifact {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    0 1px 2px rgba(15, 18, 26, 0.06),
    0 24px 60px -30px rgba(15, 18, 26, 0.35);
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  line-height: 1.9;
  overflow: hidden;
}

.artifact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.artifact-bar strong { font-weight: 600; color: var(--ink); }

.artifact-body {
  margin: 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  color: var(--ink);
}
.artifact-body .line { display: block; white-space: pre; }

.artifact-result {
  border-top: 1px dashed var(--line-strong);
  margin: 0;
  padding: 0.75rem 1.25rem;
  color: var(--success);
  white-space: pre-wrap;
}

/* artifact syntax roles */
.t-com { color: var(--ink-soft); }             /* comments */
.t-key { color: var(--accent); }               /* keywords / verbs */
.t-str { color: var(--spark); }                /* strings */
.t-ok  { color: var(--success); font-weight: 600; }
.t-add { color: var(--success); }
.t-chg { color: #b45309; }
.theme-terraform .t-chg { color: #e5b567; }
.t-dim { color: var(--ink-soft); }

/* waiting dot on the human-in-the-loop line */
.t-wait { color: var(--accent); font-weight: 600; }

.caret::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 0.15em;
  vertical-align: text-bottom;
  background: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .caret::after { animation: caret-blink 1.1s steps(1) infinite; }
  @keyframes caret-blink { 50% { opacity: 0; } }

  /* lines settle in one after another on load */
  .artifact-body .line, .artifact-result {
    opacity: 0;
    animation: line-in 0.4s ease forwards;
  }
  .artifact-body .line:nth-child(1) { animation-delay: 0.15s; }
  .artifact-body .line:nth-child(2) { animation-delay: 0.3s; }
  .artifact-body .line:nth-child(3) { animation-delay: 0.45s; }
  .artifact-body .line:nth-child(4) { animation-delay: 0.6s; }
  .artifact-body .line:nth-child(5) { animation-delay: 0.75s; }
  .artifact-body .line:nth-child(6) { animation-delay: 0.9s; }
  .artifact-body .line:nth-child(7) { animation-delay: 1.05s; }
  .artifact-result { animation-delay: 1.35s; }
  @keyframes line-in { to { opacity: 1; } }
}

/* ------------------------------------------------------------------- cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 32px -18px rgba(15, 18, 26, 0.3);
  transform: translateY(-2px);
}

.card-mark {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--card-accent, var(--accent));
  background: var(--card-accent-soft, var(--accent-soft));
  border-radius: 7px;
  display: inline-block;
  align-self: flex-start;
  padding: 0.25rem 0.6rem;
  margin: 0 0 1.1rem;
}

.card > p { color: var(--ink-soft); }

.card-topics {
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.card-topics li { margin-bottom: 0.35rem; }
.card-topics li::marker { color: var(--card-accent, var(--accent)); }

.card-audience {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  font-size: 0.95rem;
}
.card-audience .mono-label { display: block; margin-bottom: 0.2rem; color: var(--card-accent, var(--accent)); }

/* Hub page: whole card is the link */
a.card {
  text-decoration: none;
  color: inherit;
}
a.card:hover { color: inherit; }
.card-cta {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  font-weight: 600;
  color: var(--card-accent, var(--accent));
  font-size: 0.95rem;
}
.card-python { --card-accent: #2f4fd8; --card-accent-soft: #eceffb; }
.card-agentic { --card-accent: #0f766e; --card-accent-soft: #e7f2f0; }
.card-terraform { --card-accent: #6d28d9; --card-accent-soft: #f0eafb; }

/* Cross-link strip on course pages */
.crosslink {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--line-strong);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------- benefits */

.benefit-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}
.benefit-grid li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.benefit-grid strong {
  color: var(--ink);
  font-weight: 650;
}

/* ---------------------------------------------------------------- approach */

.approach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
  gap: 2.25rem 2.5rem;
  margin-top: 2.5rem;
}
.approach-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.85rem;
}
.approach-item .mono-label {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  padding-top: 0.15rem;
  color: var(--accent);
}
.approach-item h3 { grid-column: 2; margin-bottom: 0.4rem; }
.approach-item p { grid-column: 2; color: var(--ink-soft); font-size: 0.98rem; margin: 0; }

/* ------------------------------------------------------------------- about */

.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11rem;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 47rem) {
  .about-inner { grid-template-columns: 1fr; }
}

.about-inner > div:first-child p { max-width: 50rem; }

/* -------------------------------------------------------------- legal page */

.legal { max-width: 44rem; }
.legal h1 { margin-bottom: 0.5rem; }
.legal h2 { font-size: 1.3rem; margin-top: 2.5rem; }
.legal .updated { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 2.5rem; }
.legal ul { color: var(--ink-soft); padding-left: 1.2rem; margin-bottom: 1rem; }
.legal li { margin-bottom: 0.4rem; }
.legal li::marker { color: var(--accent); }

/* -------------------------------------------------------------------- photo */

.photo {
  display: block;
  width: 100%;
  max-width: clamp(9rem, 16vw, 11.5rem);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

/* ---------------------------------------------------------------- waitlist */

.section-waitlist {
  background:
    radial-gradient(40rem 24rem at 12% 0%, var(--accent-soft) 0%, transparent 70%),
    var(--bg);
  border-top: 1px solid var(--line);
}

.waitlist-inner { max-width: 42rem; }

.waitlist-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: 0 20px 50px -30px rgba(15, 18, 26, 0.3);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.form-field { margin-bottom: 1.25rem; border: 0; padding: 0; }

.form-field label,
.form-field legend {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.optional { font-weight: 400; color: var(--ink-soft); }

.form-field input[type="text"],
.form-field input[type="email"],
.form-field select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.form-field input:focus-visible,
.form-field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.form-field input[aria-invalid="true"] { border-color: var(--error); }

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 450;
  font-size: 0.98rem;
}
.checkbox input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }

.field-error {
  color: var(--error);
  font-size: 0.875rem;
  margin: 0.4rem 0 0;
}

.hp-field {
  position: absolute;
  left: -9999px;
  height: 1px;
  overflow: hidden;
}

.consent {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.form-status { margin: 1rem 0 0; font-weight: 550; }
.form-status.is-error { color: var(--error); }
.form-status.is-success { color: var(--success); }

/* ------------------------------------------------------------------ footer */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-ink);
  padding-block: 3rem;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}

.site-footer .brand { color: var(--footer-ink); font-size: 1.1rem; }
.footer-note { color: var(--footer-ink-soft); font-size: 0.9rem; max-width: 22rem; margin: 0.4rem 0 0; }

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}
.footer-links a { color: var(--footer-ink-soft); text-decoration: none; font-size: 0.92rem; }
.footer-links a:hover { color: var(--footer-ink); text-decoration: underline; }

.footer-copyright { color: var(--footer-ink-soft); font-size: 0.85rem; margin: 0; width: 100%; }

/* ------------------------------------------------- motion (enhancement only) */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
