@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

:root {
  --bg:           #0f172a;
  --bg-alt:       #08101e;
  --surface:      #1e293b;
  --border:       #2d3f55;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-subtle:  #6c87ae;
  --accent:       #38bdf8;
  --accent-dim:   rgba(56, 189, 248, 0.1);
  --accent-hover: #7dd3fc;

  --max-width:    960px;
  --nav-height:   64px;
  --section-pad:  6rem;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius:    8px;
  --radius-lg: 12px;
  --ease:      200ms ease;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

section {
  padding-block: var(--section-pad);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 2.25rem;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color var(--ease), color var(--ease),
              border-color var(--ease), transform var(--ease);
  white-space: nowrap;
  line-height: 1;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background-color: var(--accent-dim);
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: var(--accent-dim);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid rgba(56, 189, 248, 0.2);
  white-space: nowrap;
}

#navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-height);
  z-index: 100;
  background-color: rgba(8, 16, 30, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease);
}

#navbar.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-logo {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 450;
  transition: color var(--ease), background-color var(--ease);
}

.nav-links a:hover {
  color: var(--text);
  background-color: rgba(255,255,255,0.05);
}

.nav-links a.active {
  color: var(--accent);
  background-color: var(--accent-dim);
}

.nav-cta {
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

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

.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 {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-height);
  position: relative;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(56, 189, 248, 0.09) 0%, transparent 65%),
    radial-gradient(circle, rgba(56, 189, 248, 0.12) 1px, transparent 1px);
  background-size: auto, 28px 28px;
}

.hero-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding-block: 4rem;
}

.hero-text {
  display: flex;
  flex-direction: column;
}

.hero-greeting {
  font-size: 1.0625rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(2.75rem, 8vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  padding-bottom: 0.1em;
  margin-bottom: 0.625rem;
  background: linear-gradient(135deg, var(--text) 40%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: 400;
  color: var(--text-muted);
  min-height: 1.75rem;
  margin-bottom: 1.75rem;
}

.hero-bio {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.hero-creds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.5rem;
  margin-bottom: 1.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.hero-socials {
  display: flex;
  gap: 0.75rem;
}

.hero-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: color var(--ease), border-color var(--ease), background-color var(--ease);
}

.hero-socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--accent-dim);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-subtle);
  animation: bounce 2.2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

#about {
  background-color: var(--bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1.0rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
  max-width: 420px;
  align-self: start;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 110px;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.stat-caption {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.35rem;
  opacity: 0.75;
}

#experience {
  background-color: var(--bg);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--ease), box-shadow var(--ease);
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(2px - 2rem);
  top: 1.625rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: background-color var(--ease);
}

.timeline-item:hover::before {
  background: var(--accent);
}

.timeline-item:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.job-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.company-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.company-name {
  font-weight: 500;
  color: var(--accent);
}

.company-location {
  font-size: 0.875rem;
}

.company-location::before {
  content: '·';
  margin-inline: 0.4rem;
}

.date-range {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  white-space: nowrap;
  flex-shrink: 0;
  font-style: normal;
  padding-top: 0.1em;
}

.job-bullets {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.job-bullets li {
  font-size: 0.9375rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.6;
}

.job-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 0.3em;
}

#skills {
  background-color: var(--bg-alt);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem 1.5rem;
}

.skill-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skill-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.skill-group-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

#education {
  background-color: var(--bg);
}

.edu-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.edu-card {
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--ease);
}

.edu-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.edu-degree {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.edu-institution {
  font-size: 0.9375rem;
  color: var(--accent);
  font-weight: 500;
}

.edu-detail {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.edu-detail em {
  color: var(--text);
  font-style: normal;
}

#faq {
  background-color: var(--bg);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
  color: var(--text);
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item[open] .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin: 0;
}

#contact {
  background-color: var(--bg-alt);
}

.contact-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.contact-intro {
  color: var(--text-muted);
  font-size: 1.0625rem;
  max-width: 540px;
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 2.5rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 1rem;
  transition: color var(--ease);
}

