:root {
  --font-heading: "Sora", sans-serif;
  --font-body: "Manrope", sans-serif;

  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.78);
  --text: #0f1f2b;
  --muted: #4d6172;
  --accent: #00747e;
  --accent-2: #bf6931;
  --border: rgba(15, 31, 43, 0.1);
  --shadow-soft: 0 12px 28px rgba(17, 41, 62, 0.09);
  --shadow-lift: 0 18px 44px rgba(12, 28, 42, 0.17);
  --focus: #0f94a0;
  --glow: rgba(0, 116, 126, 0.22);
  --scroll-progress: 0%;
  --max-width: 1120px;
  --radius-sm: 0.8rem;
  --radius-md: 1.1rem;
  --radius-lg: 1.4rem;
  --space-xs: 0.55rem;
  --space-sm: 0.9rem;
  --space-md: 1.2rem;
  --space-lg: 1.8rem;
  --space-xl: 2.6rem;
}

html[data-theme="dark"] {
  --bg: #0d1720;
  --surface: #132230;
  --surface-2: rgba(19, 34, 48, 0.72);
  --text: #e3edf6;
  --muted: #9cb3c6;
  --accent: #56c5cc;
  --accent-2: #efb16c;
  --border: rgba(227, 237, 246, 0.14);
  --shadow-soft: 0 16px 36px rgba(3, 8, 14, 0.45);
  --shadow-lift: 0 20px 46px rgba(0, 0, 0, 0.5);
  --focus: #78d7dd;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: clamp(0.98rem, 0.25vw + 0.93rem, 1.06rem);
  line-height: 1.7;
  color: var(--text);
  background: radial-gradient(120% 120% at 12% 9%, rgba(0, 116, 126, 0.14), transparent 60%),
    radial-gradient(120% 120% at 90% 1%, rgba(191, 105, 49, 0.14), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 32%),
    var(--bg);
  transition: background-color 0.32s ease, color 0.32s ease;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1300;
  width: var(--scroll-progress);
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px var(--glow);
  transition: width 0.08s linear;
}

img {
  max-width: 100%;
  display: block;
}

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

p,
ul {
  margin: 0;
}

.container {
  width: min(var(--max-width), 92vw);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 2000;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transition: top 0.24s ease;
}

.skip-link:focus-visible {
  top: 1rem;
}

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

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(44px);
  opacity: 0.28;
  animation: drift 20s ease-in-out infinite alternate;
}

.blob-a {
  width: min(38vw, 400px);
  height: min(38vw, 400px);
  top: -8%;
  left: -9%;
  background: #46bdc4;
}

.blob-b {
  width: min(34vw, 360px);
  height: min(34vw, 360px);
  top: 14%;
  right: -8%;
  background: #dd8e58;
  animation-duration: 25s;
}

.blob-c {
  width: min(28vw, 300px);
  height: min(28vw, 300px);
  bottom: -12%;
  left: 45%;
  background: #79b4df;
  animation-duration: 29s;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, -16px, 0) scale(1.07);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  backdrop-filter: blur(14px);
}

.nav-shell {
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.03em;
  transition: color 0.25s ease, transform 0.25s ease;
}

.brand:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.nav-link {
  position: relative;
  padding: 0.38rem 0.54rem;
  color: var(--muted);
  font-weight: 600;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0.54rem;
  right: 0.54rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform 0.28s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.76rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.55rem 0.42rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 0.24rem 0;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.theme-toggle {
  position: relative;
  width: 3rem;
  height: 2.3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: transparent;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 24%, transparent);
}

.theme-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.theme-icon svg {
  width: 1.08rem;
  height: 1.08rem;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

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

.theme-sun {
  transform: translateY(0);
  opacity: 1;
}

.theme-moon {
  transform: translateY(12px);
  opacity: 0;
}

html[data-theme="dark"] .theme-sun {
  transform: translateY(-12px);
  opacity: 0;
}

html[data-theme="dark"] .theme-moon {
  transform: translateY(0);
  opacity: 1;
}

.section {
  padding: clamp(3.1rem, 6vw, 5rem) 0;
  scroll-margin-top: 5rem;
}

.section-head {
  margin-bottom: 1.6rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 1vw + 1.2rem, 2.12rem);
}

.section-head p {
  margin-top: 0.5rem;
  color: var(--muted);
  max-width: 68ch;
}

.hero {
  padding-top: clamp(3.4rem, 8vw, 6rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(1.3rem, 3vw, 3rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.81rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0.7rem 0 0;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.45rem);
  line-height: 1.12;
  letter-spacing: 0.01em;
}

.lead {
  margin-top: 1rem;
  max-width: 66ch;
  color: var(--muted);
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.16rem);
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.8rem;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.24s ease, box-shadow 0.24s ease, background-color 0.24s ease, color 0.24s ease, border-color 0.24s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #258f97);
  box-shadow: 0 10px 24px rgba(0, 109, 119, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 16px 30px rgba(0, 109, 119, 0.34);
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}

.btn-secondary:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 16%, transparent);
}

