/* ============================================================
   Team 400 - Training Portal
   Brand tokens lifted from the Team 400 design system.
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Ink & neutrals */
  --ink-900: #171d1f;
  --ink-700: #2b3538;
  --slate-500: #607881;
  --slate-300: #9aabb1;
  --line-200: #e4e8e8;
  --grey-100: #f2f3f2;
  --white: #ffffff;

  /* Surfaces */
  --cool-50: #f2f6f8;
  --cream-50: #f9f6f2;

  /* Teal ramp */
  --teal-700: #007580;
  --teal-600: #008e9d;
  --teal-500: #10baba;
  --teal-400: #00d1d1;
  --teal-100: #d6f3f3;
  --teal-50:  #ebf9f9;

  --cyan-link: #00c4de;
  --periwinkle: #6f7dfd;

  --accent-red:   #e0584c;
  --accent-amber: #e6a33c;
  --accent-green: #3f9a6a;

  /* Semantic */
  --text-strong: var(--ink-900);
  --text-body: #38454a;
  --text-muted: var(--slate-500);
  --text-on-dark: var(--white);
  --text-on-dark-muted: #aebfc4;

  --surface-page: var(--cream-50);
  --surface-card: var(--white);
  --surface-dark: var(--ink-900);

  --border-subtle: var(--line-200);
  --border-brand: var(--teal-500);

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(23,29,31,.06), 0 1px 1px rgba(23,29,31,.04);
  --shadow: 0 6px 24px rgba(23,29,31,.08);
  --shadow-lg: 0 20px 60px rgba(23,29,31,.14);

  --maxw: 1120px;
}

* { box-sizing: border-box; }

/* ---------- Password gate ---------- */
html.gate-locked { overflow: hidden; }
html.gate-locked body > *:not(#tp-gate) { display: none !important; }
#tp-gate {
  position: fixed; inset: 0; z-index: 99999;
  display: grid; place-items: center; padding: 24px;
  background: var(--ink-900);
  background-image: url("img/curves-dark.png"); background-size: cover; background-position: center;
}
#tp-gate .tp-gate__card {
  width: 100%; max-width: 360px; background: #fff;
  border-radius: 22px; padding: 34px 30px; text-align: center;
  box-shadow: 0 20px 60px rgba(23,29,31,.4);
}
#tp-gate .tp-gate__logo { height: 26px; margin-bottom: 18px; }
#tp-gate h1 { font-size: 22px; margin: 0 0 6px; }
#tp-gate p { color: #607881; font-size: 14px; margin: 0 0 18px; }
#tp-gate__form { display: flex; gap: 8px; }
#tp-gate__input {
  flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid #e4e8e8;
  border-radius: 10px; font-size: 15px; font-family: var(--font-sans);
}
#tp-gate__input:focus { outline: 2px solid #00d1d1; border-color: #00d1d1; }
#tp-gate button {
  background: #171d1f; color: #fff; border: 0; border-radius: 10px;
  padding: 12px 18px; font-weight: 600; cursor: pointer; font-family: var(--font-sans);
}
#tp-gate button:hover { background: #008e9d; }
.tp-gate__err { color: #e0584c; font-size: 13px; margin-top: 12px; min-height: 16px; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-body);
  background: var(--surface-page);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 .5em;
}

a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 0 0 1em; }

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

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin: 0 0 .75em;
}

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(249,246,242,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav .wrap {
  display: flex; align-items: center; gap: 20px;
  height: 64px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-900); letter-spacing: -.02em; }
