:root {
  --nn-red: #c8102e;
  --nn-red-bright: #e11d2e;
  --nn-red-deep: #7a0c1a;
  --nn-red-dark: #3d050c;
  --nn-red-soft: rgba(200, 16, 46, 0.1);
  --nn-red-mid: rgba(200, 16, 46, 0.18);
  --bg: #f7f4f4;
  --bg-elevated: #ffffff;
  --bg-muted: rgba(250, 246, 246, 0.85);
  --ink: #1c1012;
  --ink-secondary: #4a3338;
  --ink-muted: #7a6469;
  --line: #eadfe1;
  --line-strong: #d9c8cc;
  --brand: var(--nn-red);
  --brand-strong: var(--nn-red-bright);
  --brand-deep: var(--nn-red-deep);
  --brand-soft: var(--nn-red-soft);
  --brand-text: #9f1239;
  --green: #15803d;
  --green-soft: rgba(21, 128, 61, 0.12);
  --shadow: 0 14px 40px rgba(61, 5, 12, 0.08);
  --shadow-hover: 0 22px 50px rgba(200, 16, 46, 0.16);
  --radius: 1rem;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html.dark {
  --bg: #14070a;
  --bg-elevated: #1f0d12;
  --bg-muted: rgba(42, 16, 22, 0.75);
  --ink: #faf5f6;
  --ink-secondary: #e7d5d9;
  --ink-muted: #b89aa1;
  --line: #3a1a22;
  --line-strong: #5a2a35;
  --brand-text: #fb7185;
  --brand-soft: rgba(225, 29, 46, 0.16);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 24px 55px rgba(200, 16, 46, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

#projects {
  scroll-margin-top: 5.5rem;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button {
  font: inherit;
}

/* Atmosphere */
.page-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 8% -5%, rgba(200, 16, 46, 0.14), transparent 55%),
    radial-gradient(700px 480px at 92% 8%, rgba(122, 12, 26, 0.1), transparent 50%),
    linear-gradient(180deg, #fbf8f8 0%, var(--bg) 40%, #f3ecee 100%);
}

html.dark .page-atmosphere {
  background:
    radial-gradient(900px 520px at 10% -8%, rgba(200, 16, 46, 0.28), transparent 55%),
    radial-gradient(700px 480px at 95% 12%, rgba(122, 12, 26, 0.35), transparent 50%),
    linear-gradient(180deg, #1a090d 0%, var(--bg) 45%, #100508 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  animation: orbFloat 16s var(--ease) infinite alternate;
}

.orb-a {
  width: 320px;
  height: 320px;
  top: 12%;
  left: -90px;
  background: #c8102e;
}

.orb-b {
  width: 280px;
  height: 280px;
  right: -70px;
  top: 38%;
  background: #7a0c1a;
  animation-delay: -5s;
}

.orb-c {
  width: 220px;
  height: 220px;
  left: 40%;
  bottom: 8%;
  background: #e11d2e;
  opacity: 0.22;
  animation-delay: -9s;
}

.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(122, 12, 26, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 25%, transparent 75%);
  opacity: 0.55;
}

html.dark .dot-grid {
  background-image: radial-gradient(circle, rgba(251, 113, 133, 0.16) 1px, transparent 1px);
}

@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(36px, -28px) scale(1.08); }
}

/* Reveal system */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s var(--ease),
    transform 0.75s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.4s; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 0.75rem clamp(0.75rem, 3vw, 1.25rem) 0.35rem;
  pointer-events: none;
}

.header-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.5rem 0.55rem 0.5rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  backdrop-filter: blur(18px) saturate(1.25);
  box-shadow:
    0 4px 24px rgba(61, 5, 12, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition:
    border-color 0.3s ease,
    box-shadow 0.35s var(--ease),
    transform 0.35s var(--ease);
}