.contact-link:hover {
  color: var(--accent);
}

.contact-link svg {
  flex-shrink: 0;
  color: var(--accent);
}

#contact-form {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.875rem;
  transition: border-color var(--ease), box-shadow var(--ease);
  width: 100%;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  outline: none;
}

.form-status {
  border-radius: 6px;
  font-size: 0.9rem;
  padding: 0.65rem 0.875rem;
}

.form-status.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.form-status.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

footer {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-inner strong {
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 768px) {
  :root {
    --section-pad: 4rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.625rem;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
  }

  .nav-cta {
    display: none;
  }

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

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

  .timeline-item {
    padding: 1.25rem;
  }

  .timeline-header {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

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

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    justify-content: center;
  }
}

.hero-photo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid var(--border);
  box-shadow: 0 0 0 6px var(--accent-dim), 0 0 40px rgba(56, 189, 248, 0.08);
}

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

  .hero-photo {
    order: -1;
  }

  .profile-img {
    width: 160px;
    height: 160px;
  }
}

.otw-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.07);
  color: #4ade80;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  width: fit-content;
}

.otw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.email-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-subtle);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.copy-btn.copied {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
}

.copy-btn .icon-check {
  display: none;
}

.copy-btn.copied .icon-copy {
  display: none;
}

.copy-btn.copied .icon-check {
  display: block;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .typed-cursor {
    animation: none;
    opacity: 1;
  }

  .otw-dot {
    animation: none;
  }

  .hero-scroll-hint {
    animation: none;
    opacity: 0;
  }
}

.edu-card .tag-list {
  margin-top: 0.75rem;
}

.contact-link--static {
  pointer-events: none;
  cursor: default;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: var(--radius);
  z-index: 200;
  transition: top 0.15s;
}

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

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), color var(--ease), border-color var(--ease), background-color var(--ease);
  z-index: 90;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

@media (max-width: 768px) {
  .timeline {
    padding-left: 0;
  }

  .timeline::before,
  .timeline-item::before {
    display: none;
  }
}

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 300;
  transition: width 0.1s linear;
  pointer-events: none;
}

.typed-cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--text-muted);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 0.75s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--ease), border-color var(--ease), background-color var(--ease);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--accent-dim);
}

.theme-toggle .icon-moon {
  display: none;
}

.cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.cmd-palette.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cmd-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cmd-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin-inline: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.cmd-search-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}

.cmd-search-row svg {
  flex-shrink: 0;
  color: var(--text-subtle);
}

#cmdInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  min-width: 0;
}

#cmdInput::placeholder {
  color: var(--text-subtle);
}

.cmd-kbd {
  font-size: 0.7rem;
  color: var(--text-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  flex-shrink: 0;
  font-family: var(--font);
}

.cmd-list {
  padding: 0.375rem;
  max-height: 300px;
  overflow-y: auto;
}

.cmd-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.625rem 0.25rem;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9375rem;
  transition: background-color var(--ease), color var(--ease);
}

.cmd-item:hover,
.cmd-item.active {
  background-color: var(--accent-dim);
  color: var(--accent);
}

.cmd-item svg {
  flex-shrink: 0;
  color: var(--text-subtle);
  transition: color var(--ease);
}

.cmd-item:hover svg,
.cmd-item.active svg {
  color: var(--accent);
}

.cmd-empty {
  padding: 1.75rem;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.875rem;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:           #f8fafc;
    --bg-alt:       #f1f5f9;
    --surface:      #ffffff;
    --border:       #e2e8f0;
    --text:         #0f172a;
    --text-muted:   #475569;
    --text-subtle:  #636d7b;
    --accent:       #0369a1;
    --accent-dim:   rgba(3, 105, 161, 0.08);
    --accent-hover: #025e8c;
  }

  :root:not([data-theme="dark"]) #navbar {
    background-color: rgba(248, 250, 252, 0.9);
  }

  :root:not([data-theme="dark"]) .nav-links a:hover {
    background-color: rgba(0, 0, 0, 0.05);
  }

  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}

