/* ==========================================================================
   Portfolio — ANDYOU
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-soft: #f8fafc;
  --color-bg-muted: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-text-soft: #94a3b8;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-soft: rgba(37, 99, 235, 0.08);
  --color-accent-glow: rgba(37, 99, 235, 0.25);
  --color-border: rgba(15, 23, 42, 0.06);
  --color-border-strong: rgba(15, 23, 42, 0.1);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-brand: "Instrument Sans", var(--font);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 32px 80px rgba(15, 23, 42, 0.1);
  --shadow-card: 0 4px 6px rgba(15, 23, 42, 0.02), 0 20px 50px rgba(15, 23, 42, 0.06);
  --shadow-card-hover: 0 8px 16px rgba(15, 23, 42, 0.04), 0 32px 72px rgba(15, 23, 42, 0.1);
  --shadow-accent: 0 12px 40px var(--color-accent-glow);
  --shadow-btn: 0 2px 8px rgba(37, 99, 235, 0.2);
  --shadow-btn-hover: 0 8px 28px rgba(37, 99, 235, 0.35);

  --space-section: clamp(2.4rem, 5vw, 3.75rem);
  --space-block: clamp(1rem, 2vw, 1.5rem);
  --container: min(1140px, calc(100% - 3rem));
  --header-h: 68px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration: 0.55s;
  --duration-reveal-project: 1.05s;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text);
  background:
    radial-gradient(ellipse 80% 50% at 90% -10%, rgba(37, 99, 235, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 40%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #fafbfd 45%, #ffffff 100%);
  overflow-x: hidden;
}

#main {
  position: relative;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

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

.container {
  width: var(--container);
  margin-inline: auto;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition:
    background 0.45s var(--ease-out),
    box-shadow 0.45s var(--ease-out),
    backdrop-filter 0.45s var(--ease-out),
    border-color 0.45s var(--ease-out);
}

.header--scrolled {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--color-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 12px 40px rgba(15, 23, 42, 0.05);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--color-text);
  transition: color 0.25s;
}

.logo:hover {
  color: var(--color-accent);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.25s, opacity 0.25s;
  letter-spacing: -0.01em;
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--color-text);
}

.nav__link--cta {
  padding: 0.55rem 1.15rem;
  background: var(--color-text);
  color: #fff !important;
  border-radius: 100px;
  transition: background 0.25s, transform 0.25s var(--ease-spring);
}

.nav__link--cta:hover {
  background: var(--color-accent);
  transform: translateY(-1px);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 10px;
}

.nav__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 100px;
  border: 1.5px solid transparent;
  position: relative;
  isolation: isolate;
  transition:
    background 0.35s var(--ease-out),
    color 0.35s,
    border-color 0.35s,
    transform 0.4s var(--ease-spring),
    box-shadow 0.4s var(--ease-out);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(180deg, #3b82f6 0%, var(--color-accent) 100%);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #3b82f6 0%, var(--color-accent-hover) 100%);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-btn-hover);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.8);
  color: var(--color-text);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.btn--outline:hover {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--color-accent);
  background: var(--color-accent-soft);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
}

.btn--sm {
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
}

.btn--lg {
  padding: 1.15rem 2.5rem;
  font-size: 1.05rem;
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(92vh, 820px);
  padding-top: calc(var(--header-h) + 2rem);
  padding-bottom: var(--space-section);
  overflow: visible;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.65;
  animation: orb-float 18s ease-in-out infinite;
}

.hero__orb--1 {
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  top: -15%;
  right: -8%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.35) 0%, transparent 70%);
}

.hero__orb--2 {
  width: min(400px, 55vw);
  height: min(400px, 55vw);
  bottom: 5%;
  left: -12%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
  animation-delay: -6s;
}

.hero__orb--3 {
  width: min(280px, 40vw);
  height: min(280px, 40vw);
  top: 40%;
  left: 35%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
  animation-delay: -12s;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 75%);
  opacity: 0.5;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(2%, -3%) scale(1.05); }
  66% { transform: translate(-2%, 2%) scale(0.98); }
}

.hero__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(3rem, 7vw, 5.5rem);
  align-items: center;
}

.hero__content {
  max-width: 26.5rem;
}

/* Brand wordmark */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.brand__core {
  color: var(--color-text);
}