html.dark .header-bar {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-header.is-scrolled .header-bar {
  border-color: var(--line);
  box-shadow: 0 12px 36px rgba(61, 5, 12, 0.1);
}

.main-nav {
  display: none;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-muted) 75%, transparent);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--bg-elevated);
}

.nav-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--nn-red-bright), var(--nn-red-deep));
  box-shadow: 0 4px 14px rgba(200, 16, 46, 0.3);
}

.nav-link--ext svg {
  opacity: 0.75;
  transition: transform 0.2s var(--ease);
}

.nav-link--ext:hover svg {
  transform: translate(2px, -2px);
}

@media (min-width: 900px) {
  .main-nav {
    display: flex;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand__logo {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  flex-shrink: 0;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
  animation: logoIn 0.8s var(--ease) both;
}

.brand:hover .brand__logo {
  transform: scale(1.06) rotate(-4deg);
  box-shadow: 0 8px 20px rgba(200, 16, 46, 0.22);
}

.brand__logo--sm {
  width: 2.25rem;
  height: 2.25rem;
}

html.dark .brand__logo {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
}

.brand__copy {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.brand__row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand__row strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand__badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid rgba(200, 16, 46, 0.28);
  color: var(--brand-text);
}

.brand__sub {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn--header {
  display: none;
  padding: 0.52rem 1rem;
  font-size: 0.84rem;
  border-radius: 999px;
}

.btn--block {
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 0.85rem;
}

.menu-btn {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0.7rem;
  background: var(--bg-elevated);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.menu-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.menu-icon {
  display: grid;
  gap: 5px;
  width: 18px;
}

.menu-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.28s var(--ease), opacity 0.2s ease, width 0.28s var(--ease);
}

.menu-btn.is-open .menu-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn.is-open .menu-icon span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.menu-btn.is-open .menu-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 900px) {
  .btn--header {
    display: inline-flex;
  }

  .menu-btn {
    display: none;
  }
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease);
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}

html:not(.dark) .icon-sun { display: none; }
html.dark .icon-moon { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.75rem;
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.28) 45%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease);
}

.btn:hover::after {
  transform: translateX(120%);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--nn-red-bright), var(--nn-red) 45%, var(--nn-red-deep));
  color: #fff;
  box-shadow: 0 8px 20px rgba(200, 16, 46, 0.28);
}

.btn--primary:hover {
  box-shadow: 0 12px 28px rgba(200, 16, 46, 0.38);
}

