/* ============================================================
   ARASH NASRIVATAN — PORTFOLIO
   Design tokens
   Deep black #070A08 · Forest #0B1F16 · Panel #0E1712
   Emerald #10B981 · Rich green #059669 · Ink #F8FAFC · Mute #94A3B8
   ============================================================ */

:root {
  --void: #070a08;
  --forest: #0b1f16;
  --panel: #0e1712;
  --emerald: #10b981;
  --rich: #059669;
  --warnRed: #f87171;
  --glow: rgba(16, 185, 129, 0.15);
  --mute: #94a3b8;
  --ink: #f8fafc;
  --line: #1b2a22;
  --line-soft: rgba(27, 42, 34, 0.6);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --nav-h: 76px;
}

@media (max-width: 640px) {
  :root {
    --nav-h: 64px;
  }
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background: var(--void);
  overflow-x: hidden;
  width: 100%;
}

::selection {
  background: var(--emerald);
  color: var(--void);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--void);
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 8px;
  border: 2px solid var(--void);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--rich);
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.mono-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}

.mono-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--emerald);
}

/* ============================================================
   BACKGROUND LAYER
   ============================================================ */

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(to right, rgba(27, 42, 34, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 42, 34, 0.35) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(
    ellipse 90% 60% at 50% 0%,
    black 20%,
    transparent 75%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 90% 60% at 50% 0%,
    black 20%,
    transparent 75%
  );
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  will-change: transform;
}
.bg-glow-1 {
  width: 700px;
  height: 700px;
  top: -200px;
  left: -150px;
  background: radial-gradient(circle, var(--rich) 0%, transparent 70%);
  animation: drift1 26s ease-in-out infinite;
}
.bg-glow-2 {
  width: 600px;
  height: 600px;
  top: 40%;
  right: -200px;
  background: radial-gradient(circle, #0d3b2a 0%, transparent 70%);
  animation: drift2 32s ease-in-out infinite;
}
.bg-glow-3 {
  width: 500px;
  height: 500px;
  bottom: 10%;
  left: 30%;
  background: radial-gradient(
    circle,
    rgba(16, 185, 129, 0.15) 0%,
    transparent 70%
  );
  animation: drift3 20s ease-in-out infinite;
}
@keyframes drift3 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, -30px) scale(1.1);
  }
}
@keyframes drift1 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(60px, 80px);
  }
}
@keyframes drift2 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-50px, -60px);
  }
}

.code-fragments {
  position: absolute;
  inset: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.14);
}
.code-fragment {
  position: absolute;
  white-space: nowrap;
  animation: fragmentFloat linear infinite;
}
@keyframes fragmentFloat {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-120px);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .bg-glow {
    filter: blur(80px);
    opacity: 0.4;
  }
  .code-fragments {
    display: none;
  }
}

/* ============================================================
   CURSOR GLOW
   ============================================================ */

.cursor-glow {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
.cursor-glow.is-active {
  opacity: 1;
}

@media (max-width: 1024px), (hover: none) {
  .cursor-glow {
    display: none;
  }
}

/* ============================================================
   PRELOADER
   ============================================================ */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--void);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.6s var(--ease-out),
    visibility 0.6s;
}
#preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-inner {
  text-align: center;
  width: 280px;
}

.preloader-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.preloader-logo {
  width: 144px;
  height: 144px;
  object-fit: contain;
  display: block;
}
.preloader-mark .bracket {
  color: var(--mute);
}
.preloader-mark .mark-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--emerald);
  border-radius: 50%;
  margin: 0 4px;
  box-shadow: 0 0 12px var(--emerald);
  animation: pulseDot 1.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.preloader-line {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
  min-height: 16px;
}

.preloader-bar {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.preloader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rich), var(--emerald));
  transition: width 0.3s ease-out;
}

/* ============================================================
   SCROLL PROGRESS
   ============================================================ */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 100;
  background: transparent;
}
.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rich), var(--emerald));
  box-shadow: 0 0 8px var(--emerald);
  transition: width 0.1s linear;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition:
    background 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out),
    backdrop-filter 0.4s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(7, 10, 8, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}

