/* AI-Ready Engineers — Swiss theme (Jost) */

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

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f8fa;
  --color-surface-2: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-accent: #2563eb;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-code-bg: #f1f5f9;
  --font-sans: "Jost", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "SF Mono", "Fira Code", monospace;
  --max-width: 1120px;
  --spacing: 1.5rem;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

/* Header */
header {
  border-bottom: 1px solid var(--color-border);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

header h1 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--color-text);
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

header h1 a:hover {
  color: var(--color-primary);
}

nav {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.25rem 0;
  transition: color 0.15s;
}

nav a:hover,
nav a.active {
  color: var(--color-primary);
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing);
  padding-bottom: 4rem;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--color-text);
  margin: 2.25rem 0 0.75rem;
  line-height: 1.2;
}

h1 { font-size: 2rem; margin-top: 0; letter-spacing: -0.03em; }
h2 {
  font-size: 1.5rem;
  border: none;
  padding: 0;
  position: static;
}
h2::after { display: none; }
h3 { font-size: 1.3rem; font-weight: 600; }
h4 { font-size: 0.95rem; }

p {
  margin: 0.75rem 0;
  color: var(--color-text);
}

.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 0.85rem; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Lists */
ul, ol { margin: 0.75rem 0; padding-left: 1.35rem; }
li { margin: 0.35rem 0; }

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

pre {
  background: var(--color-code-bg);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
}

pre code { background: none; padding: 0; border: none; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: none;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-strong);
}

tr:hover td { background: var(--color-surface); }

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}

.card h3 { margin-top: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

/* Hero */
.hero {
  padding: 4.5rem 0 3rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.hero h1 {
  font-size: 3.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.035em;
  line-height: 1.05;
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  background-clip: initial;
  color: var(--color-text);
  text-transform: none;
}

.hero .subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.hero .hero-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0.4rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Sections */
section { margin: 3rem 0; }
section h2:first-child { margin-top: 0; }

/* Modules grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.intro-grid .module-card .description { font-size: 0.85rem; color: var(--color-text); }

.modules-grid.four { grid-template-columns: repeat(4, 1fr); }
[hidden] { display: none !important; }
.part-title { margin: 2rem 0 0.25rem; font-size: 1.2rem; }
.part-subtitle { margin: 0 0 0.75rem; color: var(--color-text-muted); font-size: 0.95rem; }
.part-placeholder {
  border: 1px dashed var(--color-border-strong);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 2rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.module-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.25rem;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: visible;
}

.module-card::before { display: none; }

/* Stretched-link pattern: anchor fills the card for clickability,
   but nested interactive elements (like <details>) can escape via z-index. */
.module-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

a.module-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.module-card:has(a.module-link:hover),
a.module-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
  text-decoration: none;
}

.module-card details.objectives {
  position: relative;
  z-index: 2;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  border: none;
  background: transparent;
  padding: 0;
}

.module-card details.objectives summary {
  padding: 0.35rem 0;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  list-style: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.module-card details.objectives summary::-webkit-details-marker { display: none; }

.module-card details.objectives summary::before {
  content: '▶';
  color: var(--color-primary);
  font-size: 0.95rem;
  line-height: 1;
  width: 1em;
  text-align: center;
  flex: 0 0 auto;
}

.module-card details.objectives[open] summary::before {
  content: '▼';
}

.module-card details.objectives[open] summary {
  border-bottom: none;
}

.module-card details.objectives ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  color: var(--color-text);
}

.module-card details.objectives li {
  margin: 0.2rem 0;
  line-height: 1.45;
}

.module-card .number {
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
  margin-bottom: 0.4rem;
}

.module-card .title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--color-text);
}

.module-card .description {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.45;
}

/* Optional deep-dive tiles — warm amber tint to set them apart from lesson cards */
.module-card.deep-dive {
  background: #fffbeb;
  border-color: #fde68a;
}

.module-card.deep-dive:has(a.module-link:hover),
a.module-card.deep-dive:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px #f59e0b;
}

.module-card.deep-dive .number {
  color: #b45309;
}

.module-card.deep-dive details.objectives summary::before {
  color: #d97706;
}

/* Skillset labels — uniform across skillsets */
.phase {
  display: inline-block;
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.phase-1, .phase-2, .phase-3, .phase-4 {
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
}

.phase-optional {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  text-transform: none;
  letter-spacing: 0;
}

.btn:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}