.btn--outline {
  background: var(--bg-elevated);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--outline:hover {
  border-color: rgba(200, 16, 46, 0.45);
  background: var(--brand-soft);
  color: var(--brand-text);
}

.btn--lg {
  padding: 0.9rem 1.2rem;
  border-radius: 0.9rem;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  background: rgba(20, 7, 10, 0.48);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-backdrop:not([hidden]) {
  display: block;
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0.85rem;
  right: clamp(0.75rem, 3vw, 1.25rem);
  left: clamp(0.75rem, 3vw, 1.25rem);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: color-mix(in srgb, var(--bg-elevated) 96%, transparent);
  backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: var(--shadow-hover);
  transform: translateY(-10px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.mobile-drawer:not([hidden]) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.mobile-drawer__close {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--bg-muted);
  color: var(--ink-secondary);
  cursor: pointer;
}

.mobile-drawer__link {
  display: flex;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--bg-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease);
}

.mobile-drawer__link:hover {
  border-color: rgba(200, 16, 46, 0.35);
  background: var(--brand-soft);
  transform: translateX(3px);
}

.mobile-drawer__link.is-active {
  border-color: rgba(200, 16, 46, 0.45);
  background: var(--brand-soft);
  color: var(--brand-text);
}

@media (min-width: 900px) {
  .nav-backdrop,
  .mobile-drawer {
    display: none !important;
  }
}

@media (max-width: 899px) {
  .brand__sub {
    display: none;
  }

  .brand__row strong {
    font-size: 0.98rem;
  }
}

/* Shared card animation primitives */
.sun {
  position: absolute;
  top: 1.1rem;
  right: 1.4rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe08a, #f5b942 60%, #e11d2e 120%);
  box-shadow: 0 0 0 8px rgba(245, 185, 66, 0.15);
  animation: sunPulse 3.5s ease-in-out infinite;
}

.cloud {
  position: absolute;
  height: 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow:
    0.7rem 0 0 rgba(255, 255, 255, 0.85),
    -0.55rem 0.15rem 0 rgba(255, 255, 255, 0.75);
  animation: cloudDrift 12s linear infinite;
}

html.dark .cloud {
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0.7rem 0 0 rgba(255, 255, 255, 0.12),
    -0.55rem 0.15rem 0 rgba(255, 255, 255, 0.1);
}

.cloud-a {
  top: 1.6rem;
  left: -20%;
  width: 2.4rem;
  animation-duration: 16s;
}

.cloud-b {
  top: 3.2rem;
  left: -30%;
  width: 1.8rem;
  animation-duration: 22s;
  animation-delay: -6s;
}

.bike-ride {
  position: relative;
  z-index: 2;
  margin-top: 1.5rem;
  animation: bikeBob 1.1s ease-in-out infinite;
}

.bike-svg {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  height: auto;
}

.wheel .spokes {
  transform-box: fill-box;
  transform-origin: center;
  animation: wheelSpin 0.7s linear infinite;
}

.smoke {
  animation: smokeDrift 1.8s ease-in-out infinite;
}

.bike-shadow {
  transform-origin: center;
  animation: shadowPulse 1.1s ease-in-out infinite;
}

.speed-lines {
  position: absolute;
  left: 8%;
  top: 42%;
  display: grid;
  gap: 0.45rem;
  z-index: 1;
}

.speed-lines span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.45));
  animation: speedDash 0.7s linear infinite;
}

.speed-lines span:nth-child(1) { width: 2.8rem; }
.speed-lines span:nth-child(2) { width: 2rem; animation-delay: -0.2s; }
.speed-lines span:nth-child(3) { width: 2.4rem; animation-delay: -0.4s; }

.bike-road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3.2rem;
  height: 0.55rem;
  background: rgba(122, 12, 26, 0.2);
  overflow: hidden;
}

.road-line {
  height: 100%;
  width: 200%;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 28px,
    #c8102e 28px 48px,
    transparent 48px 78px
  );
  animation: roadMove 0.8s linear infinite;
  opacity: 0.75;
}

.bike-caption {
  position: relative;
  z-index: 2;
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-text);
}

@keyframes wheelSpin {
  to { transform: rotate(360deg); }
}

@keyframes bikeBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes shadowPulse {
  0%, 100% { transform: scaleX(1); opacity: 0.85; }
  50% { transform: scaleX(0.92); opacity: 0.55; }
}

@keyframes roadMove {
  from { transform: translateX(0); }
  to { transform: translateX(-78px); }
}

@keyframes cloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(140vw); }
}

@keyframes smokeDrift {
  0%, 100% { transform: translate(0, 0); opacity: 0.9; }
  50% { transform: translate(-8px, -6px); opacity: 0.55; }
}

