/* The webfont is loaded via <link> in index.html — an @import here would make
   the browser wait for style.css to parse before even starting the font
   request, delaying first paint of every bit of text on the page. */

@font-face {
  font-family: "Elegant Display";
  src: local("Elegant Display"), local("ElegantDisplay");
  font-display: swap;
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--grainient-2);
}

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

body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "Elegant Display", "Questrial", sans-serif;
  font-feature-settings: "rlig" 1, "calt" 1;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video,
svg,
iframe {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 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;
}

.font-mono {
  font-family: "Elegant Display", "Questrial", sans-serif;
}

.font-elegant-display {
  font-family: "Elegant Display", "Questrial", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ==========================================================================
   Layout
   ========================================================================== */

main {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
}

main > :not(.viewport-background) {
  position: relative;
  z-index: 1;
}

.section {
  padding: 5rem 1rem;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 4rem;
  text-align: center;
}

.section-heading h2 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.subsection-heading {
  margin-bottom: 2rem;
  text-align: center;
}

.subsection-heading h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ==========================================================================
   Animated background (WebGL Grainient)
   ========================================================================== */

.viewport-background {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) * -1);
  right: calc(env(safe-area-inset-right, 0px) * -1);
  bottom: calc(env(safe-area-inset-bottom, 0px) * -1);
  left: calc(env(safe-area-inset-left, 0px) * -1);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.grainient-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.grainient-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Static fallback when WebGL2 is unavailable. */
.grainient-container[data-fallback="true"] {
  background:
    radial-gradient(120% 90% at 18% 8%, var(--grainient-1) 0%, transparent 46%),
    radial-gradient(120% 90% at 84% 100%, var(--grainient-3) 0%, transparent 52%),
    var(--grainient-2);
}

@media (max-width: 767px) {
  .viewport-background {
    top: calc(max(72px, env(safe-area-inset-top, 0px)) * -1);
    right: -32px;
    bottom: calc(max(168px, env(safe-area-inset-bottom, 0px)) * -1);
    left: -32px;
  }
}

/* ==========================================================================
   Adaptive tone — text flips light/dark based on the gradient beneath it
   ========================================================================== */

.adaptive-tone {
  transition: color 180ms ease;
}

.adaptive-tone--light {
  color: rgba(255, 255, 255, 0.94);
}

.adaptive-tone--dark {
  color: rgba(15, 23, 42, 0.92);
}

.adaptive-tone--light .muted {
  color: rgba(255, 255, 255, 0.72);
}

.adaptive-tone--dark .muted {
  color: rgba(15, 23, 42, 0.68);
}

.adaptive-tone--light .adaptive-border {
  border-color: rgba(255, 255, 255, 0.18);
}

.adaptive-tone--dark .adaptive-border {
  border-color: rgba(15, 23, 42, 0.18);
}

.adaptive-tone--light .adaptive-link {
  color: rgba(255, 255, 255, 0.92);
}

.adaptive-tone--dark .adaptive-link {
  color: rgba(15, 23, 42, 0.9);
}

.adaptive-tone--light .adaptive-link:hover {
  color: rgba(255, 255, 255, 1);
}

.adaptive-tone--dark .adaptive-link:hover {
  color: rgba(15, 23, 42, 1);
}

.adaptive-link {
  transition: color 200ms ease;
}

.muted {
  color: hsl(var(--muted-foreground));
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease,
    border-color 200ms ease, opacity 200ms ease;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn--primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn--primary:hover {
  background: hsl(var(--primary) / 0.9);
}

.btn--outline {
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
}

.btn--outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn--ghost {
  background: transparent;
}

.btn--ghost:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn--lg {
  height: 2.75rem;
  padding: 0 2rem;
}

.btn--sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
}

.btn--icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 9999px;
}

.btn--pill {
  height: 2.25rem;
  padding: 0 1rem;
  font-weight: 600;
  color: #000;
  background: #fff;
  border-radius: 9999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 12px 24px rgba(0, 0, 0, 0.22);
}

.btn--pill:hover {
  color: #000;
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.02);
}

