
/* ========================================
   1. DESIGN TOKENS
======================================== */

:root {
  color-scheme: dark;

  --bg: #0b0d10;
  --surface: #11151a;
  --surface-hover: #171c23;
  --border: #252b33;
  --border-light: #343c47;

  --text: #e8ebef;
  --muted: #929ba7;
  --subtle: #626d79;
  --accent: #86c9f4;
  --accent-strong: #b3e0ff;

  --font: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  --container: 1120px;
}

/* ========================================
   2. RESET & GLOBAL
======================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

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

body,
button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button {
  font: inherit;
}

button,
a {
  outline-offset: 5px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
}

::selection {
  color: var(--bg);
  background: var(--accent);
}

.container {
  width: min(var(--container), calc(100% - 64px));
  margin-inline: auto;
}

.section {
  padding-block: 110px;
}

.section-index,
.eyebrow,
.logo-label,
.aside-top,
.aside-bottom,
.hero-footer,
.visual-top,
.project-meta,
.skills-heading,
.site-footer,
.resource-header,
.resource-footer,
.health-label,
.health-stats,
.detail-number {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
}

/* ========================================
   3. HEADER & NAVIGATION
======================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(11 13 16 / 88%);
  border-bottom: 1px solid rgb(37 43 51 / 75%);
  backdrop-filter: blur(16px);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 13px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0;
}

.logo-mark span,
.accent {
  color: var(--accent);
}

.logo-label {
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--muted);
  font-size: 12px;
  transition: color 180ms ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links .nav-resume {
  padding: 8px 13px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  color: var(--text);
}

.menu-toggle {
  display: none;
}

/* ========================================
   4. HERO
======================================== */

.hero {
  min-height: 590px;
  padding-top: 100px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  column-gap: 60px;
  position: relative;
  padding-bottom: 95px;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #76d6a4;
  border-radius: 50%;
  box-shadow: 0 0 12px rgb(118 214 164 / 30%);
}

.hero h1 {
  margin: 28px 0 24px;
  font-size: clamp(43px, 5.4vw, 70px);
  line-height: 1.08;
  letter-spacing: -0.065em;
  font-weight: 650;
}

.muted-heading {
  color: #77818d;
}

.hero-description {
  max-width: 475px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

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

.button {
  min-height: 45px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #081018;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--border-light);
}

.button-secondary:hover {
  background: var(--surface-hover);
  border-color: #566271;
}

/* Technical graphic */

.hero-aside {
  min-width: 0;
  border: 1px solid var(--border);
  background:
    linear-gradient(rgb(134 201 244 / 2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(134 201 244 / 2%) 1px, transparent 1px),
    #0d1014;
  background-size: 28px 28px;
}

.aside-top,
.aside-bottom {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--subtle);
}

.aside-top {
  border-bottom: 1px solid var(--border);
}

.aside-bottom {
  border-top: 1px solid var(--border);
}

.system-graphic {
  height: 280px;
  position: relative;
  overflow: hidden;
}

.graphic-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  aspect-ratio: 1;
  border: 1px solid rgb(134 201 244 / 22%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ring-one {
  width: 100px;
}

.ring-two {
  width: 175px;
}

.ring-three {
  width: 250px;
  border-style: dashed;
  animation: rotate-ring 50s linear infinite;
}

.graphic-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 25px rgb(134 201 244 / 65%);
  transform: translate(-50%, -50%);
}

.graphic-cross {
  position: absolute;
  background: rgb(134 201 244 / 18%);
}

.cross-one {
  width: 100%;
  height: 1px;
  top: 50%;
}

.cross-two {
  height: 100%;
  width: 1px;
  left: 50%;
}

.graphic-label {
  position: absolute;
  padding: 4px 7px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  font: 9px var(--mono);
}

.label-one {
  top: 26%;
  left: 18%;
}

.label-two {
  top: 30%;
  right: 12%;
}

.label-three {
  bottom: 20%;
  right: 24%;
}

.hero-footer {
  position: absolute;
  right: 0;
  bottom: 26px;
  left: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--subtle);
}

.hero-footer a {
  color: var(--muted);
}

/* ========================================
   5. SECTION HEADINGS
======================================== */

.work-section {
  border-top: 1px solid var(--border);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 35px;
  margin-bottom: 36px;
}

.section-index {
  color: var(--accent);
}

.section-heading h2,
.about-grid h2,
.contact-section h2 {
  margin: 13px 0 0;
  font-size: clamp(31px, 4vw, 43px);
  line-height: 1.2;
  letter-spacing: -0.055em;
  font-weight: 620;
}