@keyframes speedDash {
  from { transform: translateX(12px); opacity: 0.15; }
  to { transform: translateX(-18px); opacity: 0.85; }
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.pulse {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.15rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.5);
  animation: pulse 1.8s ease infinite;
  vertical-align: middle;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(21, 128, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes logoIn {
  from { opacity: 0; transform: scale(0.7) rotate(-12deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

/* Projects — full viewport width */
.projects {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.25rem 0 4.25rem;
  isolation: isolate;
}

.projects::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  margin-left: -50vw;
  border-block: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-elevated) 92%, transparent), color-mix(in srgb, var(--bg-muted) 70%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html.dark .projects::before {
  background:
    linear-gradient(180deg, rgba(31, 13, 18, 0.95), rgba(20, 7, 10, 0.88));
}

.projects-inner {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 3rem);
}

.projects-top {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 900px) {
  .projects-top {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 2rem;
  }
}

.projects .section-head {
  max-width: none;
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .projects .section-head h2 {
    max-width: min(36rem, 100%);
  }

  .projects .section-head p {
    max-width: min(52rem, 100%);
  }
}

.section-head {
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 16, 46, 0.3);
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-head p {
  margin: 0.75rem 0 0;
  color: var(--ink-muted);
}

.projects .filter-bar {
  margin: 0;
  align-self: start;
}

@media (min-width: 900px) {
  .projects .filter-bar {
    align-self: end;
  }
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.5rem;
  padding: 0.35rem;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--bg-elevated);
}

.filter {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 0.45rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s var(--ease);
}

.filter:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.filter.is-active {
  background: linear-gradient(135deg, var(--nn-red-bright), var(--nn-red-deep));
  color: #fff;
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.28);
}

.project-grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.35rem);
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.project-item[hidden] {
  display: none;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 1.15rem;
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), border-color 0.35s ease, box-shadow 0.35s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(200, 16, 46, 0.4);
  box-shadow: var(--shadow-hover);
}

.project-card__media {
  position: relative;
  height: 11.5rem;
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
}

.project-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(20, 7, 10, 0.55));
  pointer-events: none;
}