.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.nav-logo-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}
.nav-logo-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 36px;
}
@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 14px;
  color: var(--mute);
  position: relative;
  padding: 4px 0;
  transition: color 0.25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--emerald);
  transition: width 0.3s var(--ease-out);
}
.nav-link:hover {
  color: var(--ink);
}
.nav-link:hover::after {
  width: 100%;
}
.nav-link.is-active {
  color: var(--emerald);
}
.nav-link.is-active::after {
  width: 100%;
}

.nav-cta {
  display: none;
  align-items: center;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--void);
  background: var(--emerald);
  border-radius: 8px;
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    background 0.25s ease;
}
@media (min-width: 900px) {
  .nav-cta {
    display: inline-flex;
  }
}
.nav-cta:hover {
  background: #34d399;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.nav-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
}
@media (min-width: 900px) {
  .nav-burger {
    display: none;
  }
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition:
    transform 0.35s var(--ease-in-out),
    opacity 0.25s ease;
}
.nav-burger.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-burger.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-burger.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

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

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 10, 8, 0.98);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--nav-h) + 24px) 32px 40px;
  clip-path: circle(0% at calc(100% - 40px) 40px);
  transition: clip-path 0.6s var(--ease-in-out);
  pointer-events: none;
}
.mobile-menu.is-open {
  clip-path: circle(150% at calc(100% - 40px) 40px);
  pointer-events: auto;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mobile-menu-links a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 34px;
  font-weight: 500;
  color: var(--ink);
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out),
    color 0.25s ease;
}
.mobile-menu.is-open .mobile-menu-links a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu-links a:active,
.mobile-menu-links a:hover {
  color: var(--emerald);
}
.mm-index {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--rich);
}

.mobile-menu-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   SHARED PRIMITIVES
   ============================================================ */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  flex-shrink: 0;
  animation: statusPulse 2.4s ease-in-out infinite;
}
.status-dot-sm {
  width: 6px;
  height: 6px;
}
@keyframes statusPulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 10px var(--emerald);
  }
  50% {
    opacity: 0.55;
    box-shadow: 0 0 4px var(--emerald);
  }
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(16, 185, 129, 0.05);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--mute);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    background 0.25s ease,
    border-color 0.25s ease;
}
.btn svg {
  transition: transform 0.3s var(--ease-out);
  flex-shrink: 0;
}

.btn-primary {
  background: var(--emerald);
  color: var(--void);
}
.btn-primary:hover {
  background: #34d399;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.35);
}
.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--rich);
  background: rgba(16, 185, 129, 0.06);
}
.btn-ghost:hover svg {
  transform: translateY(1px);
}

.btn-block {
  width: 100%;
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */

.reveal-up {
  opacity: 0;
  transform: translateY(22px);
  animation: revealUp 0.9s var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-up,
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

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

.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 40px) 28px 100px;
}

.hero-inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
  align-items: center;
}
@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
  }
}

.hero-copy {
  max-width: 640px;
}

.hero-title {
  font-size: clamp(2.4rem, 5.6vw, 4.1rem);
  font-weight: 600;
  color: var(--ink);
  margin: 22px 0 22px;
}
.hero-title-gradient {
  display: inline-block;
  background: linear-gradient(
    100deg,
    var(--emerald) 0%,
    #6ee7b7 45%,
    var(--rich) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease-in-out infinite;
}
@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.hero-sub {
  font-size: 17px;
  line-height: 1.65;
  color: var(--mute);
  max-width: 520px;
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 44px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink);
}

.hero-scene-wrap {
  position: relative;
}

.scene-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 560px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(
    160deg,
    rgba(11, 31, 22, 0.6),
    rgba(7, 10, 8, 0.4)
  );
  backdrop-filter: blur(6px);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.04),
    0 40px 80px -30px rgba(0, 0, 0, 0.6);
}
.scene-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.5),
    transparent 40%,
    transparent 60%,
    rgba(5, 150, 105, 0.35)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: borderRotate 8s linear infinite;
}
@keyframes borderRotate {
  0% {
    filter: hue-rotate(0deg);
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
  100% {
    filter: hue-rotate(15deg);
    opacity: 0.7;
  }
}

.hero-github-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--emerald);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}
.hero-meta-github {
  min-width: 180px;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.scene-hud {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 10, 8, 0.55);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.scene-hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scene-hud-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}
