/* Inter, the face the courses use, served from here. */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-5.2.8.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Nord, like the courses. Light is Snow Storm with Polar Night text; dark is
   the Polar Night theme the courses open in. */
:root {
  color-scheme: light dark;
  --page: #eceff4;
  --surface: #ffffff;
  --sunk: #e5e9f0;
  --line: #d8dee9;
  --line-strong: #c0c8d5;
  --heading: #2e3440;
  --text: #3b4252;
  --muted: #4c566a;
  --meta: #566176;
  --faint: #5c677c;
  --link: #41618c;
  --link-hover: #2e4a6b;
  --eyebrow: #41618c;
  --dot: #5e81ac;
  --button: #41618c;
  --button-hover: #34516f;
  --tile: #2e3440;
  --tile-line: #2e3440;
  --tint: rgb(94 129 172 / 0.14);
  --focus: #41618c;
  --shadow: 0 1px 2px 0 rgb(15 23 42 / 0.05), 0 4px 14px -6px rgb(15 23 42 / 0.12);
  --sky: transparent;
  --grid: rgb(92 103 124 / 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #2e3440;
    --surface: #3b4252;
    --sunk: #434c5e;
    --line: #4c566a;
    --line-strong: #5b677d;
    --heading: #f4f6fa;
    --text: #e5e9f0;
    --muted: #d8dee9;
    --meta: #c8cedb;
    --faint: #b4bdcc;
    --link: #9fc0de;
    --link-hover: #c9ddef;
    --eyebrow: #88c0d0;
    --dot: #88c0d0;
    --tile-line: #4c566a;
    --tint: rgb(94 129 172 / 0.22);
    --focus: #9fc0de;
    --shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.05), 0 1px 2px 0 rgb(0 0 0 / 0.22),
      0 12px 28px -16px rgb(0 0 0 / 0.55);
    --sky: rgb(94 129 172 / 0.1);
    --grid: rgb(180 189 204 / 0.13);
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: var(--line-strong);
    --faint: var(--muted);
    --meta: var(--muted);
  }
}

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

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

body {
  margin: 0;
  font-family: 'Inter Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--page);
  /* One broad, faint light from above the page in dark mode. */
  background-image: radial-gradient(90rem 34rem at 50% -14rem, var(--sky), transparent 72%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--heading);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.375rem;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: inline-block;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}

.skip {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  background: var(--button);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
  color: #fff;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

/* Header and brand lockup */

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  flex: none;
  width: auto;
  height: 2.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
}

.wm-strong {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.wm-soft {
  font-weight: 500;
  color: var(--meta);
}

.brand .wm-strong {
  font-size: 1.25rem;
}

.brand .wm-soft {
  font-size: 0.875rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav {
  display: none;
  gap: 0.25rem;
}

.nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background-color 150ms, color 150ms;
}

.nav a:hover {
  color: var(--heading);
  background-color: var(--sunk);
}

@media (min-width: 40rem) {
  .nav {
    display: flex;
  }
}

/* Opening section. The faint blueprint sheet under it is the courses' own,
   faded out from the top centre so it never shows an edge. */

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(2.25rem, 5vw, 3.25rem);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 0%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 65% at 50% 0%, #000 25%, transparent 78%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--eyebrow);
}

.dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--dot);
}

h1 {
  margin-top: 1rem;
  max-width: 15ch;
  font-size: clamp(2.375rem, 1.45rem + 4.1vw, 4rem);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.lead {
  margin-top: 1.5rem;
  max-width: 40rem;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--muted);
}

@media (min-width: 64rem) {
  .hero-row {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: end;
    gap: 4rem;
  }

  .hero-row .lead {
    margin-top: 0;
    font-size: 1.125rem;
  }
}

.code,
.nowrap {
  white-space: nowrap;
}

/* Sections */

.section {
  padding-block: clamp(2.5rem, 5vw, 3.75rem);
}