.brand__accent {
  color: var(--color-accent);
  letter-spacing: 0.11em;
}

.brand--sm {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.brand--sm .brand__accent {
  letter-spacing: 0.09em;
}

.hero__brand {
  margin-bottom: 0.9rem;
}

.hero__brand .brand {
  padding: 0.42rem 0.75rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.09em;
}

.hero__headline {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.038em;
  margin-bottom: 1rem;
  max-width: 11ch;
  color: var(--color-text);
}

.hero__lead {
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
  line-height: 1.65;
  color: var(--color-text-muted);
  max-width: 26em;
  margin-bottom: 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn--hero {
  padding: 1.05rem 2.15rem;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: var(--shadow-btn-hover);
}

.hero__actions .btn--ghost {
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.85rem 1.35rem;
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
  box-shadow: none;
}

.hero__actions .btn--ghost:hover {
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-color: transparent;
  transform: none;
}

.hero__note {
  margin-top: 1.1rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--color-text-soft);
  letter-spacing: -0.01em;
}

/* Hero visual — ambient product spotlight */
.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: clamp(420px, 52vh, 560px);
  padding: clamp(1rem, 3vw, 2rem) 0;
}

.hero-stage {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  perspective: 1800px;
  animation: hero-stage-in 1s var(--ease-out) 0.1s both;
}

.hero-stage__atmo {
  position: absolute;
  inset: -8% -6% -4%;
  pointer-events: none;
  z-index: 0;
}

.hero-stage__floor {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 72%;
  height: 18%;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.18) 0%, transparent 70%);
  filter: blur(24px);
}

.hero-stage__showcase {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(1.75rem, 4vw, 2.75rem);
  transition: transform 0.65s var(--ease-out);
  animation: hero-device-float 9s ease-in-out 1.5s infinite;
}

.hero-stage__caption {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.45rem;
  margin: 0 0 clamp(0.85rem, 2vw, 1.15rem);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.42);
}

.hero-stage__caption-name {
  color: var(--color-accent);
}

.hero-stage__caption-sep {
  opacity: 0.45;
}

.hero-stage__device {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 clamp(0.75rem, 2vw, 1.25rem);
}

.hero-device {
  width: 100%;
  max-width: 720px;
  transform-style: preserve-3d;
  transform: rotateX(2deg);
  filter:
    drop-shadow(0 32px 64px rgba(15, 23, 42, 0.22))
    drop-shadow(0 12px 28px rgba(15, 23, 42, 0.12));
}

.hero-device__lid {
  position: relative;
  padding: clamp(11px, 1.6vw, 15px) clamp(11px, 1.6vw, 15px) 0;
  border-radius: clamp(16px, 2.2vw, 20px) clamp(16px, 2.2vw, 20px) 0 0;
  background: linear-gradient(180deg, #4a4a4c 0%, #2c2c2e 42%, #1a1a1c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 -2px 0 rgba(0, 0, 0, 0.4);
}

.hero-device__camera {
  position: absolute;
  top: clamp(6px, 1vw, 9px);
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0a0a0c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  z-index: 2;
}

.hero-device__screen {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: clamp(7px, 1.1vw, 11px) clamp(7px, 1.1vw, 11px) 0 0;
  overflow: hidden;
  background: #0a0a0c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65);
}

.hero-device__shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #f8fafc;
}

.hero-device__base {
  position: relative;
  height: clamp(15px, 2.2vw, 19px);
  margin-top: -1px;
  border-radius: 0 0 clamp(14px, 2.2vw, 18px) clamp(14px, 2.2vw, 18px);
  background: linear-gradient(180deg, #d4d4d8 0%, #8e8e93 46%, #636366 100%);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
}

.hero-device__notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20%;
  height: 5px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, #b0b0b5, #8e8e93);
}

.hero-stage__dock {
  position: relative;
  z-index: 3;
  width: min(94%, 680px);
  margin: clamp(-0.35rem, -0.5vw, -0.15rem) auto 0;
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  padding: clamp(0.7rem, 1.6vw, 0.9rem) clamp(0.9rem, 2vw, 1.2rem);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 41, 59, 0.82) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(37, 99, 235, 0.06) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  animation: hero-dock-in 0.95s var(--ease-out) 0.5s both;
}