.icon {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.icon--md {
  width: 1.25rem;
  height: 1.25rem;
}

.icon--lg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ==========================================================================
   Navigation — floating glass island
   ========================================================================== */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 1rem;
  z-index: 50;
  padding: 0 1rem;
  pointer-events: none;
}

.site-header__inner {
  max-width: 80rem;
  margin: 0 auto;
}

.nav-island,
.nav-mobile-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.05) 38%,
    rgba(255, 255, 255, 0.03) 100%
  );
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.nav-island::before,
.nav-mobile-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.78;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.18), transparent 32%),
    radial-gradient(circle at 82% 120%, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 58%);
}

.nav-island::after,
.nav-mobile-panel::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  pointer-events: none;
}

.nav-island--desktop {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: box-shadow 300ms ease;
}

.nav-island--desktop[data-scrolled="true"] {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nav-island--mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  border-radius: 28px;
}

.nav-brand {
  display: flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 0.875rem;
  text-align: left;
  border-radius: 9999px;
  transition: background-color 300ms ease;
}

.nav-brand:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-brand-text {
  color: rgba(255, 255, 255, 0.92);
  font-family: "Elegant Display", "Questrial", sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  min-width: 13ch;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.nav-link-button {
  position: relative;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 9999px;
  transition: background-color 300ms ease, color 300ms ease;
}

.nav-link-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link-button::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 8px;
  left: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.72);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms ease;
}

.nav-link-button:hover::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
}

.nav-icon-button {
  width: 2.25rem;
  height: 2.25rem;
  color: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 9999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 300ms ease, color 300ms ease;
}

.nav-icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-mobile-panel {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 28px;
}

.nav-mobile-panel[hidden] {
  display: none;
}

.nav-mobile-panel nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-mobile-panel .nav-link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.84);
}

@media (min-width: 768px) {
  .site-header {
    top: 1.25rem;
  }

  .nav-island--desktop {
    display: grid;
    grid-template-columns: minmax(0, 220px) 1fr auto;
  }

  .nav-island--mobile,
  .nav-mobile-panel {
    display: none;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0 1rem;
  overflow: hidden;
}

.hero__inner {
  z-index: 1;
  max-width: 56rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.hero__subtitle {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 5rem;
  margin: 0 auto 2rem;
  text-align: center;
}

.hero__subtitle-line {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.625;
}

/* Caret sits tight against the last typed character. It blinks only while the
   phrase is resting, so it stays solid during typing and deleting. */
.hero__caret {
  display: inline-block;
  width: 1px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: currentColor;
}

.hero__caret[data-resting="true"] {
  animation: caret-blink 1s steps(1, end) infinite;
}

@keyframes caret-blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.hero__scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 1s infinite;
}

@media (min-width: 768px) {
  .hero__subtitle {
    min-height: 3.5rem;
  }

  .hero__subtitle-line {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   About
   ========================================================================== */

.about__grid {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.about__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  height: 100%;
}

.about__copy p {
  font-size: 1.125rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.about__copy p + p {
  margin-top: 1.5rem;
}

.about__media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 1rem;
  background: hsl(var(--secondary) / 0.2);
}

.about__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: var(--image-grade);
  opacity: 0;
  transition: opacity 1800ms ease-in-out;
}

.about__media img[data-active="true"] {
  opacity: 1;
}

.about__media-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.about__media-empty p:first-child {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.about__media-empty p:last-child {
  font-size: 0.8125rem;
}

.about__media-empty code {
  padding: 0.1rem 0.3rem;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

@media (min-width: 768px) {
  .about__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: stretch;
  }

  .about__copy p {
    text-align: justify;
    hyphens: auto;
    text-align-last: left;
  }
}

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline-item {
  display: grid;
  grid-template-columns: 60px 3px 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  opacity: 0;
}

.timeline-item[data-visible="true"] {
  animation: fade-in 500ms ease-out forwards;
}

.timeline-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
}

.timeline-item__date {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  border-radius: 2px;
}

.timeline-item__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.5rem;
  padding: 0.25rem;
  background: hsl(var(--secondary));
  border-radius: calc(var(--radius) - 2px);
  transition: transform 300ms ease;
}

.timeline-item:hover .timeline-item__logo {
  transform: scale(1.05);
}

.timeline-item__logo img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.6;
  transition: filter 500ms ease-in-out, opacity 500ms ease-in-out;
}