.link-list {
  margin-top: 1.2rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.link-list li a,
.link-list li span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 0.68rem;
  padding: 0.42rem 0.72rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.link-list li a:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  transform: translateY(-1px);
}

.hero-media {
  justify-self: center;
  width: min(100%, 430px);
}

.photo-frame {
  margin: 0;
  border-radius: var(--radius-lg);
  padding: 0.6rem;
  background: linear-gradient(145deg, rgba(0, 109, 119, 0.38), rgba(180, 95, 43, 0.28));
  box-shadow: var(--shadow-lift);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(350px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.34), transparent 46%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.photo-frame:hover {
  box-shadow: 0 26px 46px color-mix(in srgb, var(--accent) 22%, rgba(0, 0, 0, 0.3));
}

.photo-frame:hover::after {
  opacity: 0.9;
}

.photo-frame img {
  width: 100%;
  border-radius: calc(var(--radius-lg) - 0.35rem);
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.experience-grid,
.education-grid,
.skills-grid {
  display: grid;
  gap: 1rem;
}

.experience-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 1rem;
}

.projects-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.skills-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.education-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background-color 0.28s ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 44%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.08rem;
}

.card h4 {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.96rem;
}

.card p + p {
  margin-top: 0.65rem;
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.date,
.org,
.stack {
  color: var(--muted);
}

.stack {
  margin: 0.4rem 0 0.6rem;
  font-size: 0.92rem;
  font-weight: 650;
}

.inline-link {
  margin-top: 0.7rem;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.note-text {
  margin-top: 0.72rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.chip-list,
.simple-list {
  margin-top: 0.8rem;
  padding: 0;
  list-style: none;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip-list li {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.34rem 0.65rem;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  font-size: 0.86rem;
  font-weight: 650;
  transition: transform 0.22s ease, border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.chip-list li:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 46%, var(--border));
  color: var(--text);
}

.simple-list li {
  position: relative;
  padding-left: 1rem;
  margin-top: 0.45rem;
}

.simple-list li::before {
  content: "";
  position: absolute;
  left: 0.18rem;
  top: 0.73em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.contact-card {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 1.6rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .card:hover,
  .link-list li a:hover,
  .brand:hover,
  .theme-toggle:hover,
  .chip-list li:hover {
    transform: none;
  }

  .card:hover {
    box-shadow: var(--shadow-soft);
  }
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.992);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0ms);
}

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

html[data-theme="dark"] body {
  background: radial-gradient(120% 120% at 10% 8%, rgba(0, 109, 119, 0.1), transparent 60%),
    radial-gradient(120% 120% at 90% 0%, rgba(180, 95, 43, 0.1), transparent 62%),
    var(--bg);
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-media {
    max-width: 360px;
    order: -1;
  }
}

@media (max-width: 900px) {
  .nav-shell {
    grid-template-columns: auto auto auto;
    grid-template-areas:
      "brand toggle theme"
      "nav nav nav";
  }

  .brand {
    grid-area: brand;
  }

  .nav-toggle {
    display: block;
    grid-area: toggle;
    justify-self: end;
  }

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

  .site-nav {
    grid-area: nav;
    justify-self: stretch;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    border-top: 1px solid transparent;
    transition: max-height 0.3s ease, border-color 0.3s ease;
  }

  .nav-link {
    padding: 0.65rem 0.15rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  body.nav-open .site-nav {
    max-height: 24rem;
    border-color: var(--border);
  }

  body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--max-width), 94vw);
  }

  .section {
    padding: 2.8rem 0;
  }

  .hero {
    padding-top: 2.9rem;
  }

  .hero h1 {
    line-height: 1.18;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 46px;
  }

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

  .link-list li a {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .experience-grid,
  .projects-grid,
  .skills-grid,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 0.9rem;
  }

  .card-top {
    align-items: flex-start;
    gap: 0.4rem;
  }

  .chip-list {
    gap: 0.45rem;
  }

  .chip-list li {
    font-size: 0.83rem;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  .nav-shell {
    min-height: 4rem;
    gap: 0.65rem;
  }

  .theme-toggle {
    width: 2.8rem;
    height: 2.2rem;
  }

  .nav-toggle {
    width: 2.5rem;
    height: 2.5rem;
  }

  .photo-frame {
    padding: 0.5rem;
  }

  .simple-list li {
    padding-left: 0.9rem;
  }
}

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

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

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

  body::before {
    transition: none;
  }
}
