:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #ffffff;
  --muted: #b8b8b8;
  --line: rgba(255, 255, 255, 0.2);
  --panel: rgba(0, 0, 0, 0.58);
}

body.light-theme {
  color-scheme: light;
  --bg: #f3f4f1;
  --ink: #101010;
  --muted: #555b60;
  --line: rgba(0, 0, 0, 0.18);
  --panel: rgba(255, 255, 255, 0.68);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Arial, Helvetica, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 28px clamp(18px, 5vw, 68px);
  color: white;
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}

.brand {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  font-size: 0.78rem;
  font-weight: 900;
  justify-content: center;
  text-transform: uppercase;
}

.header-link {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.theme-toggle {
  width: 58px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: black;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.theme-toggle-knob {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-left: 3px;
  border-radius: 50%;
  background: white;
  font-size: 0.92rem;
  line-height: 1;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: white;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 18px;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 36px);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.language-switch button {
  min-height: 30px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  background: transparent;
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 900;
}

.language-switch button:last-child {
  border-right: 0;
}

.language-switch button.is-active {
  background: white;
  color: black;
}

body.light-theme .language-switch,
body.light-theme .language-switch button,
body.light-theme .theme-toggle {
  border-color: rgba(0, 0, 0, 0.64);
}

body.light-theme .language-switch button,
body.light-theme .theme-toggle {
  color: var(--ink);
}

body.light-theme .theme-toggle {
  background: rgba(255, 255, 255, 0.64);
}

body.light-theme .theme-toggle-knob {
  transform: translateX(26px);
  background: var(--ink);
  color: white;
}

body.light-theme .language-switch button.is-active,
body.light-theme .theme-toggle:hover,
body.light-theme .theme-toggle:focus-visible {
  border-color: var(--ink);
}

.nav-links a,
.header-link {
  position: relative;
}

.nav-links a::after,
.header-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: white;
  transition: transform 180ms ease;
}

body.light-theme .nav-links a::after,
body.light-theme .header-link::after {
  background: var(--ink);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.header-link:hover::after,
.header-link:focus-visible::after {
  transform: scaleX(1);
}

.panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 120px clamp(18px, 5vw, 68px) 86px;
}

.panel-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.panel-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.22) 58%, rgba(0, 0, 0, 0.68)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.82));
}

body.light-theme .panel-bg::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42) 58%, rgba(255, 255, 255, 0.74)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.78));
}

.hero-bg {
  background-image: url("https://images.unsplash.com/photo-1752614671144-7eee784abf74?auto=format&fit=crop&w=2400&q=86");
}

.profile-bg {
  background-image: url("https://images.unsplash.com/photo-1581092334651-ddf26d9a09d0?auto=format&fit=crop&w=2400&q=86");
}

.work-bg {
  background-image: url("https://images.unsplash.com/photo-1752614671119-4868a91efc14?auto=format&fit=crop&w=2400&q=86");
}

.contact-bg {
  background-image: url("https://images.unsplash.com/photo-1752802469747-bff685763f3f?auto=format&fit=crop&w=2400&q=86");
}

.panel-content,
.section,
.stats,
.site-footer {
  position: relative;
  z-index: 1;
}

.panel-content {
  max-width: 720px;
}

.panel-content.narrow {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 22px;
  font-size: clamp(2.7rem, 7vw, 6.8rem);
  font-weight: 900;
  line-height: 0.94;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.25rem;
  text-transform: uppercase;
}

.hero-copy,
.panel-content p,
.mission-grid p,
.project-list p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-copy {
  max-width: 620px;
  color: white;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

body.light-theme .site-header,
body.light-theme .hero-copy,
body.light-theme .about-copy,
body.light-theme .button {
  color: var(--ink);
}

.identity-list {
  display: grid;
  max-width: 650px;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 30px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.identity-list div {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.42);
}

body.light-theme .identity-list div {
  background: rgba(255, 255, 255, 0.66);
}

.identity-list dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.identity-list dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.featured-layout {
  position: relative;
  z-index: 1;
  width: min(760px, 58vw);
}

.featured-media {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(46vw, 760px);
  margin: 0;
  overflow: hidden;
}

.featured-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.52) 28%, rgba(0, 0, 0, 0.06) 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 34%, rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.featured-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  min-width: 162px;
  padding: 0 22px;
  border: 2px solid white;
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
  position: relative;
  text-transform: uppercase;
  transition: color 180ms ease;
}

body.light-theme .button {
  border-color: var(--ink);
}

.button::before {
  content: "";
  position: absolute;
  inset: 100% 0 0;
  background: white;
  transition: inset 180ms ease;
  z-index: -1;
}

body.light-theme .button::before {
  background: var(--ink);
}

.button:hover,
.button:focus-visible {
  color: black;
}

body.light-theme .button:hover,
body.light-theme .button:focus-visible {
  color: white;
}

.button:hover::before,
.button:focus-visible::before {
  inset: 0;
}

.button.ghost {
  background: rgba(0, 0, 0, 0.12);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-block: 1px solid var(--line);
  background: #090909;
}

body.light-theme .stats {
  background: #f7f7f3;
}

.stats div {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-right: 1px solid var(--line);
  padding: 24px;
  text-align: center;
}

.stats strong {
  font-size: clamp(3rem, 8vw, 6.8rem);
  font-weight: 900;
  line-height: 0.9;
}

.stats span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section {
  padding: clamp(76px, 10vw, 132px) clamp(18px, 5vw, 68px);
  background: #050505;
}

body.light-theme .section,
body.light-theme .skills {
  background: #f3f4f1;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.education .mission-grid {
  grid-template-columns: repeat(2, 1fr);
}

