/* E-3 / E-6 Metallic Training Portal — Industrial Aerospace */

:root {
  --bg-deep: #0b1220;
  --bg-panel: #121a2b;
  --bg-card: #172033;
  --bg-elevated: #1c2740;
  --border: #2a3654;
  --border-soft: #243049;
  --text: #e8edf7;
  --text-muted: #9aa8c3;
  --text-dim: #6b7a96;
  --accent: #c9a227;
  --accent-bright: #e8c547;
  --accent-dim: #8a7020;
  --accent-glow: rgba(201, 162, 39, 0.15);
  --warn-bg: #2a1f0a;
  --warn-border: #c9a227;
  --success: #3d9b6a;
  --focus: #e8c547;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --nav-h: 64px;
  --max: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video, iframe { max-width: 100%; }

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: #f5d96a; text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ——— Layout ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brand:hover { color: var(--accent-bright); text-decoration: none; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: grid;
  place-items: center;
  color: var(--bg-deep);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-text { font-size: 0.95rem; line-height: 1.2; }
.brand-text small {
  display: block;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--text);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu > li > a,
.nav-dropdown > summary {
  display: block;
  padding: 0.45rem 0.7rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  list-style: none;
  border: none;
  background: transparent;
}
.nav-menu > li > a:hover,
.nav-dropdown > summary:hover {
  color: var(--text);
  background: var(--bg-elevated);
  text-decoration: none;
}
.nav-menu > li > a.active,
.nav-dropdown.active > summary {
  color: var(--accent-bright);
  background: var(--accent-glow);
}

.nav-dropdown { position: relative; }
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after {
  content: "▾";
  margin-left: 0.35rem;
  font-size: 0.7rem;
  opacity: 0.7;
}
.nav-dropdown[open] > summary {
  color: var(--text);
  background: var(--bg-elevated);
}
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  z-index: 100;
}
.nav-dropdown-panel a {
  display: block;
  padding: 0.55rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.nav-dropdown-panel a:hover,
.nav-dropdown-panel a.active {
  color: var(--accent-bright);
  background: var(--accent-glow);
  text-decoration: none;
}

main {
  flex: 1;
  width: 100%;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

.page-with-sidenav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
}
.page-with-sidenav .container {
  max-width: none;
  margin: 0;
  padding: 0;
}

.side-nav {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
}
.side-nav h2 {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0 0.5rem;
}
.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-nav a {
  display: block;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.side-nav a:hover {
  color: var(--accent-bright);
  background: var(--accent-glow);
  text-decoration: none;
}

/* ——— Hero ——— */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 70% 0%, rgba(201, 162, 39, 0.12), transparent 55%),
    linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-deep) 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 1.25rem 3rem;
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.2;
  font-weight: 750;
  max-width: 18ch;
  letter-spacing: -0.02em;
}
.hero .lead {
  margin: 0 0 1.75rem;
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 42ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-bright);
  color: var(--bg-deep);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: var(--accent-glow);
}

/* ——— Sections ——— */
.section { margin-bottom: 3rem; }
.section-header {
  margin-bottom: 1.5rem;
}
.section-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}
.section-header p {
  margin: 0;
  color: var(--text-muted);
  max-width: 60ch;
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}
.page-header p {
  margin: 0;
  color: var(--text-muted);
  max-width: 65ch;
}

/* ——— Cards ——— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.card-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: #3a4a6e;
}
a.card {
  color: inherit;
  text-decoration: none;
  display: block;
}
a.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
  text-decoration: none;
}
.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--text);
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.card .meta {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.fact-card .fact-label,
.fact-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.machine-section .fact-label {
  display: block;
}

.path-card {
  position: relative;
  padding-left: 1.5rem;
}
.path-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* ——— Callouts ——— */
.callout {
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  margin: 1.5rem 0;
}
.callout-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}
.callout-title {
  font-weight: 700;
  color: var(--accent-bright);
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}
.callout p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0 1.75rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
th {
  background: var(--bg-elevated);
  color: var(--accent-bright);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
td { color: var(--text-muted); }
td strong { color: var(--text); font-weight: 600; }
tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* ——— Process flow ——— */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.5rem 0 2rem;
  padding: 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.flow-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.flow-step a {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.flow-step a:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: var(--accent-glow);
}
.flow-arrow {
  color: var(--accent);
  font-weight: 700;
  opacity: 0.7;
}

.machine-section {
  scroll-margin-top: calc(var(--nav-h) + 1rem);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-soft);
}
.machine-section:last-of-type { border-bottom: none; }
.machine-section h3 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
  color: var(--accent-bright);
}

