@font-face {
  font-family: "Plex Sans";
  src: url("assets/fonts/plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Plex Sans";
  src: url("assets/fonts/plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Caveat;
  src: url("assets/fonts/caveat-latin-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --paper: #0c0b0a;
  --ink: #edeae4;
  --ink-soft: #aaa69e;
  --accent: #c7b99f;
  --rule: #302d28;
  --surface: #151411;

  --text: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 38rem;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --page: 56rem;
  --space: clamp(2.5rem, 5vw, 3.5rem);
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
  background-image: url("assets/sky-desktop.webp");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 1600px 480px;
}

.sky {
  position: absolute;
  inset: 0 0 auto;
  height: clamp(320px, 52vh, 480px);
  overflow: hidden;
  pointer-events: none;
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
  mask-image: linear-gradient(#000 55%, transparent);
}

.sky canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

html.sky-ready {
  background-image: none;
}

.masthead,
main,
.footer {
  position: relative;
}

body {
  margin: 0;
  padding: 0 var(--gutter);
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  color: var(--ink);
  font: 400 1rem/1.65 var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
  transition: color 160ms ease, text-decoration-thickness 160ms ease;
}

a:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

code {
  font: inherit;
  font-size: 0.94em;
  background: var(--surface);
  padding: 0.05em 0.3em;
}

.skip {
  position: absolute;
  left: -999rem;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
}

.skip:focus {
  left: 0;
  z-index: 10;
}

main:focus {
  outline: none;
}

/* Masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 2rem;
  padding: 1.5rem 0 1rem;
}

.sky-toggle {
  margin-right: auto;
  padding: 0.25rem 0;
  min-height: 2.75rem;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.sky-toggle:hover {
  color: var(--ink);
}

.masthead__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  font-size: 0.9375rem;
}

.masthead__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  position: relative;
  padding-bottom: 0.2rem;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 160ms ease;
}

.masthead__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.masthead__nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.masthead__nav a:hover::after,
.masthead__nav a:focus-visible::after {
  transform: scaleX(1);
}

/* Intro */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 0 clamp(2rem, 5vw, 4rem);
  padding: clamp(4rem, 9vw, 7rem) 0 var(--space);
  align-items: start;
}

.intro__name {
  grid-column: 1 / -1;
  margin: 0;
  max-width: 14em;
  font: 600 clamp(2.25rem, 5vw, 3.25rem) / 1.1 var(--text);
  letter-spacing: -0.025em;
  text-box: trim-start cap alphabetic;
}

.intro__text {
  grid-column: 1;
}

.intro__role {
  color: #c0c7d0;
  transform-origin: 0 center;
  font-family: Caveat, cursive;
  font-size: 26px;
  font-size-adjust: from-font;
  font-weight: 400;
  line-height: 1;
  display: inline-block;
  transform: rotate(-1.4deg);
  margin: 13px 0 22px;
  text-box: trim-start cap alphabetic;
}

.intro__lede {
  margin: 0;
  max-width: 32rem;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.intro__facts {
  margin: 0;
  grid-column: 2;
  font-size: 0.9375rem;
}

.intro__facts div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.intro__facts div:first-child {
  border-top: 1px solid var(--rule);
}

.intro__facts dt {
  color: var(--ink-soft);
}

.intro__facts dd {
  margin: 0;
}

/* Sections */

.section {
  padding: var(--space) 0;
  border-top: 1px solid var(--rule);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.section__head h2 {
  margin: 0;
  font: 600 1.125rem / 1.4 var(--text);
  color: var(--ink-soft);
  letter-spacing: -0.015em;
}

.section__head h2 a {
  color: inherit;
}

.section__head h2 a:hover {
  color: var(--accent);
}

.section__note {
  margin: 0;
  max-width: 26rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* Projects */

.project {
  padding-top: clamp(1.75rem, 4vw, 2.5rem);
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  border-top: 1px solid var(--rule);
}

.project:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.project__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.65rem;
  margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
}

.project__head h3 {
  margin: 0;
  font: 600 clamp(1.1875rem, 2vw, 1.4375rem) / 1.2 var(--text);
  letter-spacing: -0.015em;
}

.project__head h3 a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.project__body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.project__copy p {
  margin: 0 0 1rem;
  max-width: var(--measure);
  color: var(--ink-soft);
}

.project__copy > :last-child {
  margin-bottom: 0;
}

.project__facts,
.about__facts {
  margin: 1.5rem 0;
  max-width: var(--measure);
}

.project__facts {
  margin-top: 0;
  font-size: 0.9375rem;
}

.project__facts div,
.about__facts div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
}

.project__facts dt,
.about__facts dt {
  color: var(--ink-soft);
}

.project__facts dd,
.about__facts dd {
  margin: 0;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.5rem;
  padding: 0.08rem 0.42rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-soft);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  vertical-align: 0.06em;
  transition: color 160ms ease, border-color 160ms ease;
}

.stars:empty {
  display: none;
}

.stars__icon {
  width: 0.68rem;
  height: 0.68rem;
  fill: currentColor;
}

.stars:hover {
  color: var(--accent);
  border-color: currentColor;
}

/* GitHub panel */

.callout {
  position: relative;
  overflow: hidden;
  margin: var(--space) 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 1rem;
}

.callout__inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  padding: clamp(2rem, 5vw, 3.25rem);
}

.callout h2 {
  margin: 0 0 0.75rem;
  font: 600 clamp(1.6rem, 3vw, 2.125rem) / 1.1 var(--text);
  letter-spacing: -0.015em;
}

.callout p {
  margin: 0 0 1.6rem;
  max-width: 32rem;
  color: var(--ink-soft);
}

.callout__link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* About */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.25rem clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about__lede {
  margin: 0 0 1rem;
  max-width: 30rem;
  font-size: 1.25rem;
  line-height: 1.45;
}

.about__copy p {
  margin: 0 0 1rem;
  max-width: var(--measure);
}

.about__facts {
  margin-top: 0.35rem;
}

/* TryHackMe figures, cached at build time */

.thm__updated {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.thm__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.thm__stats div {
  padding-top: 0.5rem;
}

.thm__stats dt {
  margin-bottom: 0.15rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.thm__stats dd {
  margin: 0;
  font-weight: 600;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.certs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.certs__list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14rem;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.certs__issuer {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* Contact */

.section--contact {
  border-top: 1px solid var(--rule);
}

.contact__lede {
  margin: 0 0 1.5rem;
  max-width: 30rem;
  font-size: 1.125rem;
}

.contact__email {
  margin: 0 0 clamp(2rem, 5vw, 2.75rem);
  font: 600 clamp(1.15rem, 5.5vw, 2rem) / 1.2 var(--text);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.contact__email a {
  text-decoration-thickness: 0.045em;
  text-decoration-color: var(--accent);
}

.contact__elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem clamp(2rem, 6vw, 4.5rem);
  margin: 0;
  font-size: 0.9375rem;
}

.contact__elsewhere dt {
  color: var(--ink-soft);
  margin-bottom: 0.15rem;
}

.contact__elsewhere dd {
  margin: 0;
}

.profile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  text-decoration: none;
}

.profile__icon {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
  color: var(--ink-soft);
  transition: color 160ms ease, transform 160ms ease;
}

.profile span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 160ms ease;
}

.profile:hover {
  color: var(--ink);
}

.profile__icon--thm {
  display: inline-block;
  width: 1.55em;
  height: 1.55em;
  background: currentColor;
  -webkit-mask: url("assets/tryhackme.svg") center / contain no-repeat;
  mask: url("assets/tryhackme.svg") center / contain no-repeat;
}

.profile:hover .profile__icon {
  color: var(--accent);
  transform: translateY(-1px);
}

.profile:hover .profile__icon--thm {
  color: var(--ink-soft);
}

.profile:hover span {
  text-decoration-color: var(--accent);
}

/* Footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: var(--space) 0 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

/* Small screens */

@media (max-width: 860px) {
  .intro,
  .about,
  .project__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .intro__name,
  .intro__text,
  .intro__facts {
    grid-column: 1;
  }

  .intro__facts {
    margin-top: 0.5rem;
  }

}

@media (max-width: 560px) {
  .sky {
    height: 300px;
    contain-intrinsic-size: auto 300px;
  }

  html {
    background-image: url("assets/sky-mobile.webp");
    background-size: 390px 300px;
  }

  .masthead__nav {
    gap: 0.1rem 1.1rem;
    font-size: 0.875rem;
  }

  .project__facts div,
  .about__facts div,
  .intro__facts div {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.75rem;
  }

  .certs__list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .contact__elsewhere {
    gap: 1.25rem 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .profile:hover .profile__icon {
    transform: none;
  }

  .masthead__nav a::after {
    transition: none;
  }
}
