:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --card: #ffffff;
  --fg: #111827;
  --muted: #4b5563;
  --line: #d1d5db;
  --head: #f9fafb;
  --accent: #1d4ed8;
  --accent-fg: #ffffff;
  --teal: #0f766e;
  --teal-fg: #ffffff;
  --primary-tint: #eef3ff;
  --secondary-tint: #ecfdf8;
  --error: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --card: #131a2e;
    --fg: #f3f4f6;
    --muted: #a3acbd;
    --line: #374151;
    --head: #182039;
    --accent: #93b4ff;
    --accent-fg: #0b1020;
    --teal: #5eead4;
    --teal-fg: #0b1020;
    --primary-tint: #1a2547;
    --secondary-tint: #0f2a2a;
    --error: #fca5a5;
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 150px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    1rem/1.6 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
body:has(dialog[open]) {
  overflow: hidden;
}
a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}
p {
  margin: 12px 0 0;
  max-width: 68ch;
}
h1,
h2,
h3 {
  color: var(--fg);
  margin: 0;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  font-weight: 720;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 22ch;
}
h2 {
  font-size: clamp(1.35rem, 3.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
}
h3 {
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.4;
}
.lead {
  font-size: 1.0625rem;
  line-height: 1.6;
  max-width: 62ch;
  margin-top: 20px;
}
.hint,
.source-note,
.video-meta,
small {
  font-size: 0.9rem;
  color: var(--muted);
}
.eyebrow {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 12px;
}
main {
  max-width: 64rem;
  padding: 40px 16px 56px;
  margin: auto;
  min-width: 0;
}
main > section,
#account-gate > section,
#account-content > section {
  margin-top: 56px;
}
main > section:first-child {
  margin-top: 0;
}
section > :where(div, form, ol, ul, dl, details, button, aside, .row-actions),
/* A section may wrap its public/private variants without changing the rhythm. */
:where(h2, p) + :where(div, form, ol, ul, dl, details, button, aside) {
  margin-top: 20px;
}
section,
[id],
h2 {
  scroll-margin-top: 16px;
}
section:focus,
h1:focus,
h2:focus,
h3:focus {
  outline-offset: 6px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 64rem;
  margin: auto;
  padding: 8px 16px;
  min-height: 64px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.brand {
  color: var(--fg);
  text-decoration: none;
  font-weight: 720;
  letter-spacing: -0.035em;
  white-space: nowrap;
  font-size: 1.1rem;
}
.tld {
  color: var(--muted);
  font-weight: 450;
}
.auth {
  margin-left: auto;
}
.site-nav {
  display: flex;
  gap: 4px;
  order: 3;
  width: 100%;
}
.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--fg);
  text-decoration: none;
}
.site-nav a[aria-current] {
  background: var(--primary-tint);
  color: var(--accent);
  font-weight: 650;
}
#account-bar,
.account {
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-email {
  display: none;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--accent);
  font-weight: 650;
}
button,
input,
select {
  font: inherit;
}
button,
.link-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}
button {
  background: var(--card);
  color: var(--fg);
}
button.solid,
button.primary,
.link-button.filled {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
button:disabled,
[aria-disabled='true'] {
  cursor: wait;
}
button.link {
  background: none;
  border-color: transparent;
  color: var(--accent);
  padding-inline: 8px;
  text-decoration: underline;
}
.link-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.hero-actions,
.row-actions,
.actions,
.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.hero-actions {
  margin-top: 20px;
}
.card,
.summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  min-width: 0;
}
.card > :first-child {
  margin-top: 0;
}
.card > a:last-child {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
#roles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.role-card h3 {
  margin-top: 20px;
}
/* One technology per line at every width: long names wrap inside their own row,
   and the padding keeps two wrapped names from reading as one block. */
