:root {
  --bg: #020812;
  --panel: #08111f;
  --panel-2: #0c1728;
  --line: rgba(53, 168, 255, 0.25);
  --line-strong: rgba(53, 168, 255, 0.65);
  --blue: #35a8ff;
  --blue-2: #0c7ff2;
  --cyan: #8fd7ff;
  --text: #e8f2ff;
  --muted: #95a6bb;
  --muted-2: #607089;
  --white: #fff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --max: 1180px;
}

/* ============================================================
   BASE
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

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

img,
svg {
  max-width: 100%;
  display: block;
}

.shell {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  background: var(--blue);
  color: #00101f;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  z-index: 999;
}

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

/* ============================================================
   HEADER / NAV
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 8, 18, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(53, 168, 255, 0.12);
}

.nav {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  font-weight: 950;
  font-size: 1.45rem;
  letter-spacing: -0.12em;
  color: var(--blue);
  text-shadow: 0 0 18px rgba(53, 168, 255, 0.45);
  border-left: 2px solid var(--blue);
  border-right: 2px solid var(--blue);
  padding: 0.05rem 0.35rem 0.05rem 0.2rem;
}

.brand-stack {
  display: flex;
  flex-direction: column;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.brand-stack strong {
  font-size: 0.9rem;
  color: var(--white);
}

.brand-stack small {
  font-size: 0.62rem;
  color: var(--blue);
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c6d3e5;
}

.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.65rem;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transition: 0.2s;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 0.5rem;
  gap: 0.35rem;
  flex-direction: column;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  min-height: 690px;
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  box-shadow: 0 0 24px var(--blue);
}

.tech-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 42%, rgba(53, 168, 255, 0.18), transparent 32%),
    radial-gradient(circle at 18% 8%, rgba(53, 168, 255, 0.11), transparent 25%),
    linear-gradient(rgba(53, 168, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 168, 255, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
}

.tech-bg::before,
.tech-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(
      90deg,
      transparent 0 12%,
      rgba(53, 168, 255, 0.22) 12.1% 12.25%,
      transparent 12.35% 100%
    ),
    linear-gradient(
      135deg,
      transparent 0 62%,
      rgba(53, 168, 255, 0.16) 62.1% 62.2%,
      transparent 62.3%
    );
  opacity: 0.5;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 4rem;
  align-items: center;
  padding: 6.2rem 0 3rem;
}

.microline,
.eyebrow,
.section-kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 850;
}

.microline span,
.eyebrow::before,
.section-kicker::after {
  content: "";
  display: inline-block;
  width: 48px;
  height: 1px;
  background: var(--line-strong);
}

.hero h1 {
  font-size: clamp(3.3rem, 7vw, 6.2rem);
  line-height: 0.95;
  margin: 0.3rem 0 0;
  font-weight: 950;
  letter-spacing: -0.06em;
  color: var(--white);
  text-shadow: 0 0 28px rgba(53, 168, 255, 0.12);
}

.hero-role {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  color: var(--blue);
  font-weight: 780;
  margin: 0.55rem 0;
}

.hero-lede {
  font-size: 1.12rem;
  color: #d4deeb;
  max-width: 650px;
  margin: 0 0 1.6rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.6rem 0 2.1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  border: 1px solid var(--line-strong);
  padding: 0.86rem 1.2rem;
  border-radius: 8px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  transition: 0.18s;
}

.button.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: white;
  box-shadow: 0 0 30px rgba(53, 168, 255, 0.22);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.035);
  color: #d9e9fb;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
}

.focus-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem 1.5rem;
  color: #c6d3e5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 0.72rem;
}

.focus-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.focus-row i {
  font-style: normal;
  color: var(--blue);
  font-size: 1rem;
}

/* ============================================================
   HERO PORTRAIT / FLOATING PANEL
   ============================================================ */

.portrait-wrap {
  position: relative;
  min-height: 480px;
  overflow: visible;
}