.timeline-item:hover .timeline-item__logo img {
  filter: grayscale(0);
  opacity: 1;
}

.timeline-item__rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.timeline-item__rail span {
  width: 3px;
  height: 100%;
  margin-top: 6px;
  background: hsl(var(--muted));
}

.timeline-item__body {
  position: relative;
  padding: 0.5rem;
  margin: -0.5rem;
  border-radius: var(--radius);
  transform: translateY(1rem);
  opacity: 0;
  transition: transform 500ms ease, opacity 500ms ease, background-color 300ms ease;
}

.timeline-item[data-visible="true"] .timeline-item__body {
  transform: translateY(0);
  opacity: 1;
}

.timeline-item__body:hover {
  background: hsl(var(--muted) / 0.1);
}

.timeline-item__body h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.timeline-item__subtitle {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-underline-offset: 4px;
}

a.timeline-item__subtitle:hover {
  text-decoration: underline;
}

.timeline-item__location {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.timeline-item__location > div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.timeline-item__location .icon {
  width: 0.75rem;
  height: 0.75rem;
}

.timeline-item__chevron {
  margin-top: 0.25rem;
}

.timeline-item__chevron .icon {
  width: 1rem;
  height: 1rem;
  transition: transform 300ms ease;
}

.timeline-item[data-expanded="true"] .timeline-item__chevron .icon {
  transform: rotate(180deg);
}

.timeline-item__hint {
  font-size: 0.625rem;
}

.timeline-item__detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 500ms ease-in-out, opacity 500ms ease-in-out;
}

.timeline-item[data-expanded="true"] .timeline-item__detail {
  max-height: 40rem;
  opacity: 1;
}

.timeline-item__detail-inner {
  padding-top: 0.5rem;
  font-size: 0.875rem;
  text-wrap: pretty;
}

.timeline-item__detail-inner li {
  position: relative;
  padding-left: 1rem;
}

.timeline-item__detail-inner li + li {
  margin-top: 0.375rem;
}

.timeline-item__detail-inner li::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: 0.125rem;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.55;
}

@media (min-width: 768px) {
  .timeline-item {
    grid-template-columns: 1fr 3px 3fr;
    gap: 2rem;
  }

  .timeline-item__date {
    font-size: 1rem;
  }

  .timeline-item__detail-inner {
    text-align: justify;
    hyphens: auto;
    text-align-last: left;
  }
}

/* ==========================================================================
   Project cards
   ========================================================================== */

.projects__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: -2rem 0 2.5rem;
}

.filter-chip {
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease;
}

.filter-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.filter-chip[aria-pressed="true"] {
  color: #000;
  background: #fff;
  border-color: transparent;
}

.projects__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: hsl(var(--card-foreground));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  opacity: 0;
  animation: fade-in 500ms ease-out forwards;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.project-card:hover {
  transform: scale(1.01);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.project-card[hidden] {
  display: none;
}

.project-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: hsl(var(--secondary));
}

.project-card__media img,
.project-card__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.project-card:hover .project-card__media img,
.project-card:hover .project-card__media video {
  transform: scale(1.05);
}

.project-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 300ms ease;
}

.project-card:hover .project-card__media::after {
  opacity: 1;
}

.project-card__badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 9999px;
  backdrop-filter: blur(8px);
}

.project-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.75rem;
}

.project-card__body h3 {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card__description {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--secondary-foreground));
  background: hsl(var(--secondary));
  border-radius: calc(var(--radius) - 4px);
}

.project-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

.projects__cta {
  margin-top: 3rem;
  text-align: center;
}

@media (min-width: 640px) {
  .projects__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card__body {
    padding: 1rem;
  }

  .project-card__body h3 {
    font-size: 1rem;
  }

  .project-card__description {
    font-size: 0.875rem;
  }

  .project-card__actions {
    flex-direction: row;
  }
}

