:root {
  --bg: #07111f;
  --bg-deep: #030812;
  --panel: rgba(8, 18, 35, 0.82);
  --panel-strong: rgba(10, 23, 44, 0.96);
  --line: rgba(88, 196, 255, 0.14);
  --line-strong: rgba(88, 196, 255, 0.3);
  --text: #eef6ff;
  --muted: #b8cce3;
  --muted-strong: #d8e7f7;
  --accent: #67d9ff;
  --accent-strong: #b4f2ff;
  --accent-faint: rgba(103, 217, 255, 0.12);
  --success: #7cf0d7;
  --radius: 24px;
  --content-width: min(1180px, calc(100vw - 2rem));
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(19, 70, 126, 0.38), transparent 30%),
    radial-gradient(circle at 85% 18%, rgba(68, 178, 255, 0.12), transparent 18%),
    linear-gradient(180deg, #04101d 0%, #061527 45%, #040a13 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(103, 217, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 217, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
  pointer-events: none;
  z-index: -2;
}

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

button,
input {
  font: inherit;
}

.portfolio-shell {
  width: var(--content-width);
  margin: 0 auto;
}

.portfolio-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: var(--content-width);
  margin: 0 auto;
  padding: 1rem 0 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.portfolio-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 13, 24, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.2);
}

.brand {
  padding-left: 1rem;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.28rem;
  width: 3rem;
  height: 3rem;
  margin-right: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.nav-toggle span {
  width: 1rem;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.4rem;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  padding: 0.78rem 0.98rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-family: "Azeret Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.site-nav a:hover,
.site-nav a.is-current {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.portfolio-main {
  width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.section {
  padding: 2rem 0;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-family: "Azeret Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  letter-spacing: -0.03em;
}

.section h2,
.detail-section h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

#overview .hero-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

#overview .hero-grid > * {
  width: 100%;
}

.hero-copy,
.hero-panel,
.card,
.cta-banner {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel,
.card {
  padding: 1.5rem;
}

.hero-copy::before,
.hero-panel::before,
.card::before,
.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(103, 217, 255, 0.65), transparent 60%);
}

.hero-copy {
  display: grid;
  gap: 1.2rem;
  background:
    radial-gradient(circle at top right, rgba(103, 217, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(9, 20, 39, 0.96), rgba(8, 18, 35, 0.88));
}

.hero-copy > * {
  width: 100%;
}

.hero-copy h1 {
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.94;
  max-width: none;
}

.hero-panel {
  display: grid;
  gap: 1rem;
}

.lead {
  max-width: none;
  font-size: 1.04rem;
}

.meta-row,
.chip-cloud,
.button-row,
.jump-row,
.status-row,
.detail-tags,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.jump-row {
  margin-top: 0.2rem;
}

.meta-pill,
.tag,
.filter-chip,
.card-label,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.62rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  font-family: "Azeret Mono", monospace;
  font-size: 0.76rem;
}

.status-badge {
  color: var(--success);
  border-color: rgba(124, 240, 215, 0.3);
  background: rgba(124, 240, 215, 0.07);
}

.button-row {
  margin-top: 0.25rem;
}

.button,
.button-ghost,
.filter-chip,
.doc-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.button:hover,
.button-ghost:hover,
.filter-chip:hover,
.doc-link:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.button {
  border-color: rgba(103, 217, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(103, 217, 255, 0.3), rgba(180, 242, 255, 0.14)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(103, 217, 255, 0.08),
    0 18px 36px rgba(2, 12, 28, 0.28);
}

.button:hover {
  background:
    linear-gradient(135deg, rgba(103, 217, 255, 0.42), rgba(180, 242, 255, 0.2)),
    rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(103, 217, 255, 0.16),
    0 22px 40px rgba(2, 12, 28, 0.34);
}

.button-ghost,
.doc-link {
  border-color: rgba(103, 217, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(6, 18, 34, 0.85);
  color: var(--muted-strong);
}

.button-ghost:hover,
.doc-link:hover {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(103, 217, 255, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(6, 18, 34, 0.92);
}

.button.is-disabled,
.doc-link.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.hero-list,
.stack-list,
.detail-list,
.link-list,
.small-list {
  display: grid;
  gap: 0.8rem;
}

.hero-list article,
.stack-list article,
.small-panel,
.evidence-card,
.image-card,
.link-card {
  padding: 1rem;
  border: 1px solid rgba(103, 217, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.hero-list h3,
.card h3,
.detail-card h3 {
  margin-bottom: 0.35rem;
  font-size: 1.18rem;
}

.stats-grid,
.featured-grid,
.document-grid,
.skills-grid,
.project-grid,
.detail-grid,
.evidence-grid,
.image-grid,
.related-grid,
.content-grid {
  display: grid;
  gap: 1rem;
}

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

.featured-grid,
.skills-grid,
.project-grid,
.evidence-grid,
.image-grid,
.related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.document-grid,
.detail-grid,
.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-head {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  max-width: 62rem;
}

.project-subsection {
  display: grid;
  gap: 1rem;
}

.project-subsection + .project-subsection {
  margin-top: 1.25rem;
}

.card {
  display: grid;
  gap: 1rem;
}

.card-topline,
.detail-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
  font-family: "Azeret Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card {
  display: grid;
  gap: 1rem;
  min-height: 100%;
}

.project-card p {
  font-size: 0.98rem;
}

.project-summary {
  color: var(--muted-strong);
}

.evidence-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.evidence-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  background: rgba(103, 217, 255, 0.08);
  color: var(--muted-strong);
  font-family: "Azeret Mono", monospace;
  font-size: 0.72rem;
}

.search-panel {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.search-input {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.search-input::placeholder {
  color: rgba(184, 204, 227, 0.72);
}

.filter-group {
  display: grid;
  gap: 0.65rem;
}

.filter-group-label {
  color: var(--accent);
  font-family: "Azeret Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.technical-summary {
  color: var(--muted-strong);
  font-size: 0.94rem;
  line-height: 1.7;
}

.technical-summary strong {
  color: var(--text);
  font-family: "Azeret Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
}

.filter-chip[aria-pressed="true"] {
  color: var(--text);
  border-color: rgba(103, 217, 255, 0.34);
  background: rgba(103, 217, 255, 0.11);
}

.results-line {
  color: var(--muted);
  font-family: "Azeret Mono", monospace;
  font-size: 0.8rem;
}

.empty-state {
  padding: 1.25rem;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.015);
}

.detail-hero {
  display: grid;
  gap: 1rem;
}

.breadcrumb {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--muted);
  font-family: "Azeret Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.detail-title {
  display: grid;
  gap: 1rem;
}

.detail-title h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.95;
  max-width: 11ch;
}

.detail-layout {
  display: grid;
  gap: 1.5rem;
}

.detail-card ul,
.detail-card ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  line-height: 1.8;
}

.media-placeholder {
  aspect-ratio: 16 / 9;
  border: 1px dashed rgba(103, 217, 255, 0.26);
  border-radius: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(103, 217, 255, 0.08), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.015);
}

.media-placeholder span,
.asset-caption,
.link-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.media-placeholder strong {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text);
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.1rem;
}

.image-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(103, 217, 255, 0.14);
}

