﻿:root {
  --bg-0: #06090e;
  --text: #e7eef7;
  --muted: #93a8bd;
  --ok: #58d892;
  --radius-lg: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --bg-parallax-x: 0px;
  --bg-parallax-y: 0px;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background: var(--bg-0);
  color: var(--text);
  overflow: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 18%, rgba(73, 137, 182, 0.16), transparent 38%),
    radial-gradient(circle at 82% 70%, rgba(31, 86, 123, 0.22), transparent 34%),
    linear-gradient(160deg, #06090e 5%, #09131d 56%, #05070b 100%);
  z-index: -2;
}

.backdrop::before,
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.backdrop::before {
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 88%);
  opacity: 0.3;
}

.backdrop::after { background: radial-gradient(circle at center, rgba(109, 198, 255, 0.14), transparent 54%); }

.bg-starfield {
  position: fixed;
  inset: -4%;
  pointer-events: none;
  z-index: -1;
  transition: transform 140ms ease-out;
}

.bg-starfield--far {
  opacity: 0.24;
  background-image:
    radial-gradient(1px 1px at 15% 22%, rgba(180, 220, 242, 0.7), transparent 60%),
    radial-gradient(1px 1px at 72% 28%, rgba(188, 232, 255, 0.6), transparent 60%);
  background-size: 280px 280px, 260px 260px;
  transform: translate3d(calc(var(--bg-parallax-x) * -0.38), calc(var(--bg-parallax-y) * -0.38), 0);
}

.bg-starfield--near {
  opacity: 0.3;
  background-image:
    radial-gradient(1.6px 1.6px at 11% 16%, rgba(194, 237, 255, 0.76), transparent 62%),
    radial-gradient(1.2px 1.2px at 69% 33%, rgba(179, 229, 255, 0.68), transparent 62%);
  background-size: 210px 210px, 240px 240px;
  transform: translate3d(calc(var(--bg-parallax-x) * -0.72), calc(var(--bg-parallax-y) * -0.72), 0);
}

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

.meteor {
  position: absolute;
  width: var(--meteor-len, 130px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(225, 248, 255, 0.98) 0%, rgba(176, 232, 255, 0.7) 18%, rgba(176, 232, 255, 0.16) 62%, transparent 100%);
  box-shadow: 0 0 10px rgba(157, 226, 255, 0.62);
  opacity: 0;
  transform-origin: left center;
  animation: meteorFlight var(--meteor-dur, 2200ms) linear;
}

@keyframes meteorFlight {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(var(--meteor-angle, 0deg)); }
  10% { opacity: 0.92; }
  100% { opacity: 0; transform: translate3d(var(--meteor-dx, -440px), var(--meteor-dy, 300px), 0) rotate(var(--meteor-angle, 0deg)); }
}

.app { min-height: 100vh; }
.system-shell { position: relative; min-height: 100vh; padding: 24px 24px 26px; }

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar-controls { display: inline-flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(130, 171, 207, 0.28);
  border-radius: 999px;
  background: rgba(8, 16, 24, 0.66);
}

.lang-switch__btn {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #b5cada;
  background: transparent;
  cursor: pointer;
}

.lang-switch__btn.is-active { color: #e9f5ff; background: rgba(79, 154, 197, 0.35); }

.identity { display: flex; flex-direction: column; gap: 4px; }
.identity__name { font-family: "Space Grotesk", sans-serif; font-size: 0.9rem; letter-spacing: 0.22em; color: #dce8f4; }
.identity__accent { font-weight: 700; color: #ffffff; text-shadow: 0 0 10px rgba(139, 226, 255, 0.12); }
.identity__role { font-size: 0.8rem; color: var(--muted); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(88, 216, 146, 0.4);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.74rem;
  color: #cdeeda;
  background: rgba(6, 20, 14, 0.52);
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 16px rgba(88, 216, 146, 0.72); }

.core-stage {
  position: relative;
  height: calc(100vh - 96px);
  border: 1px solid rgba(130, 171, 207, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(8, 13, 18, 0.62), rgba(8, 14, 20, 0.84));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.projects-stage { display: flex; flex-direction: column; padding: 0; }

.projects-crumbbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 7px 24px;
  border-bottom: 1px solid rgba(124, 168, 194, 0.18);
  background: linear-gradient(180deg, rgba(8, 19, 30, 0.94), rgba(8, 19, 30, 0.42));
  backdrop-filter: blur(8px);
}

.projects-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(143, 186, 214, 0.36);
  border-radius: 999px;
  color: #e4f3ff;
  background: linear-gradient(145deg, rgba(14, 30, 43, 0.9), rgba(9, 20, 31, 0.85));
  text-decoration: none;
}

.projects-back__icon svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.projects-crumbs {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bfd9eb;
}

.projects-crumbs__sep { color: #79a9c6; }
.projects-crumbs a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}
.projects-crumbs a:hover,
.projects-crumbs a:focus-visible { color: #e7f6ff; }

.projects-scroll {
  flex: 1;
  min-height: 0;
  padding: 50px 24px 24px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(114, 182, 216, 0.62) rgba(6, 16, 24, 0.82);
}

.projects-scroll::-webkit-scrollbar { width: 11px; }
.projects-scroll::-webkit-scrollbar-track { background: linear-gradient(180deg, rgba(5, 13, 20, 0.92), rgba(7, 18, 27, 0.9)); }
.projects-scroll::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(114, 182, 216, 0.74), rgba(84, 149, 182, 0.72)); border-radius: 999px; border: 2px solid rgba(7, 18, 27, 0.92); }

.projects-shell {
  border: 1px solid rgba(132, 172, 199, 0.24);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(9, 16, 24, 0.9), rgba(8, 13, 20, 0.84));
  box-shadow: 0 24px 58px rgba(3, 8, 13, 0.5);
  padding: 18px;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 460ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease;
}