.hero-dock__metric {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-shrink: 0;
}

.hero-dock__val {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.hero-dock__lbl {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.hero-dock__line {
  width: 1px;
  align-self: stretch;
  min-height: 2rem;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  flex-shrink: 0;
}

.hero-dock__caps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}

.hero-dock__caps span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.hero-dock__caps span::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.55);
}

.hero-stage:hover .hero-stage__dock {
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow:
    0 28px 68px rgba(15, 23, 42, 0.26),
    0 0 32px rgba(37, 99, 235, 0.08),
    0 0 0 1px rgba(37, 99, 235, 0.1) inset;
}

@keyframes hero-stage-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-dock-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-device-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}


/* Sections */
.section {
  padding-block: var(--space-section);
  position: relative;
}

.section__header {
  margin-bottom: var(--space-block);
  max-width: 36rem;
}

.section--projects {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
}

.section--projects .section__header {
  max-width: 40rem;
}

.section--projects .section__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.section__header--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: none;
}

.section__header--row .section__title {
  margin-bottom: 0;
}

.section__header--row .section__label {
  margin-bottom: 0.35rem;
}

.section__header--center {
  margin-inline: auto;
  text-align: center;
  max-width: 36rem;
}

.section__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.section__title {
  font-size: clamp(1.5rem, 3.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.section__desc {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.section__desc--inline {
  margin: 0;
  max-width: 20rem;
  text-align: right;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.projects__list .project-card.reveal {
  opacity: 0;
  transform: translateY(36px) scale(0.985);
  transition:
    opacity var(--duration-reveal-project) var(--ease-reveal),
    transform var(--duration-reveal-project) var(--ease-reveal);
  will-change: opacity, transform;
}

.projects__list .project-card.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.reveal:nth-child(2) { transition-delay: 0.06s; }
.reveal:nth-child(3) { transition-delay: 0.12s; }
.reveal:nth-child(4) { transition-delay: 0.18s; }
.reveal:nth-child(5) { transition-delay: 0.24s; }
.reveal:nth-child(6) { transition-delay: 0.3s; }


.hero__content .reveal:nth-child(1) { transition-delay: 0s; }
.hero__content .reveal:nth-child(2) { transition-delay: 0.08s; }
.hero__content .reveal:nth-child(3) { transition-delay: 0.16s; }
.hero__content .reveal:nth-child(4) { transition-delay: 0.24s; }
.hero__content .reveal:nth-child(5) { transition-delay: 0.32s; }

/* Skills */
.skills-groups {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.skills-group {
  padding: 1rem 1.05rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s,
    border-color 0.35s,
    background 0.35s;
}

.skills-group:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: var(--shadow-md);
  background: #fff;
}

.skills-group__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--color-border);
}

.skills-group__title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.7;
}

.skills-group__list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.skills-group__list li {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  padding: 0.2rem 0;
  transition: color 0.25s, transform 0.25s var(--ease-out);
}

.skills-group:hover .skills-group__list li {
  color: var(--color-text);
}

.skills-group__list li:hover {
  color: var(--color-accent);
  transform: translateX(3px);
}

/* Projects */
.projects__list {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vw, 2.5rem);
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  align-items: start;
  padding: clamp(1.25rem, 2.8vw, 1.65rem);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    transform 0.55s var(--ease-out),
    box-shadow 0.55s var(--ease-out),
    border-color 0.4s;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.project-card.is-visible:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(37, 99, 235, 0.16);
}

.project-card:nth-child(even) {
  grid-template-columns: 1fr;
}

.project-card:nth-child(even) .project-card__visual,
.project-card:nth-child(even) .project-card__body {
  grid-column: auto;
  grid-row: auto;
}

.project-card__body {
  min-width: 0;
  padding-top: 0.25rem;
  border-top: 1px solid var(--color-border);
}

.project-card__visual {
  position: relative;
  width: 100%;
  align-self: start;
  flex-shrink: 0;
  overflow: visible;
  isolation: isolate;
}

/* Showcase: главная сверху, Sheets и Telegram в ряд */
.project-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
}

.project-showcase__main {
  grid-column: 1 / -1;
  width: 100%;
}