.lead-image-grid {
  grid-template-columns: minmax(0, 1fr);
}

.lead-image-grid .image-card {
  padding: 1.35rem;
  gap: 1.15rem;
}

.lead-image-grid .image-card img,
.lead-image-grid .media-placeholder {
  aspect-ratio: 16 / 8;
}

.evidence-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(103, 217, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.5rem;
}

.cta-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 85% 15%, rgba(103, 217, 255, 0.15), transparent 24%),
    linear-gradient(180deg, rgba(7, 23, 43, 0.96), rgba(8, 18, 35, 0.88));
}

.cta-banner h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

#contact .cta-banner {
  grid-template-columns: 1fr;
}

#contact .cta-banner > :first-child {
  width: 100%;
}

#contact .cta-banner p,
#contact .cta-banner h2 {
  max-width: none;
}

.footer {
  width: var(--content-width);
  margin: 0 auto;
  padding: 0 0 2.5rem;
  color: var(--muted);
  font-family: "Azeret Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

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

@media (max-width: 980px) {
  .hero-grid,
  .content-grid,
  .detail-grid,
  .document-grid,
  .cta-banner {
    grid-template-columns: 1fr;
  }

  .featured-grid,
  .project-grid,
  .skills-grid,
  .evidence-grid,
  .image-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .hero-copy h1,
  .detail-title h1 {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  :root {
    --content-width: min(100vw - 1rem, 100%);
    --radius: 20px;
  }

  .portfolio-header {
    padding-top: 0.8rem;
    flex-wrap: wrap;
  }

  .brand {
    padding: 0.95rem 0 0.95rem 1rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .portfolio-header.is-open .nav-toggle span:nth-child(1) {
    transform: translateY(0.44rem) rotate(45deg);
  }

  .portfolio-header.is-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .portfolio-header.is-open .nav-toggle span:nth-child(3) {
    transform: translateY(-0.44rem) rotate(-45deg);
  }

  .site-nav {
    display: grid;
    gap: 0.35rem;
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    padding: 0 0.45rem;
    margin-top: 0;
    transform: translateY(-0.35rem);
    transition:
      max-height 220ms ease,
      opacity 220ms ease,
      transform 220ms ease,
      padding 220ms ease,
      margin-top 220ms ease;
  }

  .portfolio-header.is-open .site-nav {
    max-height: 24rem;
    opacity: 1;
    pointer-events: auto;
    padding: 0 0.45rem 0.5rem;
    margin-top: 0.15rem;
    transform: translateY(0);
  }

  .site-nav a {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
  }

  .portfolio-main {
    padding-top: 1rem;
  }

  .section {
    padding: 1.5rem 0;
  }

  .hero-copy,
  .hero-panel,
  .card,
  .cta-banner {
    padding: 1.15rem;
  }

  .hero-copy h1,
  .detail-title h1,
  .section h2,
  .detail-section h2 {
    font-size: clamp(2.2rem, 12vw, 4rem);
    line-height: 0.98;
  }

  .lead,
  p,
  .detail-card ul,
  .detail-card ol,
  .asset-caption,
  .link-note {
    font-size: 0.96rem;
  }

  .featured-grid,
  .skills-grid,
  .project-grid,
  .document-grid,
  .detail-grid,
  .content-grid,
  .evidence-grid,
  .image-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

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

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

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