:root {
  color-scheme: light;
  --bg: #eef2f7;
  --bg-alt: #f8fafc;
  --surface: rgba(232, 237, 246, 0.76);
  --surface-strong: rgba(220, 228, 241, 0.84);
  --surface-border: rgba(72, 88, 120, 0.22);
  --text: #0c1220;
  --muted: #536071;
  --accent: #3158d4;
  --accent-soft: rgba(49, 88, 212, 0.13);
  --accent-strong: #173aa6;
  --accent-rgb: 49, 88, 212;
  --line: #16233a;
  --shadow: none;
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --max-width: 1240px;
}

html {
  scroll-behavior: smooth;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060914;
  --bg-alt: #0a1020;
  --surface: rgba(10, 16, 32, 0.74);
  --surface-strong: rgba(14, 24, 46, 0.82);
  --surface-border: rgba(142, 164, 214, 0.24);
  --text: #eef4ff;
  --muted: #a7b3c9;
  --accent: #7aa7ff;
  --accent-soft: rgba(122, 167, 255, 0.14);
  --accent-strong: #a9c9ff;
  --accent-rgb: 122, 167, 255;
  --line: #d6e3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  color: var(--text);
  transition:
    background 240ms ease,
    color 240ms ease;
}

body.is-loading {
  overflow: hidden;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  opacity: 1;
  visibility: visible;
  transition:
    opacity 520ms ease,
    visibility 520ms ease;
}

body:not(.is-loading) .page-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.is-loading .page-shell,
body.is-loading .scroll-progress {
  opacity: 0;
}

.loader-mark {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 0;
  background: transparent;
  border: 0;
  animation: loaderPulse 1.4s ease-in-out infinite;
}

.loader-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.loader-mark img[data-logo-tone="light"] {
  width: 88%;
  height: 88%;
}

.loader-spinner {
  width: 58px;
  height: 58px;
  border: 3px solid color-mix(in srgb, var(--text) 16%, transparent);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: loaderSpin 820ms linear infinite;
}

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

button,
a.button {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 48px;
  opacity: 1;
  transition: opacity 420ms ease;
}

.scroll-progress {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  width: min(360px, calc(100vw - 40px));
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 24%, transparent);
  border: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent);
  opacity: 0;
  transform: translate3d(-50%, 12px, 0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.scroll-progress.is-visible {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.5);
  transform: scaleX(0);
  transform-origin: left;
}

.site-header {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 12px clamp(12px, 1.6vw, 22px);
  background: color-mix(in srgb, var(--bg-alt) 72%, transparent);
  border: 1px solid transparent;
  backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

body[data-theme="dark"] .site-header {
  background: color-mix(in srgb, var(--bg-alt) 66%, transparent);
  border-color: transparent;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #f8fbff;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: none;
  overflow: hidden;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 0.98rem;
}

.brand-copy small {
  color: var(--muted);
}

.site-nav-wrap {
  min-width: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 2.6vw, 34px);
}

.site-nav a {
  position: relative;
  padding: 8px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 1px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.toggle-button:hover,
.toggle-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.35);
}

.theme-swatch {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--text) 50%, var(--bg-alt) 50%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.theme-toggle {
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  gap: 0;
}

#language-toggle {
  width: auto;
  min-width: 68px;
  padding: 0 12px;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 800;
}

.language-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.section {
  padding: 92px 0 0;
}

.hero {
  display: flex;
  gap: clamp(34px, 7vw, 96px);
  justify-content: space-between;
  min-height: calc(100vh - 150px);
  align-items: center;
  text-align: left;
  border-bottom: 1px solid var(--surface-border);
}

.hero-copy {
  display: grid;
  justify-items: start;
  flex: 1 1 0;
  max-width: 1040px;
  min-width: 0;
}

.hero-logo {
  flex: 0 0 auto;
  width: clamp(185px, 25vw, 340px);
  max-height: 340px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(20, 20, 20, 0.08));
}

