/* Design tokens */
:root {
  --font-sans: 'Inter', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  --bg: #070a12;
  --bg-soft: rgba(14, 18, 30, 0.75);
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-alt: rgba(255, 255, 255, 0.08);
  --text: #e8edf8;
  --muted: #96a1c2;
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.2);
  --border: rgba(148, 163, 184, 0.2);
  --radius: 18px;
  --shadow: 0 24px 70px rgba(5, 7, 18, 0.55);
  --aurora-x: 48%;
  --aurora-y: 38%;
  --aurora-strength: 0.75;
  --aurora-hue: 220;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: rgba(255, 255, 255, 0.84);
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-alt: rgba(15, 23, 42, 0.05);
  --text: #0a1020;
  --muted: #4f5c76;
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.18);
  --border: rgba(15, 23, 42, 0.14);
  --shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
  --aurora-strength: 0.68;
  --aurora-hue: 200;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, rgba(249, 115, 22, 0.28), transparent 55%),
    radial-gradient(900px 600px at 0% 8%, rgba(245, 158, 11, 0.18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

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

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

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

main {
  display: block;
}

.container {
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
}

.section {
  position: relative;
  padding: clamp(56px, 7vw, 120px) 0;
  scroll-margin-top: 82px;
}

.bg-dynamic,
.bg-aurora,
.noise,
.mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-dynamic {
  background: radial-gradient(700px 600px at 16% 20%, rgba(59, 130, 246, 0.22), transparent 65%),
    radial-gradient(800px 680px at 88% 12%, rgba(249, 115, 22, 0.22), transparent 70%);
  z-index: -4;
  background-size: 120% 120%;
  animation: bgDrift 32s ease-in-out infinite alternate;
}

.bg-aurora {
  inset: -12%;
  z-index: -3;
  filter: blur(20px);
  mix-blend-mode: screen;
  opacity: var(--aurora-strength);
  background:
    radial-gradient(420px 320px at var(--aurora-x) var(--aurora-y), hsla(var(--aurora-hue), 95%, 62%, 0.55), transparent 70%),
    radial-gradient(520px 360px at calc(100% - var(--aurora-x)) calc(100% - var(--aurora-y)), hsla(calc(var(--aurora-hue) + 60), 90%, 65%, 0.45), transparent 72%);
  transition: opacity 0.6s ease;
  animation: auroraDrift 18s ease-in-out infinite alternate;
}

.noise {
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800' viewBox='0 0 1200 800'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='1200' height='800' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.mesh {
  z-index: -2;
  background: radial-gradient(900px 900px at 50% 10%, rgba(255, 255, 255, 0.14), transparent 60%);
  opacity: 0.55;
}

#bgParticles {
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  #bgParticles {
    display: none;
  }
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(130%) blur(16px);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.nav.scrolled {
  background: color-mix(in srgb, var(--bg-soft) 95%, transparent);
  box-shadow: 0 18px 48px rgba(5, 10, 20, 0.32);
  border-color: color-mix(in srgb, var(--border) 65%, transparent);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand .logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(120deg, #f97316, #fb923c, #f59e0b);
  box-shadow: 0 16px 28px rgba(249, 115, 22, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.brand:hover .logo {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 20px 40px rgba(249, 115, 22, 0.38);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}

.nav-links a {
  position: relative;
  padding: 10px 12px;
  border-radius: 12px;
  opacity: 0.9;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.nav-links a.bump {
  animation: bump 0.45s ease;
}

.nav-underline {
  position: absolute;
  bottom: 6px;
  left: 0;
  height: 3px;
  border-radius: 3px;
  width: 0;
  background: linear-gradient(90deg, #f59e0b, #f97316, #fb923c);
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.4);
  transform: translateX(0);
  opacity: 0;
  transition: transform 0.3s ease, width 0.3s ease, opacity 0.25s ease;
  pointer-events: none;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, #f97316, #fb923c, #f59e0b);
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  box-shadow: 0 18px 42px rgba(249, 115, 22, 0.45);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
  --x: 50%;
}

.cta::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(120px 30px at var(--x) 0%, rgba(255, 255, 255, 0.55), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.cta:hover::after {
  opacity: 0.75;
}

.burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 60%, transparent);
  transition: transform 0.25s ease, background 0.25s ease;
}

.burger:hover {
  transform: translateY(-1px);
}

.burger span {
  display: block;
  position: relative;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
  transition: background 0.25s ease;
}

.burger span::before,
.burger span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s ease;
}

.burger span::before {
  top: -7px;
}

.burger span::after {
  top: 7px;
}

.burger.open span {
  background: transparent;
}

.burger.open span::before {
  transform: translateY(7px) rotate(45deg);
}

.burger.open span::after {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  width: min(90vw, 320px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 94%, transparent);
  box-shadow: var(--shadow);
  transform: translateY(-10px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 35;
}

.mobile-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mobile-panel a {
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-card) 65%, transparent);
}

.mobile-dim {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 14, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 30;
}

.mobile-dim.show {
  opacity: 1;
  pointer-events: auto;
}

/* Typography helpers */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
}

.grad {
  background: linear-gradient(120deg, #fb923c, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: color-mix(in srgb, var(--muted) 45%, var(--text));
  max-width: 520px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-title h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.kicker {
  color: var(--muted);
  font-weight: 500;
}

.muted {
  color: var(--muted);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(32px, 6vw, 64px);
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg-card) 60%, transparent);
  color: var(--text);
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: 0 10px 28px rgba(4, 6, 16, 0.28);
}

.btn.primary {
  background: linear-gradient(120deg, #f97316, #fb923c, #f59e0b);
  color: #fff;
  box-shadow: 0 20px 44px rgba(249, 115, 22, 0.4);
}

.btn.ghost {
  background: color-mix(in srgb, var(--accent-soft) 40%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(28px, 4vw, 48px);
}

.stat {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 70%, transparent);
  text-align: left;
  display: grid;
  gap: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background 0.35s ease;
  will-change: transform, border-color, box-shadow;
}

.stat:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 22px 48px rgba(8, 10, 20, 0.45);
  background: color-mix(in srgb, var(--bg-card) 60%, rgba(56, 189, 248, 0.18));
}

.stat strong {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-variant-numeric: tabular-nums;
}

.stat span:last-child {
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-art {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: center;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
  opacity: 0.75;
  background-size: 130% 130%;
  animation: orbGlow 18s ease-in-out infinite alternate;
}

.orb.o1 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle at 30% 30%, rgba(249, 115, 22, 0.9), rgba(17, 24, 39, 0));
  top: -20px;
  left: 40px;
}

