:root {
  color-scheme: dark;
  --bg: #030303;
  --ink: #ffffff;
  --muted: #c8c6bd;
  --faint: rgba(247, 247, 243, 0.08);
  --rule: rgba(247, 247, 243, 0.16);
  --surface: rgba(18, 18, 18, 0.82);
  --surface-strong: rgba(28, 28, 27, 0.96);
  --nav-bg: rgba(3, 3, 3, 0.7);
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.52);
  --shadow-hover: 0 30px 100px rgba(0, 0, 0, 0.62);
  --grid-line: rgba(247, 247, 243, 0.018);
  --glow: rgba(255, 255, 255, 0.07);
  --fade-top: #0a0a0a;
  --accent-1: rgba(255, 255, 255, 0.92);
  --accent-1-text: #ffffff;
  --accent-1-bg: rgba(255, 255, 255, 0.09);
  --accent-2: rgba(255, 255, 255, 0.74);
  --accent-2-text: rgba(255, 255, 255, 0.86);
  --accent-2-bg: rgba(255, 255, 255, 0.065);
  --accent-3: rgba(255, 255, 255, 0.56);
  --accent-3-text: rgba(255, 255, 255, 0.74);
  --accent-3-bg: rgba(255, 255, 255, 0.045);
  --accent-4: rgba(255, 255, 255, 0.4);
  --accent-4-text: rgba(255, 255, 255, 0.62);
  --accent-4-bg: rgba(255, 255, 255, 0.03);
  --font-display: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f3;
  --ink: #14130f;
  --muted: #6b675c;
  --faint: rgba(20, 19, 15, 0.05);
  --rule: rgba(20, 19, 15, 0.14);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --nav-bg: rgba(247, 247, 243, 0.78);
  --shadow: 0 20px 60px rgba(20, 19, 15, 0.1);
  --shadow-hover: 0 26px 70px rgba(20, 19, 15, 0.16);
  --grid-line: rgba(20, 19, 15, 0.045);
  --glow: rgba(20, 19, 15, 0.05);
  --fade-top: #ffffff;
  --accent-1: rgba(20, 19, 15, 0.86);
  --accent-1-text: #14130f;
  --accent-1-bg: rgba(20, 19, 15, 0.07);
  --accent-2: rgba(20, 19, 15, 0.66);
  --accent-2-text: rgba(20, 19, 15, 0.78);
  --accent-2-bg: rgba(20, 19, 15, 0.05);
  --accent-3: rgba(20, 19, 15, 0.48);
  --accent-3-text: rgba(20, 19, 15, 0.62);
  --accent-3-bg: rgba(20, 19, 15, 0.035);
  --accent-4: rgba(20, 19, 15, 0.32);
  --accent-4-text: rgba(20, 19, 15, 0.5);
  --accent-4-bg: rgba(20, 19, 15, 0.025);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, var(--glow), transparent 26rem),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(180deg, var(--fade-top) 0%, var(--bg) 72%);
  background-size: auto, 42px 42px, 42px 42px, auto;
  background-repeat: no-repeat, repeat, repeat, no-repeat;
  background-attachment: fixed, fixed, fixed, fixed;
  transition: background-color 0.3s ease;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  transition: color 0.3s ease;
}

a {
  color: inherit;
  text-decoration-color: rgba(255, 255, 255, 0.28);
  text-underline-offset: 0.18em;
}

[data-theme="light"] a {
  text-decoration-color: rgba(20, 19, 15, 0.28);
}

a:hover {
  text-decoration-color: currentColor;
}

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

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

strong {
  font-weight: 700;
}

em {
  font-style: italic;
  font-weight: 600;
}

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

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
  z-index: 1000;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}

.site-nav__brand {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--faint);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-nav__brand:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: var(--surface-strong);
}

[data-theme="light"] .site-nav__brand:hover {
  border-color: rgba(20, 19, 15, 0.32);
}

.site-nav__links {
  display: flex;
  gap: 22px;
  margin-right: auto;
  overflow-x: auto;
}

