:root {
  --bg: #090d18;
  --bg-soft: #0f1627;
  --panel: rgba(15, 22, 39, 0.72);
  --panel-strong: #111a2f;
  --line: rgba(151, 172, 219, 0.28);
  --text: #e8edf8;
  --muted: #a6b7dd;
  --primary: #6fd3ff;
  --accent: #4dffb4;
  --warn: #ffbe78;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 65px rgba(2, 6, 16, 0.55);
  --container: min(1120px, 92vw);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at 10% 8%, #1b2750 0%, rgba(9, 13, 24, 0) 42%),
              radial-gradient(circle at 85% 12%, #1a4b49 0%, rgba(9, 13, 24, 0) 38%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-tap-highlight-color: rgba(111, 211, 255, 0.2);
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -48px;
  z-index: 40;
  background: #0a1324;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.ambient,
.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.ambient {
  background: radial-gradient(circle at 20% 80%, rgba(111, 211, 255, 0.09), transparent 40%),
              radial-gradient(circle at 90% 72%, rgba(77, 255, 180, 0.08), transparent 35%);
}

.grid-overlay {
  z-index: -1;
  background-image: linear-gradient(to right, rgba(166, 183, 221, 0.08) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(166, 183, 221, 0.08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 92%);
}

.site-header {
  position: sticky;
  top: 0;
  width: var(--container);
  margin: 18px auto 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 13, 23, 0.74);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  z-index: 20;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 14px rgba(111, 211, 255, 0.75);
}

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 6px auto;
  background: var(--text);
  transition: transform 0.25s ease;
}

.menu-btn:hover,
.menu-btn:focus-visible,
.btn:hover,
.btn:focus-visible,
.filter-btn:hover,
.filter-btn:focus-visible,
.journey-btn:hover,
.journey-btn:focus-visible {
  border-color: rgba(111, 211, 255, 0.72);
  background: rgba(111, 211, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(111, 211, 255, 0.15), 0 10px 24px rgba(11, 28, 52, 0.4);
}

.site-nav {
  display: flex;
  gap: 20px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
  border-radius: 999px;
  padding: 6px 10px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(111, 211, 255, 0.08);
}

.section {
  width: var(--container);
  margin: 0 auto;
  padding: 96px 0 0;
}

#writing {
  scroll-margin-top: 110px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding-top: 56px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-family: "JetBrains Mono", monospace;
  margin: 0 0 14px;
}

h1,
h2,
h3,
.role,
.org {
  line-height: 1.18;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 54ch;
  margin: 18px 0 0;
}

.hero-actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(111, 211, 255, 0.72);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: linear-gradient(120deg, rgba(111, 211, 255, 0.2), rgba(77, 255, 180, 0.16));
}

.btn-ghost {
  background: rgba(15, 22, 39, 0.38);
}