.orb.o2 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.65), rgba(12, 17, 34, 0));
  bottom: -10px;
  right: 10px;
  animation-duration: 22s;
  animation-direction: alternate-reverse;
}

.glass {
  position: relative;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--bg-card) 80%, rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(18px);
  z-index: 2;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
  overflow: hidden;
}

.glass h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.glass p {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.glass::after {
  content: "";
  position: absolute;
  inset: -60%;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  transform: translateX(-120%) rotate(18deg);
  animation: glassShine 14s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Cards & grids */
.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(18px, 4vw, 28px);
}

.card {
  position: relative;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  --lift: 0px;
  --tiltX: 0deg;
  --tiltY: 0deg;
  transform: perspective(1200px) translateY(var(--lift)) rotateX(var(--tiltX)) rotateY(var(--tiltY));
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    background 0.4s ease;
  will-change: transform, box-shadow, border-color;
  transform-style: preserve-3d;
}

.card.alt {
  background: var(--bg-card-alt);
  box-shadow: none;
}

.card:hover,
.card:focus-within {
  --lift: -12px;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 28px 60px rgba(8, 12, 24, 0.52);
  background: color-mix(in srgb, var(--bg-card) 60%, rgba(249, 115, 22, 0.12));
}

.card.alt:hover,
.card.alt:focus-within {
  background: color-mix(in srgb, var(--bg-card-alt) 80%, rgba(249, 115, 22, 0.08));
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon {
  width: 28px;
  height: 28px;
}

.card.tall {
  min-height: 220px;
}

.grid.portfolio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(18px, 4vw, 28px);
}

.project {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: grid;
  gap: 0;
  box-shadow: var(--shadow);
  --lift: 0px;
  --tiltX: 0deg;
  --tiltY: 0deg;
  transform: perspective(1200px) translateY(var(--lift)) rotateX(var(--tiltX)) rotateY(var(--tiltY));
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease,
    box-shadow 0.45s ease,
    background 0.45s ease;
  will-change: transform, box-shadow, border-color;
  transform-style: preserve-3d;
}

.project:hover,
.project:focus-within {
  --lift: -14px;
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 32px 68px rgba(7, 10, 20, 0.58);
  background: color-mix(in srgb, var(--bg-card) 60%, rgba(37, 99, 235, 0.22));
}

.project .thumb {
  padding: 48px 28px;
  background: radial-gradient(circle at 16% 20%, rgba(249, 115, 22, 0.55), rgba(10, 16, 32, 0.4)),
    linear-gradient(135deg, rgba(17, 24, 39, 0.85), rgba(17, 24, 39, 0.45));
  font-weight: 600;
  letter-spacing: 0.04em;
}

.project:hover .thumb,
.project:focus-within .thumb {
  background: radial-gradient(circle at 16% 20%, rgba(249, 115, 22, 0.65), rgba(10, 16, 32, 0.32)),
    linear-gradient(135deg, rgba(17, 24, 39, 0.85), rgba(59, 130, 246, 0.45));
}

.project-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
}