.hero-logo[data-logo-tone="light"] {
  width: clamp(215px, 29vw, 395px);
  max-height: 395px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--accent-strong);
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.contact-card h2 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.hero h1 {
  min-height: 1.92em;
  max-width: 14ch;
  font-size: clamp(3.7rem, 7.4vw, 7.2rem);
  white-space: pre-line;
  transition: color 180ms ease;
}

.hero h1[data-tone="name"] {
  color: var(--text);
}

.hero h1[data-tone="tone-1"] {
  color: var(--accent-strong);
}

.hero h1[data-tone="tone-2"] {
  color: #256f85;
}

.hero h1[data-tone="tone-3"] {
  color: #5b4bc4;
}

.hero h1[data-tone="tone-0"] {
  color: #246b59;
}

body[data-theme="dark"] .hero h1[data-tone="tone-2"] {
  color: #8ed8ed;
}

body[data-theme="dark"] .hero h1[data-tone="tone-3"] {
  color: #b8adff;
}

body[data-theme="dark"] .hero h1[data-tone="tone-0"] {
  color: #8fd8c2;
}

.hero h1.is-typing::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.78em;
  margin-left: 0.08em;
  background: currentColor;
  animation: caretBlink 780ms steps(1) infinite;
  transform: translateY(0.08em);
}

.hero-lead {
  max-width: 720px;
  min-height: 1.45em;
  margin: 22px 0 0;
  font-size: 1.22rem;
  line-height: 1.45;
  white-space: normal;
  color: var(--line);
}

body[data-theme="dark"] .hero-lead {
  color: var(--muted);
}

.section-heading p,
.contact-copy p,
.stack-item p,
.feature-card p,
.about-card p,
.timeline-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  justify-content: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.hero-socials {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.hero-socials a {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: var(--accent-strong);
  opacity: 0.9;
  transition:
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    color 200ms ease,
    opacity 200ms ease;
}

.hero-socials a:hover,
.hero-socials a:focus-visible {
  transform: translateY(-1px);
  color: var(--text);
  opacity: 1;
}

.hero-social-icon {
  width: 24px;
  height: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.button-icon,
.contact-icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--accent);
  color: #f8fbff;
  box-shadow: none;
}

.button-secondary,
.button-ghost {
  background: transparent;
  border-color: var(--surface-border);
}

.button-ghost {
  color: var(--muted);
}

.language-pill {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--surface-border) 70%, transparent);
  color: var(--text);
}

.glass-card,
.feature-card,
.about-card,
.timeline-card,
.skill-category {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.section-heading {
  display: grid;
  grid-template-columns: 180px minmax(0, 760px);
  column-gap: clamp(28px, 6vw, 84px);
  row-gap: 10px;
  align-items: start;
  max-width: none;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--surface-border);
}

.section-heading .section-kicker {
  grid-row: 1 / span 2;
}

.section-heading h2,
.section-heading > p:not(.section-kicker) {
  grid-column: 2;
}

.section-heading h2,
.contact-card h2 {
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 3.4vw, 3.2rem);
}

.section-heading h2 strong {
  color: var(--accent-strong);
  font-weight: 700;
}

.section-heading h2 u {
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

.section-heading > p:not(.section-kicker) {
  max-width: 740px;
}

.section-heading .section-kicker {
  margin-top: 0.42rem;
}

.about-grid,
.feature-grid,
.skills-grid,
.education-layout {
  display: grid;
  gap: 14px;
}

.about-grid,
.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.projects-carousel {
  position: relative;
}

.projects-grid {
  display: flex;
  --drag-offset: 0px;
  gap: 20px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 18px;
  scroll-behavior: auto;
  scroll-padding-inline: 2px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
  cursor: grab;
  transform: translate3d(var(--drag-offset), 0, 0);
  transition: transform 220ms ease;
  will-change: transform;
}

.projects-grid::-webkit-scrollbar {
  display: none;
}

.projects-grid.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
  transition: none;
  user-select: none;
}