.site-nav__links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav__links a:hover,
.site-nav__links a.is-active {
  color: var(--ink);
  border-color: var(--ink);
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn--solid {
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  border: 1px solid var(--ink);
}

.btn--solid:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn--ghost {
  border: 1px solid var(--rule);
  background: var(--faint);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
}

[data-theme="light"] .btn--ghost:hover {
  border-color: rgba(20, 19, 15, 0.32);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
  transition: transform 0.3s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: rotate(20deg);
  border-color: rgba(255, 255, 255, 0.32);
  background: var(--surface-strong);
}

[data-theme="light"] .theme-toggle:hover {
  border-color: rgba(20, 19, 15, 0.32);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.icon-sun {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: block;
}

[data-theme="light"] .icon-moon {
  display: none;
}

.resume {
  width: min(100%, 880px);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.hero {
  padding: 72px 24px 48px;
  position: relative;
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--faint);
  color: var(--muted);
  margin-bottom: 24px;
}

.hero__tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--bg);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .hero__tag::before {
  box-shadow: 0 0 8px rgba(20, 19, 15, 0.35);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.2vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.98;
  margin: 0 0 16px;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .hero h1 {
  text-shadow: none;
}

.hero__tagline {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 20px;
  min-height: 1.4em;
  transition: opacity 0.25s ease;
}

.hero__tagline::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--ink);
  margin-left: 2px;
  vertical-align: -0.15em;
  animation: caret 1s step-end infinite;
}

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

.hero__summary {
  max-width: 640px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 28px;
}

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

.resume h2 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 56px 0 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-margin-top: 96px;
}

.hero + h2 {
  margin-top: 8px;
}

.resume h2::before {
  content: "//";
  color: var(--muted);
  font-weight: 600;
}

.entry {
  position: relative;
  padding: 28px 28px 28px 32px;
  margin-bottom: 22px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--entry-accent, var(--accent-1));
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.entry:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.entry::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 34px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--entry-accent, var(--accent-1));
  box-shadow: 0 0 0 4px var(--bg);
  transform: translateX(-50%);
}

.entry h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.entry__version {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--entry-accent-text, var(--accent-1-text));
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px 9px;
}

.entry p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 10px 0;
}

.entry ul {
  margin: 0 0 18px;
  padding-left: 1.15rem;
}

.entry ul:last-child {
  margin-bottom: 0;
}

.entry li {
  margin-bottom: 9px;
  line-height: 1.65;
  padding-left: 0.1rem;
}

.entry li:last-child {
  margin-bottom: 0;
}

.entry li strong {
  background: var(--accent-1-bg);
  color: var(--accent-1-text);
  padding: 1px 5px;
  border-radius: 5px;
}

.skills-panel {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 28px 30px;
  box-shadow: var(--shadow);
}

.skills-panel p {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.chip-row:last-child {
  margin-bottom: 0;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink);
  background: var(--faint);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
}

[data-theme="light"] .chip:hover {
  border-color: rgba(20, 19, 15, 0.32);
}

.chip:not(.chip--muted) {
  color: var(--accent-1-text);
}

.chip--muted {
  color: var(--muted);
  background: transparent;
}

.site-footer {
  text-align: center;
  padding: 40px 24px 60px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  html {
    background-size: auto, 34px 34px, 34px 34px, auto;
  }
}

@media (max-width: 640px) {
  .site-nav {
    padding: 12px 14px;
    gap: 8px;
  }

  .site-nav__links {
    gap: 10px;
  }

  .site-nav__links a {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }

  .site-nav__actions {
    gap: 8px;
  }

  .site-nav__actions .btn--ghost {
    display: none;
  }

  .hero {
    padding: 52px 20px 36px;
  }

  .resume {
    padding: 0 16px 60px;
  }

  .entry {
    padding: 22px 18px 22px 22px;
  }

  .skills-panel {
    padding: 22px 20px;
  }
}

@media print {
  .scroll-progress,
  .site-nav,
  .site-footer,
  .hero__tag,
  .hero__tagline,
  .hero__actions {
    display: none !important;
  }

  html, body {
    background: #ffffff;
  }

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

  .hero {
    padding: 0 0 16pt;
    margin: 0 0 16pt;
  }

  .hero h1 {
    color: #000000;
    text-shadow: none;
  }

  .hero__summary {
    color: #000000;
  }

  .entry {
    box-shadow: none;
    border: 1px solid #cccccc;
    background: #ffffff;
    break-inside: avoid;
  }

  .entry li strong {
    background: none;
    color: #000000;
  }

  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