.media--hero {
  background:
    radial-gradient(circle at 20% 20%, rgba(225, 29, 46, 0.45), transparent 45%),
    linear-gradient(145deg, #3d050c, #7a0c1a 50%, #1c1012);
}

.media--bike {
  height: 14.5rem;
  display: block;
  padding: 0;
  background:
    linear-gradient(180deg, #fff7f8 0%, #ffe9ec 48%, #f7f4f3 48%, #efe7e9 100%);
  color: var(--ink);
}

html.dark .media--bike {
  background:
    linear-gradient(180deg, #2a1016 0%, #1c0b10 48%, #14070a 48%, #1a0c10 100%);
}

.media--bike::after {
  display: none;
}

.card-bike-scene {
  position: relative;
  height: 100%;
  overflow: hidden;
  padding: 1.85rem 0.35rem 0.55rem;
}

.card-bike-sky {
  position: absolute;
  inset: 0 0 52% 0;
  pointer-events: none;
}

.card-bike-sky .sun {
  top: 0.55rem;
  right: 0.85rem;
  width: 1.55rem;
  height: 1.55rem;
  box-shadow: 0 0 0 5px rgba(245, 185, 66, 0.14);
}

.card-bike-sky .cloud-a {
  top: 0.85rem;
  width: 1.6rem;
  height: 0.75rem;
}

.card-bike-sky .cloud-b {
  top: 1.85rem;
  width: 1.2rem;
  height: 0.65rem;
}

.card-bike-ride {
  margin-top: 0.15rem;
}

.card-bike-svg {
  max-width: 100%;
  width: 100%;
  height: auto;
  max-height: 8.5rem;
}

.card-bike-road {
  bottom: 1.85rem;
  height: 0.4rem;
}

.card-bike-caption {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--brand-text);
}

.media--bike .project-card__chip,
.media--bike .project-card__metric {
  color: #fff;
}

.media--bike .speed-lines {
  left: 6%;
  top: 38%;
  gap: 0.3rem;
}

.media--bike .speed-lines span:nth-child(1) { width: 1.8rem; }
.media--bike .speed-lines span:nth-child(2) { width: 1.3rem; }
.media--bike .speed-lines span:nth-child(3) { width: 1.55rem; }

.media--nitol {
  background:
    radial-gradient(circle at 80% 10%, rgba(200, 16, 46, 0.4), transparent 40%),
    linear-gradient(145deg, #2a0a10, #5a101c 50%, #14070a);
}

.media--hr {
  background:
    radial-gradient(circle at 30% 80%, rgba(225, 29, 46, 0.35), transparent 45%),
    linear-gradient(145deg, #4a0c16, #7a0c1a 45%, #2a0a10);
}

.media--scene {
  height: 14.5rem;
  display: block;
  padding: 0;
  color: var(--ink);
}

.media--scene.media--nitol {
  background:
    linear-gradient(180deg, #fff8f5 0%, #ffe8e1 46%, #f6f1ef 46%, #efe8e6 100%);
}

.media--scene.media--hr {
  background:
    linear-gradient(180deg, #f7f9ff 0%, #e8eefc 46%, #f4f5f8 46%, #ebeff5 100%);
}

html.dark .media--scene.media--nitol {
  background:
    linear-gradient(180deg, #2a1210 0%, #1c0c0a 46%, #140808 46%, #1a0c0c 100%);
}

html.dark .media--scene.media--hr {
  background:
    linear-gradient(180deg, #101520 0%, #0c1018 46%, #0a0d14 46%, #10141c 100%);
}

.media--scene::after {
  display: none;
}

.media--scene .project-card__chip,
.media--scene .project-card__metric {
  color: #fff;
}

.card-scene {
  position: relative;
  height: 100%;
  overflow: hidden;
  padding: 1.85rem 0.75rem 0.55rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.card-scene__glow {
  position: absolute;
  inset: 12% 18% auto;
  height: 5rem;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.22), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
  animation: glowPulse 5.5s ease-in-out infinite;
}

.card-scene__glow--hr {
  background: radial-gradient(circle, rgba(59, 100, 200, 0.22), transparent 70%);
}

.ops-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.35rem;
}

.ops-gauge {
  position: relative;
  text-align: center;
}

.ops-gauge svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 5.2rem;
}

.ops-gauge__arc {
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  animation: gaugeFill 2.4s var(--ease) 0.2s forwards;
}

.ops-gauge__needle {
  transform-origin: 60px 58px;
  animation: needleSweep 2.8s var(--ease) infinite alternate;
}

.ops-gauge__value {
  position: absolute;
  left: 50%;
  bottom: 0.15rem;
  transform: translateX(-50%);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-text);
}

.ops-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.28rem;
  height: 4.6rem;
  padding: 0.4rem 0.35rem 0.2rem;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
}

.ops-bars span {
  flex: 1;
  height: var(--h);
  border-radius: 999px 999px 0.2rem 0.2rem;
  background: linear-gradient(180deg, var(--nn-red-bright), var(--nn-red-deep));
  transform-origin: bottom;
  animation: barPulse 1.8s ease-in-out infinite;
}

.ops-bars span:nth-child(2) { animation-delay: 0.12s; }
.ops-bars span:nth-child(3) { animation-delay: 0.24s; }
.ops-bars span:nth-child(4) { animation-delay: 0.36s; }
.ops-bars span:nth-child(5) { animation-delay: 0.48s; }
.ops-bars span:nth-child(6) { animation-delay: 0.6s; }

.ops-ticks {
  position: absolute;
  top: 2.35rem;
  right: 0.85rem;
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: 1;
}

.ops-ticks li {
  width: 2.4rem;
  height: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.55), transparent);
  animation: tickSlide 1.4s linear infinite;
}

.ops-ticks li:nth-child(2) { width: 1.7rem; animation-delay: -0.35s; }
.ops-ticks li:nth-child(3) { width: 2rem; animation-delay: -0.7s; }

.hr-people {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.85rem;
  min-height: 4.2rem;
  margin-bottom: -0.35rem;
}

.hr-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  animation: personBob 2.4s ease-in-out infinite;
}

.hr-person--b { animation-delay: 0.25s; }
.hr-person--c { animation-delay: 0.5s; }
.hr-person--d { animation-delay: 0.75s; }

.hr-head {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #f2c7a8, #d4a070);
  border: 2px solid rgba(200, 16, 46, 0.25);
}

.hr-body {
  width: 1.7rem;
  height: 1.85rem;
  border-radius: 0.85rem 0.85rem 0.45rem 0.45rem;
  background: linear-gradient(180deg, var(--nn-red-bright), var(--nn-red-deep));
}

.hr-person--b .hr-body {
  background: linear-gradient(180deg, #3b5bdb, #1e3a8a);
}

.hr-person--c .hr-body {
  background: linear-gradient(180deg, #0f766e, #115e59);
}

.hr-person--d .hr-body {
  background: linear-gradient(180deg, #9f1239, #7a0c1a);
}

.hr-network {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 3.2rem;
  margin-top: -0.4rem;
}

.hr-network__line {
  animation: dashMove 1.8s linear infinite;
}

.hr-network__node {
  animation: nodePulse 1.8s ease-in-out infinite;
}

.hr-network__node:nth-child(3) { animation-delay: 0.25s; }
.hr-network__node:nth-child(4) { animation-delay: 0.5s; }

.hr-pulse-chips {
  position: absolute;
  top: 2.25rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  z-index: 2;
}

.hr-pulse-chips span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 16, 46, 0.25);
  background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
  color: var(--brand-text);
  animation: chipFloat 3s ease-in-out infinite;
}

.hr-pulse-chips span:nth-child(2) { animation-delay: 0.35s; }
.hr-pulse-chips span:nth-child(3) { animation-delay: 0.7s; }

@keyframes gaugeFill {
  to { stroke-dashoffset: 28; }
}

@keyframes needleSweep {
  from { transform: rotate(-48deg); }
  to { transform: rotate(42deg); }
}

@keyframes barPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.85; }
  50% { transform: scaleY(0.72); opacity: 1; }
}