.btn-secondary:hover {
  background: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Contact */
.contact-info {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.contact-info p { margin: 0.3rem 0; }
.contact-info p:last-child { margin-bottom: 0; }

/* Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Quick feedback */
.quick-feedback {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 3rem;
}

.quick-feedback h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.quick-feedback p { margin: 0 0 1rem; color: var(--color-text-muted); max-width: 640px; }

.quick-feedback textarea {
  width: 100%;
  max-width: 640px;
  font: inherit;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  resize: vertical;
}

.quick-feedback textarea::placeholder { color: var(--color-text-muted); }

.quick-feedback textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.quick-feedback button {
  margin-top: 0.75rem;
  padding: 0.55rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: background 0.15s;
}

.quick-feedback button:hover { background: var(--color-primary-dark); }

/* Callout boxes */
.objectives {
  background: rgba(37, 99, 235, 0.06);
  border-left: 3px solid var(--color-primary);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 0 8px 8px 0;
}

.objectives h3 { margin-top: 0; color: var(--color-primary); }

.example {
  background: rgba(22, 163, 74, 0.06);
  border-left: 3px solid #16a34a;
  padding: 0.9rem 1.15rem;
  margin: 1rem 0;
  border-radius: 0 6px 6px 0;
}

.example-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: #15803d;
  margin-bottom: 0.4rem;
  text-transform: none;
  letter-spacing: 0;
}

.insight {
  background: rgba(37, 99, 235, 0.06);
  border-left: 3px solid var(--color-primary);
  padding: 0.9rem 1.15rem;
  margin: 1rem 0;
  border-radius: 0 6px 6px 0;
}

.trap {
  background: rgba(239, 68, 68, 0.06);
  border-left: 3px solid #ef4444;
  padding: 0.9rem 1.15rem;
  margin: 1rem 0;
  border-radius: 0 6px 6px 0;
}

.definition {
  background: rgba(168, 85, 247, 0.06);
  border-left: 3px solid #a855f7;
  padding: 0.9rem 1.15rem;
  margin: 1rem 0;
  border-radius: 0 6px 6px 0;
}

.formula {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  text-align: center;
}

/* Details / collapsible */
details {
  margin: 1rem 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
}

details summary {
  cursor: pointer;
  padding: 0.85rem 1.15rem;
  font-weight: 600;
  list-style: none;
}

details summary::-webkit-details-marker { display: none; }

details[open] summary { border-bottom: 1px solid var(--color-border); }

details .details-content {
  padding: 0.85rem 1.15rem 1rem;
  background: var(--color-bg);
  border-radius: 0 0 10px 10px;
}

/* Session page */
.session-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.session-header .number {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: none;
  letter-spacing: 0.02em;
}

.session-header h1 { margin: 0.25rem 0 0.5rem; }
.session-header .meta { color: var(--color-text-muted); font-size: 0.9rem; }

/* Footer */
footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem var(--spacing);
  margin-top: 4rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  text-align: left;
}

footer p { margin: 0; }

footer a { color: var(--color-text-muted); }
footer a:hover { color: var(--color-primary); }

/* Responsive */
@media (max-width: 900px) {
  .modules-grid, .modules-grid.four, .intro-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  :root { --spacing: 1rem; }

  header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero { padding: 3rem 0 2rem; }
  .hero h1 { font-size: 2.25rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .modules-grid, .modules-grid.four, .card-grid, .intro-grid { grid-template-columns: 1fr; }

  footer { flex-direction: column; }
}

/* Skillset section — collapsible group of session cards */
.skillset {
  margin: 1.25rem 0 1.75rem;
}
.skillset > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--color-border);
}
.skillset > summary::-webkit-details-marker { display: none; }
.skillset > summary::before {
  content: '▼';
  color: var(--color-primary);
  font-size: 1.15rem;
  line-height: 1;
  width: 1em;
  text-align: center;
  flex: 0 0 auto;
}
.skillset:not([open]) > summary::before { content: '▶'; }
.skillset > summary h2,
.skillset > summary h3 {
  margin: 0;
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 700;
}
.skillset > summary:hover {
  background: var(--color-surface);
}

/* Deep Dive — optional foundations track. Identical layout to a Skillset section,
   distinguished only by the yellow background, amber chevron, and "Optional" pill. */
.deep-dive {
  margin: 1.25rem 0 1.75rem;
  background: #fffbeb;
}
.deep-dive > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--color-border);
}
.deep-dive > summary::-webkit-details-marker { display: none; }
.deep-dive > summary::before {
  content: '▶';
  color: #b45309;
  font-size: 1.15rem;
  line-height: 1;
  width: 1em;
  text-align: center;
  flex: 0 0 auto;
}
.deep-dive[open] > summary::before { content: '▼'; }
.deep-dive > summary h3 {
  margin: 0;
  display: inline-block;
  font-size: 1.25rem;
}
.deep-dive > summary:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Inline link from a session card to the Deep Dive band */
.deep-dive-link {
  margin: 0.75rem 1rem 1rem;
  padding: 0.6rem 0.85rem;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 0.9rem;
}
.deep-dive-link a {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Reused for in-session callouts (e.g., S8 deep-dive pointer) */
.callout-soft {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 0.95rem;
}
.callout-soft a {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Topic — major collapsible block with shaded panel + skillset-style triangle.
   Used for stand-alone course pages where each major section opens/closes. */
details.topic {
  margin: 1rem 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
}
details.topic > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.15rem;
}
details.topic > summary::-webkit-details-marker { display: none; }
details.topic > summary::before {
  content: '▶';
  color: var(--color-primary);
  font-size: 1rem;
  line-height: 1;
  width: 1em;
  text-align: center;
  flex: 0 0 auto;
}
details.topic[open] > summary::before { content: '▼'; }
details.topic > summary h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
details.topic > summary:hover h2 {
  color: var(--color-primary);
}
details.topic[open] > summary {
  border-bottom: 1px solid var(--color-border);
}
details.topic .details-content {
  padding: 1rem 1.25rem 1.25rem;
  background: var(--color-bg);
  border-radius: 0 0 10px 10px;
}
details.topic .details-content > :first-child { margin-top: 0; }
details.topic .details-content > :last-child { margin-bottom: 0; }

.closing {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

/* Module-card extras — dimension line + playground link */
.module-card .dimension {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0.4rem 0 0;
  line-height: 1.45;
}
.module-card .dimension strong {
  color: var(--color-text);
  font-weight: 600;
}
.module-card .playground-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}
.module-card .playground-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}
.module-card details.objectives p {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-text);
}
.module-card details.objectives .playground-link {
  margin-top: 0.5rem;
}

/* Compact video rows, for tiles with more than one video */
.module-card a.video-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.35rem 0 0.55rem; color: inherit; text-decoration: none; }
.module-card a.video-row:hover .video-caption { text-decoration: underline; }
.video-thumb { position: relative; flex: 0 0 44%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 21px; border-radius: 6px; background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.video-caption { font-size: 0.85rem; line-height: 1.3; }
