:root {
  --bg-main: #030b16;
  --bg-surface: #081529;
  --text-main: #e6f2ff;
  --text-muted: #a7bdd6;
  --accent: #2cc8ff;
  --accent-strong: #1a8cff;
  --accent-soft: rgba(44, 200, 255, 0.22);

  --glass-bg: rgba(10, 23, 40, 0.5);
  --glass-border: rgba(170, 215, 255, 0.22);
  --glass-border-hover: rgba(32, 153, 255, 0.92);
  --glass-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --glass-blur: 16px;

  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;

  --container: min(1100px, calc(100vw - 2rem));

  --duration-fast: 180ms;
  --duration-mid: 320ms;
  --duration-slow: 650ms;
  --ease-emphatic: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 15% 20%, rgba(32, 142, 224, 0.22), transparent 40%),
    radial-gradient(circle at 85% 12%, rgba(11, 98, 171, 0.24), transparent 36%),
    linear-gradient(145deg, var(--bg-main), var(--bg-surface));
  overflow-x: hidden;
}

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

main {
  position: relative;
  z-index: 3;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 280px;
  aspect-ratio: 1;
  top: -70px;
  left: -90px;
  background: rgba(16, 147, 255, 0.45);
}

.orb-b {
  width: 360px;
  aspect-ratio: 1;
  right: -130px;
  bottom: 8vh;
  background: rgba(12, 200, 255, 0.35);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 188, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 188, 255, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.site-header {
  width: var(--container);
  margin: 0 auto;
  padding: 1.2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: rgba(4, 12, 24, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(135, 199, 255, 0.18);
  z-index: -1;
}

.brand {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 1rem;
  color: #c8ebff;
  padding: 0.55rem 0.95rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-right: 0.8rem;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.93rem;
  transition: color var(--duration-fast) ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #ffffff;
}

.section {
  width: var(--container);
  margin: 0 auto;
  padding: var(--space-6) 0;
  position: relative;
  z-index: 4;
}

.section-head {
  margin-bottom: 1.35rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: #87ccf6;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
}

h2 {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition:
    transform var(--duration-mid) var(--ease-emphatic),
    border-color var(--duration-mid) var(--ease-emphatic),
    box-shadow var(--duration-mid) var(--ease-emphatic),
    background-color var(--duration-mid) ease;
}

.glass-card:hover,
.glass-card:focus-within,
.glass-card:focus-visible {
  transform: translateY(-7px);
  border-color: var(--glass-border-hover);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
}

.hero-section {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  text-align: left;
  padding-top: var(--space-5);
}

.hero-content {
  width: min(980px, 100%);
  padding: clamp(1.2rem, 3vw, 2.2rem);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: clamp(0.9rem, 2vw, 1.5rem);
  align-items: start;
}

.hero-copy {
  min-width: 0;
}

.hero-photo-frame {
  margin: 0;
  width: min(230px, 100%);
  aspect-ratio: 1 / 1;
  justify-self: end;
  border-radius: 44%;
  padding: 0.35rem;
  border: 1px solid rgba(98, 189, 255, 0.65);
  background: radial-gradient(circle at 28% 20%, rgba(56, 176, 255, 0.42), rgba(8, 28, 50, 0.48));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.hero-photo {
  width: 100%;
  height: 100%;
  border-radius: 44%;
  display: block;
  object-fit: cover;
  object-position: center 20%;
}

.hero-line {
  display: block;
  margin-bottom: 0.35rem;
  font-family: "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 0.05em;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  color: #9edcff;
}

.typed-name {
  display: inline-flex;
  align-items: center;
  min-height: 1.2em;
  font-family: "Orbitron", "Segoe UI", sans-serif;
  font-size: clamp(1.8rem, 6vw, 3.4rem);
  line-height: 1.1;
  color: #f1fbff;
  letter-spacing: 0.03em;
}

.typed-name::after {
  content: "|";
  margin-left: 0.1em;
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.hero-summary {
  max-width: 62ch;
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: clamp(0.98rem, 2vw, 1.08rem);
  line-height: 1.65;
}

.hero-metrics {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric {
  padding: 0.9rem 0.8rem;
  display: grid;
  gap: 0.2rem;
  border-radius: var(--radius-md);
}

.metric-value {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  font-weight: 700;
  color: #d8f6ff;
}

.metric-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-weight: 800;
  letter-spacing: 0.02em;
  transition:
    transform var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

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

.btn-primary,
.btn-small {
  border: 1px solid rgba(42, 182, 255, 0.8);
  background: linear-gradient(130deg, rgba(22, 147, 255, 0.6), rgba(42, 205, 255, 0.28));
  color: #f4fdff;
}

.btn-primary {
  padding: 0.72rem 1.2rem;
}

.btn-secondary {
  padding: 0.72rem 1.2rem;
  border: 1px solid rgba(153, 215, 255, 0.42);
  background: rgba(14, 28, 46, 0.4);
}

.btn-small {
  padding: 0.45rem 0.9rem;
  font-size: 0.84rem;
}

.scroll-indicator {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(148, 212, 255, 0.45);
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.85rem;
  background: rgba(2, 10, 20, 0.58);
  color: #cfeeff;
  font-family: "Orbitron", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  animation: drift 1.6s ease-in-out infinite;
  transition: opacity var(--duration-fast) ease;
}

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

  50% {
    transform: translateX(-50%) translateY(6px);
  }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.tools-subhead {
  margin: var(--space-5) 0 0.45rem;
  font-family: "Orbitron", "Segoe UI", sans-serif;
  font-size: clamp(1.08rem, 1.8vw, 1.32rem);
  letter-spacing: 0.02em;
  color: #d9f4ff;
}

.tools-subtext {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  line-height: 1.6;
}

.os-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.tool-logo-wrap {
  width: 56px;
  height: 56px;
  min-height: 56px;
  border-radius: 10px;
  border: 1px solid rgba(148, 212, 255, 0.2);
  background: rgba(9, 26, 45, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  overflow: hidden;
}

.tool-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.tool-icon-fallback {
  color: #a7def9;
  font-size: 2rem !important;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.skill-card {
  position: relative;
  padding: 1.2rem;
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.skill-card i {
  font-size: 2rem;
}

.skill-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.skill-card::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.5rem);
  transform: translateX(-50%) translateY(4px);
  width: min(220px, 92%);
  border-radius: 10px;
  background: rgba(3, 14, 26, 0.95);
  border: 1px solid rgba(77, 183, 255, 0.35);
  color: #d6f4ff;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.4rem 0.52rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.skill-card:hover::after,
.skill-card:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#skills .skills-grid,
#tools .skills-grid,
#tools .os-grid {
  align-items: start;
  isolation: isolate;
}

#skills .skill-card,
#tools .tool-card {
  overflow: hidden;
  transform-origin: center top;
  will-change: transform;
  --reveal-delay: 0ms;
}

#skills .skill-card:hover,
#skills .skill-card:focus-visible,
#skills .skill-card:focus-within,
#tools .tool-card:hover,
#tools .tool-card:focus-visible,
#tools .tool-card:focus-within {
  transform: translateY(-7px) scale(1.025);
  z-index: 6;
}

#skills .skill-extra,
#tools .skill-extra {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(10px);
  transition:
    max-height var(--duration-mid) var(--ease-emphatic),
    opacity var(--duration-mid) ease,
    transform var(--duration-mid) ease;
  transition-delay: 0ms;
}

#skills .skill-extra p,
#tools .skill-extra p {
  margin: 0.15rem 0 0;
  color: #cde7fa;
  font-size: 0.84rem;
  line-height: 1.55;
}

#skills .skill-card:hover .skill-extra,
#skills .skill-card:focus-visible .skill-extra,
#skills .skill-card:focus-within .skill-extra,
#tools .tool-card:hover .skill-extra,
#tools .tool-card:focus-visible .skill-extra,
#tools .tool-card:focus-within .skill-extra {
  max-height: 92px;
  opacity: 1;
  transform: translateY(0);
  transition-delay: var(--reveal-delay);
}

#skills .skills-grid .skill-card:nth-child(1),
#tools .skills-grid .tool-card:nth-child(1),
#tools .os-grid .tool-card:nth-child(1) {
  --reveal-delay: 0ms;
}