.quick-stats {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.quick-stats li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.quick-stats strong {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.15rem;
  color: var(--primary);
}

.quick-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.hero-panel {
  position: relative;
}

.profile-frame {
  position: relative;
}

.hero-panel > img,
.profile-frame > img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.profile-badge {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: rgba(5, 10, 18, 0.74);
  border: 1px solid rgba(111, 211, 255, 0.34);
  border-radius: 12px;
  padding: 10px 12px;
  backdrop-filter: blur(7px);
}

.profile-badge p {
  margin: 0;
}

.badge-role {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.03em;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(77, 255, 180, 0.8);
}

.badge-name {
  margin-top: 5px !important;
  font-weight: 700;
  font-size: 0.95rem;
}

.badge-org {
  margin-top: 2px !important;
  color: var(--muted);
  font-size: 0.8rem;
}

.hero-meta {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.meta-card {
  background: rgba(8, 12, 21, 0.88);
  border: 1px solid rgba(111, 211, 255, 0.24);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.meta-label {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-size: 0.72rem;
}

.meta-card h3 {
  font-size: 1rem;
  margin-top: 8px;
}

.meta-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.meta-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.meta-card li {
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.impact article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.impact h2 {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  color: var(--primary);
}

.impact p {
  margin: 6px 0 0;
  color: var(--muted);
}

.architecture .section-heading {
  margin-bottom: 14px;
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.arch-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.arch-grid h3 {
  font-size: 1.05rem;
}

.arch-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-heading {
  max-width: 72ch;
  margin-bottom: 24px;
  border-left: 2px solid rgba(111, 211, 255, 0.42);
  padding-left: 14px;
}

.section-heading h2 {
  margin-top: 6px;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 16px 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 0;
  width: 4px;
  height: calc(100% - 36px);
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.time {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.role {
  margin-top: 6px;
  font-size: 1.15rem;
  font-weight: 700;
}

.org {
  color: var(--muted);
  margin-top: 2px;
}

.timeline-item p {
  margin: 8px 0 0;
  color: #ced9f3;
}

.timeline-item:hover,
.timeline-item:focus-within {
  transform: translateY(-2px);
  border-color: rgba(111, 211, 255, 0.5);
  box-shadow: 0 12px 30px rgba(5, 14, 28, 0.35);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-btn {
  border: 1px solid var(--line);
  background: rgba(11, 17, 30, 0.76);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.filter-btn.is-active {
  color: var(--bg);
  background: linear-gradient(120deg, var(--primary), var(--accent));
  border-color: transparent;
}

.filter-btn:focus-visible,
.site-nav a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.filter-btn:hover,
.filter-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(111, 211, 255, 0.72);
}

.filter-btn:active {
  transform: scale(0.97);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.project-card {
  grid-column: span 6;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 0.22s ease, border-color 0.2s ease, box-shadow 0.22s ease;
}

.project-card:nth-child(3n + 1) {
  grid-column: span 8;
}

.project-card:nth-child(3n + 2),
.project-card:nth-child(3n + 3) {
  grid-column: span 4;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(111, 211, 255, 0.55);
  box-shadow: 0 14px 34px rgba(4, 13, 25, 0.45);
}

.project-card:active {
  transform: scale(0.985);
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.project-content {
  padding: 16px;
}

.project-content h3 {
  font-size: 1.18rem;
}

.project-content p {
  color: var(--muted);
  margin: 8px 0 10px;
}

.project-content span {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid rgba(77, 255, 180, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
}

.project-card.is-hidden {
  display: none;
}

.split-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.panel:hover,
.panel:focus-within {
  transform: translateY(-2px);
  border-color: rgba(111, 211, 255, 0.45);
}

.panel h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  margin-top: 6px;
}

.panel ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.panel li {
  margin-bottom: 10px;
  color: var(--muted);
}

.panel a {
  color: var(--text);
  text-underline-offset: 3px;
}

.testimonial-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(320px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.testimonial-card {
  scroll-snap-align: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.testimonial-card:hover,
.testimonial-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(111, 211, 255, 0.48);
}

.testimonial-card p {
  margin: 0;
  color: #d4e0fa;
}

.person {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.person img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.person h3 {
  margin: 0;
  font-size: 0.94rem;
}

.person span {
  color: var(--muted);
  font-size: 0.8rem;
}

.journey-carousel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.journey-viewport {
  overflow: hidden;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid rgba(111, 211, 255, 0.2);
  background: #0b1323;
}

.journey-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: pan-y;
}

.journey-slide {
  min-width: 100%;
  margin: 0;
}

.journey-slide img {
  width: 100%;
  height: clamp(260px, 55vw, 520px);
  object-fit: contain;
  background: #0b1323;
  padding: 8px;
}

.journey-slide figcaption {
  position: static;
  font-size: 0.86rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(111, 211, 255, 0.2);
  text-align: center;
  white-space: normal;
}

.journey-controls {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.journey-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 16, 29, 0.9);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease;
}

.journey-btn:hover,
.journey-btn:focus-visible {
  border-color: rgba(111, 211, 255, 0.65);
  background: rgba(14, 23, 40, 1);
}

.journey-btn:active {
  transform: scale(0.95);
}

.journey-dots {
  display: flex;
  gap: 8px;
}

.journey-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(111, 211, 255, 0.55);
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.journey-dot.is-active {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(111, 211, 255, 0.2);
}

.contact {
  text-align: center;
  padding-bottom: 80px;
}

.contact h2 {
  font-size: clamp(1.45rem, 3.2vw, 2.4rem);
  margin-top: 6px;
}

.contact p {
  color: var(--muted);
  max-width: 62ch;
  margin: 14px auto 0;
}

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

.site-footer {
  width: var(--container);
  margin: 0 auto;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  color: var(--muted);
  font-size: 1.1rem;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
}

.is-pressed {
  transform: scale(0.97) !important;
}

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

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 24px;
  }

  .hero-panel {
    max-width: 650px;
  }

  .project-card,
  .project-card:nth-child(3n + 1),
  .project-card:nth-child(3n + 2),
  .project-card:nth-child(3n + 3) {
    grid-column: span 6;
  }

}

@media (max-width: 840px) {
  .menu-btn {
    display: block;
  }

  .site-nav {
    position: absolute;
    right: 14px;
    top: calc(100% + 8px);
    flex-direction: column;
    width: min(260px, 88vw);
    background: rgba(7, 12, 21, 0.95);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    display: none;
  }

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

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

  .project-card,
  .project-card:nth-child(3n + 1),
  .project-card:nth-child(3n + 2),
  .project-card:nth-child(3n + 3) {
    grid-column: span 12;
  }

  .split-section {
    grid-template-columns: 1fr;
  }

  .hero-meta,
  .arch-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .section {
    padding-top: 74px;
  }

  .site-header {
    border-radius: 14px;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

  .meta-card {
    padding: 12px;
  }

  .testimonial-strip {
    grid-auto-columns: minmax(270px, 86vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .project-card,
  .timeline-item,
  .panel,
  .testimonial-card,
  .journey-track,
  .journey-btn,
  .journey-dot,
  .filter-btn {
    transition: none;
  }
}