.projects-grid.is-dragging .project-card {
  pointer-events: none;
}

.projects-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.projects-dots button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.projects-dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--text) 26%, transparent);
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.projects-dots.is-dragging button::before {
  transition: none;
}

.projects-dots button.is-active::before {
  background: var(--accent);
  transform: scale(1.08);
}

.about-card,
.feature-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.about-card:hover,
.feature-card:hover,
.project-card:hover,
.skill-category:hover,
.timeline-card:hover,
.stack-block:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--surface-border));
}

.project-card {
  display: grid;
  flex: 0 0 calc((100% - 40px) / 3);
  grid-template-rows: auto auto;
  align-content: start;
  height: clamp(440px, 36vw, 480px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--surface-border) 76%, transparent);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(
      150deg,
      color-mix(in srgb, var(--surface) 88%, transparent) 0%,
      color-mix(in srgb, var(--surface) 78%, transparent) 55%,
      rgba(var(--accent-rgb), 0.28) 100%
    );
  backdrop-filter: blur(10px);
  scroll-snap-align: start;
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.project-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--surface-border));
}

.project-media {
  display: grid;
  place-items: center;
  min-height: 0;
  align-self: start;
  height: clamp(170px, 15vw, 205px);
  margin: clamp(4px, 0.8vw, 10px) clamp(16px, 1.7vw, 22px) 0;
  padding: clamp(10px, 1.2vw, 14px);
  background: color-mix(in srgb, var(--bg-alt) 64%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface-border) 68%, transparent);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.project-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  filter: none;
}

.project-media img[data-theme-logo] {
  max-width: 80%;
  max-height: 80%;
}

.project-media img[data-logo-tone="dark"] {
  transform: translateY(-15%);
}

.project-content {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: clamp(20px, 2.2vw, 26px) clamp(16px, 1.8vw, 22px) 14px;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  color: var(--text);
}

.project-number {
  font-size: clamp(2.65rem, 4.2vw, 3.55rem);
  font-weight: 800;
  line-height: 0.9;
}

.project-aside {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-items: end;
  gap: 8px;
  min-width: 0;
}

.project-type {
  max-width: 8.8rem;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.16;
  text-align: right;
}

.project-card h3 {
  margin: 0;
  font-size: clamp(1.28rem, 1.65vw, 1.58rem);
  line-height: 1.08;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.project-tags span {
  padding: 4px 7px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.7rem;
  line-height: 1.1;
  background: color-mix(in srgb, var(--surface) 48%, transparent);
}

.project-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 24px;
  height: 24px;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--accent-strong);
  font-weight: 700;
  opacity: 0.9;
  transition:
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    color 200ms ease,
    opacity 200ms ease;
}

.project-link:hover,
.project-link:focus-visible {
  transform: translateY(-1px);
  color: var(--text);
  opacity: 1;
}

.project-link-icon {
  width: 19px;
  height: 19px;
  color: currentColor;
}

.project-detail-view {
  min-height: calc(100vh - 120px);
}

.project-detail {
  display: grid;
  gap: 22px;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: clamp(48px, 8vh, 78px) 0 28px;
}

.project-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.project-detail-back:hover,
.project-detail-back:focus-visible {
  color: var(--text);
  transform: translateX(-2px);
}

.project-detail-back-icon {
  width: 18px;
  height: 18px;
}

.project-detail-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--accent-strong);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-detail-stack span:not(:last-child)::after {
  content: "•";
  margin-left: 14px;
  color: color-mix(in srgb, var(--accent-strong) 58%, transparent);
}

.project-detail-header {
  display: grid;
  gap: 8px;
}

.project-detail-header .section-kicker {
  margin: 0;
}

.project-detail h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 2.7rem);
  line-height: 1.02;
  white-space: nowrap;
}

