:root {
  color-scheme: dark;
  --font-heading:
    "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-body:
    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --bg: #050505;
  --text: #f7f7f2;
  --muted: #9b9b94;
  --subtle: #161616;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --shadow: rgba(0, 0, 0, 0.36);
  --toggle-bg: rgba(255, 255, 255, 0.06);
  --toggle-thumb: #f7f7f2;
  --focus: #d8d8d0;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f0e8;
  --text: #211f1c;
  --muted: #746c61;
  --subtle: #ebe3d8;
  --line: rgba(33, 31, 28, 0.13);
  --line-strong: rgba(33, 31, 28, 0.24);
  --shadow: rgba(72, 55, 35, 0.1);
  --toggle-bg: rgba(33, 31, 28, 0.06);
  --toggle-thumb: #211f1c;
  --focus: #5d564c;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(
      circle at 50% 0%,
      color-mix(in srgb, var(--text) 5%, transparent),
      transparent 34rem
    ),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 360ms ease,
    color 360ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image: linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 9.25rem;
  opacity: 0.16;
  transition: opacity 360ms ease;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-1rem);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.site-shell {
  position: relative;
  overflow: hidden;
  padding-block: 6rem;
}

.hero {
  animation: pageIn 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__inner {
  max-width: 58rem;
}

.hero__title {
  position: relative;
  display: inline-block;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 5vw, 3.9rem);
  font-weight: 100;
  line-height: 0.91;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero__title-word {
  display: inline-block;
  white-space: nowrap;
}

.hero__title-space {
  display: inline-block;
  width: 0.32em;
}

.hero__title-letter {
  display: inline-block;
  transform: translate3d(0, 0, 0);
  transform-origin: center;
  will-change: transform;
}

.hero__role {
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 500;
  line-height: 1.4;
}

.social-nav {
  opacity: 0;
  animation: fadeUp 680ms cubic-bezier(0.22, 1, 0.36, 1) 180ms forwards;
}

.icon-link {
  display: inline-grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--subtle) 78%, transparent);
  color: var(--text);
  box-shadow: 0 1rem 2.5rem var(--shadow);
  text-decoration: none;
  transition:
    background-color 260ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease,
    color 260ms ease,
    transform 260ms ease;
}

.icon-link svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  transition: transform 260ms ease;
}

.icon-link:hover {
  border-color: var(--line-strong);
  background: var(--text);
  color: var(--bg);
  transform: translateY(-0.35rem);
}

.icon-link:hover svg {
  transform: scale(1.08);
}

.icon-link:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0.35rem;
}

.theme-toggle {
  position: fixed;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  z-index: 10;
  width: 4.9rem;
  height: 2.55rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--text);
  box-shadow: 0 1rem 2.25rem var(--shadow);
  backdrop-filter: blur(18px);
  transition:
    background-color 300ms ease,
    border-color 300ms ease,
    box-shadow 300ms ease,
    transform 300ms ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  transform: translateY(-0.12rem);
}

.theme-toggle__track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  height: 100%;
  padding-inline: 0.5rem;
}

.theme-toggle__thumb {
  position: absolute;
  top: 0.35rem;
  left: 0.38rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--toggle-thumb);
  box-shadow: 0 0.45rem 1.1rem var(--shadow);
  transition:
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 300ms ease;
}

.theme-toggle__icon {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.theme-toggle__icon svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle__icon--moon svg {
  fill: currentColor;
  stroke: none;
}

[data-theme="light"] .theme-toggle__thumb {
  transform: translateX(2.32rem);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 575.98px) {
  .site-shell {
    padding-block: 5.5rem 4rem;
  }

  .hero__title {
    font-size: clamp(2.3rem, 9vw, 3.2rem);
  }

  .icon-link {
    width: 3rem;
    height: 3rem;
  }

  .theme-toggle {
    width: 4.45rem;
    height: 2.35rem;
  }

  .theme-toggle__thumb {
    width: 1.58rem;
    height: 1.58rem;
  }

  [data-theme="light"] .theme-toggle__thumb {
    transform: translateX(2.05rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