.section-heading > p {
  max-width: 340px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

/* ========================================
   6. PROJECT FILTERS
======================================== */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.filter-button {
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  transition: 180ms ease;
}

.filter-button:hover {
  color: var(--text);
  background: var(--surface);
}

.filter-button.active {
  color: var(--accent-strong);
  background: rgb(134 201 244 / 8%);
  border-color: rgb(134 201 244 / 25%);
}

.filter-button span {
  margin-left: 6px;
  color: var(--subtle);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 24px;
}

.project-card {
  min-width: 0;
  transition: opacity 180ms ease;
}

.project-card[hidden] {
  display: none;
}

/* ========================================
   7. PROJECT VISUALS
======================================== */

.project-visual {
  position: relative;
  display: block;
  height: 255px;
  overflow: hidden;
  background: #111820;
  border: 1px solid var(--border);
  transition: border-color 180ms ease;
}

.project-visual:hover {
  border-color: #526170;
}

.visual-top {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #8b99a8;
  background: linear-gradient(#10151c, rgb(16 21 28 / 0%));
}

.visual-open {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--accent);
  background: #0c1117;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  opacity: 0;
  transform: translateY(4px);
  transition: 180ms ease;
}

.project-visual:hover .visual-open {
  opacity: 1;
  transform: translateY(0);
}

/* Procedural terrain illustration */

.visual-world {
  background:
    radial-gradient(ellipse at 50% 65%, rgb(45 105 130 / 19%), transparent 55%),
    #0d141a;
}

.terrain-art {
  position: absolute;
  inset: 55px -10px 0;
  transform: perspective(260px) rotateX(56deg) scale(1.4);
  transform-origin: center 70%;
}

.terrain-line {
  position: absolute;
  inset: 0;
  border: 1px solid rgb(105 195 223 / 28%);
  border-radius: 45%;
  transform: rotate(-18deg) scale(var(--scale, 1));
}

.line-a { --scale: 0.45; }
.line-b { --scale: 0.65; }
.line-c { --scale: 0.85; }
.line-d { --scale: 1.05; }
.line-e { --scale: 1.25; }

.terrain-point {
  position: absolute;
  top: 40%;
  left: 51%;
  width: 7px;
  height: 7px;
  background: var(--accent);
  box-shadow: 0 0 22px var(--accent);
  border-radius: 50%;
}

/* AI network illustration */

.visual-ai {
  background:
    radial-gradient(ellipse at center, rgb(93 126 180 / 15%), transparent 65%),
    #11131c;
}

.node-network {
  position: absolute;
  inset: 25px 5% 0;
}

.node-network svg {
  width: 100%;
  height: 100%;
}

.network-lines path {
  fill: none;
  stroke: rgb(134 201 244 / 33%);
  stroke-width: 1.2;
}

.network-nodes circle {
  fill: #111925;
  stroke: var(--accent);
  stroke-width: 1.6;
}

.network-nodes circle:nth-child(4) {
  fill: var(--accent);
  filter: drop-shadow(0 0 7px rgb(134 201 244 / 75%));
}

.network-label {
  position: absolute;
  left: 8%;
  bottom: 25px;
  color: var(--subtle);
  font: 9px var(--mono);
  letter-spacing: 0.1em;
}

/* Health interface */

.visual-health {
  background:
    radial-gradient(ellipse at 50% 50%, rgb(57 106 88 / 12%), transparent 65%),
    #101714;
}

.health-interface {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(76%, 310px);
  padding: 20px;
  border: 1px solid #35443e;
  background: rgb(12 19 16 / 94%);
  transform: translate(-50%, -40%);
}

.health-label {
  color: #7eaa91;
}

.health-row {
  margin-top: 19px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #9aa99f;
  font: 10px var(--mono);
}

.health-row strong {
  color: #d9e5dd;
  font-weight: 500;
}

.health-track {
  height: 5px;
  margin-top: 10px;
  background: #28352d;
}

.health-fill {
  width: 75%;
  height: 100%;
  background: #7dbb91;
  box-shadow: 0 0 12px rgb(125 187 145 / 25%);
}

.health-divider {
  margin-block: 17px;
  height: 1px;
  background: #29372f;
}

.health-stats {
  display: flex;
  justify-content: space-between;
}

.health-stats div {
  display: grid;
  gap: 5px;
}

.health-stats span {
  color: #718078;
  font-size: 9px;
}

.health-stats strong {
  color: #a5cbb1;
  font-size: 10px;
  font-weight: 500;
}

/* Resource interface */

.visual-resource {
  background:
    radial-gradient(ellipse at center, rgb(121 94 160 / 14%), transparent 65%),
    #15121a;
}

.resource-interface {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(78%, 330px);
  padding: 15px;
  border: 1px solid #3c334a;
  background: rgb(18 15 24 / 95%);
  transform: translate(-50%, -40%);
}

.resource-header,
.resource-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #9689a8;
  font-size: 8px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-block: 17px;
}

.resource-slot {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  border: 1px solid #41364f;
  background: #211a2a;
}

