:root {
  --bg: #050505;
  --bg-soft: #0b0b0b;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.14);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Jost", system-ui, sans-serif;
  --radius-lg: 1.75rem;
  --radius-pill: 999px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(74, 222, 128, 0.08), transparent 24%),
    radial-gradient(circle at 85% 0%, rgba(255, 255, 255, 0.04), transparent 20%),
    linear-gradient(180deg, #040404 0%, #080808 45%, #050505 100%);
  overflow-x: hidden;
}

body.is-loading {
  overflow: hidden;
}

img {
  display: block;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.beam-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.beam {
  position: absolute;
  width: 140%;
  height: 28%;
  left: -20%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.02) 35%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.02) 65%,
    transparent 100%
  );
  transform: rotate(-18deg);
  filter: blur(1px);
  opacity: 0.45;
  animation: beam-drift 14s linear infinite;
}

.beam-1 { top: 8%; animation-duration: 16s; }
.beam-2 { top: 28%; animation-duration: 20s; animation-delay: -4s; opacity: 0.3; }
.beam-3 { top: 52%; animation-duration: 18s; animation-delay: -8s; }
.beam-4 { top: 74%; animation-duration: 22s; animation-delay: -2s; opacity: 0.25; }

@keyframes beam-drift {
  0% { transform: translateX(-8%) rotate(-18deg); }
  100% { transform: translateX(8%) rotate(-18deg); }
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #050505;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  width: min(420px, calc(100% - 40px));
  text-align: left;
}

.loader-label,
.loader-status,
.loader-percent {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loader-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.loader-status {
  margin: 0 0 18px;
  min-height: 1.4rem;
  color: var(--text);
  font-size: 0.92rem;
  overflow: hidden;
}

.loader-status span {
  display: inline-block;
  animation: status-rise 0.45s var(--ease);
}

@keyframes status-rise {
  from { transform: translateY(112%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.loader-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.loader-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, var(--accent));
  transition: width 0.18s linear;
}

.loader-percent {
  margin: 14px 0 0;
  color: var(--accent);
  font-size: 0.82rem;
}

.site-header {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 30;
}

.nav-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
}

.nav-pill a {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-pill a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

main {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: 80px;
}

.glass {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow);
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
}

.hero-content {
  max-width: 900px;
}

.hero-greeting,
.badge,
.exp-index,
.tag-row span,
.chip,
.modal-tabs .tab {
  font-family: var(--mono);
}

.hero-greeting {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  letter-spacing: 0.04em;
}

.hero-title {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.role-rotator {
  display: inline-block;
  position: relative;
  min-width: 10ch;
  color: var(--accent);
  vertical-align: bottom;
  overflow: hidden;
}

.role-text {
  display: inline-block;
  white-space: nowrap;
}

.role-text.is-entering {
  animation: role-in 0.55s var(--ease) forwards;
}

.role-text.is-leaving {
  animation: role-out 0.45s var(--ease) forwards;
}

@keyframes role-in {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes role-out {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-100%); opacity: 0; }
}

.hero-lead,
.split-copy p,
.section-intro p,
.contact-panel p {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.05rem;
}

.hero-lead {
  margin: 28px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-meta {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-meta li {
  padding-left: 18px;
  position: relative;
}

.hero-meta li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.45);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: transform 0.22s var(--ease), background 0.22s ease, border-color 0.22s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: rgba(255, 255, 255, 0.92);
  color: #0a0a0a;
}

.btn-ghost {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}

.section {
  padding-top: 110px;
}

.badge {
  display: inline-block;
  margin-bottom: 18px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scramble-heading,
.section-intro h2,
.split-copy h2,
.contact-panel h2 {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.split-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: start;
}

.split-copy p + p {
  margin-top: 16px;
}

.text-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--accent);
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
}

.stack-card,
.contact-panel {
  border-radius: var(--radius-lg);
  padding: 28px;
}

.stack-card h3 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 1.35rem;
}

.stack-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.stack-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0;
  padding: 22px;
  border-radius: 1.25rem;
  border: 1px solid rgba(74, 222, 128, 0.12);
  background:
    radial-gradient(circle at center, rgba(74, 222, 128, 0.08), transparent 70%),
    rgba(255, 255, 255, 0.02);
}