.nav__brand img { height: 24px; width: auto; }
.nav__links { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.nav__links a {
  color: var(--text-muted); font-weight: 500; font-size: 14px;
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
}
.nav__links a:hover { background: var(--white); color: var(--ink-900); }
.nav__links a.is-active { background: var(--ink-900); color: var(--white); }

/* ---------- Hero (dark) ---------- */
.hero {
  position: relative;
  background: var(--ink-900);
  color: var(--text-on-dark);
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0;
  background-image: url("img/curves-dark.png");
  background-size: cover; background-position: center;
  opacity: .5;
}
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(23,29,31,.2) 0%, rgba(23,29,31,.85) 100%);
}
.hero .wrap { position: relative; padding: 84px 24px 76px; }
.hero__logos { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.hero__logos img { height: 26px; width: auto; }
.hero__logos .divider { width: 1px; height: 24px; background: rgba(255,255,255,.25); }
.hero h1 {
  color: #fff; font-size: clamp(38px, 6vw, 64px);
  max-width: 15ch; margin-bottom: .35em;
}
.hero h1 em { color: var(--teal-400); font-style: normal; }
.hero__lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--text-on-dark-muted); max-width: 54ch; font-weight: 300; }
.hero__cta { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--teal { background: var(--teal-500); color: #04282b; }
.btn--teal:hover { background: var(--teal-400); text-decoration: none; }
.btn--light { background: #fff; color: var(--ink-900); }
.btn--light:hover { background: var(--grey-100); text-decoration: none; }
.btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn--ghost:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.btn--dark { background: var(--ink-900); color: #fff; }
.btn--dark:hover { background: var(--ink-700); text-decoration: none; }

/* ---------- Section shells ---------- */
.section { padding: 64px 0; }
.section--tint { background: var(--cool-50); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.section__head { max-width: 62ch; margin-bottom: 34px; }
.section__head h2 { font-size: clamp(26px, 3.4vw, 34px); }
.section__head p { color: var(--text-muted); font-size: 17px; }

/* ---------- Track cards (landing) ---------- */
.tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.track {
  position: relative; display: block; padding: 30px;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  color: inherit; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  overflow: hidden;
}
.track:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-brand); text-decoration: none; }
.track__tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-700); background: var(--teal-50); padding: 5px 11px; border-radius: 999px; margin-bottom: 16px; }
.track h3 { font-size: 24px; margin-bottom: 8px; }
.track p { color: var(--text-muted); margin-bottom: 18px; }
.track__list { list-style: none; margin: 0 0 20px; padding: 0; }
.track__list li { padding: 6px 0 6px 24px; position: relative; font-size: 15px; color: var(--text-body); border-top: 1px solid var(--border-subtle); }
.track__list li:first-child { border-top: 0; }
.track__list li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--teal-500); }
.track__go { font-weight: 600; color: var(--teal-700); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Feature strip ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.feature { padding: 22px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius); }
.feature h4 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--text-muted); font-size: 14px; margin: 0; }
.feature__ico { width: 38px; height: 38px; border-radius: 10px; background: var(--teal-50); color: var(--teal-700); display: grid; place-items: center; font-size: 20px; margin-bottom: 14px; }

/* ---------- Layout with sidebar TOC ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; }
.toc { position: sticky; top: 88px; align-self: start; }
.toc__title { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.toc__prog { height: 6px; border-radius: 999px; background: var(--grey-100); overflow: hidden; margin-bottom: 8px; }
.toc__prog span { display: block; height: 100%; width: 0; background: var(--teal-500); transition: width .3s ease; }
.toc__prog-label { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.toc nav { display: flex; flex-direction: column; gap: 2px; }
.toc nav a { font-size: 14px; color: var(--text-muted); padding: 7px 12px; border-radius: 8px; border-left: 2px solid transparent; }
.toc nav a:hover { background: var(--white); color: var(--ink-900); text-decoration: none; }
.toc nav a.is-active { color: var(--ink-900); font-weight: 600; border-left-color: var(--teal-500); background: var(--white); }

/* ---------- Big band separators (CoWork vs Coding) ---------- */
.band {
  display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap;
  margin: 14px 0 32px; padding: 22px 26px;
  background: var(--ink-900); color: #fff; border-radius: var(--radius);
  scroll-margin-top: 88px; position: relative; overflow: hidden;
}
.band__no { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-400); }
.band h2 { color: #fff; margin: 0; font-size: clamp(23px, 3.2vw, 30px); letter-spacing: -.02em; }
.band p { color: var(--text-on-dark-muted); margin: 6px 0 0; font-size: 15px; width: 100%; }

/* TOC group labels */
.toc__group { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-strong); margin: 18px 0 4px; padding: 0 12px; }
.toc__group:first-of-type { margin-top: 0; }

/* ---------- Exercise groups & cards ---------- */
.group { margin-bottom: 56px; scroll-margin-top: 88px; }
.group__head { border-bottom: 2px solid var(--ink-900); padding-bottom: 14px; margin-bottom: 26px; }
.group__head .eyebrow { margin-bottom: .4em; }
.group__head h2 { font-size: clamp(24px, 3vw, 30px); margin: 0; }
.group__head p { margin: 10px 0 0; color: var(--text-muted); }