.resource-slot span {
  color: #80748e;
  font: 8px var(--mono);
}

.resource-slot b {
  align-self: center;
  color: #c4a5ef;
  font-size: 22px;
  font-weight: 400;
}

.resource-footer {
  padding-top: 10px;
  border-top: 1px solid #3c334a;
}

/* ========================================
   8. PROJECT INFORMATION
======================================== */

.project-info {
  padding-top: 19px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--subtle);
  font-size: 9px;
}

.project-status {
  color: #a6b7a9;
}

.project-info h3,
.detail-item h3 {
  margin: 14px 0 8px;
  font-size: 20px;
  font-weight: 580;
  letter-spacing: -0.035em;
}

.project-info > p {
  min-height: 54px;
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.tag-list span {
  padding: 4px 8px;
  color: #a7b1bd;
  background: #131920;
  border: 1px solid var(--border);
  border-radius: 3px;
  font: 9px var(--mono);
}

.project-link {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-light);
  font-size: 11px;
  transition: color 180ms ease;
}

.project-link span {
  color: var(--accent);
}

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

.filter-empty {
  padding-block: 30px;
  color: var(--muted);
  text-align: center;
}

/* ========================================
   9. TECHNICAL DETAIL SECTIONS
======================================== */

.details-section {
  border-top: 1px solid var(--border);
}

.detail-list {
  border-top: 1px solid var(--border);
}

.detail-item {
  display: grid;
  grid-template-columns: 65px 1fr;
  gap: 20px;
  padding-block: 30px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 95px;
}

.detail-number {
  padding-top: 6px;
  color: var(--accent);
}

.detail-item h3 {
  margin-top: 0;
}

.detail-item p {
  max-width: 720px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.detail-item p strong {
  color: #d5dce4;
  font-weight: 550;
}

.detail-item .detail-placeholder {
  margin-top: 18px;
  padding: 12px 14px;
  color: #8797a7;
  border-left: 2px solid #4b748f;
  background: #10151b;
  font-size: 11px;
}

/* ========================================
   10. ABOUT
======================================== */

.about-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #0e1115;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 70px;
}

.about-grid h2 {
  max-width: 360px;
}

.about-copy > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

.skills-block {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.skills-heading {
  color: var(--subtle);
}

.skills-note {
  margin: 13px 0 0;
  color: var(--subtle);
  font-size: 10px;
}

/* ========================================
   11. CONTACT & FOOTER
======================================== */

.contact-section {
  padding-block: 110px 120px;
}

.contact-section h2 {
  margin-top: 16px;
}

.contact-section > p {
  max-width: 470px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.9;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--subtle);
  font-size: 9px;
}

.footer-inner {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-inner a {
  color: var(--muted);
}

/* ========================================
   12. MOTION
======================================== */

@keyframes rotate-ring {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

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

/* ========================================
   13. RESPONSIVE LAYOUT
======================================== */

@media (max-width: 850px) {
  .hero {
    grid-template-columns: 1fr 0.8fr;
    column-gap: 28px;
  }

  .hero h1 {
    font-size: clamp(40px, 6vw, 56px);
  }

  .system-graphic {
    height: 235px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }

  .section-heading > p {
    max-width: 520px;
  }

  .about-grid {
    gap: 38px;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 36px);
  }

  .section {
    padding-block: 75px;
  }

  .nav {
    min-height: 66px;
  }

  .logo-label {
    font-size: 9px;
  }

  .menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
    cursor: pointer;
  }

  .menu-toggle span {
    width: 16px;
    height: 1px;
    background: var(--text);
    transition: transform 180ms ease;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    gap: 0;
    padding: 12px 18px 18px;
    background: #0e1115;
    border-bottom: 1px solid var(--border);
  }

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

  .nav-links a {
    padding: 12px 0;
  }

  .nav-links .nav-resume {
    width: fit-content;
    margin-top: 8px;
    padding: 8px 12px;
  }

  .hero {
    min-height: unset;
    grid-template-columns: 1fr;
    gap: 45px;
    padding-top: 76px;
    padding-bottom: 95px;
  }

  .hero h1 {
    margin-top: 24px;
    font-size: clamp(42px, 11vw, 60px);
  }

  .hero-description {
    font-size: 14px;
  }

  .hero-aside {
    max-width: 480px;
  }

  .system-graphic {
    height: 240px;
  }

  .hero-footer {
    bottom: 24px;
    font-size: 8px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .project-visual {
    height: clamp(220px, 65vw, 290px);
  }

  .project-info > p {
    min-height: unset;
  }

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

  .detail-item {
    grid-template-columns: 32px 1fr;
    gap: 12px;
  }

  .footer-inner {
    padding-block: 22px;
    flex-direction: column;
    align-items: start;
    gap: 10px;
  }
}
