/* ============================================================
   EskDev — design system
   ============================================================ */

:root {
  --bg: #04050c;
  --bg-elevated: #0a0d18;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f6ff;
  --muted: #9aa3bb;
  --faint: #6b738a;
  --accent: #4ea8ff;
  --accent-2: #8b7cff;
  --accent-3: #3ee0c4;
  --danger: #ff6b7a;
  --ok: #3ee0c4;
  --glow: 0 0 40px rgba(78, 168, 255, 0.22);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --radius-sm: 14px;
  --sidebar-w: 280px;
  --font-display: "Syne", sans-serif;
  --font-body: "Outfit", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --mx: 50%;
  --my: 30%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

html,
body {
  min-height: 100%;
  background: var(--bg) !important;
}

body {
  margin: 0;
  color: var(--text) !important;
  background-color: var(--bg) !important;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

::selection {
  background: rgba(78, 168, 255, 0.35);
  color: #fff;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #8cc8ff;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10000;
  background: var(--accent);
  color: #041018;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Ambient background ---------- */

.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg);
}

.site-bg__photo {
  position: absolute;
  inset: -4%;
  background-image: url("../images/bg-testi2.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(0.95) contrast(1.06) brightness(0.78);
  animation: bgDrift 48s ease-in-out infinite alternate;
}

.site-bg__wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 5, 12, 0.42) 0%, rgba(4, 5, 12, 0.58) 48%, rgba(4, 5, 12, 0.82) 100%),
    radial-gradient(ellipse at 18% 0%, rgba(78, 168, 255, 0.08), transparent 42%),
    radial-gradient(ellipse at 88% 12%, rgba(90, 140, 150, 0.1), transparent 46%);
}

@media (max-width: 768px) {
  .site-bg__photo {
    background-image: url("../images/bg-testi2-sm.webp");
    animation: none;
    filter: saturate(0.9) contrast(1.04) brightness(0.8);
  }

  .site-bg .orb,
  .spotlight {
    display: none;
  }
}

.site-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
  animation: drift 22s ease-in-out infinite;
}

.orb-1 {
  width: 420px;
  height: 420px;
  left: 10%;
  top: 4%;
  background: #2a6dff;
}

.orb-2 {
  width: 320px;
  height: 320px;
  right: 6%;
  top: 22%;
  background: #6d4dff;
  animation-delay: -7s;
}

.spotlight {
  position: absolute;
  width: 560px;
  height: 560px;
  left: var(--mx);
  top: var(--my);
  transform: translate(-50%, -50%);
  background:
    radial-gradient(
      circle,
      rgba(255, 252, 245, 0.78) 0%,
      rgba(210, 235, 255, 0.42) 14%,
      rgba(120, 190, 255, 0.2) 32%,
      rgba(78, 168, 255, 0.06) 52%,
      transparent 68%
    );
  mix-blend-mode: screen;
  filter: saturate(1.15);
  pointer-events: none;
  z-index: 2;
  transition: left 0.06s linear, top 0.06s linear;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}

@keyframes bgDrift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-1.2%, -0.8%, 0); }
}

/* ---------- Layout ---------- */

#page-content {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  padding: 2.5rem 1.5rem 5rem;
}

@media (min-width: 992px) {
  #page-content {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    padding: 2.75rem 2.5rem 6rem;
  }
}

.page-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

/* ---------- Page hero ---------- */