@media (min-width: 1024px) {
  .projects__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

/* ==========================================================================
   Tech stack
   ========================================================================== */

.tech-stack {
  padding: 1.5rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tech-group + .tech-group {
  margin-top: 1rem;
}

.tech-group__heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tech-group__heading h3 {
  font-size: 1.125rem;
  font-weight: 500;
  color: hsl(var(--card-foreground));
}

.tech-group__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--dot);
}

.tech-group__card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  transition: box-shadow 300ms ease;
}

.tech-group__card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tech-pill {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--secondary-foreground));
  background: hsl(var(--secondary));
  border-radius: calc(var(--radius) - 2px);
  cursor: default;
  transition: transform 300ms ease, background-color 300ms ease, color 300ms ease;
}

.tech-pill:hover {
  color: #fff;
  background: var(--dot);
  transform: scale(1.05);
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact__grid {
  display: grid;
  gap: 2rem;
}

.contact__intro h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.contact__intro p {
  margin-bottom: 1.5rem;
}

.contact__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact__list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact__list .icon {
  color: hsl(var(--muted-foreground));
  flex: none;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: hsl(var(--muted-foreground));
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.3);
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-status {
  font-size: 0.875rem;
}

.form-status[data-state="error"] {
  color: hsl(0 84% 70%);
}

.form-status[data-state="success"] {
  color: hsl(150 60% 62%);
}

.form-status[data-state="pending"] {
  color: hsl(var(--muted-foreground));
}

@media (min-width: 768px) {
  .contact__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 2rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.site-footer__socials {
  display: flex;
  gap: 0.5rem;
}


/* ==========================================================================
   Resume modal
   ========================================================================== */

.dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.dialog[hidden] {
  display: none;
}

.dialog__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  animation: fade-in 200ms ease-out forwards;
}

.dialog__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100vw;
  height: 100dvh;
  padding: 0.75rem;
  overflow: hidden;
  color: hsl(var(--card-foreground));
  background: hsl(var(--background));
  border: 0;
  animation: dialog-in 200ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.dialog__header {
  padding-right: 2.5rem;
}

.dialog__header h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.dialog__header p {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.dialog__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 2px);
  opacity: 0.7;
  transition: opacity 200ms ease, background-color 200ms ease;
}

.dialog__close:hover {
  opacity: 1;
  background: hsl(var(--accent));
}

.dialog__body {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.dialog__body iframe,
.dialog__body embed {
  width: 100%;
  height: 100%;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
}

.dialog__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (min-width: 640px) {
  .dialog {
    padding: 1rem;
  }

  .dialog__panel {
    width: 100%;
    max-width: 56rem;
    height: 90vh;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
  }

  .dialog__header p {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .dialog__close {
    top: 1rem;
    right: 1rem;
  }
}

/* ==========================================================================
   Custom cursor
   ========================================================================== */

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 1rem;
  height: 1rem;
  background: #fff;
  border-radius: 9999px;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: difference;
  will-change: transform;
  transition: opacity 150ms ease;
}

.has-custom-cursor,
.has-custom-cursor * {
  cursor: none !important;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes hero-fade-in {
  0% {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateX(-50%) translateY(0);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

.animate-hero-fade-in {
  opacity: 0;
  animation: hero-fade-in 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

  .animate-hero-fade-in,
  .hero__caret,
  .project-card,
  .timeline-item[data-visible="true"],
  .hero__scroll-cue {
    animation: none !important;
    opacity: 1 !important;
  }

  .timeline-item[data-visible="true"] .timeline-item__body,
  .timeline-item__body {
    transform: none;
    opacity: 1;
  }
}

/* ==========================================================================
   Project media lightbox
   ========================================================================== */

.project-card__media {
  cursor: zoom-in;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vmin, 48px);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 180ms ease-out;
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  max-width: 100%;
  max-height: 100%;
}

.lightbox__stage {
  display: flex;
  cursor: default;
  max-width: 100%;
  min-height: 0;
}

.lightbox__stage video,
.lightbox__stage img {
  display: block;
  max-width: min(1280px, 92vw);
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.lightbox__caption {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: clamp(8px, 2vmin, 20px);
  right: clamp(8px, 2vmin, 20px);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.24);
}

@media (max-width: 640px) {
  .lightbox__stage video,
  .lightbox__stage img {
    max-height: 70vh;
  }
}