@keyframes tickSlide {
  from { transform: translateX(8px); opacity: 0.25; }
  to { transform: translateX(-10px); opacity: 0.9; }
}

@keyframes personBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes dashMove {
  to { stroke-dashoffset: -24; }
}

@keyframes nodePulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.25); opacity: 1; }
}

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

.project-card__media-title {
  position: relative;
  z-index: 1;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.4s var(--ease);
}

.project-card:hover .project-card__media-title {
  transform: scale(1.06);
}

.project-card__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 48%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
  z-index: 1;
}

.project-card:hover .project-card__shine {
  transform: translateX(120%);
}

.project-card__chip,
.project-card__metric {
  position: absolute;
  top: 0.75rem;
  z-index: 2;
  font-size: 0.65rem;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 0.45rem;
  backdrop-filter: blur(8px);
}

.project-card__chip {
  left: 0.75rem;
  background: rgba(20, 7, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.project-card__metric {
  right: 0.75rem;
  background: rgba(21, 128, 61, 0.22);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #86efac;
}

.project-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem 1.15rem 1.2rem;
  flex: 1;
}

.project-card__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-text);
}

.project-card__body h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.project-card__body > p:not(.project-card__eyebrow) {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tags span {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.5rem;
  border-radius: 0.45rem;
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  background: var(--bg-muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.project-card:hover .tags span {
  border-color: rgba(200, 16, 46, 0.28);
}

.project-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  color: var(--brand-text);
  font-weight: 700;
  font-size: 0.9rem;
}

.project-card__cta svg {
  transition: transform 0.25s var(--ease);
}

.project-card:hover .project-card__cta svg {
  transform: translateX(5px);
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  border-top: 1px solid var(--line);
}

.brand--footer strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}

.site-footer p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .bike-ride,
  .bike-shadow,
  .road-line,
  .cloud,
  .smoke,
  .speed-lines span,
  .sun,
  .wheel .spokes,
  .card-bike-ride,
  .ops-gauge__needle,
  .ops-bars span,
  .hr-person,
  .hr-network__line,
  .hr-network__node,
  .hr-pulse-chips span {
    animation: none !important;
  }

  .ops-gauge__arc {
    stroke-dashoffset: 28;
  }
}
