/* ============================================
   Problyst — design system
   Editorial-technical: ink + paper + teal,
   Space Grotesk display, JetBrains Mono labels.
   ============================================ */

:root {
  --ink: #0c0d10;
  --ink-soft: #43464d;
  --ink-faint: #83868f;
  --paper: #fbfaf7;
  --paper-raised: #ffffff;
  --line: #e4e2db;
  --line-strong: #c9c6bc;
  --accent: #0d7a6c;
  --accent-dark: #0a5f54;
  --accent-wash: #eaf3f1;
  --amber: #b45309;
  --code-bg: #101318;
  --code-line: #232830;
  --radius: 6px;
  --max-width: 1120px;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  line-height: 1.15;
  font-weight: 600;
}

img { max-width: 100%; display: block; }

a { color: var(--accent-dark); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Monospace label (replaces emoji/eyebrows) ---------- */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-links a:hover { color: var(--ink); }

.nav-links a.btn { color: #fff; font-size: 0.85rem; padding: 9px 20px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #26282e; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }

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

.btn-lg { padding: 15px 34px; font-size: 1rem; }

.btn s {
  text-decoration: line-through;
  opacity: 0.55;
  font-weight: 400;
}

/* split CTA pair: title + sub-label, equal widths
   (.hero .cta-row sets flex — this selector must outrank it) */
.cta-split,
.hero .cta-row.cta-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 540px;
}

.btn-cta {
  text-align: left;
  padding: 14px 20px;
}

.btn-cta .btn-title {
  display: block;
  font-weight: 600;
  font-size: 0.97rem;
  white-space: nowrap;
}

.btn-cta .btn-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.72;
  margin-top: 4px;
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--code-bg);
  color: #f2f1ec;
  padding: 84px 0;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #5fd4c4;
  display: inline-block;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  margin-bottom: 22px;
  color: #fff;
}

.hero h1 em {
  font-style: normal;
  color: #5fd4c4;
}

.hero p.sub {
  font-size: 1.08rem;
  max-width: 520px;
  margin-bottom: 34px;
  color: #b9bcc4;
}

