:root {
  color-scheme: dark;
  --paper: #282a2b;
  --ink: #f5f5f2;
  --muted: #e2e2de;
  --line: rgb(255 255 255 / 22%);
  --blue: #c6ddff;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  isolation: isolate;
  background: #242424;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("assets/charcoal-grain.svg"), radial-gradient(ellipse at 50% 15%, rgb(255 255 255 / 5%), transparent 70%);
  background-size: 256px 256px, 100% 100%;
  background-repeat: repeat, no-repeat;
  content: "";
  pointer-events: none;
}

::selection {
  background: #536985;
  color: var(--ink);
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
  border-radius: 4px;
}

.page {
  display: flex;
  flex-direction: column;
  width: min(100% - 48px, 520px);
  min-height: 100svh;
  margin-inline: auto;
  padding-bottom: 48px;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 8px 14px;
  background: var(--paper);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 68px;
  text-align: center;
}

.intro-copy {
  max-width: 100%;
}

.portrait-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin-bottom: 31px;
  overflow: hidden;
  border-radius: 50%;
}

.portrait {
  display: block;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 40%;
  transform: translate(6%, 5%) scale(1.6);
  transform-origin: 44% 34%;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 43px);
  font-weight: 600;
  letter-spacing: -1.6px;
  line-height: 1.2;
}

.role-lines {
  margin-top: 12px;
}

.role-line {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.role-appointment {
  white-space: nowrap;
}

.role-link {
  white-space: nowrap;
  text-decoration-color: rgb(198 221 255 / 55%);
}

.role-link:hover,
.role-link:focus-visible {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.social-links {
  position: relative;
  margin-top: 23px;
}

.social-footer {
  align-self: center;
  margin-top: auto;
}

.social-footer .link-preview {
  top: auto;
  bottom: calc(100% + 12px);
}

.social-footer .link-preview::before {
  top: auto;
  bottom: -13px;
}

.social-links ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.social-link {
  position: static;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.social-icon {
  display: block;
  flex-shrink: 0;
}

.github-icon,
.x-icon,
.medium-icon {
  filter: invert(1);
}

.hindra-icon,
.rankd-icon {
  outline: 1px solid rgb(255 255 255 / 28%);
  outline-offset: 1px;
  border-radius: 50%;
}

.rankd-icon {
  border-radius: 7px;
}

.social-link:hover,
.social-link:focus-visible {
  background-color: rgb(255 255 255 / 9%);
}

.social-link:active {
  background-color: rgb(255 255 255 / 15%);
}

.link-preview {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 10;
  display: block;
  width: min(300px, calc(100vw - 40px));
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 20px rgb(0 0 0 / 25%);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
}

/* Keep the gap hoverable so the pointer can reach the preview. */
.link-preview::before {
  position: absolute;
  top: -13px;
  right: 0;
  left: 0;
  height: 13px;
  content: "";
}

.social-link:hover .link-preview,
.social-link:focus-visible .link-preview,
.role-link:hover .link-preview,
.role-link:focus-visible .link-preview {
  opacity: 1;
  visibility: visible;
}

.social-link:hover .link-preview,
.role-link:hover .link-preview {
  z-index: 20;
}

.role-preview {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(280px, calc(100vw - 40px));
  padding: 16px;
  white-space: normal;
}

.role-logo {
  flex-shrink: 0;
  margin-top: 2px;
}

.role-preview-copy {
  display: block;
  flex: 1;
  min-width: 0;
}

.preview-shot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  border-bottom: 1px solid var(--line);
  border-radius: 9px 9px 0 0;
  object-fit: cover;
  background: white;
}

.preview-copy {
  display: block;
  padding: 13px 15px 15px;
}

.preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.preview-arrow {
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
}

.preview-domain {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
}

.preview-description {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.text-section {
  max-width: 38ch;
  margin: 40px auto 0;
  padding-bottom: 36px;
  line-height: 1.8;
}

.section-content p {
  margin: 0;
}

.section-content p + p {
  margin-top: 16px;
}

/* One short arrival; individual elements keep their positions. */
@media (prefers-reduced-motion: no-preference) {
  .page {
    animation: page-fade 250ms ease-out;
  }

  .social-link {
    transition: background-color 140ms ease-out;
  }

  .role-link {
    transition: color 140ms ease-out;
  }

  .link-preview {
    transition: opacity 100ms ease-out, visibility 0s linear 100ms;
  }

  .social-link:hover .link-preview,
  .role-link:hover .link-preview {
    transition-delay: 80ms;
  }

  .social-link:focus-visible .link-preview,
  .role-link:focus-visible .link-preview {
    transition-delay: 0ms;
  }
}

@keyframes page-fade {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

@media (max-width: 600px) {
  .intro {
    padding-top: 42px;
  }

  .portrait-frame {
    width: 110px;
    height: 110px;
    margin-bottom: 26px;
  }

  .portrait {
    width: 110px;
    height: 110px;
  }

  h1 {
    font-size: clamp(28px, 7.8vw, 39px);
    letter-spacing: -1px;
  }

  .role-line {
    font-size: 14px;
  }

  .social-links ul {
    gap: 8px;
  }

  .social-link {
    width: 48px;
    height: 48px;
  }

  .text-section {
    margin-top: 32px;
    padding-bottom: 28px;
  }
}

@media (max-width: 400px) {
  .role-separator {
    display: none;
  }

  .role-appointment {
    display: block;
    margin-top: 4px;
    white-space: normal;
  }
}

@media (hover: none) {
  .social-link:hover .link-preview,
  .role-link:hover .link-preview {
    opacity: 0;
    visibility: hidden;
  }

  .social-link:focus-visible .link-preview,
  .role-link:focus-visible .link-preview {
    opacity: 1;
    visibility: visible;
  }
}

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

@media print {
  body {
    background: white;
    color: black;
  }

  body::before {
    display: none;
  }

  :root {
    --paper: white;
    --ink: black;
    --muted: #444;
    --line: #ccc;
    --blue: #2456a6;
  }

  .social-icon {
    filter: none;
  }

  .page {
    width: 100%;
    min-height: auto;
  }

  .skip-link,
  .link-preview {
    display: none;
  }

  .intro {
    padding-top: 0;
  }

  .text-section {
    break-inside: avoid;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