.projects-page.is-projects-ready .projects-shell { transform: none; opacity: 1; }

.eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8eb5d1;
}

.projects-header h1 { margin: 8px 0 10px; font-family: "Space Grotesk", sans-serif; }
.projects-lead { margin: 0; color: #c2d8e9; }

.projects-gallery {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}

.project-card {
  border: 1px solid rgba(134, 175, 201, 0.24);
  border-radius: 14px;
  background: linear-gradient(156deg, rgba(10, 22, 33, 0.84), rgba(8, 18, 27, 0.74));
  padding: 14px;
}

.project-card--flagship {
  border-color: rgba(120, 203, 240, 0.46);
  box-shadow: 0 0 0 1px rgba(102, 188, 230, 0.18), 0 12px 28px rgba(8, 33, 49, 0.3);
}

.project-card--secondary {
  border-color: rgba(134, 175, 201, 0.2);
  background: linear-gradient(156deg, rgba(10, 22, 33, 0.74), rgba(8, 18, 27, 0.66));
}

.project-card__media {
  position: relative;
  width: 100%;
  height: 168px;
  margin-bottom: 12px;
  border: 1px solid rgba(128, 172, 199, 0.28);
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 22%, rgba(82, 153, 201, 0.24), transparent 48%),
    linear-gradient(155deg, rgba(11, 23, 35, 0.9), rgba(8, 18, 27, 0.76));
  display: grid;
  place-items: center;
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: drop-shadow(0 10px 18px rgba(4, 16, 28, 0.42));
}

.project-card__media--logo img {
  display: none;
}

.project-card__media--logo {
  background-image:
    url("/assets/images/keyping-logo.png"),
    radial-gradient(circle at 14% 22%, rgba(82, 153, 201, 0.24), transparent 48%),
    linear-gradient(155deg, rgba(11, 23, 35, 0.9), rgba(8, 18, 27, 0.76));
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: center center, 14% 22%, center;
  background-size: auto 82%, auto, auto;
}

.project-card__media--portfolio {
  background-image:
    url("/assets/images/portfolio-core.png"),
    radial-gradient(circle at 80% 20%, rgba(54, 165, 211, 0.2), transparent 46%),
    radial-gradient(circle at 20% 70%, rgba(93, 139, 185, 0.16), transparent 54%),
    linear-gradient(160deg, rgba(8, 19, 30, 0.96), rgba(8, 14, 22, 0.88));
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: center center, 80% 20%, 20% 70%, center;
  background-size: cover, auto, auto, auto;
}

.project-card__media--portfolio::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.2;
}

.project-card__media-label {
  position: relative;
  z-index: 1;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c7e2f4;
}

.project-card__eyebrow {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8fb8d2;
}

.project-card h2 {
  margin: 8px 0 10px;
  font-family: "Space Grotesk", sans-serif;
  color: #ecf7ff;
}

.project-card__desc {
  margin: 0;
  line-height: 1.52;
  color: #c2d9ea;
}

.stack-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-list li {
  border: 1px solid rgba(130, 180, 208, 0.3);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: #d3e8f6;
  background: rgba(11, 22, 33, 0.68);
}

.project-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.project-btn {
  border: 1px solid rgba(129, 173, 201, 0.34);
  border-radius: 999px;
  min-width: 180px;
  padding: 11px 18px;
  color: #e0f1ff;
  text-decoration: none;
  background: rgba(9, 21, 31, 0.7);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  text-align: center;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 220ms ease;
}

.project-btn:hover,
.project-btn:focus-visible {
  border-color: rgba(140, 205, 239, 0.62);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(9, 30, 45, 0.42);
}

.project-btn--primary {
  border-color: rgba(98, 190, 236, 0.56);
  background: linear-gradient(145deg, rgba(17, 53, 77, 0.88), rgba(11, 32, 48, 0.84));
}

body.is-leaving-projects .projects-shell {
  transition-duration: 160ms;
  transform: translateY(-6px) scale(0.992);
  opacity: 0.9;
}

body.is-leaving-projects .projects-stage {
  transition-duration: 160ms;
  filter: saturate(1.04);
  opacity: 0.72;
  transform: scale(0.985) translateY(-10px);
}

@media (max-width: 980px) {
  .projects-gallery { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { overflow: auto; }
  .system-shell { min-height: auto; padding: 14px; }
  .topbar { margin-bottom: 10px; align-items: flex-start; flex-wrap: wrap; }
  .topbar-controls { width: 100%; justify-content: space-between; }
  .core-stage { height: 65vh; min-height: 420px; border-radius: 18px; }
  .projects-crumbbar { min-height: 36px; padding: 6px 14px; }
  .projects-crumbs { font-size: 0.64rem; gap: 6px; }
  .projects-back { width: 26px; height: 26px; }
  .projects-scroll { padding: 44px 14px 14px; scrollbar-width: auto; }
  .projects-scroll::-webkit-scrollbar { width: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