.portrait-frame {
  position: absolute;
  inset: 0 3rem 1.2rem 1.5rem;
  border-radius: 26px;
  clip-path: polygon(8% 0, 100% 0, 100% 86%, 88% 100%, 0 100%, 0 10%);
  border: 1px solid var(--line-strong);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 40px rgba(53, 168, 255, 0.18);
}

.photo {
  background-size: cover;
  background-position: center;
}

.portrait {
  background-image: var(--photo-portrait);
  background-position: center top;
}

.lab-photo {
  background-image: var(--photo-lab);
}

.project-1 {
  background-image: var(--photo-project-1);
}

.project-2 {
  background-image: var(--photo-project-2);
}

.project-3 {
  background-image: var(--photo-project-3);
}

.footer-photo {
  background-image: var(--photo-footer-wide);
}

.hero-panel {
  position: absolute;
  right: 0;
  bottom: 1.25rem;
  width: min(300px, 70%);
  padding: 1.35rem;
  border: 1px solid var(--line-strong);
  background: rgba(5, 12, 24, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  clip-path: polygon(9% 0, 100% 0, 100% 91%, 91% 100%, 0 100%, 0 9%);
  transform: translateX(72%);
  z-index: 4;
}

.hero-panel .panel-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--blue);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.hero-panel strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--blue);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.hero-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: #d9e5f4;
}

/* ============================================================
   SKILL BAND
   ============================================================ */

.skill-band {
  padding: 2rem 0;
  background: #030916;
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  margin: 0 0 1rem;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.85rem;
}