.scene-hud-bottom {
  top: auto;
  bottom: 18px;
  left: 18px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.scroll-cue-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--emerald), transparent);
  animation: scrollCue 2s ease-in-out infinite;
}
@keyframes scrollCue {
  0% {
    transform: scaleY(0.4);
    transform-origin: top;
    opacity: 0.4;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 1;
  }
  100% {
    transform: scaleY(0.4);
    transform-origin: bottom;
    opacity: 0.4;
  }
}
@media (max-width: 768px) {
  .scroll-cue {
    display: none;
  }
}

/* ============================================================
   SECTIONS — SHARED
   ============================================================ */

.section {
  position: relative;
  z-index: 2;
  padding: 120px 28px;
}
.section-alt {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(11, 31, 22, 0.35) 12%,
    rgba(11, 31, 22, 0.35) 88%,
    transparent 100%
  );
}
@media (max-width: 768px) {
  .section {
    padding: 88px 20px;
  }
}

.section-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-eyebrow {
  display: block;
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 600;
  color: var(--ink);
}
.section-desc {
  margin-top: 14px;
  font-size: 15.5px;
  color: var(--mute);
  line-height: 1.6;
}

/* ============================================================
   ABOUT
   ============================================================ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 64px;
    align-items: start;
  }
}

.terminal {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(9, 15, 12, 0.7);
  margin-bottom: 20px;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.dot-red {
  background: #f87171;
  opacity: 0.7;
}
.dot-yellow {
  background: #fbbf24;
  opacity: 0.7;
}
.dot-green {
  background: var(--emerald);
  opacity: 0.85;
}
.terminal-title {
  margin-left: 6px;
}

.terminal-body {
  padding: 18px 18px 22px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.9;
  min-height: 168px;
  color: var(--mute);
}
.terminal-body p {
  margin: 0;
}
.t-prompt {
  color: var(--rich);
  margin-right: 6px;
}
.t-cmd {
  color: var(--ink);
}
.t-key {
  color: var(--rich);
}
.t-val {
  color: var(--ink);
}
.t-ok {
  color: var(--emerald);
}
.terminal-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--emerald);
  margin-left: 3px;
  vertical-align: -2px;
  animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.profile-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.04), transparent);
  padding: 6px 20px;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.profile-row:last-child {
  border-bottom: none;
}

.about-copy p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--mute);
  margin-bottom: 18px;
}
.about-lead {
  font-size: 19px !important;
  color: var(--ink) !important;
  line-height: 1.55 !important;
  font-weight: 500;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 36px;
}
@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.stat {
  background: var(--panel);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--emerald);
}
.stat-label {
  font-size: 12.5px;
  color: var(--mute);
}

/* ============================================================
   GITHUB ACTIVITY — contribution graph
   ============================================================ */

.github-activity {
  margin-top: 36px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(
    160deg,
    rgba(16, 185, 129, 0.04),
    rgba(14, 23, 18, 0.6)
  );
  overflow: hidden;
}

.github-activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.github-activity-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 6px;
}

.github-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--mute);
  transition:
    border-color 0.25s ease,
    color 0.25s ease,
    background 0.25s ease;
}
.github-profile-link:hover {
  border-color: var(--rich);
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.06);
}

.contrib-graph-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.contrib-graph-range {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--mute);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.contrib-graph-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--mute);
}
.contrib-graph-loading.is-hidden {
  display: none;
}