.section-courses {
  padding-top: 0.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.section-lead {
  margin-top: 0.75rem;
  max-width: 42rem;
  font-size: 1.0625rem;
  color: var(--muted);
}

/* Course cards */

.courses {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

@media (min-width: 52rem) {
  .courses {
    grid-template-columns: 1fr 1fr;
  }
}

.course {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.course-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* The marks sit on Polar Night in both modes, the way they do as app icons. */
.tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
  background: var(--tile);
  box-shadow: inset 0 0 0 1px var(--tile-line);
}

.tile .mark {
  width: 2.25rem;
  height: 2.25rem;
}

.tile-sm {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
}

.tile-sm .mark {
  width: 1.75rem;
  height: 1.75rem;
}

.tile-exam {
  color: #81a1c1;
}

.tile-exam .icon {
  width: 1.375rem;
  height: 1.375rem;
}

.course-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.375rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.course-name .wm-soft {
  font-size: 1rem;
}

.course-exam {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--faint);
}

.course-desc {
  flex: 1;
  color: var(--muted);
}

.course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* On a phone the two buttons stack at full width rather than wrap unevenly. */
@media (max-width: 30rem) {
  .course-actions .button {
    flex: 1 1 100%;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 1.125rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  background-color: var(--button);
  /* Lit from above, like the course buttons. */
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0) 65%);
  box-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.14), 0 1px 2px 0 rgb(0 0 0 / 0.16);
  transition: background-color 150ms, border-color 150ms, color 150ms, transform 150ms;
}

.button:hover {
  color: #fff;
  background-color: var(--button-hover);
}

.button:active {
  transform: scale(0.98);
}

.button .icon {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform 150ms;
}

.button-quiet {
  color: var(--text);
  background-color: transparent;
  background-image: none;
  border-color: var(--line-strong);
  box-shadow: none;
}

.button-quiet:hover {
  color: var(--heading);
  background-color: var(--sunk);
}

.button-sm {
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
}

@media (hover: hover) {
  .button:hover .icon {
    transform: translateX(2px);
  }
}

/* What every course shares, two by two from tablet width up */

.facts {
  display: grid;
  gap: 1.5rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .facts {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

.facts li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.fact-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--tint);
  color: var(--link);
}

.fact-icon .icon {
  width: 1.375rem;
  height: 1.375rem;
}

.fact-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.facts p {
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* The four steps, in one panel */

.steps {
  display: grid;
  gap: 1.75rem 2rem;
  margin: 2rem 0 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

@media (min-width: 40rem) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

.step-n {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--eyebrow);
}

.step-title {
  margin-top: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.steps p {
  margin-top: 0.375rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* CompTIA's order. A column on a phone, a row from tablet width up. */

.path {
  display: grid;
  gap: 1.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.path-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.path-text {
  display: flex;
  flex-direction: column;
}

.path-cert {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--heading);
}

.path-code {
  font-size: 0.875rem;
  color: var(--faint);
}

.path-course {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.path-arrow {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0.75rem;
  color: var(--meta);
  transform: rotate(90deg);
}

@media (min-width: 52rem) {
  .path {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .path-step {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .path-text {
    align-items: center;
  }

  .path-arrow {
    top: 0.75rem;
    right: -1.625rem;
    left: auto;
    transform: none;
  }
}

/* Who builds it, and the footer */

.section-maker {
  padding-top: 0;
}

.maker {
  max-width: 40rem;
  margin-inline: auto;
  font-size: 0.9375rem;
  text-align: center;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem 2.5rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.brand-sm .brand-mark {
  height: 1.75rem;
}

.brand-sm .wm-strong {
  font-size: 1rem;
}

.brand-sm .wm-soft {
  font-size: 0.8125rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.875rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--heading);
  text-decoration: underline;
}

.legal {
  margin-top: 1.25rem;
  max-width: 48rem;
  font-size: 0.8125rem;
  color: var(--faint);
}

/* A short arrival for the opener and the two courses, nothing after that. */

@media (prefers-reduced-motion: no-preference) {
  .hero-head > *,
  .hero .lead,
  .course {
    animation: rise 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .hero h1 {
    animation-delay: 60ms;
  }

  .hero .lead {
    animation-delay: 120ms;
  }

  .course {
    animation-delay: 180ms;
  }

  .course + .course {
    animation-delay: 240ms;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