.page-hero {
  width: min(1180px, 100%);
  margin: 0 auto 2.75rem;
  padding: 1.25rem 0 0;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.page-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.page-hero h1,
.hero-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, #fff 20%, #9ecbff 55%, #c4b5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-lead {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.12rem;
  margin: 0.85rem 0 0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

/* ---------- Buttons ---------- */

.btn,
button.btn,
a.btn,
input[type="submit"] {
  --btn-bg: rgba(78, 168, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(78, 168, 255, 0.35);
  background: var(--btn-bg);
  color: #fff !important;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none !important;
}

.btn:hover,
button.btn:hover,
a.btn:hover,
input[type="submit"]:hover {
  background: rgba(78, 168, 255, 0.24);
  border-color: rgba(140, 200, 255, 0.7);
  box-shadow: var(--glow);
  transform: translateY(-2px);
  color: #fff !important;
}

.btn-primary,
.btn.btn-primary,
input[type="submit"].btn-primary {
  background: linear-gradient(135deg, #3d8dff, #6d5cff) !important;
  border-color: transparent !important;
}

.btn-secondary,
.btn.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
}

.btn img {
  width: 16px;
  height: 16px;
}

/* ---------- Cards ---------- */

.glass,
.vastapaino-box,
.project-card,
.neu-box,
.contact-card,
.stat-card,
.skill-card,
.reason-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal-delay-1 { animation-delay: 0.08s; }
.reveal-delay-2 { animation-delay: 0.16s; }
.reveal-delay-3 { animation-delay: 0.24s; }
.reveal-delay-4 { animation-delay: 0.32s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Hero / etusivu ---------- */

.hero {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 1rem 0 3rem;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(62, 224, 196, 0.28);
  background: rgba(62, 224, 196, 0.08);
  color: var(--ok);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(62, 224, 196, 0.7);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.omakuva-outer {
  position: relative;
  margin-bottom: 1.75rem;
  background: conic-gradient(from var(--angle), #4ea8ff, #8b7cff, #3ee0c4, #4ea8ff);
  border-radius: 50%;
  padding: 3px;
  animation: spin 6s linear infinite;
}

.omakuva-ring {
  background: #05060c;
  border-radius: 50%;
  padding: 5px;
}

.omakuva-wrap {
  width: min(260px, 68vw);
  height: min(260px, 68vw);
  border-radius: 50%;
  overflow: hidden;
  filter: drop-shadow(0 0 28px rgba(78, 168, 255, 0.45));
}

.omakuva {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 10% 10%;
  display: block;
  filter: contrast(1.08) saturate(0.95);
}

@keyframes spin {
  to { --angle: 360deg; }
}

.hero-name {
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
  background: linear-gradient(180deg, #fff, #b9d7ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-role {
  min-height: 2rem;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: var(--accent-2);
  margin-bottom: 1.25rem;
}

.hero-role span {
  display: inline-block;
  transition: opacity 0.22s ease;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.6rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.9rem;
}

.chip a {
  color: inherit;
  overflow-wrap: anywhere;
}

.etusivu-intro {
  max-width: 40rem;
  color: var(--muted);
  margin: 0 auto 1.75rem;
}

.etusivu-intro p {
  margin: 0 0 0.7rem;
}

.etusivu-intro-lead {
  color: var(--text) !important;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: min(720px, 100%);
}

.stat-card {
  padding: 1.1rem 0.8rem;
}

.stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (min-width: 992px) {
  .hero {
    padding: 1.6rem 0 3.6rem;
  }

  .omakuva-wrap {
    width: 318px;
    height: 318px;
  }

  .hero-name {
    font-size: clamp(3.4rem, 5.6vw, 6.1rem);
  }

  .hero-role {
    font-size: 1.28rem;
    min-height: 2.2rem;
    margin-bottom: 1.4rem;
  }

  .chip {
    font-size: 1.02rem;
    padding: 0.48rem 0.95rem;
  }

  .etusivu-intro {
    max-width: 48rem;
  }

  .etusivu-intro p {
    font-size: 1.22rem;
    line-height: 1.75;
  }

  .hero-actions .btn {
    padding: 0.86rem 1.4rem;
    font-size: 1.02rem;
  }

  .stats-row {
    width: min(880px, 100%);
    gap: 1.15rem;
  }

  .stat-card {
    padding: 1.35rem 1rem;
  }

  .stat-card strong {
    font-size: 1.9rem;
  }

  .stat-card span {
    font-size: 0.95rem;
  }

  .section-head h2 {
    font-size: 2.45rem;
  }

  .preview-card img {
    height: 210px;
  }

  .preview-card h3 {
    font-size: 1.28rem;
  }

  .preview-card p {
    font-size: 1.02rem;
  }
}

/* Marquee */

.marquee-wrap {
  margin: 3.5rem 0 1rem;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee {
  display: flex;
  gap: 0.7rem;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee span {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 3.5rem 0 1.4rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.preview-card {
  overflow: hidden;
  text-align: left;
  color: inherit;
  display: block;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.preview-card:hover {
  transform: translateY(-6px);
  border-color: rgba(78, 168, 255, 0.4);
  color: inherit;
}

.preview-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 1.1rem;
  background: #080b14;
}

.preview-card div {
  padding: 1rem 1.1rem 1.2rem;
}

.preview-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.preview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Profile ---------- */

.prose-block {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.prose-block p,
#profiili-sivu p,
#koulutus-sivu p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.12rem;
  line-height: 1.75;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

#profiili-sivu .info-card,
#profiili-sivu .vastapaino-box,
#koulutus-sivu .reason-simple-item {
  background: rgba(8, 12, 18, 0.62);
  border-color: rgba(255, 255, 255, 0.16);
}

#profiili-sivu h2,
#profiili-sivu h3,
#profiili-sivu h5,
#koulutus-sivu h2,
#koulutus-sivu h3 {
  color: #fff;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 2rem;
}

.info-card,
.vastapaino-box {
  padding: 1.6rem 1.5rem;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.vastapaino-box::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2));
}

.info-card:hover,
.vastapaino-box:hover {
  transform: translateY(-4px);
  border-color: rgba(78, 168, 255, 0.35);
  background: var(--surface-hover);
}

.info-card h3,
.vastapaino-box h5 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
  background: rgba(78, 168, 255, 0.12);
  border: 1px solid rgba(186, 214, 220, 0.28);
  color: #d7eef5;
}

.card-icon svg,
.reason-simple-item .icon svg {
  width: 20px;
  height: 20px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.triple-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

/* ---------- Timeline / koulutus ---------- */

.timeline-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}

.timeline-container {
  position: relative;
  padding-left: 0.4rem;
}

.timeline-item {
  position: relative;
  padding: 0 0 2rem 1.8rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(78, 168, 255, 0.15);
}

.timeline-item.active-path {
  border-left-color: var(--ok);
}

.timeline-item.active-path::before {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(62, 224, 196, 0.18), 0 0 18px var(--ok);
}

.timeline-item .year {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.timeline-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.reason-card,
.reason-simple-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.reason-simple-item .icon,
.reason-card .icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(78, 168, 255, 0.14);
  color: #d7eef5;
}

/* ---------- Skills ---------- */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.skill-card {
  padding: 1.4rem 1.3rem;
}

.skill-card h3 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  color: var(--muted);
}

.gallery-frame {
  padding: 1.2rem;
  margin-top: 1.5rem;
}

.gallery-frame h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.fixed-carousel-height img,
.lajikuva {
  max-height: 460px;
  object-fit: contain;
  margin: 0 auto;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

/* ---------- Projects ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 1.25rem;
}

.project-card {
  height: 100%;
  overflow: visible;
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  color: inherit;
  transform-style: preserve-3d;
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.55) 0%, rgba(8, 11, 18, 0.82) 62%, rgba(2, 4, 8, 0.96) 100%);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(90, 180, 230, 0.16),
    0 32px 70px -10px rgba(80, 170, 230, 0.38);
}

.project-card::before {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -36px;
  height: 70px;
  background: radial-gradient(ellipse at center, rgba(140, 210, 255, 0.42), transparent 72%);
  filter: blur(16px);
  pointer-events: none;
  z-index: -1;
}

.project-card::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -20px;
  height: 34px;
  background: radial-gradient(ellipse at center, rgba(190, 230, 255, 0.72), rgba(78, 168, 255, 0.18) 48%, transparent 74%);
  filter: blur(9px);
  pointer-events: none;
  z-index: -1;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(78, 168, 255, 0.4);
  box-shadow:
    0 26px 52px rgba(0, 0, 0, 0.52),
    0 0 52px rgba(90, 180, 230, 0.22),
    0 36px 80px -8px rgba(80, 170, 230, 0.5);
}

.project-card:hover::before {
  background: radial-gradient(ellipse at center, rgba(160, 220, 255, 0.52), transparent 72%);
}

.project-card__media {
  position: relative;
  height: 214px;
  overflow: hidden;
  background: #0b1020;
  border-radius: var(--radius) var(--radius) 0 0;
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s ease;
}

.project-card__media.is-logo img {
  object-fit: contain;
  padding: 1.4rem;
}

.project-card:hover .project-card__media img {
  transform: scale(1.07);
}

.project-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 6, 12, 0.85), transparent 55%);
}

.project-card__tag {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 1;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.75);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.project-card__body {
  padding: 1.15rem 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.28) 100%);
  border-radius: 0 0 var(--radius) var(--radius);
}

.project-card h4,
.project-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  text-align: left;
  background: none;
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: none;
  padding: 0;
  border: 0;
}

.project-card p {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: left;
  margin: 0 0 1rem;
}

.tech-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
}

.tech-logo {
  width: 26px !important;
  height: 26px !important;
  object-fit: contain;
}

.project-card .button-group,
.button-group {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.google {
  padding: 0 0 0.8rem;
  display: flex;
  justify-content: center;
}

.google img {
  height: 48px;
}

.badge-new {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #3d8dff, #6d5cff);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Popups */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, 0.82);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 4000;
  backdrop-filter: blur(12px);
  padding: 1.2rem;
}

.overlay:target {
  display: flex;
}

.overlay-content {
  width: min(920px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #0c101c;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 2rem;
  position: relative;
  color: var(--text);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
}

.popup-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  padding: 0 !important;
  font-size: 1.6rem;
  line-height: 1;
}

.popup-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.popup-header h2 {
  margin: 0 0 0.4rem;
  font-size: 2rem;
  background: linear-gradient(135deg, #4ea8ff, #b388ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.tech-badges .badge {
  background: rgba(78, 168, 255, 0.14);
  border: 1px solid rgba(78, 168, 255, 0.28);
  color: #d7e9ff;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-weight: 600;
}

.popup-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.popup-text p,
.popup-text li {
  color: #c9d0e0;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.feature-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.feature-icon {
  font-size: 1.25rem;
}

.popup-content-grid,
.tech-grid,
.stats-bar {
  display: grid;
  gap: 1rem;
}

.popup-content-grid {
  grid-template-columns: 1fr 1fr;
}

.tech-grid {
  grid-template-columns: repeat(3, 1fr);
}

.stats-bar {
  grid-template-columns: repeat(4, 1fr);
  padding: 1.2rem;
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.08);
}

.tech-item,
.problem-box,
.solution-box {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.problem-box { border-left: 3px solid #ef4444; }
.solution-box { border-left: 3px solid #10b981; }

.popup-footer {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.gallery-container,
.image-stack {
  flex: 0 0 42%;
}

.displayed-img,
.stack-img,
.screenshot-img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.thumb-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.thumb-bar img {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
}

/* ---------- Contact ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 1.4rem;
  align-items: start;
}

.contact-card {
  padding: 1.5rem;
}

.contact-card h2,
.contact-form-card h2 {
  margin: 0 0 0.8rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.contact-links a:hover {
  border-color: rgba(78, 168, 255, 0.4);
  color: #fff;
}

.contact-form-card {
  padding: 1.6rem 1.5rem 1.7rem;
}

.form-label {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
}

.form-control,
.neu-box input,
.neu-box textarea,
.contact-form-card input,
.contact-form-card textarea {
  width: 100%;
  max-width: none !important;
  background: rgba(8, 10, 18, 0.7) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 12px !important;
  padding: 0.75rem 0.9rem !important;
  margin: 0 0 0.9rem !important;
}

.form-control:focus,
.contact-form-card input:focus,
.contact-form-card textarea:focus {
  outline: none;
  border-color: rgba(78, 168, 255, 0.7) !important;
  box-shadow: 0 0 0 4px rgba(78, 168, 255, 0.15);
}

.thank-you-box,
.alert {
  width: min(1180px, 100%);
  margin: 0 auto 1.2rem;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  text-align: center;
}

.thank-you-box {
  background: rgba(62, 224, 196, 0.08);
  border: 1px solid rgba(62, 224, 196, 0.28);
}

.alert-danger {
  background: rgba(255, 107, 122, 0.1);
  border: 1px solid rgba(255, 107, 122, 0.3);
  color: #ffd4d8;
}

/* ---------- Footer ---------- */

.main-footer {
  position: relative;
  z-index: 1;
  margin-left: 0;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 1rem;
}

@media (min-width: 992px) {
  .main-footer {
    margin-left: var(--sidebar-w);
  }
}

.footer-icons {
  display: flex;
  gap: 0.9rem;
}

.footer-icons a,
.sidebar-icons a {
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-icons a:hover,
.sidebar-icons a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #07080f;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 99px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .projects-grid,
  .featured-grid,
  .triple-grid,
  .timeline-layout,
  .contact-layout,
  .skill-grid,
  .split-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 991px) {
  #page-content {
    padding-top: 5.5rem;
  }

  .hero-name {
    font-size: clamp(2.05rem, 9vw, 3rem);
  }

  .site-bg .orb,
  .spotlight {
    display: none;
  }

  .popup-layout,
  .popup-content-grid,
  .tech-grid,
  .stats-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .stats-row,
  .projects-grid,
  .featured-grid,
  .triple-grid,
  .timeline-layout,
  .contact-layout,
  .skill-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .overlay-content {
    padding: 1.3rem 1rem 1.5rem;
  }

  .gallery-container,
  .image-stack {
    flex: 1 1 auto;
  }

  html { font-size: 16px; }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .site-bg__photo,
  .site-bg .orb {
    animation: none !important;
  }
}