.contrib-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  animation: contribDot 1.2s ease-in-out infinite;
}
.contrib-loading-dot:nth-child(2) {
  animation-delay: 0.15s;
}
.contrib-loading-dot:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes contribDot {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.contrib-graph {
  /*
   * Number of GitHub contribution weeks is assigned dynamically
   * from JavaScript.
   */
  --contrib-weeks: 53;

  /*
   * Gap is responsive and can also be updated by ResizeObserver.
   */
  --contrib-gap: 2px;

  display: grid;

  /*
   * Every week gets an equal fraction of the available width.
   * This is the key to preventing horizontal overflow.
   */
  grid-template-columns: repeat(var(--contrib-weeks), minmax(0, 1fr));

  gap: var(--contrib-gap);

  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.contrib-graph.is-ready {
  animation: fadeInGraph 0.6s var(--ease-out);
}
@keyframes fadeInGraph {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.contrib-week {
  display: flex;
  flex-direction: column;
  gap: var(--contrib-gap);

  /*
   * Prevent grid items from creating intrinsic width.
   */
  min-width: 0;
  width: 100%;
}

.contrib-day {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  min-width: 0;
  min-height: 0;

  border-radius: 2px;

  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.025);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.contrib-day[data-level="1"] {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.08);
}

.contrib-day[data-level="2"] {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.12);
}

.contrib-day[data-level="3"] {
  background: rgba(16, 185, 129, 0.42);
  border-color: rgba(16, 185, 129, 0.18);
}

.contrib-day[data-level="4"] {
  background: rgba(16, 185, 129, 0.72);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.18);
}
.contrib-day.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.contrib-day:hover {
  transform: scale(1.45);
  z-index: 2;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

@media (max-width: 640px) {
  .contrib-day:hover {
    transform: scale(1.7);
  }
}

.contrib-graph-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  justify-content: flex-end;
}

.contrib-legend-cell {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 2px;
  background: rgba(27, 42, 34, 0.8);
}

@media (max-width: 640px) {
  .contrib-legend-cell {
    width: 8px;
    height: 8px;
    flex-basis: 8px;
  }
}
.contrib-legend-cell[data-level="1"] {
  background: rgba(16, 185, 129, 0.25);
}
.contrib-legend-cell[data-level="2"] {
  background: rgba(16, 185, 129, 0.45);
}
.contrib-legend-cell[data-level="3"] {
  background: rgba(16, 185, 129, 0.7);
}
.contrib-legend-cell[data-level="4"] {
  background: var(--emerald);
}

.contrib-tooltip {
  position: fixed;
  z-index: 200;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(7, 10, 8, 0.95);
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  white-space: nowrap;
}
.contrib-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .github-activity {
    padding: 16px;
  }
  .github-activity-head {
    margin-bottom: 14px;
  }
  .contrib-graph-legend {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ============================================================
   STACK / TECHNOLOGIES
   ============================================================ */

.stack-groups {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.stack-group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}
.stack-group-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.stack-group-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.stack-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) {
  .stack-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .stack-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tech-card {
  position: relative;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 23, 18, 0.5);
  transition:
    transform 0.35s var(--ease-out),
    border-color 0.35s ease,
    background 0.35s ease;
  overflow: hidden;
}
.tech-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    180px circle at var(--mx, 50%) var(--my, 0%),
    rgba(16, 185, 129, 0.14),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}
.tech-card:hover {
  transform: translateY(-4px);
  border-color: var(--rich);
  background: rgba(16, 185, 129, 0.05);
}
.tech-card:hover::before {
  opacity: 1;
}

.tech-card-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--emerald);
  margin-bottom: 14px;
  transition: transform 0.35s var(--ease-out);
  position: relative;
  z-index: 1;
}
.tech-card:hover .tech-card-icon {
  transform: scale(1.1) rotate(-4deg);
}