.project-meta {
  display: grid;
  gap: 6px;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.step {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  font-size: 0.98rem;
  --lift: 0px;
  --tiltX: 0deg;
  --tiltY: 0deg;
  transform: perspective(1200px) translateY(var(--lift)) rotateX(var(--tiltX)) rotateY(var(--tiltY));
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease,
    box-shadow 0.45s ease,
    background 0.45s ease;
  will-change: transform, box-shadow, border-color;
  transform-style: preserve-3d;
}

.step:hover,
.step:focus-within {
  --lift: -10px;
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 22px 48px rgba(6, 8, 18, 0.52);
  background: color-mix(in srgb, var(--bg-card) 70%, rgba(56, 189, 248, 0.15));
}

.step strong {
  color: var(--text);
}

.contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 5vw, 36px);
  align-items: start;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 75%, transparent);
  color: var(--text);
  resize: vertical;
  min-height: 48px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  background: color-mix(in srgb, var(--bg-card) 80%, rgba(249, 115, 22, 0.08));
}

input:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  min-height: 1.2em;
}

.form-note.error {
  color: #fca5a5;
}

.form-note.success {
  color: #4ade80;
}

.hero-actions .btn.ghost {
  border-color: transparent;
}

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

footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  backdrop-filter: blur(12px);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Toggles & indicators */
.theme-toggle {
  position: fixed;
  right: 24px;
  bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 80%, transparent);
  box-shadow: var(--shadow);
  z-index: 45;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}

.scrollbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 50;
  pointer-events: none;
}

.scrollbar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22d3ee, #6366f1, #f97316);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
  transition: width 0.18s ease;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="left"] {
  transform: translateX(-28px);
}

[data-reveal="right"] {
  transform: translateX(28px);
}

[data-reveal="up"] {
  transform: translateY(32px);
}

[data-reveal="zoom"] {
  transform: scale(0.94);
}

[data-reveal="flip"] {
  transform: rotateX(12deg);
  transform-origin: top;
}

.reveal.show[data-reveal="left"],
.reveal.show[data-reveal="right"],
.reveal.show[data-reveal="up"],
.reveal.show[data-reveal="zoom"],
.reveal.show[data-reveal="flip"] {
  transform: none;
}

/* Count-up odometer styling */
.odometer {
  display: inline-flex;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}

.odod {
  display: inline-flex;
  overflow: hidden;
}

.odod .col {
  display: grid;
  transition: transform 0.9s cubic-bezier(0.23, 1, 0.32, 1);
}

.odod .col span {
  display: block;
  height: 1em;
  line-height: 1.1;
}