.education .section-heading h2 {
  font-size: clamp(2.4rem, 6vw, 5.6rem);
}

.profile-panel {
  align-items: center;
}

.profile-panel .narrow {
  max-width: min(1280px, 88vw);
}

.profile-panel h2 {
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
}

.about-copy {
  max-width: 1240px;
  color: white;
  font-size: clamp(1.55rem, 2.65vw, 2.55rem);
  font-weight: 500;
  line-height: 1.36;
}

.mission-grid article {
  min-height: 260px;
  padding: 30px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

body.light-theme .mission-grid article {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0));
}

body.light-theme .featured-media {
  box-shadow: none;
}

body.light-theme .featured-media::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.5) 28%, rgba(255, 255, 255, 0.04) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 34%, rgba(255, 255, 255, 0.36));
}

.mission-grid span,
.project-list span {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.education-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.project-list {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  overflow: visible;
}

.project-list article {
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr minmax(240px, 0.8fr);
  gap: 24px;
  align-items: center;
  min-height: 118px;
  padding: 26px;
  background: #080808;
  cursor: pointer;
  outline: 1px solid transparent;
  outline-offset: -1px;
  transition:
    background 220ms ease,
    box-shadow 220ms ease,
    outline-color 220ms ease,
    transform 220ms ease;
  will-change: transform;
}

.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111111;
}

.project-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 260ms ease;
}

body.light-theme .project-list article,
body.light-theme .skill-grid a {
  background: #ffffff;
}

.project-list article:hover,
.project-list article:focus {
  z-index: 2;
  background: #111111;
  outline-color: rgba(255, 255, 255, 0.46);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  transform: translateY(-8px) scale(1.012);
}

.project-list article:active {
  transform: translateY(-3px) scale(1.006);
}

.project-list article:hover .project-thumb img,
.project-list article:focus .project-thumb img {
  transform: scale(1.06);
}

body.light-theme .project-list article:hover,
body.light-theme .project-list article:focus {
  background: #f7f7f3;
  outline-color: rgba(0, 0, 0, 0.28);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
}

.project-list h3,
.project-list p {
  margin-bottom: 0;
}

.skills {
  background: #080808;
  border-top: 1px solid var(--line);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.skill-grid a {
  min-height: 92px;
  display: grid;
  place-items: center;
  background: #050505;
  color: white;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  transition:
    background 180ms ease,
    color 180ms ease;
}

body.light-theme .skill-grid a {
  color: var(--ink);
}

.skill-grid a:hover,
.skill-grid a:focus-visible {
  background: #ffffff;
  color: #000000;
}

body.light-theme .skill-grid a:hover,
body.light-theme .skill-grid a:focus-visible {
  background: var(--ink);
  color: white;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 68px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 760ms ease,
    transform 760ms ease;
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-reveal="left"] {
  transform: translateX(-38px);
}

.reveal[data-reveal="right"] {
  transform: translateX(38px);
}

.reveal[data-reveal="scale"] {
  transform: translateY(24px) scale(0.96);
}

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

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(18px);
  }

  body.light-theme .site-header {
    background: rgba(255, 255, 255, 0.86);
  }

  .brand {
    max-width: 100%;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .nav-links {
    width: 100%;
    justify-content: start;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    font-size: 0.72rem;
    scrollbar-width: none;
    white-space: nowrap;
  }

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

  .header-actions {
    justify-content: space-between;
    gap: 12px;
  }

  .language-switch {
    grid-template-columns: repeat(2, 34px);
  }

  .panel {
    min-height: auto;
    padding: 168px 18px 64px;
  }

  .hero {
    min-height: 100svh;
    align-items: end;
  }

  .section {
    padding: 74px 18px;
  }

  .section-heading {
    margin-bottom: 26px;
  }

  h1,
  h2 {
    font-size: clamp(2.55rem, 15vw, 5rem);
    line-height: 0.95;
  }

  h3 {
    font-size: 1.08rem;
    line-height: 1.25;
  }

  .hero-copy,
  .panel-content p,
  .mission-grid p,
  .project-list p,
  .education-list {
    font-size: 0.95rem;
  }

  .about-copy {
    font-size: clamp(1.22rem, 6vw, 1.85rem);
    line-height: 1.42;
  }

  .stats,
  .mission-grid,
  .identity-list,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .identity-list div,
  .stats div,
  .mission-grid article,
  .skill-grid a {
    min-height: auto;
    padding: 20px;
  }

  .stats strong {
    font-size: clamp(3.5rem, 20vw, 5.8rem);
  }

  .work-feature {
    display: flex;
    flex-direction: column;
  }

  .featured-layout {
    width: 100%;
  }

  .featured-media {
    position: relative;
    width: 100%;
    min-height: 320px;
    margin: 28px 0 0;
    order: 2;
  }

  .featured-media::before {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.34)),
      linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 58%);
  }

  .project-list article {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  .project-thumb {
    max-width: none;
    aspect-ratio: 4 / 3;
  }

  .contact-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 560px) {
  .header-link {
    display: none;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .panel {
    padding-top: 188px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: auto auto;
  }

  .theme-toggle {
    justify-self: end;
  }

  h1,
  h2 {
    font-size: clamp(2.35rem, 16vw, 4.6rem);
  }

  .stats div {
    min-height: 132px;
  }

  .project-list article:hover,
  .project-list article:focus {
    transform: translateY(-5px) scale(1.006);
  }

  .hero-actions,
  .button,
  .site-footer {
    display: grid;
    width: 100%;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