.tech-card-name {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.tech-card-desc {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* ============================================================
   RESUME
   ============================================================ */

.resume-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
@media (min-width: 1024px) {
  .resume-layout {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 72px;
  }
}

.resume-preview {
  cursor: pointer;
  perspective: 1000px;
}

.resume-doc {
  position: relative;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 210 / 297;
  background: linear-gradient(155deg, #0f1a14, #0a130e);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px 26px;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(16, 185, 129, 0.03);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out);
}
.resume-preview:hover .resume-doc,
.resume-preview:focus-visible .resume-doc {
  transform: rotateY(-6deg) rotateX(3deg) translateY(-6px);
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 40px -10px rgba(16, 185, 129, 0.25);
}

.resume-doc-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}
.resume-doc-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.resume-doc-lines {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rdl {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.rdl-w90 {
  width: 90%;
}
.rdl-w85 {
  width: 85%;
}
.rdl-w75 {
  width: 75%;
}
.rdl-w70 {
  width: 70%;
}
.rdl-w60 {
  width: 60%;
}
.rdl-w40 {
  width: 40%;
}
.rdl-gap {
  height: 14px;
  background: transparent;
}

.resume-doc-zoom {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 100px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--emerald);
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.resume-preview:hover .resume-doc-zoom,
.resume-preview:focus-visible .resume-doc-zoom {
  opacity: 1;
  transform: translateY(0);
}

.resume-side-title {
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}
.resume-side-copy {
  font-size: 15px;
  color: var(--mute);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 440px;
}
.resume-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

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

.projects-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  color: var(--mute);
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}
.filter-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--mute);
  transition:
    background 0.25s ease,
    color 0.25s ease;
}
.filter-btn.is-active .filter-count {
  background: rgba(7, 10, 8, 0.25);
  color: var(--void);
}
.filter-btn:hover {
  color: var(--ink);
  border-color: var(--rich);
}
.filter-btn.is-active {
  color: var(--void);
  background: var(--emerald);
  border-color: var(--emerald);
  font-weight: 500;
}

.project-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(14, 23, 18, 0.5);
  min-width: 220px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.project-search:focus-within {
  border-color: var(--rich);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.project-search svg {
  color: var(--mute);
  flex-shrink: 0;
}
.project-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 13.5px;
  color: var(--ink);
  font-family: "Inter", sans-serif;
  min-width: 0;
}
.project-search input::placeholder {
  color: var(--mute);
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 720px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }
}
@media (min-width: 1100px) {
  .project-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: 22px;
  }
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
  transition:
    transform 0.5s var(--ease-out),
    border-color 0.4s ease,
    box-shadow 0.5s var(--ease-out);
  will-change: transform;
  grid-column: span 1;
}
@media (min-width: 1100px) {
  .project-card {
    grid-column: span 4;
  }
  .project-card.is-featured,
  .project-card.is-wide {
    grid-column: span 4;
  }
}
.project-card.is-filtered-out,
.project-card.is-search-hidden,
.project-card.is-page-hidden {
  display: none;
}
.project-card:hover {
  border-color: var(--rich);
  box-shadow:
    0 30px 60px -25px rgba(0, 0, 0, 0.6),
    0 0 30px -12px rgba(16, 185, 129, 0.2);
}

.project-card-index {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 3;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--emerald);
  opacity: 0.5;
}

.project-media {
  position: relative;
  flex-shrink: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(160deg, #0d1712, #070a08);
}
.project-card.is-featured .project-media {
  aspect-ratio: 16 / 10;
}
.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.7s var(--ease-out),
    filter 0.5s ease;
  filter: saturate(0.85) brightness(0.9);
}
.project-card:hover .project-media img {
  transform: scale(1.06);
  filter: saturate(1) brightness(1);
}
.project-image-trigger {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: zoom-in;
}
.project-image-trigger-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 100px;
  background: var(--emerald);
  color: var(--void);
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}
.project-media:hover .project-image-trigger-chip,
.project-image-trigger:focus-visible .project-image-trigger-chip {
  opacity: 1;
  transform: translateY(0);
}
.project-image-trigger:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: -4px;
}
.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(7, 10, 8, 0.85) 100%
  );
}
.project-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(16, 185, 129, 0.12),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}
.project-card:hover .project-media::before {
  opacity: 1;
}

.project-media-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 5px 11px;
  border-radius: 100px;
  background: rgba(7, 10, 8, 0.75);
  border: 1px solid rgba(16, 185, 129, 0.25);
  backdrop-filter: blur(6px);
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald);
}

