:root {
  color-scheme: light dark;
  --bg: #f7f8fb;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --text: #111318;
  --text-strong: #05070b;
  --muted: #606977;
  --quiet: #8a93a3;
  --line: rgba(18, 24, 38, 0.1);
  --line-strong: rgba(18, 24, 38, 0.18);
  --accent: #0a66c2;
  --accent-2: #09847a;
  --accent-soft: rgba(10, 102, 194, 0.12);
  --mint-soft: rgba(9, 132, 122, 0.1);
  --shadow: 0 28px 90px rgba(23, 31, 47, 0.12);
  --shadow-soft: 0 16px 48px rgba(23, 31, 47, 0.08);
  --radius: 8px;
  --max: 1200px;
  --header-h: 72px;
  --font:
    "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    "Helvetica Neue", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #05070b;
  --bg-elevated: #0b1018;
  --surface: rgba(16, 22, 33, 0.58);
  --surface-strong: rgba(17, 24, 39, 0.76);
  --text: #e9eef6;
  --text-strong: #ffffff;
  --muted: #a8b1c0;
  --quiet: #737f91;
  --line: rgba(233, 238, 246, 0.12);
  --line-strong: rgba(233, 238, 246, 0.2);
  --accent: #71b7ff;
  --accent-2: #65d8c7;
  --accent-soft: rgba(113, 183, 255, 0.13);
  --mint-soft: rgba(101, 216, 199, 0.1);
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 14px 46px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #05070b;
    --bg-elevated: #0b1018;
    --surface: rgba(16, 22, 33, 0.58);
    --surface-strong: rgba(17, 24, 39, 0.76);
    --text: #e9eef6;
    --text-strong: #ffffff;
    --muted: #a8b1c0;
    --quiet: #737f91;
    --line: rgba(233, 238, 246, 0.12);
    --line-strong: rgba(233, 238, 246, 0.2);
    --accent: #71b7ff;
    --accent-2: #65d8c7;
    --accent-soft: rgba(113, 183, 255, 0.13);
    --mint-soft: rgba(101, 216, 199, 0.1);
    --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 14px 46px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 20% 4%, var(--accent-soft), transparent 32rem),
    radial-gradient(circle at 82% 18%, var(--mint-soft), transparent 30rem),
    linear-gradient(180deg, color-mix(in srgb, var(--bg), #ffffff 5%) 0, var(--bg) 48rem);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-position: center top;
  background-size: 88px 88px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 62%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0, color-mix(in srgb, var(--bg), transparent 14%) 50%, transparent 100%),
    linear-gradient(180deg, transparent 0, var(--bg) 80%);
}

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

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

p {
  margin-bottom: 0;
}

ul {
  margin: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  transform: translateY(-150%);
  border-radius: var(--radius);
  background: var(--text-strong);
  color: var(--bg);
  padding: 10px 14px;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: var(--header-h);
  padding: 12px max(20px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong), transparent 5%), color-mix(in srgb, var(--surface), transparent 18%));
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.055);
  backdrop-filter: blur(26px) saturate(1.35);
}

.brand,
.nav-links,
.header-controls,
.hero-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  color: var(--accent);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  color: var(--text-strong);
  font-size: 0.95rem;
}

.brand-copy small {
  color: var(--quiet);
  font-size: 0.78rem;
}

.nav-links {
  justify-content: center;
  gap: 6px;
}

.nav-links a {
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  transition: color 180ms ease, background 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--surface);
  color: var(--text-strong);
}

.header-controls {
  position: relative;
  gap: 6px;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong), transparent 4%), color-mix(in srgb, var(--surface), transparent 24%));
  padding: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 12px 34px rgba(0, 0, 0, 0.075);
  backdrop-filter: blur(18px) saturate(1.25);
}

.control-button {
  min-height: 34px;
  min-width: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 780;
  padding: 6px 10px;
  box-shadow: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.control-button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent), transparent 12%);
  color: #ffffff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent), transparent 72%);
}

.theme-cycle {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong), transparent 4%), color-mix(in srgb, var(--surface), transparent 24%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 12px 34px rgba(0, 0, 0, 0.075);
  backdrop-filter: blur(18px) saturate(1.25);
}