.hero .cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero .btn-outline { color: #f2f1ec; border-color: #3a3f49; }
.hero .btn-outline:hover { border-color: #f2f1ec; }

.hero .trust-note {
  margin-top: 26px;
  font-size: 0.83rem;
  color: #83868f;
  max-width: 520px;
}

/* Terminal / code window */
.code-window {
  background: #0a0c0f;
  border: 1px solid var(--code-line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.75;
}

.code-window .bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--code-line);
}

.code-window .dot { width: 10px; height: 10px; border-radius: 50%; background: #2e333c; }

.code-window .bar .file {
  margin-left: 10px;
  color: #6b7280;
  font-size: 0.72rem;
}

.code-window pre {
  padding: 20px 22px;
  overflow-x: auto;
  color: #c8ccd4;
}

.code-window .c-kw { color: #7fb4e8; }
.code-window .c-str { color: #96c795; }
.code-window .c-fn { color: #d8b06a; }
.code-window .c-com { color: #565d68; }
.code-window .c-out { color: #5fd4c4; }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
section.alt { background: #f4f2ec; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head {
  max-width: 680px;
  margin-bottom: 56px;
}

.section-head .mono-label { display: block; margin-bottom: 14px; }

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 14px;
}

.section-head p { color: var(--ink-soft); font-size: 1.02rem; }

/* ---------- Cards / grids ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* loose variant: independent bordered cards (course catalog) */
.grid-3.loose {
  gap: 20px;
  background: none;
  border: none;
}

.card {
  background: var(--paper-raised);
  padding: 34px 30px;
}

.card .num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  display: block;
  margin-bottom: 18px;
}

.card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- Curriculum ---------- */
.module {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-bottom: none;
}

.module:last-of-type { border-bottom: 1px solid var(--line); }

.module summary {
  padding: 22px 26px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
}

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

.module summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 1.1rem;
  font-weight: 400;
}
.module[open] summary::after { content: "−"; }

.module .tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-left: auto;
  white-space: nowrap;
}

.module .module-body {
  padding: 0 26px 24px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  border-top: 1px dashed var(--line);
  padding-top: 18px;
  margin: 0 26px 24px;
  padding-left: 0;
  padding-right: 0;
}

.module .module-body ul { padding-left: 20px; }
.module .module-body li { margin-bottom: 7px; }
.module .module-body strong { color: var(--ink); }

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.price-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  background: var(--ink);
  color: #f2f1ec;
  border-color: var(--ink);
  position: relative;
}

.price-card .badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #5fd4c4;
  margin-bottom: 14px;
}

.price-card h3 { font-size: 1.1rem; margin-bottom: 4px; }

.price-card .price {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 0 2px;
}

.price-card .price .strike {
  font-size: 1.05rem;
  color: var(--ink-faint);
  text-decoration: line-through;
  font-weight: 400;
  margin-right: 10px;
}

.price-card.featured .price .strike { color: #6b7280; }

.price-card .per {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.price-card.featured .per { color: #83868f; }

.price-card ul {
  list-style: none;
  margin-bottom: 30px;
  flex-grow: 1;
}

.price-card ul li {
  padding: 8px 0 8px 22px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.price-card ul li:last-child { border-bottom: none; }

.price-card ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.price-card.featured ul li { color: #c3c6cd; border-color: #26282e; }
.price-card.featured ul li::before { color: #5fd4c4; }

.price-card .btn { text-align: center; }
.price-card.featured .btn-outline { color: #fff; border-color: #3a3f49; }
.price-card.featured .btn-outline:hover { border-color: #fff; }

/* ---------- Credibility strip ---------- */
.cred-strip {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.cred-strip .cred {
  padding: 30px 32px;
  border-left: 1px solid var(--line);
}

.cred-strip .cred:first-child { border-left: none; }

.cred-strip .org {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.cred-strip .what { color: var(--ink-soft); font-size: 0.88rem; }

/* ---------- Stats band ---------- */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--paper-raised);
}

.stats-band .stat {
  padding: 34px 28px;
  border-left: 1px solid var(--line);
}

.stats-band .stat:first-child { border-left: none; }

.stats-band .stat .num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.stats-band .stat .label {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 8px;
}

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--line); }

.faq-item summary {
  padding: 20px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }

.faq-item .faq-body {
  padding: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  max-width: 640px;
}

/* ---------- Course catalog cards ---------- */
.course-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
}

.course-card:hover { border-color: var(--line-strong); }

.course-card .thumb {
  background: var(--code-bg);
  padding: 26px 26px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #5fd4c4;
  border-bottom: 1px solid var(--line);
}

.course-card .thumb .path { color: #565d68; display: block; margin-bottom: 4px; font-size: 0.7rem; }

.course-card .body { padding: 26px; display: flex; flex-direction: column; flex-grow: 1; }

.course-card .level {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
}

.course-card h3 { font-size: 1.12rem; margin-bottom: 10px; }
.course-card p { color: var(--ink-soft); font-size: 0.9rem; flex-grow: 1; }

.course-card .meta {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin: 18px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.course-card .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.course-card .foot .price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

.course-card .foot .price small {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 560px;
  margin: 0 auto;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 7px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.form-note {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-top: 16px;
  text-align: center;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--code-bg);
  color: #f2f1ec;
  border-radius: 10px;
  padding: 64px 56px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

.cta-band h2 {
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  margin-bottom: 14px;
  color: #fff;
  max-width: 640px;
}

.cta-band p { color: #b9bcc4; margin-bottom: 30px; max-width: 560px; }

/* ---------- Instructor ---------- */
.instructor {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
}

.instructor .photo {
  width: 200px;
  height: 200px;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: #5fd4c4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  border: 1px solid var(--line);
}

.instructor h3 { font-size: 1.5rem; margin-bottom: 6px; }

.instructor .title {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}

.instructor p { color: var(--ink-soft); margin-bottom: 14px; font-size: 0.96rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--code-bg);
  color: #83868f;
  padding: 60px 0 30px;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 44px;
}

.site-footer h4 {
  color: #f2f1ec;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 9px; }
.site-footer a { color: #83868f; text-decoration: none; }
.site-footer a:hover { color: #f2f1ec; }

.footer-bottom {
  border-top: 1px solid var(--code-line);
  padding-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: var(--code-bg);
  color: #f2f1ec;
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

.page-hero .mono-label { color: #5fd4c4; display: block; margin-bottom: 16px; }

.page-hero h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  color: #fff;
  margin-bottom: 14px;
}

.page-hero p.sub { color: #b9bcc4; font-size: 1.02rem; max-width: 560px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 40px; }

.placeholder-note {
  background: #fdf6e9;
  border: 1px dashed var(--amber);
  color: #7c4a10;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.84rem;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {

  /* scroll-reveal: .reveal is added by main.js, so no-JS users see everything */
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
    transition-delay: var(--reveal-delay, 0s);
  }

  .reveal.visible {
    opacity: 1;
    transform: none;
  }

  .btn { transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
  .btn:hover { transform: translateY(-2px); }
  .btn-accent:hover { box-shadow: 0 8px 20px rgba(13, 122, 108, 0.28); }
  .btn-primary:hover { box-shadow: 0 8px 20px rgba(12, 13, 16, 0.22); }

  /* one combined rule: `transition` is a single property, so a separate
     hover rule would silently cancel the reveal fade on these elements */
  .card, .course-card, .price-card, .cred-strip .cred, .stats-band .stat {
    transition: opacity 0.55s ease, transform 0.3s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .course-card:hover, .price-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(12, 13, 16, 0.1);
  }

  .card:hover { box-shadow: inset 0 -2px 0 var(--accent); }

  .code-window {
    animation: float 7s ease-in-out infinite;
  }

  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }

  .code-window .cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #5fd4c4;
    vertical-align: -2px;
    animation: blink 1.1s steps(1) infinite;
  }

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

  .module summary::after, .faq-item summary::after {
    transition: transform 0.2s ease;
    display: inline-block;
  }

  .module[open] summary::after, .faq-item[open] summary::after {
    transform: rotate(180deg);
  }

  .nav-links a { transition: color 0.15s ease; }
  .site-footer a { transition: color 0.15s ease; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  section { padding: 64px 0; }
  .hero { padding: 60px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .grid-3, .pricing-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-band { grid-template-columns: 1fr 1fr; }
  .stats-band .stat { border-left: none; border-top: 1px solid var(--line); }
  .stats-band .stat:nth-child(-n+2) { border-top: none; }
  .stats-band .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .cred-strip { grid-template-columns: 1fr; }
  .cred-strip .cred { border-left: none; border-top: 1px solid var(--line); }
  .cred-strip .cred:first-child { border-top: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .instructor { grid-template-columns: 1fr; }
  .cta-band { padding: 44px 28px; }

  .cta-split,
  .hero .cta-row.cta-split { grid-template-columns: 1fr; max-width: 380px; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    border-bottom: 1px solid var(--line);
    gap: 18px;
  }
  .nav-links.open { display: flex; }
}
