:root {
  --bg: #0b0f14;
  --bg-alt: #111820;
  --surface: #161d27;
  --surface-hover: #1c2532;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf4;
  --text-muted: #8b9cb3;
  --accent: #3dd6c3;
  --accent-dim: rgba(61, 214, 195, 0.12);
  --accent-glow: rgba(61, 214, 195, 0.25);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 72px;
  --container: min(1120px, calc(100% - 2.5rem));
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  background: rgba(11, 15, 20, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: var(--container);
  margin-inline: auto;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-resume {
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
}

.nav-resume:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 3rem) 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, var(--accent-glow), transparent),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(80, 120, 255, 0.08), transparent);
  pointer-events: none;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
  opacity: 0.4;
}

.hero-inner {
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 38rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: #4de8d4;
}

.btn-ghost {
  border-color: var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stats dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.hero-stats dd {
  font-size: 0.95rem;
  font-weight: 500;
}

.cert-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.cert-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(61, 214, 195, 0.25);
  white-space: nowrap;
}

/* Sections */

.section {
  padding: 6rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  margin-bottom: 3rem;
}

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.about-text {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Skills */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, background 0.2s;
}

.skill-card:hover {
  border-color: rgba(61, 214, 195, 0.3);
  background: var(--surface-hover);
}

.skill-icon {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.skill-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.skill-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tech-tags span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(61, 214, 195, 0.2);
}

/* Timeline */

.timeline {
  list-style: none;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -1.65rem;
  top: 0.45rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.timeline-meta time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.timeline-content h3 {
  font-size: 1.2rem;
  margin: 0.35rem 0 0.15rem;
}

.timeline-org {
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-content > p:last-child {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Credentials */

.creds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.cred-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.cred-card-cert {
  border-color: rgba(61, 214, 195, 0.2);
  background: linear-gradient(160deg, var(--surface) 0%, rgba(61, 214, 195, 0.04) 100%);
}

.cred-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(61, 214, 195, 0.2);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.cred-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.cred-org {
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.cred-card time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cred-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Contact */

.contact-section {
  padding-bottom: 8rem;
}

.contact-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-alt) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.contact-lead {
  color: var(--text-muted);
  max-width: 32rem;
  margin-bottom: 2rem;
}

.contact-links {
  display: grid;
  gap: 1rem;
}

.contact-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s;
}

.contact-link:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.contact-link-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact-link-value {
  font-size: 1.05rem;
  font-weight: 500;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-inner a:hover {
  color: var(--accent);
}

.footer-stats {
  opacity: 0.45;
  font-size: 0.78rem;
}

/* Cookie banner */

.cookie-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(560px, calc(100% - 2rem));
}

.cookie-banner-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  max-height: min(85vh, 640px);
  overflow-y: auto;
}

.cookie-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.cookie-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-actions .btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  min-height: 2.5rem;
}

.cookie-category {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
}

.cookie-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.cookie-category-head strong {
  font-size: 0.95rem;
  margin-right: 0.5rem;
}

.cookie-required,
.cookie-optional {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  vertical-align: middle;
}

.cookie-required {
  background: rgba(61, 214, 195, 0.15);
  color: var(--accent);
  border: 1px solid rgba(61, 214, 195, 0.25);
}

.cookie-optional {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.cookie-category-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.cookie-toggle-locked {
  cursor: not-allowed;
  opacity: 0.7;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.2s;
}

.cookie-toggle-track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.cookie-toggle input:checked + .cookie-toggle-track {
  background: var(--accent-dim);
  border-color: rgba(61, 214, 195, 0.4);
}

.cookie-toggle input:checked + .cookie-toggle-track::before {
  transform: translateX(20px);
  background: var(--accent);
}

.cookie-toggle input:disabled + .cookie-toggle-track {
  background: var(--accent-dim);
  border-color: rgba(61, 214, 195, 0.3);
}

.cookie-toggle input:disabled + .cookie-toggle-track::before {
  transform: translateX(20px);
  background: var(--accent);
}

/* Reveal animation */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li a {
    display: block;
    padding: 0.85rem 0.5rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}
