/* ============================================================
   Training Program — futuristic tech-startup aesthetic
   Light + Dark themes, Inter / JetBrains Mono, hairline UI
   ============================================================ */

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

/* ---------- Theme tokens ---------- */
:root {
  color-scheme: light dark;

  /* Light defaults */
  --bg:           #fafafb;
  --bg-tint:      #f4f4f7;
  --surface:      #ffffff;
  --surface-2:    #f7f7f9;
  --border:       #e6e6ec;
  --border-strong:#d2d2da;
  --text:         #0a0a0d;
  --text-strong:  #000000;
  --muted:        #6b6b78;
  --muted-2:      #93939e;

  --accent:       #e1112a;
  --accent-soft:  rgba(225, 17, 42, 0.10);
  --accent-glow:  rgba(225, 17, 42, 0.18);

  --grid-dot:     rgba(10, 10, 13, 0.045);
  --hairline:     rgba(10, 10, 13, 0.06);
  --shadow-sm:    0 1px 2px rgba(10, 10, 13, 0.04);
  --shadow-md:    0 4px 16px rgba(10, 10, 13, 0.06);

  --radius:       14px;
  --radius-sm:    10px;
  --radius-lg:    18px;

  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #07070a;
    --bg-tint:      #0b0b10;
    --surface:      #0f0f15;
    --surface-2:    #14141b;
    --border:       #1d1d26;
    --border-strong:#2c2c38;
    --text:         #e8e8ee;
    --text-strong:  #ffffff;
    --muted:        #7a7a87;
    --muted-2:      #5a5a65;

    --accent:       #ff2742;
    --accent-soft:  rgba(255, 39, 66, 0.12);
    --accent-glow:  rgba(255, 39, 66, 0.28);

    --grid-dot:     rgba(255, 255, 255, 0.04);
    --hairline:     rgba(255, 255, 255, 0.06);
    --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md:    0 8px 24px rgba(0, 0, 0, 0.45);
  }
}

/* Forced overrides */
[data-theme="light"] {
  color-scheme: light;
  --bg:           #fafafb;
  --bg-tint:      #f4f4f7;
  --surface:      #ffffff;
  --surface-2:    #f7f7f9;
  --border:       #e6e6ec;
  --border-strong:#d2d2da;
  --text:         #0a0a0d;
  --text-strong:  #000000;
  --muted:        #6b6b78;
  --muted-2:      #93939e;
  --accent:       #e1112a;
  --accent-soft:  rgba(225, 17, 42, 0.10);
  --accent-glow:  rgba(225, 17, 42, 0.18);
  --grid-dot:     rgba(10, 10, 13, 0.045);
  --hairline:     rgba(10, 10, 13, 0.06);
  --shadow-sm:    0 1px 2px rgba(10, 10, 13, 0.04);
  --shadow-md:    0 4px 16px rgba(10, 10, 13, 0.06);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg:           #07070a;
  --bg-tint:      #0b0b10;
  --surface:      #0f0f15;
  --surface-2:    #14141b;
  --border:       #1d1d26;
  --border-strong:#2c2c38;
  --text:         #e8e8ee;
  --text-strong:  #ffffff;
  --muted:        #7a7a87;
  --muted-2:      #5a5a65;
  --accent:       #ff2742;
  --accent-soft:  rgba(255, 39, 66, 0.12);
  --accent-glow:  rgba(255, 39, 66, 0.28);
  --grid-dot:     rgba(255, 255, 255, 0.04);
  --hairline:     rgba(255, 255, 255, 0.06);
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 8px 24px rgba(0, 0, 0, 0.45);
}

/* ---------- Base ---------- */
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}

body {
  position: relative;
  background-image:
    radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(800px 500px at 85% -10%, var(--accent-glow), transparent 60%),
    radial-gradient(600px 400px at -10% 110%, var(--accent-soft), transparent 60%);
  opacity: 0.7;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

::selection { background: var(--accent); color: #fff; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.005em;
  color: var(--text-strong);
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #ff8aa0));
  box-shadow: 0 0 0 1px var(--hairline), 0 6px 18px var(--accent-glow);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--bg);
  border-radius: 2px;
  mix-blend-mode: difference;
  opacity: 0.0;
}

.brand-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

nav {
  display: flex;
  gap: 0.1rem;
  align-items: center;
}