.skill-grid article {
  min-height: 82px;
  padding: 1rem;
  border: 1px solid rgba(53, 168, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.skill-grid span {
  color: var(--blue);
  font-size: 1.5rem;
}

.skill-grid strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

/* ============================================================
   GENERAL SECTIONS
   ============================================================ */

.section-pad {
  padding: 6rem 0;
}

.compact {
  padding: 3.2rem 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 2rem;
  align-items: stretch;
}

.about-copy,
.about-card,
.wins,
.capability-matrix > div,
.project-card {
  border: 1px solid rgba(53, 168, 255, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border-radius: var(--radius);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.about-copy {
  padding: 2.2rem;
}

.about-copy h2,
.section-header h2,
.timeline h2,
.contact h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  margin: 0.4rem 0 1.1rem;
  letter-spacing: -0.04em;
}

.about-copy p,
.about-card p,
.timeline p,
.wins li,
.capability-matrix p,
.contact p,
.project-card p {
  color: #bac9db;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.stat-strip div {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.stat-strip strong {
  display: block;
  color: var(--blue);
  font-size: 1.15rem;
}

.stat-strip span {
  color: var(--muted);
  font-size: 0.9rem;
}

.about-card {
  overflow: hidden;
}

.about-card .photo {
  height: 300px;
}

.about-card h3,
.about-card p {
  padding-inline: 1.35rem;
}

.about-card h3 {
  font-size: 1.35rem;
  margin: 1.2rem 0 0.4rem;
}

.about-card p {
  padding-bottom: 1.35rem;
}

/* ============================================================
   PROJECTS
   ============================================================ */

.dark-panel {
  background: linear-gradient(180deg, #030914, #06101e);
  border-block: 1px solid var(--line);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.4rem;
}

.section-header a {
  color: var(--blue);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.project-card {
  overflow: hidden;
}

.project-img {
  height: 190px;
  background-color: #07111f;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line);
}

.project-card div:not(.project-img) {
  padding: 1.25rem;
}

.project-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.tags {
  color: var(--blue) !important;
  font-weight: 800;
  font-size: 0.83rem;
  margin: 0.15rem 0 0.75rem !important;
}

/* ============================================================
   EXPERIENCE
   ============================================================ */

.experience-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
}

.timeline {
  position: relative;
}

.timeline-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}

.timeline-list article {
  position: relative;
  padding: 1.35rem 1.35rem 1.35rem 2.4rem;
  border-left: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 0 14px 14px 0;
}

.dot {
  position: absolute;
  left: -8px;
  top: 1.55rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 20px var(--blue);
}

.timeline h3 {
  margin: 0;
}

.meta {
  color: var(--blue) !important;
  font-weight: 800;
  margin: 0.15rem 0 0.3rem;
}

.wins {
  padding: 1.5rem;
}

.wins h3 {
  font-size: 1.6rem;
  margin-top: 0;
}

.wins ul {
  padding-left: 1.2rem;
  display: grid;
  gap: 1rem;
}

.wins li::marker {
  color: var(--blue);
}

/* ============================================================
   CAPABILITY MATRIX
   ============================================================ */

.capability-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.capability-matrix > div {
  padding: 1.4rem;
}

.capability-matrix h3 {
  margin: 0 0 0.5rem;
}

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */

.contact {
  padding: 5rem 0 2.5rem;
  background: #030813;
  border-top: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.65fr;
  gap: 1.5rem;
  align-items: stretch;
}

.contact-copy {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(53, 168, 255, 0.09), rgba(255, 255, 255, 0.02));
}

.contact-info {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 0.8rem;
  align-content: center;
}

.contact-info a:not(.button),
.contact-info span {
  color: #d9e9fb;
}

.contact-info .button {
  margin-top: 0.6rem;
}

.footer-photo {
  grid-column: 1 / -1;
  height: 180px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  opacity: 0.88;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0;
  color: var(--muted);
  background: #02060d;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */

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

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

.delay-1 {
  transition-delay: 0.08s;
}

.delay-2 {
  transition-delay: 0.16s;
}

/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 1050px) {
  .hero-grid,
  .about-grid,
  .experience-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    right: 1rem;
    bottom: 1rem;
    transform: none;
    width: min(300px, calc(100% - 2rem));
  }

  .portrait-wrap {
    min-height: 520px;
  }

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

  .project-grid,
  .capability-matrix {
    grid-template-columns: 1fr;
  }

  .section-header {
    display: block;
  }

  .contact-info {
    align-content: start;
  }
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 760px) {
  .shell {
    width: min(100% - 28px, var(--max));
  }

  .site-header {
    position: sticky;
  }

  .nav {
    height: 78px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    inset: 78px 14px auto 14px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(2, 8, 18, 0.96);
  }

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

  .brand-stack small {
    display: none;
  }

  .hero {
    min-height: auto;
    overflow: hidden;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    padding-top: 3.2rem;
    padding-bottom: 2rem;
    gap: 2rem;
  }

  .hero-copy {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(3rem, 17vw, 4.6rem);
  }

  .hero-role {
    font-size: 1.55rem;
  }

  .hero-lede {
    font-size: 1rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-bottom: 1.6rem;
  }

  .button {
    width: 100%;
    min-height: 48px;
  }

  .focus-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
    font-size: 0.69rem;
  }

  /* The important mobile fix:
     portrait and card become stacked blocks instead of overlaying. */
  .portrait-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    min-height: 0;
    overflow: visible;
  }

  .portrait-frame {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 430px;
    border-radius: 24px;
    background-position: center top;
    background-size: cover;
  }

  .portrait-wrap .hero-panel {
    position: relative;
    inset: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.35rem;
  }

  .skill-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-strip {
    grid-template-columns: 1fr;
  }

  .section-pad {
    padding: 4rem 0;
  }

  .about-copy,
  .contact-copy,
  .contact-info,
  .wins,
  .capability-matrix > div {
    padding: 1.35rem;
  }

  .about-copy h2,
  .section-header h2,
  .timeline h2,
  .contact h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}

/* ============================================================
   SMALL MOBILE
   ============================================================ */

@media (max-width: 460px) {
  .shell {
    width: min(100% - 24px, var(--max));
  }

  .brand {
    gap: 0.7rem;
  }

  .brand-stack {
    letter-spacing: 0.16em;
  }

  .brand-stack strong {
    font-size: 0.78rem;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .focus-row {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    min-height: 390px;
  }

  .hero-panel strong {
    font-size: 0.76rem;
  }

  .hero-panel ul {
    font-size: 0.7rem;
  }

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

  .footer-inner {
    display: block;
  }

  .contact-grid {
    display: block;
  }

  .contact-info,
  .footer-photo {
    margin-top: 1rem;
  }
}