.control-button:hover,
.control-button:focus-visible {
  background: var(--surface-strong);
}

.control-button[aria-pressed="true"]:hover,
.control-button[aria-pressed="true"]:focus-visible {
  background: color-mix(in srgb, var(--accent), transparent 8%);
}

.control-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent), transparent 32%);
  outline-offset: 2px;
}

.stage {
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
  padding: 118px 0;
  scroll-margin-top: var(--header-h);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 54px;
  align-items: end;
  min-height: calc(100svh - var(--header-h));
  padding-top: 88px;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
}

.kicker {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 800;
}

h1 {
  max-width: 900px;
  margin-bottom: 24px;
  color: var(--text-strong);
  font-size: clamp(4.2rem, 10vw, 8.8rem);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 0.9;
}

h2 {
  max-width: 900px;
  margin-bottom: 22px;
  color: var(--text-strong);
  font-size: clamp(2.35rem, 5.4vw, 5rem);
  font-weight: 740;
  letter-spacing: 0;
  line-height: 1;
}

h3 {
  margin-bottom: 10px;
  color: var(--text-strong);
  font-size: 1.2rem;
  line-height: 1.25;
}

.hero-lead {
  max-width: 820px;
  color: var(--muted);
  font-size: clamp(1.18rem, 2.2vw, 1.55rem);
  line-height: 1.45;
}

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

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

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

.button.primary {
  border-color: color-mix(in srgb, var(--accent), #000000 4%);
  background: var(--accent);
  color: #ffffff;
}

.button.ghost {
  background: var(--surface-strong);
  color: var(--text-strong);
}

.hero-visual {
  position: absolute;
  inset: 8% -5% auto auto;
  width: min(720px, 72vw);
  height: min(560px, 72vh);
  pointer-events: none;
}

.glass-plane {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong), transparent 6%), transparent 55%),
    repeating-linear-gradient(90deg, transparent 0 46px, var(--line) 47px 48px);
  box-shadow: var(--shadow);
}

.plane-one {
  inset: 10% 0 12% 12%;
  transform: perspective(1000px) rotateX(58deg) rotateZ(-32deg);
}

.plane-two {
  inset: 18% 9% 4% 0;
  opacity: 0.58;
  transform: perspective(1000px) rotateX(58deg) rotateZ(-32deg) translate3d(16px, 30px, 0);
}

.signal-map {
  position: absolute;
  right: 12%;
  bottom: 12%;
  display: grid;
  grid-template-columns: repeat(2, 64px);
  gap: 12px;
}

.signal-map span {
  height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-strong), var(--accent-soft));
}

.hero-dashboard,
.timeline-card,
.skill-card,
.project-card,
.education-panel,
.contact-card,
.flow article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-strong), transparent 2%), color-mix(in srgb, var(--surface), transparent 22%));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.2);
}

.hero-dashboard {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.dash-line {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 20px;
  background: var(--surface-strong);
}

.dash-line span {
  color: var(--quiet);
  font-size: 0.84rem;
  font-weight: 750;
}

.dash-line strong {
  color: var(--text-strong);
  font-size: 1.6rem;
  line-height: 1;
}

.chapter,
.story,
.experience,
.skills,
.domains,
.signal,
.projects,
.education,
.contact {
  border-top: 1px solid var(--line);
}

.chapter {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 52px;
}

.chapter-label {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  align-self: start;
}

.chapter-label span {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--accent);
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.chapter-label p,
.period,
.role,
.section-heading p,
.story-copy p,
.project-card p,
.skill-card p,
.education-item span,
.certificate-list,
.site-footer {
  color: var(--muted);
}

.chapter-body {
  max-width: 940px;
}

.chapter-body p,
.story-copy p {
  max-width: 790px;
  font-size: 1.14rem;
}

.chapter-body p + p {
  margin-top: 18px;
}

.story {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 44px;
  align-items: center;
}

.flow {
  display: grid;
  gap: 14px;
}

.flow article {
  padding: 24px;
}

.flow span,
.project-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.section-heading {
  max-width: 980px;
  margin-bottom: 46px;
}

.section-heading p {
  max-width: 760px;
  font-size: 1.08rem;
}

.timeline,
.skill-grid,
.project-grid,
.education-layout {
  display: grid;
  gap: 18px;
}

.timeline {
  gap: 28px;
}

.timeline-card {
  padding: clamp(24px, 4vw, 42px);
}

.timeline-head {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.period {
  margin-bottom: 8px;
  font-size: 0.94rem;
  font-weight: 800;
}

.role {
  font-weight: 700;
}

.pill {
  align-self: start;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent);
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 850;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  padding-left: 20px;
}

.detail-list li {
  color: var(--muted);
  padding-left: 2px;
}

.skill-grid,
.project-grid,
.education-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skill-card,
.project-card,
.education-panel {
  padding: 26px;
}

.skill-card p,
.project-card p {
  margin-bottom: 0;
}

.domain-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.domain-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text-strong);
  padding: 12px 15px;
  font-weight: 760;
  box-shadow: var(--shadow-soft);
}