nav a {
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

nav a:hover { color: var(--text-strong); }
nav a.active {
  color: var(--text-strong);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

/* Theme toggle */
.theme-toggle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.theme-toggle:hover {
  color: var(--text-strong);
  background: var(--surface);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-effective-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-effective-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Page typography ---------- */
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1.5rem;
}

.page-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}

h1.page-title {
  font-size: 2.3rem;
  margin: 0.5rem 0 0.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  line-height: 1.05;
}

.page-subtitle {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 0.98rem;
  max-width: 56ch;
}

p { margin: 0.6rem 0; }

/* ---------- Roster grid ---------- */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.85rem;
}

.trainee-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.15rem;
  transition: border-color 0.15s, transform 0.05s, background 0.15s;
  overflow: hidden;
}

.trainee-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--accent-soft));
  opacity: 0;
  transition: opacity 0.2s;
}

@media (hover: hover) {
  .trainee-card:hover {
    border-color: var(--accent);
  }
  .trainee-card:hover::before { opacity: 1; }
}

.trainee-card:active { transform: scale(0.99); }

.trainee-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.trainee-card h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.trainee-card .id-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-feature-settings: "tnum";
}

.trainee-card .meta {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  font-feature-settings: "tnum";
}

.trainee-card .preview {
  margin-top: 0.7rem;
  font-size: 0.93rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ---------- Trainee detail ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 0.35rem 0;
  text-transform: uppercase;
}

.back-link:hover { color: var(--accent); }

.detail-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem 0 0.4rem;
}

.detail-header h1 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge.active {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.badge.active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.badge.muted {
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
  margin: 0.5rem 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.detail-meta dt {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.2rem;
}

.detail-meta dd {
  margin: 0;
  color: var(--text);
  font-feature-settings: "tnum";
}

.summary-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius);
  margin: 0.5rem 0 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
  box-shadow: var(--shadow-sm);
}

.summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.2rem;
  bottom: 1.2rem;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

.summary-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.notes-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.94rem;
}

.notes-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* ---------- Sessions list ---------- */
.session-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.session-list a {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
  transition: border-color 0.15s, transform 0.05s;
}

@media (hover: hover) {
  .session-list a:hover {
    border-color: var(--accent);
  }
}

.session-list a:active { transform: translateX(2px); }

.session-list .date-stamp {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 600;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

.session-list .date-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-strong);
}

.session-list .attendees {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 0.2rem;
  line-height: 1.5;
}

/* ---------- Markdown note ---------- */
article.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem 2.1rem;
  margin: 0.75rem 0 2rem;
  box-shadow: var(--shadow-sm);
}

article.note > :first-child { margin-top: 0; }
article.note > :last-child { margin-bottom: 0; }

article.note h1 {
  font-size: 1.65rem;
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  position: relative;
}

article.note h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 64px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

article.note h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin: 1.85rem 0 0.55rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

article.note h3 {
  font-size: 1rem;
  margin: 1.05rem 0 0.3rem;
  color: var(--text-strong);
  font-weight: 700;
}

article.note ul,
article.note ol {
  padding-left: 1.4rem;
  margin: 0.5rem 0 0.8rem;
}

article.note li { margin: 0.4rem 0; }
article.note li::marker { color: var(--muted-2); }

article.note p { margin: 0.6rem 0; }

article.note strong {
  color: var(--text-strong);
  font-weight: 700;
}

article.note em {
  color: var(--muted);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: 0.02em;
  display: inline-block;
}

article.note hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

article.note code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ---------- States ---------- */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  margin-top: 1rem;
}

.loading {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  padding: 1.25rem 0 calc(1.25rem + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  font-feature-settings: "tnum";
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 600px) {
  body { font-size: 15.5px; background-size: 22px 22px; }
  .container { padding: 1rem; }
  h1.page-title { font-size: 1.85rem; }
  .detail-header h1 { font-size: 1.7rem; }
  article.note { padding: 1.25rem 1.25rem 1.5rem; }
  article.note h1 { font-size: 1.35rem; }
  .header-inner { padding-top: 0.6rem; padding-bottom: 0.6rem; }
  nav a { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
  .brand-text { font-size: 0.7rem; }
  .summary-card { padding: 1.1rem 1.2rem; }
  .session-list a { grid-template-columns: 1fr; gap: 0.25rem; }
  .session-list .date-stamp { font-size: 0.7rem; }
}

@media (max-width: 380px) {
  .brand-text { display: none; }
}

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