.project-detail-media {
  display: grid;
  place-items: center;
  min-height: clamp(320px, 34vw, 420px);
  margin: 0;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--surface-strong) 76%, transparent),
      rgba(var(--accent-rgb), 0.18)
    );
  overflow: hidden;
}

.project-detail-media img {
  width: min(78%, 520px);
  max-height: 310px;
  object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.22));
}

.project-detail-body {
  display: grid;
  gap: 18px;
  max-width: none;
}

.project-detail-body p {
  margin: 0;
  color: var(--line);
  font-size: clamp(1rem, 1.25vw, 1.08rem);
  line-height: 1.7;
}

body[data-theme="dark"] .project-detail-body p {
  color: var(--text);
}

.project-detail-github {
  width: fit-content;
}

.about-card h3,
.feature-card h3,
.skill-category h3,
.stack-block h3,
.timeline-title {
  margin: 0 0 10px;
  font-size: 1.02rem;
}

.card-index {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  height: auto;
  margin-bottom: 22px;
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong);
  font-family: "DM Serif Display", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 0;
  border-left: 1px solid var(--surface-border);
}

.timeline-card {
  position: relative;
  padding: 28px 0 28px 28px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}

.timeline-card::before {
  content: "";
  position: absolute;
  top: 34px;
  left: -5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 18px;
  color: var(--muted);
}

.timeline-bullets {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.timeline-bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.timeline-bullets li::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: var(--accent);
}

.skills-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skill-category {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.skill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  border: 1px solid var(--surface-border);
}

.skill-item i {
  font-size: 1.7rem;
  color: var(--accent-strong);
}

.skill-svg {
  width: 1.7rem;
  height: 1.7rem;
  color: var(--accent-strong);
  flex: 0 0 auto;
}

.skill-item span {
  font-size: 0.98rem;
}

.contact-card,
.stack-block {
  border-radius: var(--radius-xl);
}

.language-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.education-layout {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.stack-column {
  display: grid;
  gap: 18px;
}

.stack-block {
  padding: 20px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.stack-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--surface-border);
}

.stack-item {
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--surface-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.stack-item strong {
  display: block;
  margin-bottom: 6px;
}

.stack-item small {
  display: inline-block;
  margin-bottom: 0;
  color: var(--accent-strong);
}

.compact-list .stack-item {
  padding: 13px 0;
}

.certification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.certification-link {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  color: var(--accent-strong);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.certification-link:hover,
.certification-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.35);
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
}

.certification-link-icon {
  width: 17px;
  height: 17px;
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1fr);
  align-items: end;
  gap: clamp(28px, 6vw, 72px);
  padding: 34px 0;
  border-width: 1px 0;
  border-radius: 0;
  background: transparent;
}

.contact-copy p {
  max-width: 560px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  min-height: 48px;
  padding: 0 15px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  border: 1px solid var(--surface-border);
  color: var(--accent-strong);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.contact-links a svg {
  width: 24px;
  height: 24px;
}

.contact-links span {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.32);
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
}

.site-footer {
  padding: 30px 0 10px;
  color: var(--muted);
  text-align: center;
}

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity 500ms ease,
    transform 500ms ease;
}