.stack-icons span {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.88rem;
  color: #d4d4d8;
}

.toolkit-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  transition: transform 0.22s var(--ease), color 0.22s ease;
}

.toolkit-trigger:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.toolkit-trigger span {
  transition: transform 0.22s var(--ease);
}

.toolkit-trigger:hover span {
  transform: translate(2px, -2px);
}

.section-intro {
  max-width: 760px;
  margin-bottom: 34px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
}

.project-card {
  border-radius: var(--radius-lg);
  padding: 14px;
  transition: transform 0.28s var(--ease), border-color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  background: var(--panel-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.project-card:hover h4 {
  color: var(--accent);
}

.project-image {
  overflow: hidden;
  border-radius: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  aspect-ratio: 6 / 5;
  line-height: 0;
}

.project-image--censored {
  position: relative;
  background: #080808;
}

.project-image--censored img {
  object-fit: contain;
  object-position: center top;
}

.nda-blur {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 68%;
  height: 14%;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.48);
  border: 1px solid rgba(147, 197, 253, 0.32);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    0 0 32px rgba(59, 130, 246, 0.32),
    inset 0 0 20px rgba(191, 219, 254, 0.1);
  pointer-events: none;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}

.project-card:hover .project-image img {
  transform: scale(1.04);
}

.project-card h4 {
  margin: 16px 6px 10px;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  transition: color 0.25s ease;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 6px 6px;
}

.tag-row span {
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.experience-list {
  display: grid;
  gap: 16px;
}

.experience-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  border-radius: 1.25rem;
  padding: 22px 24px;
  transition: transform 0.28s var(--ease), border-color 0.28s ease, background 0.28s ease;
}

.experience-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--panel-strong);
}

.exp-index {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  transition: background 0.28s ease, color 0.28s ease, transform 0.28s var(--ease);
}

.experience-card:hover .exp-index {
  background: #f4f4f5;
  color: #111;
}

.exp-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.exp-top h4,
.exp-company,
.exp-detail {
  transition: transform 0.28s var(--ease);
}

.experience-card:hover .exp-top h4,
.experience-card:hover .exp-company,
.experience-card:hover .exp-top span,
.experience-card:hover .exp-detail {
  transform: translateY(-0.4rem);
}

.exp-top h4 {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.05rem;
}

.exp-top span,
.exp-company,
.exp-detail,
.domain-note {
  color: var(--muted);
}

.exp-company {
  margin: 6px 0 0;
}

.exp-detail {
  margin: 8px 0 0;
  line-height: 1.65;
  font-size: 0.95rem;
  max-width: 62ch;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
  font-weight: 600;
}

.contact-links a:hover {
  color: var(--accent);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: relative;
  width: min(640px, 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  transform: translateY(18px) scale(0.97);
  transition: transform 0.32s var(--ease);
}

.modal-backdrop.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal h3 {
  margin: 0 0 18px;
  font-family: var(--mono);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 1.4rem;
  line-height: 1;
}

.modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.modal-tabs .tab {
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.modal-tabs .tab.is-active,
.modal-tabs .tab:hover {
  color: #052e16;
  background: var(--accent);
  border-color: var(--accent);
}

.modal-panel {
  display: none;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-panel.is-active {
  display: flex;
}

.chip {
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
}

[data-reveal] {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(28px) scale(0.98);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease),
    filter 0.7s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

@media (max-width: 980px) {
  .split-layout,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid .project-card:nth-child(4) {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  main {
    width: min(100% - 28px, 100%);
  }

  .site-header {
    top: 16px;
    left: 16px;
    right: 16px;
  }

  .nav-pill {
    width: 100%;
    justify-content: center;
  }

  .hero {
    min-height: auto;
    padding-top: 140px;
  }

  .hero-title {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .exp-top {
    flex-direction: column;
    gap: 6px;
  }

  .experience-card {
    grid-template-columns: 1fr;
  }

  .exp-index {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .loader {
    display: none;
  }
}