.project-showcase__main-label {
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: -0.01em;
}

.project-showcase__main .project-card__frame {
  height: auto;
  max-height: none;
  overflow: visible;
}

.project-showcase__main .project-card__frame::before {
  height: 22px;
}

.project-showcase__main .project-card__media {
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  max-height: clamp(260px, 48vw, 540px);
  padding: 6px 8px 8px;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  overflow: hidden;
}

.project-showcase__main .project-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.project-showcase--bot .project-showcase__main .project-card__media {
  aspect-ratio: 9 / 16;
  max-height: clamp(320px, 55vw, 480px);
  background: #b4d4a7;
}

.project-showcase--bot .project-showcase__main .project-card__media img {
  object-fit: contain;
  object-position: top center;
}

.project-showcase__float {
  position: static;
  margin: 0;
  width: 100%;
  max-width: none;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.4s var(--ease-spring),
    box-shadow 0.4s var(--ease-out);
}

.project-card.is-visible:hover .project-showcase__float {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.project-showcase__label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.5rem 0.6rem;
  background: var(--color-bg-soft);
  border-bottom: 1px solid var(--color-border);
}

.project-showcase__label-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.project-showcase__label-text strong {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
  line-height: 1.25;
}

.project-showcase__label-text > span {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.project-showcase__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.project-showcase__icon--brand {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.project-showcase__float--sheets .project-showcase__thumb {
  height: auto;
  min-height: 88px;
  max-height: 120px;
}

.project-showcase__thumb {
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.project-showcase__thumb img,
.project-showcase__main .project-card__media img {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.project-showcase__thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  object-position: top center;
}

.project-showcase__float--telegram .project-showcase__thumb {
  height: auto;
  min-height: 100px;
  max-height: 140px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: #b4d4a7;
}

.project-showcase__float--telegram .project-showcase__thumb img {
  object-fit: contain;
  object-position: top center;
  width: 100%;
  height: auto;
  max-height: 140px;
}

.project-showcase__thumb--square img {
  object-position: top center;
}

.project-showcase--bot {
  grid-template-columns: 1fr;
}

.project-showcase--bot .project-showcase__float--sheets {
  grid-column: 1 / -1;
}

.project-showcase--bot .project-showcase__thumb {
  height: auto;
  min-height: 72px;
  max-height: 100px;
}

.project-card__frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.project-card__frame::before {
  content: "";
  flex-shrink: 0;
  height: 26px;
  background: linear-gradient(180deg, #e2e8f0 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--color-border);
  background-image:
    radial-gradient(circle at 18px 50%, #f87171 5px, transparent 5px),
    radial-gradient(circle at 34px 50%, #fbbf24 5px, transparent 5px),
    radial-gradient(circle at 50px 50%, #4ade80 5px, transparent 5px);
  background-repeat: no-repeat;
  background-size: auto;
}

.project-card__media {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px 12px;
  overflow: hidden;
  background: #f8fafc;
}

.project-card__media picture,
.project-card__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
}

.project-card__media img {
  object-fit: contain;
  object-position: center top;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.project-card__badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 4;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
}

/* Phone mockup — AutoService Bot */
.phone-mockup {
  position: relative;
  z-index: 1;
  width: min(200px, 72%);
  transition: transform 0.6s var(--ease-out);
}

.project-card__visual--phone:hover .phone-mockup {
  transform: scale(1.04);
}

.phone-mockup__frame {
  position: relative;
  padding: 10px;
  border-radius: 36px;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 48px rgba(15, 23, 42, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.phone-mockup__island {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 14px;
  background: #0f172a;
  border-radius: 20px;
  z-index: 3;
}

.phone-mockup__screen {
  border-radius: 28px;
  overflow: hidden;
  background: #8ebad8;
  aspect-ratio: 9 / 16;
}

.tg-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-size: 9px;
  line-height: 1.35;
}

.tg-chat__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 28px 10px 8px;
  background: #517da2;
  color: #fff;
}

.tg-chat__header strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.tg-chat__header span {
  font-size: 8px;
  opacity: 0.85;
}

.tg-chat__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
}

.tg-chat__messages {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  background: linear-gradient(180deg, #8ebad8 0%, #9ec5de 100%);
}

.tg-msg {
  max-width: 88%;
  padding: 5px 8px;
  border-radius: 10px;
  font-size: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.tg-msg--in {
  align-self: flex-start;
  background: #fff;
  color: #0f172a;
  border-bottom-left-radius: 3px;
}

.tg-msg--out {
  align-self: flex-end;
  background: #effdde;
  color: #0f172a;
  border-bottom-right-radius: 3px;
}

.tg-keyboard {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-self: stretch;
}

.tg-key {
  flex: 1 1 auto;
  min-width: calc(50% - 4px);
  padding: 5px 6px;
  text-align: center;
  font-size: 7.5px;
  font-weight: 500;
  color: #2563eb;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Project features */
.project-features {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.04) 0%, rgba(248, 250, 252, 0.9) 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-md);
}

.project-features__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

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

.project-features__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
}

.project-features__list li::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: var(--color-accent);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}

.project-card__title {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.project-card__text {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.95rem;
  max-width: 52em;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-card__tags li {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.38rem 0.8rem;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  letter-spacing: -0.01em;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}

.project-card:hover .project-card__tags li {
  border-color: rgba(37, 99, 235, 0.12);
}

.project-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Stats */
.stats__wrap {
  position: relative;
  overflow: hidden;
  padding: clamp(1.35rem, 3vw, 1.85rem) clamp(1.25rem, 3vw, 2rem);
  background: linear-gradient(135deg, #0f172a 0%, #172554 45%, #1e40af 100%);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  color: #fff;
}

.stats__wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 80% at 10% 50%, rgba(59, 130, 246, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 40% 60% at 90% 80%, rgba(99, 102, 241, 0.28) 0%, transparent 50%);
  pointer-events: none;
}

.stats__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.stat-card {
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.35s;
}

.stat-card + .stat-card {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.stat-card__value {
  display: block;
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.65rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.stat-card__value.is-counting {
  color: #93c5fd;
  text-shadow: 0 0 24px rgba(147, 197, 253, 0.4);
}

.stat-card__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* Services — 4 offer cards */
.section--services {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(248, 250, 252, 0.65) 100%);
}

.offers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.offer-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.35rem 1.3rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition:
    transform 0.4s var(--ease-out),
    box-shadow 0.4s,
    border-color 0.35s,
    background 0.35s;
}

.offer-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(255, 255, 255, 0.98);
}

.offer-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 0.9rem;
  font-size: 1.35rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--color-accent-soft) 0%, rgba(255, 255, 255, 0.9) 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 12px;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.35s;
}

.offer-card:hover .offer-card__icon {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.offer-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.85rem;
  color: var(--color-text);
}

.offer-card__list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: auto;
}

.offer-card__list li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.offer-card__list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* Contact */
.contact {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.55) 0%, rgba(255, 255, 255, 0) 100%);
}