.project-status {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(7, 10, 8, 0.75);
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.project-status.is-live {
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.3);
}
.project-status.is-live .status-dot,
.project-status.is-beta .status-dot {
  width: 5px;
  height: 5px;
}
.project-status.is-beta {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}
.project-status.is-beta .status-dot {
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.7);
}
.project-status.is-down,
.project-status.is-not-deployed {
  color: var(--warnRed);
  border-color: rgba(248, 113, 113, 0.35);
}
.project-status.is-down .status-dot,
.project-status.is-not-deployed .status-dot {
  width: 5px;
  height: 5px;
  background: var(--warnRed);
  box-shadow: none;
  animation: none;
  opacity: 0.85;
}

.project-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 24px;
}
.project-card.is-featured .project-body {
  padding: 26px 28px 28px;
}

.project-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.25;
}
.project-card.is-featured .project-name {
  font-size: 22px;
}

.project-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--mute);
  margin-bottom: 10px;
}
.project-card.is-featured .project-desc {
  font-size: 14px;
}
.project-read-more {
  display: inline-flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--emerald);
  transition: color 0.25s ease;
}
.project-read-more:hover {
  color: #34d399;
}
.project-desc + .project-tech {
  margin-top: 6px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.project-tech span {
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--mute);
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}
.project-card:hover .project-tech span {
  border-color: rgba(16, 185, 129, 0.2);
}

.project-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  flex-shrink: 0;
}
.project-actions a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink);
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}
.project-actions a:hover {
  border-color: var(--rich);
  background: rgba(16, 185, 129, 0.07);
}
.project-actions a.is-primary {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--void);
  font-weight: 500;
}
.project-actions a.is-primary:hover {
  background: #34d399;
}
.project-private-note {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.06);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--warnRed);
}

.projects-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding-top: 8px;
}
.projects-showing {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--mute);
}

.project-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--mute);
}
.project-empty svg {
  margin: 0 auto 16px;
  color: var(--rich);
  opacity: 0.6;
}
.project-empty p {
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--ink);
}

@media (min-width: 1024px) {
  .project-card {
    transform-style: preserve-3d;
  }
}

@media (max-width: 719px) {
  .projects-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .project-search {
    min-width: 0;
    width: 100%;
  }
}

/* ============================================================
   CERTIFICATES
   ============================================================ */

.cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) {
  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .cert-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cert-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.4s var(--ease-out),
    border-color 0.35s ease;
}
.cert-card:hover {
  transform: translateY(-5px);
  border-color: var(--rich);
}
.cert-card.is-page-hidden {
  display: none;
}

.cert-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(160deg, #0d1712, #070a08);
}
.cert-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.6s var(--ease-out),
    filter 0.4s ease;
  filter: saturate(0.9);
}
.cert-card:hover .cert-media img {
  transform: scale(1.06);
  filter: saturate(1.05);
}

.cert-media-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 8, 0.55);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cert-card:hover .cert-media-overlay {
  opacity: 1;
}
.cert-media-overlay span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 100px;
  background: var(--emerald);
  color: var(--void);
  font-size: 12.5px;
  font-weight: 500;
}

.cert-info {
  padding: 18px 20px 20px;
}
.cert-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}
.cert-issuer {
  font-size: 13px;
  color: var(--mute);
  margin-bottom: 10px;
}
.cert-date {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--rich);
}
.certificates-footer {
  margin-top: 34px;
}

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

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
}
@media (min-width: 1024px) {
  .contact-layout {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 72px;
  }
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 36px;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  color: var(--ink);
  transition:
    gap 0.3s var(--ease-out),
    color 0.25s ease,
    padding-left 0.3s var(--ease-out);
}
.contact-link svg {
  color: var(--mute);
  transition: color 0.25s ease;
}
.contact-link:hover {
  color: var(--emerald);
  gap: 20px;
  padding-left: 6px;
}
.contact-link:hover svg {
  color: var(--emerald);
}

.contact-form {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(14, 23, 18, 0.4);
  backdrop-filter: blur(10px);
  padding: 32px;
  position: relative;
}
@media (max-width: 480px) {
  .contact-form {
    padding: 24px 20px;
  }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 560px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}