#skills .skills-grid .skill-card:nth-child(2),
#tools .skills-grid .tool-card:nth-child(2),
#tools .os-grid .tool-card:nth-child(2) {
  --reveal-delay: 45ms;
}

#skills .skills-grid .skill-card:nth-child(3),
#tools .skills-grid .tool-card:nth-child(3),
#tools .os-grid .tool-card:nth-child(3) {
  --reveal-delay: 90ms;
}

#skills .skills-grid .skill-card:nth-child(4),
#tools .skills-grid .tool-card:nth-child(4) {
  --reveal-delay: 135ms;
}

#skills .skills-grid .skill-card:nth-child(5),
#tools .skills-grid .tool-card:nth-child(5) {
  --reveal-delay: 180ms;
}

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

.project-card {
  padding: 1.2rem;
  display: grid;
  gap: 0.8rem;
}

.project-number {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  color: #93daf8;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

.project-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.62;
}

.tech-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.18rem;
  color: #b8e8ff;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.reveal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.reveal-card {
  padding: 1.2rem;
  overflow: hidden;
}

.reveal-summary {
  margin: 0.6rem 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.reveal-body {
  margin-top: 0.7rem;
  max-height: 0;
  opacity: 0;
  transform: translateY(8px);
  transition:
    max-height var(--duration-slow) var(--ease-emphatic),
    opacity var(--duration-mid) ease,
    transform var(--duration-mid) ease;
}

.reveal-body p {
  margin: 0;
  color: #d6edff;
  line-height: 1.65;
}

.reveal-card:hover .reveal-body,
.reveal-card:focus-visible .reveal-body {
  max-height: 190px;
  opacity: 1;
  transform: translateY(0);
}

.reveal-card.is-active .reveal-body {
  max-height: 190px;
  opacity: 1;
  transform: translateY(0);
}

.timeline-grid,
.awards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.timeline-card,
.award-card {
  padding: 1.1rem;
  display: grid;
  gap: 0.42rem;
}

.timeline-card p,
.award-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.text-link {
  display: inline-flex;
  align-items: center;
  color: #9edfff;
  font-weight: 700;
  font-size: 0.9rem;
}

.text-link:hover,
.text-link:focus-visible {
  color: #d8f6ff;
}

.contact-section {
  padding-bottom: 2.2rem;
}

.contact-card {
  padding: clamp(1.2rem, 2vw, 2rem);
}

.contact-card > p {
  margin-top: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.contact-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #d3edff;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  color: #ffffff;
}

.social-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.52rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(123, 196, 255, 0.28);
  background: rgba(8, 22, 38, 0.48);
  color: #d8f3ff;
  font-weight: 700;
  font-size: 0.85rem;
}

.social-links a:hover,
.social-links a:focus-visible {
  border-color: rgba(52, 166, 255, 0.85);
}

.site-footer {
  width: var(--container);
  margin: 0 auto;
  padding: 0.8rem 0 2rem;
  color: #8eb0cc;
  font-size: 0.85rem;
  text-align: center;
}

:focus-visible {
  outline: 2px solid rgba(76, 192, 255, 0.94);
  outline-offset: 2px;
}

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .glass-card,
  .site-header::before {
    background: rgba(8, 20, 36, 0.9);
  }
}

@media (min-width: 760px) {
  .projects-grid,
  .timeline-grid,
  .awards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reveal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .os-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-header {
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-photo-frame {
    justify-self: center;
    width: min(200px, 58vw);
    order: -1;
  }

  .scroll-indicator {
    bottom: 0.8rem;
  }
}

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