.education-panel {
  align-self: start;
}

.education-item {
  display: grid;
  gap: 4px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.education-item strong {
  color: var(--text-strong);
}

.certificate-list {
  display: grid;
  gap: 12px;
  padding-left: 20px;
}

.contact {
  min-height: 74svh;
  display: grid;
  place-items: center;
}

.contact-card {
  width: min(860px, 100%);
  padding: clamp(28px, 6vw, 64px);
  text-align: center;
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
  text-align: left;
}

.identity-grid div,
.identity-grid a {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-strong), transparent 5%), color-mix(in srgb, var(--surface), transparent 26%));
  padding: 18px;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.identity-grid a:hover,
.identity-grid a:focus-visible {
  border-color: color-mix(in srgb, var(--accent), transparent 24%);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-strong), transparent 0%), color-mix(in srgb, var(--accent-soft), transparent 24%));
  transform: translateY(-2px);
}

.identity-grid span {
  color: var(--quiet);
  font-size: 0.78rem;
  font-weight: 850;
}

.identity-grid strong {
  color: var(--text-strong);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

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

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

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

  .reveal,
  .button {
    transform: none;
    transition: none;
  }
}

@media (max-width: 1020px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .chapter,
  .story {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-dashboard {
    grid-template-columns: repeat(4, 1fr);
  }

  .chapter-label {
    position: static;
  }

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

@media (max-width: 760px) {
  :root {
    --header-h: 68px;
  }

  body {
    font-size: 15px;
  }

  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    min-height: var(--header-h);
    padding-block: 8px;
    padding-inline: 14px;
  }

  .nav-links {
    grid-column: auto;
    min-width: 0;
    gap: 4px;
    scrollbar-width: none;
    white-space: nowrap;
  }

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

  .nav-links a {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 0.84rem;
  }

  .header-controls {
    flex: 0 0 auto;
    gap: 4px;
  }

  .segmented-control {
    padding: 3px;
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    display: none;
  }

  .stage {
    width: min(100% - 28px, var(--max));
    padding: 78px 0;
  }

  .hero {
    padding-top: 52px;
  }

  h1 {
    font-size: clamp(3.2rem, 18vw, 5.2rem);
  }

  h2 {
    font-size: clamp(2.05rem, 10.5vw, 3.3rem);
  }

  .hero-dashboard,
  .skill-grid,
  .project-grid,
  .education-layout,
  .identity-grid {
    grid-template-columns: 1fr;
  }

  .timeline-head {
    display: grid;
  }

  .pill {
    justify-self: start;
  }

  .button {
    width: 100%;
  }

  .hero-visual {
    inset: 3% -36% auto auto;
    opacity: 0.62;
    width: 620px;
  }

  .signal-map {
    display: none;
  }
}

@media (max-width: 430px) {
  .nav-links a {
    padding-inline: 10px;
  }

  .header-controls {
    gap: 6px;
  }

  .control-button {
    min-width: 34px;
    padding-inline: 8px;
    font-size: 0.8rem;
  }
}