.contact-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  max-width: 52rem;
  margin: 0 auto 1.35rem;
  padding: 0.85rem 1.15rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.contact-trust li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: -0.01em;
}

.contact-trust li::before {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}

.contact__links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.35rem;
  max-width: 920px;
  margin-inline: auto;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition:
    transform 0.4s var(--ease-spring),
    box-shadow 0.4s,
    border-color 0.35s;
}

.contact-link:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(37, 99, 235, 0.2);
}

.contact-link__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  transition: transform 0.4s var(--ease-spring);
}

.contact-link:hover .contact-link__icon {
  transform: scale(1.08);
}

.contact-link__icon--telegram {
  background: rgba(37, 99, 235, 0.1);
  color: #229ed9;
}

.contact-link__icon--github {
  background: var(--color-bg-muted);
  color: var(--color-text);
}

.contact-link__icon--email {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.contact-link__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
}

.contact-link__label {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.contact-link__hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-soft);
}

.contact-link:hover .contact-link__label {
  color: var(--color-accent);
}

.contact__cta {
  text-align: center;
}

.contact__cta .btn--primary {
  min-width: 240px;
}

/* Footer */
.footer {
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--color-border);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.footer__copy {
  font-weight: 600;
  font-size: 0.9rem;
}

.footer__note {
  font-size: 0.85rem;
  color: var(--color-text-soft);
}

/* Zoomable project images */
.is-zoomable {
  cursor: zoom-in;
  position: relative;
}

