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

@font-face {
  font-family: Sora;
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("/assets/fonts/sora-latin-wght-normal.woff2") format("woff2");
}

:root {
  --bg: #f7f7f8;
  --text: #1d2330;
  --muted: #626b7c;
  --line: #d8dde7;
  --accent-1: #c72c5b;
  --accent-2: #007b76;
  --accent-3: #a85c00;
  --accent-4: #2563eb;
  --accent-5: #6d3fd1;
  --highlight-ink: #fff;
  --shape-fill-opacity: 0.065;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #11141b;
  --text: #e8edf8;
  --muted: #aeb9cf;
  --line: #333a4a;
  --accent-1: #ff7ca8;
  --accent-2: #2dd6cd;
  --accent-3: #ffb454;
  --accent-4: #7ab4ff;
  --accent-5: #b59aff;
  --highlight-ink: #0f131b;
  --shape-fill-opacity: 0.08;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, "Segoe UI", sans-serif;
  line-height: 1.7;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.ambient-shapes {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-shape {
  --shape-color: var(--accent-1);
  --shape-rotation: 0deg;
  --shape-rotation-end: 3deg;
  --float-duration: 18s;
  --float-delay: 0s;

  position: absolute;
  display: block;
}

.ambient-shape::before {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  animation: shape-float var(--float-duration) ease-in-out var(--float-delay)
    infinite alternate;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.ambient-shape-circle::before {
  background-color: var(--shape-color);
  border-radius: 50%;
  opacity: var(--shape-fill-opacity);
}

.ambient-shape-triangle::before {
  background-color: var(--shape-color);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: var(--shape-fill-opacity);
}

.ambient-shape-square::before {
  background-color: var(--shape-color);
  border-radius: 0.2rem;
  opacity: var(--shape-fill-opacity);
}

.ambient-shape-1 {
  top: clamp(-8rem, -5vw, -3.5rem);
  right: clamp(-10rem, -7vw, -5rem);
  width: clamp(15rem, 24vw, 27rem);
  aspect-ratio: 0.92;

  --shape-color: var(--accent-1);
  --shape-rotation: -10deg;
  --shape-rotation-end: -6deg;
  --float-duration: 22s;
  --float-delay: -7s;
}

.ambient-shape-2 {
  top: 43%;
  left: clamp(-18rem, -15vw, -9rem);
  width: clamp(16rem, 26vw, 27rem);
  aspect-ratio: 1;

  --shape-color: var(--accent-2);
  --shape-rotation: 2deg;
  --shape-rotation-end: -2deg;
  --float-duration: 19s;
  --float-delay: -12s;
}

.ambient-shape-3 {
  right: -4rem;
  bottom: 7%;
  width: clamp(8rem, 12vw, 12rem);
  aspect-ratio: 1;

  --shape-color: var(--accent-4);
  --shape-rotation: 13deg;
  --shape-rotation-end: 8deg;
  --float-duration: 16s;
  --float-delay: -4s;
}

.ambient-shape-4,
.ambient-shape-5,
.ambient-shape-6 {
  display: none;
}

.card {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  margin: auto;
  padding: clamp(0.9rem, 2.4vh, 1.8rem) 1.25rem clamp(1.4rem, 3.4vh, 3rem);
}

.card-compact {
  max-width: 42rem;
}

.error-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.error-code {
  margin: 0 0 0.35rem;
  color: var(--accent-2);
  font-family: Sora, Manrope, sans-serif;
  font-size: clamp(4.5rem, 14vw, 7.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.lead {
  margin: 1rem 0 1.5rem;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.1rem;
}

.button-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0.55rem 1rem;
  border: 1px solid currentcolor;
  border-radius: 999px;
  font-weight: 600;
}

.header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-bottom: 1.35rem;
}

.language-menu {
  position: relative;
  height: 2.75rem;
}

.language-menu > summary,
.theme-toggle {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.language-menu > summary {
  list-style: none;
  font-family: Sora, Manrope, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.language-menu > summary::-webkit-details-marker {
  display: none;
}

.theme-toggle {
  visibility: hidden;
  font-size: 1rem;
}

:where(html[data-theme-source]) .theme-toggle {
  visibility: visible;
}

.language-menu > summary:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-4);
  outline-offset: 2px;
}

.language-menu[open] > summary {
  border-color: var(--text);
}

.language-options {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 8.25rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--bg);
  box-shadow: 0 0.8rem 2rem rgb(15 19 27 / 14%);
}

.toggle-icon {
  width: 1rem;
  height: 1rem;
  display: block;
  stroke: currentcolor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sun {
  display: none;
}

html[data-theme="dark"] .icon-sun {
  display: block;
}

html[data-theme="dark"] .icon-moon {
  display: none;
}

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

h1,
h2 {
  font-family: inherit;
  margin: 0;
  font-weight: 600;
}

h1 {
  font-family: Sora, Manrope, sans-serif;
  font-size: clamp(2.55rem, 6vw, 3.8rem);
  line-height: 1.1;
  color: var(--accent-1);
  letter-spacing: -0.02em;
}

.error-page h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
}

.error-page .button-link {
  margin-top: 0.35rem;
  align-self: flex-start;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.error-page .button-link:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-1px);
}

.intro {
  margin-bottom: 0.4rem;
}

.subtitle {
  min-height: 1.8em;
  margin: 0.7rem 0 0;
  color: var(--text);
  font-size: 1.03rem;
}

.subtitle-role {
  color: var(--accent-5);
  font-weight: 600;
}

.typed {
  color: var(--text);
  font-weight: 500;
}

.typewriter {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.typewriter:disabled {
  cursor: default;
}

.caret {
  display: inline-block;
  width: 0.09em;
  height: 1em;
  margin-left: 0.14em;
  background: var(--text);
  transform: translateY(0.1em);
  animation: blink 0.9s steps(1, end) infinite;
}

.typewriter[data-paused="true"] .caret {
  animation: none;
  opacity: 1;
}

.bio {
  margin-top: 2.45rem;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 1rem;
  color: var(--accent-2);
}

.bio p {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

a {
  color: var(--accent-5);
  text-decoration: none;
  border-bottom: 1px solid currentcolor;
}

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

.language-options a {
  display: flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.38rem 0.65rem;
  border: 0;
  border-radius: 0.62rem;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}

.language-options a[aria-current="page"] {
  background: var(--line);
}

.language-options a[aria-current="page"]::after {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--accent-1);
  content: "";
}

.highlight {
  --highlight-color: currentcolor;

  font-weight: 500;
  color: var(--highlight-color);
  padding: 0 0.08em;
  border-radius: 0.18em;
  background-image: linear-gradient(
    var(--highlight-color),
    var(--highlight-color)
  );
  background-repeat: no-repeat;
  background-size: 100% 0.12em;
  background-position: 0 100%;
  box-decoration-break: clone;
  transition:
    background-size 0.24s ease,
    color 0.24s ease;
}

.highlight-pink {
  --highlight-color: var(--accent-1);
}

.highlight-orange {
  --highlight-color: var(--accent-3);
}

.highlight-blue {
  --highlight-color: var(--accent-4);
}

@media (hover: hover) {
  .language-menu > summary:hover,
  .theme-toggle:hover {
    border-color: var(--text);
    transform: translateY(-1px);
  }

  a:hover {
    color: var(--accent-2);
  }

  .language-options a:hover {
    background: var(--line);
  }

  .highlight:hover {
    background-size: 100% 100%;
    color: var(--highlight-ink);
  }
}

@keyframes blink {
  0%,
  48% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes shape-float {
  from {
    transform: translate3d(-0.35rem, 0.3rem, 0) rotate(var(--shape-rotation));
  }

  to {
    transform: translate3d(0.55rem, -0.65rem, 0)
      rotate(var(--shape-rotation-end));
  }
}

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

  .caret {
    display: none;
  }

  .ambient-shape::before {
    animation: none;
    transition: none;
  }
}

@media (width >= 72rem) {
  .ambient-shape-4,
  .ambient-shape-5,
  .ambient-shape-6 {
    display: block;
  }

  .ambient-shape-4 {
    top: 15%;
    left: 7%;
    width: clamp(2.75rem, 4vw, 4rem);
    aspect-ratio: 1;

    --shape-color: var(--accent-3);
    --shape-rotation: 0deg;
    --shape-rotation-end: 5deg;
    --float-duration: 14s;
    --float-delay: -9s;
  }

  .ambient-shape-5 {
    bottom: 13%;
    left: 8%;
    width: clamp(4rem, 6vw, 6rem);
    aspect-ratio: 1.05;

    --shape-color: var(--accent-5);
    --shape-rotation: -14deg;
    --shape-rotation-end: -9deg;
    --float-duration: 17s;
    --float-delay: -2s;
  }

  .ambient-shape-6 {
    top: 48%;
    right: 6%;
    width: clamp(3.75rem, 5.5vw, 5.5rem);
    aspect-ratio: 1;

    --shape-color: var(--accent-3);
    --shape-rotation: -8deg;
    --shape-rotation-end: -13deg;
    --float-duration: 15s;
    --float-delay: -11s;
  }
}

@media (width <= 640px) {
  .ambient-shape-1 {
    top: -4rem;
    right: -6rem;
    width: 11rem;
  }

  .ambient-shape-2 {
    top: 58%;
    left: -10rem;
    width: 13rem;
  }

  .ambient-shape-3 {
    right: -3.5rem;
    bottom: 8%;
    width: 7rem;
  }

  .card {
    padding-top: 1rem;
  }

  .header {
    margin-bottom: 1.1rem;
  }

  .subtitle {
    min-height: 3.4em;
  }
}
