:root {
  color-scheme: light;
  --bg: #fbfcff;
  --bg-soft: #eef8ff;
  --surface: #ffffff;
  --surface-light: #f6f9ff;
  --text: #142033;
  --muted: #5d687b;
  --line: rgba(20, 32, 51, 0.12);
  --green: #087a55;
  --cyan: #075f7d;
  --coral: #c93a2d;
  --yellow: #8a5a00;
  --shadow: 0 22px 70px rgba(31, 45, 74, 0.14);
  --header-bg: rgba(255, 255, 255, 0.8);
  --header-bg-solid: rgba(255, 255, 255, 0.94);
  --body-gradient: linear-gradient(180deg, #fff2e8 0, #eefaff 330px, #fbfcff 700px);
  --hero-gradient: linear-gradient(135deg, #fff0e7 0, #effcff 34%, #f5efff 68%, #ffffff 100%);
  --section-gradient: linear-gradient(180deg, #eef8ff, #fff7ef);
  --contact-gradient: linear-gradient(135deg, rgba(15, 159, 110, 0.12), transparent 42%), linear-gradient(90deg, #ffffff, #f1fbff);
  --card-bg: var(--surface);
  --pill-bg: var(--surface-light);
  --button-soft-bg: rgba(255, 255, 255, 0.82);
  --radius: 8px;
  --max-width: 1120px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b12;
  --bg-soft: #0f1420;
  --surface: #151b29;
  --surface-light: #1d2638;
  --text: #f5f7fb;
  --muted: #aeb8ca;
  --line: rgba(255, 255, 255, 0.13);
  --green: #35e6a1;
  --cyan: #45d7ff;
  --coral: #ff7a68;
  --yellow: #f7ca55;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --header-bg: rgba(8, 11, 18, 0.78);
  --header-bg-solid: rgba(8, 11, 18, 0.94);
  --body-gradient: linear-gradient(180deg, rgba(69, 215, 255, 0.1), rgba(255, 122, 104, 0.05) 360px, #080b12 760px);
  --hero-gradient: radial-gradient(circle at 15% 20%, rgba(53, 230, 161, 0.13), transparent 28%), radial-gradient(circle at 82% 35%, rgba(255, 122, 104, 0.14), transparent 30%), #080b12;
  --section-gradient: linear-gradient(180deg, #0f1420, #101827);
  --contact-gradient: linear-gradient(135deg, rgba(53, 230, 161, 0.12), transparent 42%), linear-gradient(90deg, #151b29, #101827);
  --card-bg: rgba(255, 255, 255, 0.045);
  --pill-bg: rgba(255, 255, 255, 0.065);
  --button-soft-bg: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    var(--body-gradient),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 76px;
  padding: 16px clamp(20px, 4vw, 56px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, background 180ms ease;
}

.site-header.scrolled {
  background: var(--header-bg-solid);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(15, 159, 110, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 159, 110, 0.14), rgba(8, 126, 164, 0.12));
  color: var(--green);
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.site-nav a {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
  transition: color 180ms ease, background 180ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  background: rgba(8, 126, 164, 0.08);
  color: var(--text);
}

:root[data-theme="dark"] .site-nav a:hover,
:root[data-theme="dark"] .site-nav a.active {
  background: rgba(255, 255, 255, 0.08);
}

.theme-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--button-soft-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.theme-button:hover {
  border-color: rgba(8, 126, 164, 0.28);
  transform: translateY(-1px);
}

.theme-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
}

.theme-icon::after {
  position: absolute;
  top: -2px;
  left: 6px;
  width: 12px;
  height: 18px;
  border-radius: 50%;
  background: var(--button-soft-bg);
  content: "";
  transform: scale(0);
  transform-origin: right center;
  transition: transform 180ms ease;
}

:root[data-theme="dark"] .theme-icon {
  border-color: var(--yellow);
}

:root[data-theme="dark"] .theme-icon::after {
  transform: scale(1);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--button-soft-bg);
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  background: var(--text);
  border-radius: 999px;
  transition: transform 180ms ease, opacity 180ms ease;
}

.menu-button.is-open span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-button.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-button.is-open span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.section {
  padding: 104px clamp(20px, 5vw, 64px);
}

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  align-items: center;
  overflow: hidden;
  padding-top: 128px;
  isolation: isolate;
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 38%;
  content: "";
  background: linear-gradient(180deg, transparent, var(--bg));
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  background: var(--hero-gradient);
}

.hero-content,
.section-heading,
.profile-grid,
.skills-grid,
.projects-grid,
.contact-content {
  width: min(100%, var(--max-width));
  margin: 0 auto;
}

.hero-content {
  max-width: 820px;
  margin-left: max(0px, calc((100vw - var(--max-width)) / 2));
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 820px;
  font-size: clamp(3.4rem, 12vw, 7.4rem);
  font-weight: 800;
}

h2 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
}

h3 {
  font-size: 1.25rem;
}

.hero-lead {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.28rem);
}

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

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

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

.button.primary {
  background: linear-gradient(90deg, var(--green), var(--cyan));
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(8, 126, 164, 0.22);
}

:root[data-theme="dark"] .button.primary {
  color: #06110d;
  box-shadow: 0 14px 30px rgba(53, 230, 161, 0.18);
}

.button.secondary {
  border-color: var(--line);
  background: var(--button-soft-bg);
  color: var(--text);
}

.profile-section,
.projects-section {
  background: var(--section-gradient);
}

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

.section-heading h2 {
  margin-bottom: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: start;
}

.profile-copy {
  padding-top: 4px;
}

.profile-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.profile-copy p + p {
  margin-top: 18px;
}

.stats {
  display: grid;
  gap: 12px;
}

.stats div,
.skill-card,
.project-card,
.contact-content {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.stats div {
  padding: 20px;
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-size: 1.2rem;
}

.stats span {
  margin-top: 4px;
  color: var(--muted);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.skill-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 22px;
  transition: border-color 180ms ease, transform 180ms ease;
}

.skill-card:hover,
.project-card:hover {
  border-color: rgba(15, 159, 110, 0.36);
  transform: translateY(-4px);
}

.skill-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 28px;
  border-radius: var(--radius);
  background: rgba(8, 126, 164, 0.1);
  color: var(--cyan);
  font-weight: 800;
}

.skill-card:nth-child(2) .skill-icon {
  background: rgba(226, 85, 68, 0.1);
  color: var(--coral);
}

.skill-card:nth-child(3) .skill-icon {
  background: rgba(183, 121, 0, 0.12);
  color: var(--yellow);
}

.skill-card:nth-child(4) .skill-icon {
  background: rgba(15, 159, 110, 0.12);
  color: var(--green);
}

.skill-card p,
.project-body p,
.contact-content p {
  color: var(--muted);
}

.skill-card p {
  margin: 14px 0 22px;
}

.tags,
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tags span,
.project-tags span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  overflow: hidden;
  transition: border-color 180ms ease, transform 180ms ease;
}

.project-visual {
  position: relative;
  height: 210px;
  overflow: hidden;
  background: #f8fbff;
}

.project-visual::before {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 58px;
  height: 10px;
  border-radius: 999px;
  content: "";
  background: linear-gradient(90deg, var(--coral), var(--yellow), var(--green));
}

.visual-portfolio {
  background:
    linear-gradient(135deg, rgba(15, 159, 110, 0.16), transparent 46%),
    linear-gradient(180deg, #f8fbff, #eafdf6);
}

:root[data-theme="dark"] .visual-portfolio {
  background:
    linear-gradient(135deg, rgba(53, 230, 161, 0.18), transparent 46%),
    linear-gradient(180deg, #151b29, #0f1420);
}

.visual-portfolio span {
  position: absolute;
  left: 22px;
  height: 16px;
  border-radius: 999px;
  background: rgba(20, 32, 51, 0.12);
}

:root[data-theme="dark"] .visual-portfolio span {
  background: rgba(255, 255, 255, 0.12);
}

.visual-portfolio span:nth-child(1) {
  top: 72px;
  width: 62%;
}

.visual-portfolio span:nth-child(2) {
  top: 108px;
  width: 45%;
}

.visual-portfolio span:nth-child(3) {
  right: 22px;
  bottom: 22px;
  left: auto;
  width: 110px;
  height: 56px;
  border-radius: var(--radius);
  background: rgba(15, 159, 110, 0.18);
}

.visual-dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 62px 18px 18px;
  background:
    linear-gradient(135deg, rgba(8, 126, 164, 0.14), transparent 48%),
    linear-gradient(180deg, #f8fbff, #edf8ff);
}

:root[data-theme="dark"] .visual-dashboard {
  background:
    linear-gradient(135deg, rgba(69, 215, 255, 0.16), transparent 48%),
    linear-gradient(180deg, #151b29, #101827);
}

.visual-dashboard span {
  min-height: 54px;
  border-radius: var(--radius);
  background: rgba(20, 32, 51, 0.08);
}

:root[data-theme="dark"] .visual-dashboard span {
  background: rgba(255, 255, 255, 0.09);
}

.visual-dashboard span:nth-child(2) {
  background: rgba(8, 126, 164, 0.16);
}

.visual-dashboard span:nth-child(3) {
  background: rgba(226, 85, 68, 0.14);
}

.visual-watch {
  background:
    linear-gradient(135deg, rgba(183, 121, 0, 0.12), transparent 42%),
    linear-gradient(180deg, #fffaf0, #f8fbff);
}

:root[data-theme="dark"] .visual-watch {
  background:
    linear-gradient(135deg, rgba(247, 202, 85, 0.14), transparent 42%),
    linear-gradient(180deg, #151b29, #101827);
}

.visual-watch span {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(183, 121, 0, 0.3);
}

.visual-watch span:nth-child(1) {
  top: 68px;
  left: 44px;
  width: 74px;
  height: 74px;
}

.visual-watch span:nth-child(2) {
  right: 54px;
  bottom: 42px;
  width: 96px;
  height: 96px;
  border-color: rgba(8, 126, 164, 0.28);
}

.visual-watch span:nth-child(3) {
  top: 84px;
  right: 110px;
  width: 28px;
  height: 28px;
  background: rgba(15, 159, 110, 0.28);
}

.project-body {
  padding: 22px;
}

.project-type {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-body h3 {
  margin-bottom: 12px;
}

.project-body p:not(.project-type) {
  min-height: 78px;
  margin: 0 0 22px;
}

.contact-section {
  padding-bottom: 72px;
}

.contact-content {
  padding: clamp(28px, 5vw, 56px);
  background: var(--contact-gradient);
}

.contact-content h2 {
  max-width: 820px;
}

.contact-content p {
  max-width: 680px;
  margin: 18px 0 0;
}

.site-footer {
  padding: 28px 20px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

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

@media (max-width: 980px) {
  .skills-grid,
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .site-header {
    min-height: 68px;
    padding: 12px 18px;
  }

  .menu-button {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 68px;
    right: 18px;
    left: 18px;
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--header-bg-solid);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .site-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-nav a {
    width: 100%;
  }

  .section {
    padding: 78px 20px;
  }

  .hero {
    min-height: 92vh;
    padding-top: 104px;
  }

  .hero-content {
    margin-left: auto;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 5.4rem);
  }

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

  .skill-card {
    min-height: auto;
  }

  .project-body p:not(.project-type) {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .brand {
    gap: 8px;
  }

  .brand span:last-child {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .theme-button {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .theme-button span:not(.theme-icon) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

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

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