/* SecAITech Learn */

:root {
  --ink: #16233B;
  --paper: #F7F8F6;
  --surface: #FFFFFF;
  --rule: #D6DAD8;
  --field: #B6BCC6;
  --muted: #58616E;
  --faint: #9AA2AC;
  --route: #2456A6;
  --route-soft: #E8EEF8;
  --done: #1E6B47;
  --done-soft: #E6F1EA;
  --danger: #A4262C;
  --danger-soft: #F8E8E8;
  --focus: #2D5BD7;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.6 var(--sans); }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--route); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.frame { max-width: 48rem; margin: 0 auto; padding: 0 1.25rem; }
.frame--wide { max-width: 72rem; }

/* ---------- Header & footer ---------- */

.site-head { background: var(--surface); border-bottom: 1px solid var(--rule); }
.site-head-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.wordmark { font-weight: 700; font-size: 1.0625rem; text-decoration: none; letter-spacing: -.01em; }
.wordmark span { font-weight: 400; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 1.25rem; font-size: .9375rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

.site-foot { margin-top: 5rem; border-top: 1px solid var(--rule); background: var(--surface); }
.site-foot p { margin: 0; padding: 1.5rem 0 2rem; color: var(--muted); font-size: .875rem; max-width: 44rem; }
.site-foot a { color: inherit; }

/* ---------- Home ---------- */

.hero { padding: 4rem 0 2.5rem; }
.hero h1, .roadmap-head h1 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.125rem, 6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 1rem;
}
.hero p { font-size: 1.125rem; color: var(--muted); margin: 0; max-width: 38rem; }

.roles { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.roles li { border-bottom: 1px solid var(--rule); }
.role {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title meta" "summary summary";
  gap: .35rem 1.5rem;
  padding: 1.5rem .25rem;
  text-decoration: none;
}
.role-title { grid-area: title; font-weight: 700; font-size: 1.25rem; line-height: 1.3; }
.role-summary { grid-area: summary; color: var(--muted); max-width: 36rem; }
.role-meta { grid-area: meta; color: var(--muted); font-size: .875rem; white-space: nowrap; padding-top: .2rem; }
.role:hover .role-title { color: var(--route); text-decoration: underline; text-underline-offset: 3px; }
.role:hover { background: var(--surface); }

.how { margin-top: 3rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
.how h2 { font-size: 1.0625rem; margin: 0 0 .5rem; }
.how p { margin: 0; color: var(--muted); }
.empty { color: var(--muted); }

/* ---------- Roadmap page ---------- */

.crumbs { padding-top: 2rem; font-size: .9375rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.roadmap-head { padding: 1.25rem 0 2rem; }
.roadmap-summary { font-size: 1.1875rem; color: var(--muted); margin: 0 0 1.5rem; max-width: 38rem; }
.roadmap-facts { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 0; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.roadmap-facts dt { font-size: .8125rem; color: var(--muted); }
.roadmap-facts dd { margin: .1rem 0 0; font-weight: 600; max-width: 22rem; }

.job-note { background: var(--route-soft); border-left: 4px solid var(--route); padding: 1.25rem 1.5rem; border-radius: 0 8px 8px 0; margin-bottom: 2.5rem; }
.job-note h2 { font-size: 1rem; margin: 0 0 .5rem; }
.job-note p { margin: 0 0 .75rem; }
.job-note p:last-child { margin-bottom: 0; }

.progress { position: sticky; top: 0; z-index: 2; background: var(--paper); padding: .85rem 0; margin-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.progress-text { margin: 0 0 .5rem; font-size: .9375rem; font-weight: 600; }
.progress-bar { height: 6px; background: var(--rule); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--done); border-radius: 999px; transition: width .3s ease; }

/* The route: numbered stations on one continuous line. The page's one distinctive element. */
.route { list-style: none; margin: 0; padding: 0; }
.station { position: relative; display: grid; grid-template-columns: 2.75rem 1fr; gap: 1.25rem; padding-bottom: 2.75rem; }
.station::before {
  content: "";
  position: absolute;
  left: calc(1.375rem - 2px);
  top: 2.75rem;
  bottom: 0;
  width: 4px;
  background: var(--rule);
}
.station:last-child::before { display: none; }
.station.is-done::before { background: var(--done); }
.station-marker {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--route);
  color: var(--route);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.station.is-done .station-marker { background: var(--done); border-color: var(--done); color: #fff; }
.station-body h2 { font-size: 1.375rem; line-height: 1.3; margin: .45rem 0 .25rem; letter-spacing: -.01em; }
.station-time { margin: 0 0 .75rem; color: var(--muted); font-size: .9375rem; }
.station-text p { margin: 0 0 .85rem; max-width: 38rem; }

.resources { list-style: none; margin: 1rem 0 0; padding: 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.resources li { padding: .85rem 1rem; border-bottom: 1px solid var(--rule); }
.resources li:last-child { border-bottom: 0; }
.resources a { font-weight: 600; }
.res-meta { display: block; font-size: .8125rem; color: var(--muted); margin-top: .1rem; }
.res-note { display: block; font-size: .875rem; margin-top: .25rem; }

.done-toggle { margin-top: 1rem; }
.done-toggle[aria-pressed="true"] { background: var(--done-soft); border-color: var(--done); color: var(--done); }

.academy { margin-top: 2rem; padding: 2rem; background: var(--ink); color: #fff; border-radius: 10px; }
.academy h2 { font-family: var(--serif); font-weight: 600; font-size: 1.625rem; line-height: 1.2; margin: 0 0 .5rem; }
.academy p { margin: 0 0 1.25rem; color: #D5DBE6; max-width: 34rem; }
.academy p:last-child { margin: 0; }
.academy .btn { background: #fff; color: var(--ink); border-color: #fff; }
.academy .btn:hover { background: var(--route-soft); }

/* ---------- Buttons & forms ---------- */

button, .btn {
  font: inherit; font-weight: 600; line-height: 1.2;
  display: inline-block;
  padding: .65rem 1.05rem;
  border: 1px solid var(--ink); border-radius: 6px;
  background: var(--ink); color: #fff;
  text-decoration: none; cursor: pointer;
}
button:hover, .btn:hover { background: #22345A; color: #fff; }
button:disabled { opacity: .35; cursor: default; }
.btn-quiet, .done-toggle { background: var(--surface); color: var(--ink); border-color: var(--field); }
.btn-quiet:hover, .done-toggle:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #861E23; }
.btn-small { padding: .4rem .7rem; font-size: .875rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { background: none; color: var(--route); }
.site-nav .link-btn { color: var(--muted); font-size: .9375rem; text-decoration: none; }
.site-nav .link-btn:hover { color: var(--ink); text-decoration: underline; }
.danger-text { color: var(--danger); }
.icon-btn { padding: .2rem .5rem; font-size: .9375rem; background: var(--surface); color: var(--ink); border-color: var(--field); }
.icon-btn:hover:not(:disabled) { background: var(--route-soft); color: var(--ink); }

input[type="text"], input[type="password"], input[type="url"], select, textarea {
  font: inherit; color: inherit;
  width: 100%; min-width: 0;
  padding: .6rem .75rem;
  background: var(--surface);
  border: 1px solid var(--field);
  border-radius: 6px;
}
textarea { resize: vertical; line-height: 1.5; }
.field label, .stack > label { display: block; font-weight: 600; margin-bottom: .35rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.stack > .field, .stack > .field-row, .stack > input { width: 100%; }
.field-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.field.grow { flex: 1 1 9rem; }
.hint { color: var(--muted); font-size: .875rem; margin: .35rem 0 0; }
.optional { color: var(--muted); font-weight: 400; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 500; }
.check input { margin-top: .35rem; }
.prefixed { display: flex; }
.prefixed span { padding: .6rem .6rem; border: 1px solid var(--field); border-right: 0; border-radius: 6px 0 0 6px; background: var(--paper); color: var(--muted); }
.prefixed input { border-radius: 0 6px 6px 0; }
form.inline { display: inline; margin: 0; }

.flash { padding: .85rem 1rem; border-radius: 6px; margin: 0 0 1.25rem; background: var(--done-soft); border-left: 4px solid var(--done); }
.flash--error { background: var(--danger-soft); border-left-color: var(--danger); }
.flash--info { background: var(--route-soft); border-left-color: var(--route); margin-top: 1.5rem; }

/* ---------- Admin ---------- */

.admin main h1 { font-size: 1.75rem; line-height: 1.2; margin: 2rem 0 1rem; letter-spacing: -.015em; }
.admin .crumbs + h1, .admin .crumbs + .title-row h1 { margin-top: .5rem; }
.admin .crumbs { padding-top: 1.5rem; }
.title-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.title-row h1 { margin-bottom: .5rem !important; }
.title-actions { display: flex; align-items: center; gap: 1.25rem; margin: 0 0 1.5rem; }

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 1.5rem; }
.panel h2 { font-size: 1.1875rem; margin: 0 0 1rem; }
.panel h3 { font-size: 1rem; margin: 2rem 0 .75rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.panel--narrow { max-width: 34rem; margin-top: 2.5rem; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.5rem; align-items: start; }

.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: .8125rem; font-weight: 600; color: var(--muted); background: var(--paper); }
tbody tr:last-child td { border-bottom: 0; }
.strong { font-weight: 600; }
.sub { display: block; color: var(--muted); font-size: .8125rem; }
.nowrap { white-space: nowrap; }
.order-cell { display: flex; gap: .25rem; white-space: nowrap; }

.badge { display: inline-block; font-size: .8125rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; }
.badge--live { background: var(--done-soft); color: var(--done); }
.badge--draft { background: #EEF0F2; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .4rem 1rem; font-size: .9375rem; }
.danger-zone summary, .edit-zone summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger-zone summary { color: var(--danger); }
.danger-zone[open] { flex-basis: 100%; }
.danger-zone form { margin-top: .6rem; padding: .85rem; background: var(--danger-soft); border-radius: 6px; gap: .6rem; }
.danger-zone p { margin: 0; }
.danger-zone label { font-weight: 500; font-size: .875rem; }

.admin-steps, .admin-resources { list-style: none; margin: 0; padding: 0; }
.admin-steps li, .admin-resources li { display: flex; gap: 1rem; align-items: flex-start; padding: .85rem 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.admin-step-main, .admin-res-main { flex: 1 1 12rem; min-width: 0; }
.admin-res-main .strong { overflow-wrap: anywhere; }
.edit-zone { margin-top: .4rem; font-size: .9375rem; }
.edit-zone[open] > form.stack { margin-top: .75rem; padding: 1rem; background: var(--paper); border-radius: 6px; }
.delete-inline { display: block; margin-top: .75rem; }

/* Setup and sign-in */
.page { max-width: 28rem; margin: 0 auto; padding: 2rem 1.25rem 0; }
.masthead { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 1rem; margin-bottom: 2rem; border-bottom: 1px solid var(--rule); }
.masthead-note { margin: 0; color: var(--muted); font-size: .9375rem; }
.page h1 { font-size: 1.75rem; margin: 0 0 1rem; }

/* ---------- Small screens ---------- */

@media (max-width: 36rem) {
  .hero { padding-top: 2.5rem; }
  .role { grid-template-columns: 1fr; grid-template-areas: "title" "summary" "meta"; }
  .station { grid-template-columns: 2.25rem 1fr; gap: .9rem; }
  .station::before { left: calc(1.125rem - 2px); top: 2.25rem; }
  .station-marker { width: 2.25rem; height: 2.25rem; font-size: .9375rem; }
  .station-body h2 { font-size: 1.1875rem; margin-top: .3rem; }
  .academy { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar span { transition: none; }
}

@media print {
  .site-head, .progress, .done-toggle, .academy, .site-foot { display: none; }
}