[data-reveal="left"] {
  transform: translate3d(24px, 0, 0);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loaderPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

@media (max-width: 1080px) {
  .site-header {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
  }

  .hero,
  .contact-card,
  .education-layout,
  .about-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    flex-basis: calc((100% - 20px) / 2);
    height: clamp(430px, 46vw, 470px);
  }

  .hero {
    text-align: center;
  }

  .hero-copy {
    justify-items: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-lead {
    white-space: normal;
  }

  .contact-card {
    align-items: start;
  }

  .contact-links {
    justify-content: flex-start;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .section-heading .section-kicker,
  .section-heading h2,
  .section-heading > p:not(.section-kicker) {
    grid-column: 1;
    grid-row: auto;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: min(var(--max-width), calc(100% - 20px));
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-copy strong {
    font-size: 0.92rem;
  }

  .brand-copy small {
    font-size: 0.82rem;
  }

  .site-nav-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    position: relative;
    min-width: 0;
    padding-right: 28px;
  }

  .site-nav-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 4px;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--accent-strong);
    border-right: 2px solid var(--accent-strong);
    opacity: 0.72;
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
  }

  .site-nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px 18px 2px 0;
    mask-image: linear-gradient(
      90deg,
      transparent 0,
      #000 18px,
      #000 calc(100% - 34px),
      transparent 100%
    );
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 8px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.72rem;
  }

  .site-nav a::after {
    display: block;
    bottom: 2px;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    justify-content: flex-end;
  }

  .toggle-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    font-size: 0.82rem;
  }

  .hero {
    flex-direction: column;
    min-height: auto;
    gap: 18px;
    padding-top: 22px;
    padding-bottom: 28px;
  }

  .hero-logo {
    width: min(50vw, 200px);
    max-height: 200px;
  }

  .hero-logo[data-logo-tone="light"] {
    width: min(58vw, 235px);
    max-height: 235px;
  }

  .hero h1 {
    max-width: none;
    min-height: 2.86em;
    font-size: clamp(3.05rem, 15vw, 4.2rem);
    line-height: 0.92;
  }

  .hero-lead {
    max-width: 26rem;
    margin-top: 14px;
    font-size: 1rem;
    line-height: 1.45;
  }

  .hero-actions {
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
  }

  .hero-socials {
    justify-content: center;
    margin-top: 14px;
  }

  .button {
    min-height: 44px;
    padding: 0 14px;
  }

  .skill-list {
    grid-template-columns: 1fr;
  }

  .projects-carousel {
    display: block;
  }

  .projects-grid {
    scroll-padding-inline: 0;
    gap: 14px;
  }

  .project-card {
    flex-basis: 100%;
    height: auto;
    min-height: 390px;
    grid-template-rows: auto auto;
  }

  .project-content {
    gap: 12px;
    padding: 20px 16px 14px;
  }

  .project-meta {
    gap: 12px;
  }

  .project-number {
    font-size: clamp(2.55rem, 12vw, 3.35rem);
  }

  .project-type {
    max-width: 9.5rem;
    font-size: 0.78rem;
  }

  .project-media {
    height: clamp(210px, 58vw, 260px);
    min-height: 0;
    margin: 4px 18px 18px;
    padding: 14px;
  }

  .project-media img {
    max-width: 100%;
    max-height: 100%;
  }

  .project-media img[data-theme-logo] {
    max-width: 80%;
    max-height: 80%;
  }

  .project-media img[data-logo-tone="dark"] {
    transform: translateY(-14%);
  }

  .project-detail {
    gap: 20px;
    padding-top: 28px;
  }

  .project-detail-stack {
    gap: 8px 10px;
    font-size: 0.6rem;
  }

  .project-detail-stack span:not(:last-child)::after {
    margin-left: 10px;
  }

  .project-detail h1 {
    max-width: none;
    font-size: clamp(1.85rem, 9vw, 2.45rem);
    white-space: normal;
  }

  .project-detail-media {
    min-height: 250px;
    padding: 20px;
  }

  .project-detail-media img {
    width: min(88%, 320px);
    max-height: 210px;
  }

  .project-detail-body {
    gap: 16px;
  }

  .project-detail-body p {
    font-size: 1rem;
    line-height: 1.68;
  }

  .contact-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .contact-links a {
    min-height: 48px;
    padding: 12px;
    border-radius: var(--radius-md);
  }

  .scroll-progress {
    bottom: 10px;
    width: min(240px, calc(100vw - 48px));
    height: 3px;
  }

  .section {
    padding-top: 60px;
  }
}

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

  .projects-grid {
    scroll-behavior: auto;
  }

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