.machine-section p { color: var(--text-muted); }
.machine-section .machine-subhead { margin-top: 1.75rem; }
.machines-hero-note {
  margin-top: 0.85rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 52rem;
}
.watch-strip {
  margin: 1.5rem 0 1.75rem;
  padding: 1.1rem 1.25rem 1.2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.watch-strip-title {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.watch-strip-lede {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.watch-strip-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.watch-strip-links a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.82rem;
  text-decoration: none;
}
.watch-strip-links a:hover {
  border-color: var(--accent-dim);
  color: var(--accent-bright);
  background: var(--accent-glow);
}
.machine-section .video-card.machine-demo {
  margin-top: 1.15rem;
}
.machine-section .video-card h4 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  color: var(--text);
}

/* ——— Video embeds ——— */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-card-body {
  padding: 1.25rem 1.35rem 0.5rem;
}
.video-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}
.video-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}
.video-card p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.playlist-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: var(--bg-panel);
  border: 1px dashed var(--accent-dim);
  border-radius: var(--radius);
  margin: 0.5rem 0 1.5rem;
}
.playlist-card .icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 1.2rem;
}
.playlist-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}
.playlist-card p {
  margin: 0 0 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.ext-link::after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.8;
}

/* ——— Feature video grid on home ——— */
.featured-videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.featured-videos .video-card-body { padding: 1rem 1rem 0.25rem; }
.featured-videos h3 { font-size: 0.95rem; }

/* ——— Training resource cards ——— */
.resource-card .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ——— Watch plan ——— */
.day-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  break-inside: avoid;
}
.day-block h3 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
  color: var(--accent-bright);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.day-block h3 .day-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.95rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist input[type="checkbox"] {
  margin-top: 0.3rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.checklist label {
  cursor: pointer;
  flex: 1;
}
.checklist input:checked + label {
  color: var(--text-dim);
  text-decoration: line-through;
}
.plan-progress {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.plan-progress strong { color: var(--accent-bright); }
.progress-bar {
  flex: 1;
  min-width: 140px;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-bright));
  transition: width 0.25s ease;
}

/* ——— Lists ——— */
.tight-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}
.tight-list li { margin-bottom: 0.35rem; }
.tight-list strong { color: var(--text); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ——— Footer ——— */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 2rem 1.25rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 70ch;
  line-height: 1.55;
}
.footer-meta {
  margin-top: 0.75rem !important;
  font-size: 0.8rem !important;
}

/* ——— Utilities ——— */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
  .page-with-sidenav {
    grid-template-columns: 1fr;
  }
  .side-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
  }
  .side-nav h2 { width: 100%; margin-bottom: 0.4rem; }
  .side-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    gap: 0.15rem;
    box-shadow: var(--shadow);
  }
  .nav-menu.is-open { display: flex; }
  .nav-dropdown-panel {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--bg-elevated);
    margin-top: 0.25rem;
    min-width: 0;
  }
  .nav-menu > li > a,
  .nav-dropdown > summary {
    padding: 0.7rem 0.85rem;
  }
}

/* ——— Print (watch plan) ——— */
@media print {
  .site-header, .nav-toggle, .site-footer, .btn, .plan-progress .btn {
    display: none !important;
  }
  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }
  .day-block {
    background: #fff;
    border: 1px solid #ccc;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .day-block h3 { color: #333; }
  .checklist li { color: #222; border-color: #ddd; }
  a { color: #111; text-decoration: none; }
  .callout, .callout-warn {
    background: #f8f4e8;
    border-color: #999;
    color: #222;
  }
  .callout-title { color: #333; }
  .page-header { border-color: #ccc; }
}