.card {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 26px 28px; margin-bottom: 20px; scroll-margin-top: 88px;
}
.card__top { display: flex; align-items: flex-start; gap: 16px; }
.card__check {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  width: 26px; height: 26px; margin-top: 2px; border-radius: 7px;
  border: 2px solid var(--slate-300); background: #fff; cursor: pointer; position: relative;
  transition: background .15s, border-color .15s;
}
.card__check:hover { border-color: var(--teal-500); }
.card__check:checked { background: var(--teal-500); border-color: var(--teal-500); }
.card__check:checked::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #04282b; font-size: 15px; font-weight: 700; }
.card__titles { flex: 1; min-width: 0; }
.card h3 { font-size: 20px; margin: 0 0 6px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--grey-100); color: var(--text-muted); }
.pill--time { background: var(--teal-50); color: var(--teal-700); }
.pill--who { background: #f3f0fb; color: #5b53b8; }
.pill--num { background: var(--ink-900); color: #fff; font-variant-numeric: tabular-nums; }
.pill--adv { background: #fbe9e7; color: #c0392b; }
.card__goal { color: var(--text-body); margin: 12px 0 0; }
.card__body { margin-top: 16px; }

/* Prompt block */
.prompt { position: relative; margin: 16px 0; }
.prompt__label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.prompt pre {
  margin: 0; background: var(--ink-900); color: #e8eef0;
  border-radius: var(--radius-sm); padding: 18px 52px 18px 18px;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;
}
.prompt pre code { font-family: inherit; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,.1); color: #cfe9ea; border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px; padding: 6px 11px; font-size: 12px; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer; transition: background .15s;
}
.copy-btn:hover { background: rgba(255,255,255,.2); }
.copy-btn.copied { background: var(--teal-500); color: #04282b; border-color: var(--teal-500); }

/* Inline code / callouts */
code:not(pre code) { font-family: var(--font-mono); font-size: .88em; background: var(--teal-50); color: var(--teal-700); padding: 2px 6px; border-radius: 5px; }

.callout { border-left: 3px solid var(--teal-500); background: var(--teal-50); border-radius: 0 8px 8px 0; padding: 14px 18px; margin: 16px 0; font-size: 14.5px; color: var(--text-body); }
.callout--warn { border-left-color: var(--accent-amber); background: #fef6e9; }
.callout--check { border-left-color: var(--accent-green); background: #eef7f1; }
.callout strong { color: var(--ink-900); }

.card__body ul, .card__body ol { margin: 12px 0; padding-left: 22px; }
.card__body li { margin-bottom: 7px; }
.card__body h4 { font-size: 15px; margin: 20px 0 8px; color: var(--ink-900); }

/* Details / expandable */
details.more { margin-top: 14px; border-top: 1px dashed var(--border-subtle); padding-top: 8px; }
details.more > summary {
  cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; color: var(--teal-700);
  padding: 8px 0; display: inline-flex; align-items: center; gap: 8px;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; transition: transform .15s; display: inline-block; }
details.more[open] > summary::before { transform: rotate(90deg); }

/* Download cards */
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.dl {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  text-decoration: none; color: inherit; transition: border-color .12s, transform .12s, box-shadow .12s;
}
.dl:hover { border-color: var(--border-brand); transform: translateY(-2px); box-shadow: var(--shadow-sm); text-decoration: none; }
.dl__ico { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; background: var(--ink-900); color: var(--teal-400); display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.dl__name { font-weight: 600; color: var(--ink-900); font-size: 15px; }
.dl__desc { font-size: 13px; color: var(--text-muted); }
.dl__arrow { margin-left: auto; color: var(--teal-600); font-size: 18px; }

/* Inline download chip inside a card */
.dl-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--ink-900); color: #fff; padding: 9px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 600; text-decoration: none; margin: 4px 0; }
.dl-chip:hover { background: var(--ink-700); text-decoration: none; color: #fff; }
.dl-chip .arw { color: var(--teal-400); }

/* ---------- Footer ---------- */
.footer { background: var(--ink-900); color: var(--text-on-dark-muted); padding: 44px 0; margin-top: 40px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.footer img { height: 22px; }
.footer a { color: #cfe9ea; }
.footer__note { font-size: 13px; }

/* ---------- Reset progress link ---------- */
.reset-link { background: none; border: 0; color: var(--text-muted); font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; font-family: var(--font-sans); }
.reset-link:hover { color: var(--accent-red); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; margin-bottom: 30px; padding: 18px; background: var(--white); border: 1px solid var(--border-subtle); border-radius: var(--radius); }
  .toc nav { max-height: 220px; overflow-y: auto; }
}
@media (max-width: 620px) {
  .nav__links a { padding: 8px 10px; }
  .hero .wrap { padding: 60px 24px 54px; }
  .card { padding: 22px 18px; }
  .section { padding: 48px 0; }
}