.form-telegram-link {
  color: var(--emerald);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.form-telegram-link:hover {
  color: #34d399;
  opacity: 0.9;
}
.form-success.is-error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
  color: #f87171;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.field label {
  font-size: 12.5px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.05em;
  color: var(--mute);
}
.field input,
.field textarea {
  background: rgba(7, 10, 8, 0.5);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 14.5px;
  color: var(--ink);
  font-family: "Inter", sans-serif;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  resize: vertical;
}
.field input:hover,
.field textarea:hover {
  border-color: #2a3f33;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rich);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.field.has-error input,
.field.has-error textarea {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}
.field-error {
  font-size: 12px;
  color: #f87171;
  min-height: 0;
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.field.has-error .field-error {
  max-height: 20px;
  margin-top: 2px;
}

.contact-form .btn-block {
  margin-top: 4px;
}

.form-success {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--emerald);
  font-size: 13.5px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition:
    opacity 0.4s ease,
    max-height 0.4s ease,
    margin-top 0.4s ease;
}
.form-success.is-visible {
  opacity: 1;
  max-height: 60px;
}

/* ============================================================
   MAGNETIC BUTTON WRAPPER STATE
   ============================================================ */

[data-magnetic] {
  will-change: transform;
}

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

.footer {
  position: relative;
  z-index: 2;
  padding: 48px 28px 40px;
}
.footer-line {
  max-width: 1280px;
  margin: 0 auto 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rich), transparent);
  opacity: 0.5;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--mute);
}
.footer-dot {
  color: var(--line);
}
.footer-top {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--mute);
  transition:
    border-color 0.25s ease,
    color 0.25s ease,
    transform 0.3s var(--ease-out);
}
.footer-top:hover {
  border-color: var(--rich);
  color: var(--emerald);
  transform: translateY(-3px);
}

/* ============================================================
   MODALS
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 5, 0.85);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.8);
  transform: scale(0.94) translateY(16px);
  opacity: 0;
  transition:
    transform 0.4s var(--ease-out),
    opacity 0.4s var(--ease-out);
  overflow: hidden;
}
.modal.is-open .modal-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-panel-resume {
  max-width: 760px;
  height: min(85vh, 900px);
  display: flex;
  flex-direction: column;
}
.modal-panel-cert {
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--mute);
  transition:
    background 0.25s ease,
    color 0.25s ease;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
.modal-close-float {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: rgba(7, 10, 8, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
}

.modal-body {
  flex: 1;
  overflow: auto;
}
.resume-object {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
.resume-fallback {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--mute);
  padding: 40px;
}

.modal-panel-project-image {
  width: min(1040px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.project-image-modal-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(90vh - 74px);
  background: #0a130e;
  overflow: hidden;
}
.project-image-modal-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(90vh - 74px);
  object-fit: contain;
  display: block;
}
.modal-body-project-image {
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
}
.project-image-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.modal-panel-project-description {
  max-width: 640px;
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
}
.project-description-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.modal-body-project-description {
  overflow: auto;
  padding: 22px 24px 26px;
}
.project-description-modal-text {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--mute);
}

.cert-modal-img {
  width: 100%;
  display: block;
  background: #0a130e;
}
.modal-body-cert {
  padding: 22px 24px 26px;
}
.cert-modal-name {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.cert-modal-issuer {
  font-size: 14px;
  color: var(--mute);
  margin-bottom: 16px;
}
.cert-modal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.cert-modal-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--emerald);
  padding: 8px 14px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 100px;
  transition: background 0.25s ease;
}
.cert-modal-link:hover {
  background: rgba(16, 185, 129, 0.1);
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

/* ============================================================
   RESPONSIVE FINE-TUNING
   ============================================================ */

@media (max-width: 380px) {
  .hero-title {
    font-size: 2rem;
  }
  .btn {
    padding: 13px 20px;
    font-size: 14px;
  }
}

@media (max-width: 1023px) {
  .scene-frame {
    max-height: 420px;
  }
}