[data-theme="light"] {
  --bg:           #f8fafc;
  --bg-alt:       #f1f5f9;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --text:         #0f172a;
  --text-muted:   #475569;
  --text-subtle:  #636d7b;
  --accent:       #0369a1;
  --accent-dim:   rgba(3, 105, 161, 0.08);
  --accent-hover: #025e8c;
}

[data-theme="light"] #navbar {
  background-color: rgba(248, 250, 252, 0.9);
}

[data-theme="light"] .nav-links a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

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

/* ─── Terminal ─────────────────────────────────────────────────────────────── */

#terminal { background-color: var(--bg-alt); }

.term-window {
  max-width: 720px;
  margin: 0 auto;
  background: #020b14;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  cursor: text;
}

.term-chrome {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem;
  background: #0a1929;
  border-bottom: 1px solid var(--border);
}

.term-dots {
  display: flex;
  gap: 6px;
}

.term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.term-dot-red    { background: #ff5f56; }
.term-dot-yellow { background: #ffbd2e; }
.term-dot-green  { background: #27c93f; }

.term-title {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin: 0 auto;
  letter-spacing: 0.03em;
}

.term-body {
  padding: 1rem 1.25rem 0.5rem;
  min-height: 180px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--text);
}

.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line.term-cmd    { color: var(--accent); }
.term-line.term-muted  { color: var(--text-subtle); }
.term-line.term-error  { color: #f87171; }
.term-line.term-ok     { color: #4ade80; }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem 0.875rem;
}

.term-prompt {
  color: var(--accent);
  font-size: 0.8125rem;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.8125rem;
  font-family: inherit;
  caret-color: var(--accent);
}

.tag-wip {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(56, 189, 248, 0.06);
}

.tag-planned {
  border-style: dashed;
  color: var(--text-subtle);
}

.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 1rem;
}

.page-404-code {
  font-size: clamp(5rem, 20vw, 10rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.page-404-msg {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 28rem;
}

@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }

  #navbar,
  #progress-bar,
  .skip-link,
  .hero-scroll-hint,
  .hero-actions,
  .hero-socials,
  .otw-badge,
  .typed-cursor,
  .copy-btn,
  .back-to-top,
  #contact-form,
  .cmd-palette,
  footer { display: none !important; }

  html, body {
    font-size: 11pt;
    background: white !important;
    color: #111 !important;
  }

  body, section, #contact, #skills, #about, #experience, #education {
    background: white !important;
    background-color: white !important;
  }

  section {
    padding-block: 1.5rem;
  }

  #hero {
    min-height: auto;
    padding-top: 1.5rem;
    padding-bottom: 1rem;
  }

  .hero-content {
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
  }

  .profile-img {
    width: 100px;
    height: 100px;
    border: 1px solid #ccc;
  }

  .hero-name {
    -webkit-text-fill-color: #111;
    background: none;
    color: #111 !important;
    font-size: 2rem;
  }

  .hero-title,
  .hero-bio,
  .hero-greeting {
    color: #333 !important;
  }

  .section-title {
    color: #111 !important;
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .section-title::after {
    background: #111 !important;
  }

  .timeline-item,
  .edu-card,
  .stat-card,
  .skill-group {
    background: white !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .timeline::before,
  .timeline-item::before {
    display: none !important;
  }

  .timeline {
    padding-left: 0 !important;
  }

  .tag,
  .skill-tag {
    background: #f0f0f0 !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .tag-wip {
    background: #e8f4fd !important;
    color: #0369a1 !important;
    border-color: #0369a1 !important;
  }

  .tag-planned {
    background: #f0f0f0 !important;
    color: #555 !important;
    border: 1px dashed #999 !important;
  }

  #terminal { display: none !important; }

  .text-accent,
  .contact-link svg,
  .skill-group-label {
    color: #111 !important;
  }

  .contact-links .contact-link {
    color: #333 !important;
  }

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

  .stat-number {
    color: #111 !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  a[href]::after {
    content: none;
  }
}