.technology-links {
  display: grid;
  gap: 0;
  max-width: 68ch;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.technology-links li {
  min-width: 0;
}
.technology-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding-block: 8px;
}
.atlas-link {
  margin-top: 20px;
}
.video-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.video-grid {
  gap: 16px;
}
.video-card {
  margin: 0;
}
.video-frame {
  aspect-ratio: 16/9;
  border-radius: 9px;
  overflow: hidden;
  margin-top: 16px;
  background: var(--head);
}
.video-frame video,
.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.youtube-consent {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
  text-align: center;
  gap: 8px;
}
.youtube-consent p {
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}
.youtube-consent button {
  font-size: 0.9rem;
  padding: 8px;
}
.summary-row {
  gap: 8px 24px;
}
.summary-row p {
  margin: 0;
}
.account-line {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.status {
  min-height: 0;
  overflow-wrap: anywhere;
}
.status:empty {
  margin: 0;
}
.ok {
  color: var(--teal);
}
.err {
  color: var(--error);
}

.row-actions > a,
.section-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 20px;
}
.readiness {
  border-left: 3px solid var(--teal);
  padding: 8px 14px;
  background: var(--head);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
th {
  background: var(--head);
  font-weight: 600;
}
caption {
  padding: 12px 0;
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
}
#observatory-evidence table {
  min-width: 36rem;
}
#observatory-evidence td {
  width: 35%;
}
#course-table {
  margin-top: 20px;
}
#course-table .num {
  color: var(--muted);
}
#course-table .title {
  display: block;
  font-weight: 600;
}
.course {
  width: 29%;
}
.pick {
  width: 12rem;
}
.level {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--head);
  color: var(--muted);
  font-size: 0.8rem;
}
.pick-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
button.mark {
  min-height: 44px;
}
button.mark.rank-primary[aria-pressed='true'] {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
button.mark.rank-secondary[aria-pressed='true'] {
  background: var(--teal);
  color: var(--teal-fg);
  border-color: var(--teal);
}
tr.is-primary td {
  background: var(--primary-tint);
}
tr.is-secondary td {
  background: var(--secondary-tint);
}
tr.is-primary td:first-child {
  box-shadow: inset 4px 0 0 var(--accent);
}
tr.is-secondary td:first-child {
  box-shadow: inset 4px 0 0 var(--teal);
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
input,
select {
  min-height: 46px;
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  background: var(--card);
}

.form-grid {
  display: grid;
  gap: 18px;
  max-width: 44rem;
}
.form-grid button {
  justify-self: start;
}

summary {
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
  color: var(--accent);
}
details form {
  margin-top: 20px;
}
.legal h2 {
  margin-top: 56px;
}
.legal h3 {
  margin-top: 24px;
}
footer {
  max-width: 64rem;
  margin: auto;
  padding: 24px 16px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
}
footer p {
  margin: 0;
}
dialog {
  width: min(26rem, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: var(--card);
  color: var(--fg);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
dialog::backdrop {
  background: #0009;
}
dialog[open] {
  animation: appear 0.15s ease-out;
}
.dialog-body {
  padding: 20px;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.icon {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: none;
  font-size: 1.5rem;
}
dialog form > button {
  margin-top: 16px;
}
dialog .actions {
  margin-top: 8px;
  gap: 0;
}
#code {
  font-size: 1.5rem;
  letter-spacing: 0.35em;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog[open] {
    animation: none;
  }
}
@media (min-width: 720px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .video-grid {
    gap: 20px;
  }
  .account-email {
    display: block;
  }
}
@media (min-width: 1000px) {
  .topbar-inner {
    flex-wrap: nowrap;
    gap: 20px;
  }
  .site-nav {
    width: auto;
    order: 0;
  }
  .auth {
    order: 2;
  }
  .account-email {
    max-width: 10rem;
  }

  html {
    scroll-padding-top: 90px;
  }
}
@media (max-width: 759px) {
  #course-table,
  #course-table tbody,
  #course-table tr,
  #course-table td {
    display: block;
    width: 100%;
  }
  #course-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #course-table {
    border: 0;
    background: none;
  }
  #course-table tr {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
  }
  #course-table td {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  #course-table td.num {
    display: none;
  }
  #course-table td.desc {
    margin: 12px 0;
  }
  #course-table tr.is-primary {
    background: var(--primary-tint);
    box-shadow: inset 4px 0 0 var(--accent);
  }
  #course-table tr.is-secondary {
    background: var(--secondary-tint);
    box-shadow: inset 4px 0 0 var(--teal);
  }
  .pick-buttons {
    flex-direction: row;
  }
  .pick-buttons button {
    flex: 1 1 0;
  }
}
@media (max-width: 599px) {
  main {
    padding-top: 28px;
  }
  main > section,
  #account-gate > section,
  #account-content > section,
  .legal h2 {
    margin-top: 40px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav a {
    padding: 8px;
  }
  dialog {
    margin-top: 12px;
  }
}
@media (max-width: 419px) {
  .account {
    display: none;
  }
  .topbar-inner {
    gap: 6px;
  }
  .auth button {
    padding-inline: 10px;
  }
}

.rules-notice {
  border-left: 3px solid var(--accent);
  margin-bottom: 32px;
  overflow-anchor: none;
}
.rules-notice button {
  margin-top: 16px;
}
/* After acceptance the notice is only its confirmation line. */
.rules-notice[data-state='accepted'] > :not(#rules-status) {
  display: none;
}
.rules-notice a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