/* Helpers */
.card::after,
.project::after,
.step::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(280px 220px at 20% 20%, rgba(249, 115, 22, 0.35), transparent 65%),
    linear-gradient(120deg, rgba(56, 189, 248, 0.25), transparent 60%);
  transition: opacity 0.35s ease;
  mix-blend-mode: screen;
}

.card:hover::after,
.project:hover::after,
.step:hover::after,
.card:focus-within::after,
.project:focus-within::after,
.step:focus-within::after {
  opacity: 0.85;
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }

  .burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    order: -1;
    min-height: 260px;
  }

  .stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .contact {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-toggle {
    right: 16px;
    bottom: 18px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100%, calc(100% - 32px));
  }

  .section {
    padding: clamp(42px, 12vw, 72px) 0;
  }

  .section-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .glass {
    padding: 20px;
  }

  .project-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .theme-toggle {
    width: calc(100% - 32px);
    left: 16px;
    justify-content: center;
  }
}

@keyframes bgDrift {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  50% {
    transform: scale(1.05) translate3d(2%, -2%, 0);
  }
  100% {
    transform: scale(1.02) translate3d(-2%, 2%, 0);
  }
}

@keyframes auroraDrift {
  0% {
    transform: translate3d(0, 0, 0);
    filter: hue-rotate(0deg);
  }
  50% {
    transform: translate3d(3%, -2%, 0) scale(1.05);
    filter: hue-rotate(10deg);
  }
  100% {
    transform: translate3d(-2%, 3%, 0) scale(0.98);
    filter: hue-rotate(-8deg);
  }
}

@keyframes orbGlow {
  0% {
    opacity: 0.65;
    background-position: 0% 0%;
  }
  50% {
    opacity: 0.92;
    background-position: 50% 50%;
  }
  100% {
    opacity: 0.7;
    background-position: 100% 100%;
  }
}

@keyframes glassShine {
  0% {
    transform: translateX(-120%) rotate(18deg);
    opacity: 0;
  }
  45% {
    transform: translateX(120%) rotate(18deg);
    opacity: 0.55;
  }
  100% {
    transform: translateX(140%) rotate(18deg);
    opacity: 0;
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes bump {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-4px);
  }
  70% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .cta {
    animation: none;
  }

  .bg-dynamic,
  .bg-aurora,
  .orb,
  .glass::after {
    animation: none !important;
  }
}


/* suffix like '+' */ font-size: .75em; vertical-align: super; margin-left: 2px; }


/* === ODOMETER v2 (robust) === */
.odometer{display:inline-flex;gap:4px;font-variant-numeric:tabular-nums}
.odometer .cell{display:inline-block;height:1em;line-height:1;overflow:hidden}
.odometer .col{display:grid;transition:transform .8s cubic-bezier(.22,1,.36,1);will-change:transform}
.odometer .col span{display:block;height:1em;line-height:1}
.stat strong{display:flex;align-items:baseline;gap:8px;font-weight:800;letter-spacing:-.02em}
.stat .suffix{font-size:.55em;line-height:1;transform:translateY(-.42em);opacity:.9;margin-left:4px}
@media(min-width:1024px){.stats{grid-template-columns:repeat(3,minmax(0,1fr))}}

@media (max-width: 640px){
  .theme-toggle{position:fixed;top:50%;right:max(12px,env(safe-area-inset-right));left:auto;bottom:auto;
    transform:translateY(-50%);padding:10px 12px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;
    gap:0;z-index:1000;box-shadow:0 4px 16px rgba(0,0,0,.15);backdrop-filter:blur(6px)}
  #themeText{display:none}
}


/* === PATCH 2025-10-23: Mobile theme toggle — circular bottom-right === */
@media (max-width: 640px) {
  .theme-toggle {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom));
    right:  calc(16px + env(safe-area-inset-right));
    left: auto;
    top: auto;
    transform: none;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 1200;
    box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 0 0 1px var(--border);
    backdrop-filter: blur(8px);
    background: color-mix(in srgb, var(--bg-card) 75%, transparent);
    touch-action: manipulation;
  }
  /* прячем подпись: оставляем только иконку */
  .theme-toggle .theme-text, #themeText { display: none !important; }
}