.is-zoomable::after {
  content: "Увеличить";
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 0.3rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border-radius: 100px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.is-zoomable:hover::after,
.is-zoomable:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.is-zoomable:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: visibility 0.3s, opacity 0.3s var(--ease-out);
}

.lightbox.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1200px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.lightbox__figure {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  margin: 0;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  transition: background 0.25s, transform 0.25s var(--ease-spring);
}

.lightbox__close:hover {
  background: #fff;
  transform: scale(1.05);
}

.lightbox__loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: lightbox-spin 0.7s linear infinite;
}

.lightbox__loader[hidden] {
  display: none;
}

@keyframes lightbox-spin {
  to { transform: rotate(360deg); }
}

.lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(92vh - 3.5rem);
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.lightbox__img.is-loaded {
  opacity: 1;
}

.lightbox__caption {
  flex-shrink: 0;
  padding: 0.85rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg-soft);
  border-top: 1px solid var(--color-border);
  line-height: 1.45;
}

body.has-lightbox {
  overflow: hidden;
}

@media (max-width: 768px) {
  .lightbox__close {
    top: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .projects__list .project-card.reveal { opacity: 1; transform: none; transition: none; }
  .hero__orb { animation: none; }
  .hero-stage { animation: none; }
  .hero-stage__showcase { animation: none; }
  .hero-stage__dock { animation: none; }
  .btn:hover,
  .offer-card:hover,
  .skills-group:hover,
  .project-card.is-visible:hover,
  .contact-link:hover,
  .project-showcase__main:hover .project-card__media img,
  .project-card.is-visible:hover .project-showcase__float,
  .is-zoomable::after { transition: none; opacity: 0; }
  .lightbox { transition: none; }
  .lightbox__img { transition: none; }
}

/* Large screens */
@media (min-width: 1280px) {
  :root {
    --container: min(1140px, calc(100% - 4rem));
  }

  .project-showcase__main .project-card__media {
    max-height: clamp(300px, 36vw, 560px);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero__layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero__content {
    max-width: none;
    text-align: center;
  }

  .hero__brand {
    justify-content: center;
  }

  .hero__headline {
    max-width: none;
    margin-inline: auto;
  }

  .hero__lead {
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__note {
    text-align: center;
  }

  .hero__visual {
    flex-direction: column;
    min-height: 280px;
    padding-top: 0.5rem;
  }

  .hero-stage {
    max-width: 620px;
  }

  .hero-stage__dock {
    width: min(96%, 580px);
  }

  .hero {
    min-height: auto;
  }

  .skills-groups {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact__links {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card + .stat-card {
    border-left: none;
  }

  .stat-card:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 768px) {
  .nav__toggle {
    display: flex;
  }

  .nav__list {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s var(--ease-out), opacity 0.3s, visibility 0.3s;
  }

  .nav__list.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__list li {
    width: 100%;
  }

  .nav__link {
    display: block;
    padding: 1rem 0;
    font-size: 1.05rem;
  }

  .nav__link--cta {
    text-align: center;
    margin-top: 0.5rem;
  }

  .project-card,
  .project-card:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .project-card:nth-child(even) .project-card__visual,
  .project-card:nth-child(even) .project-card__body {
    grid-column: auto;
    grid-row: auto;
  }

  .offers {
    grid-template-columns: 1fr;
  }

  .project-features__list {
    grid-template-columns: 1fr;
  }

  .project-showcase__main .project-card__media {
    max-height: clamp(220px, 58vw, 380px);
  }

  .hero-stage__dock {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 520px;
  }

  .hero-dock__line {
    width: 100%;
    height: 1px;
    min-height: 0;
    align-self: stretch;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  }


}

@media (max-width: 640px) {
  .section__header--row {
    flex-direction: column;
    align-items: flex-start;
  }

  .section__desc--inline {
    text-align: left;
    max-width: none;
  }

  .skills-groups {
    grid-template-columns: 1fr;
  }


  .contact-trust {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .stat-card:nth-child(odd) {
    border-right: none;
  }
}

@media (max-width: 480px) {
  :root {
    --container: calc(100% - 1.5rem);
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .stats__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact__links {
    grid-template-columns: 1fr;
  }
}
