/* ==========================================================================
   Variables
   ========================================================================== */
:root {
  --bg: #0a0d0a;
  --bg-elevated: #10140f;
  --bg-card: #12160f;
  --border: #212a1e;
  --border-hover: #2f3d29;

  --green: #3ddc7a;
  --green-strong: #2bc466;
  --green-dim: #1c7a45;
  --green-glow: rgba(61, 220, 122, 0.35);

  --accent: #ffb545;
  --accent-glow: radial-gradient(circle, rgba(255, 181, 69, 0.65) 0%, rgba(255, 181, 69, 0.25) 45%, rgba(255, 181, 69, 0) 75%);

  --text: #e7ece6;
  --text-dim: #a9b3a5;
  --text-faint: #6f796c;

  --radius: 14px;
  --radius-sm: 8px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 320ms var(--ease);
  --transition-fast: 150ms var(--ease);

  --max-width: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, blockquote {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

/* Native link/element drag-and-drop stalls pointermove (and can leave
   :hover "stuck") while the drag gesture is active — this UI has no use
   for dragging links or cards, so opt out entirely. */
a,
.card,
.contact-link {
  -webkit-user-drag: none;
}

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

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

code {
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: 0.9em;
  background: rgba(61, 220, 122, 0.08);
  color: var(--green);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--green);
  color: #06110a;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 13, 10, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav__links {
  display: flex;
  gap: 2rem;
}

.nav__links a {
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: color var(--transition);
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--green);
  transition: width var(--transition);
}

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

.nav__links a:hover::after,
.nav__links a:focus-visible::after {
  width: 100%;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.nav__toggle:hover,
.nav__toggle:focus-visible {
  background: rgba(61, 220, 122, 0.12);
  transform: scale(1.08);
}

.nav__toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition), background-color var(--transition-fast);
}

.nav__toggle:hover span,
.nav__toggle:focus-visible span {
  background: var(--green);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--green);
  color: #06110a;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--green-glow);
  background: var(--green-strong);
}

.btn--ghost {
  border-color: var(--border-hover);
  color: var(--text);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(61, 220, 122, 0.15);
}

/* ==========================================================================
   Cursor spotlight (global, mouse-only)
   ========================================================================== */
.cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--green-glow), transparent 70%);
  filter: blur(15px);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0) translate(-50%, -50%);
  transition: opacity 220ms var(--ease);
  will-change: transform, opacity;
}

.cursor-spotlight.is-active {
  opacity: 1;
}

@media (pointer: coarse) {
  .cursor-spotlight {
    display: none;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 1.5rem 4rem;
  overflow: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at top right, rgba(255, 181, 69, 0.08), transparent 50%);
}

.hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* On fine-pointer devices the global .cursor-spotlight layer handles the
   glow (including inside hero), so this element only renders anything on
   touch devices, where it drives the autonomous drift animation instead. */
@media (pointer: coarse) {
  .hero__glow {
    background-image: radial-gradient(circle, var(--green-glow), transparent 45%);
    background-repeat: no-repeat;
    background-size: 1100px 1100px;
    background-position: 30% 30%;
    will-change: background-position;
    animation: heroGlowDrift 10s ease-in-out infinite;
  }
}

@keyframes heroGlowDrift {
  0% { background-position: 30% 30%; }
  50% { background-position: 68% 52%; }
  100% { background-position: 30% 30%; }
}

.hero__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 220, 122, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 220, 122, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black, transparent 75%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.hero__greeting {
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.hero__name {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero__role {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-dim);
  margin-bottom: 1.75rem;
}

.hero__desc {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.hero__desc .accent {
  color: var(--accent);
  /*font-weight: 600;*/
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 1.5px solid var(--border-hover);
  border-radius: 14px;
  z-index: 1;
}

.hero__scroll-hint span {
  display: block;
  width: 4px;
  height: 8px;
  background: var(--green);
  border-radius: 2px;
  margin: 6px auto 0;
  animation: scrollDot 1.8s ease infinite;
}

@keyframes scrollDot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

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

/* ==========================================================================
   Sections (shared)
   ========================================================================== */
.section {
  position: relative;
  padding: 6rem 1.5rem;
  overflow: hidden;
}

/* Soft fade instead of a hard rule between sections — a hint of a seam,
   not a border. */
.section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 25%, var(--border) 75%, transparent);
  filter: blur(1px);
  opacity: 0.55;
  pointer-events: none;
}

/* Faint grid texture behind each section, softened via blur so it reads as
   an ambient glow/texture rather than a crisp ruled grid (same motif as
   hero's grid, but muted the way .nav mutes content behind it with blur). */
.section::before {
  content: '';
  position: absolute;
  inset: -10%;
  z-index: -1;
  background-image:
    linear-gradient(rgba(61, 220, 122, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 220, 122, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  filter: blur(2.5px);
  opacity: 0.65;
  mask-image: radial-gradient(ellipse 65% 55% at 50% 40%, black, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 40%, black, transparent 85%);
  pointer-events: none;
}

.section__inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ==========================================================================
   Section background orbs (scroll parallax)
   ========================================================================== */
.section-orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* .orb is a plain positioning host — JS applies the scroll-parallax
   translate3d() to it directly. The actual visible blob (color, blur,
   breathing pulse) lives on ::after so the CSS animation's transform
   never fights with JS's inline transform on the same property. */
.orb {
  position: absolute;
  pointer-events: none;
  will-change: transform;
}

.orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  filter: blur(90px);
  animation: orbPulse 10s ease-in-out infinite;
}

@keyframes orbPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

.orb--green::after {
  background: var(--green);
  opacity: 0.16;
}

.orb--accent::after {
  background: var(--accent);
  opacity: 0.13;
}

/* Per-section placement + size — each section gets its own corner/scale
   instead of the same green-top-left / accent-bottom-right pair repeated
   five times. Pulse timing is staggered per orb so they never sync up. */
#experience .orb--green {
  top: -15%;
  right: -10%;
  left: auto;
  width: 380px;
  height: 380px;
}

#experience .orb--green::after {
  animation-duration: 9s;
}

#experience .orb--accent {
  bottom: -10%;
  left: -8%;
  width: 280px;
  height: 280px;
}

#experience .orb--accent::after {
  animation-duration: 12s;
  animation-delay: 1.5s;
}

#projects .orb--green {
  top: -18%;
  left: -10%;
  width: 480px;
  height: 480px;
}

#projects .orb--green::after {
  animation-duration: 13s;
  animation-delay: 0.6s;
}

#projects .orb--accent {
  top: 35%;
  right: -8%;
  bottom: auto;
  width: 260px;
  height: 260px;
}

#projects .orb--accent::after {
  animation-duration: 8.5s;
}

#interests .orb--green {
  bottom: -14%;
  left: -6%;
  top: auto;
  width: 360px;
  height: 360px;
}

#interests .orb--green::after {
  animation-duration: 10.5s;
  animation-delay: 2s;
}

#interests .orb--accent {
  top: -10%;
  right: -6%;
  width: 240px;
  height: 240px;
}

#interests .orb--accent::after {
  animation-duration: 14s;
}

#books .orb--green {
  top: -10%;
  left: 6%;
  width: 240px;
  height: 240px;
}

#books .orb--green::after {
  animation-duration: 11s;
  animation-delay: 1s;
}

#books .orb--accent {
  bottom: -18%;
  right: -10%;
  width: 440px;
  height: 440px;
}

#books .orb--accent::after {
  animation-duration: 9.5s;
  animation-delay: 2.5s;
}

#contacts .orb--green {
  bottom: -20%;
  left: 30%;
  top: auto;
  width: 460px;
  height: 460px;
}

#contacts .orb--green::after {
  animation-duration: 12.5s;
  animation-delay: 0.4s;
}

#contacts .orb--accent {
  top: -10%;
  left: -8%;
  right: auto;
  width: 260px;
  height: 260px;
}

#contacts .orb--accent::after {
  animation-duration: 8s;
  animation-delay: 1.8s;
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.section__subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 3rem;
  max-width: 640px;
}

.section__more {
  margin-top: 2.5rem;
  color: var(--text-dim);
}

.section__more a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

.section__more a:hover,
.section__more a:focus-visible {
  border-color: var(--accent);
}

/* ==========================================================================
   Stats
   ========================================================================== */
.stats {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.stat:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.stat__number {
  display: block;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--green);
  margin-bottom: 0.5rem;
}

.stat__label {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ==========================================================================
   Timeline (experience)
   ========================================================================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  padding-left: 1.75rem;
  border-left: 1px solid var(--border);
}

.timeline__item {
  position: relative;
}

.timeline__heading {
  position: relative;
}

.timeline__marker {
  position: absolute;
  left: -2.28rem;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--green);
  transition: background-color 600ms var(--ease), box-shadow 600ms var(--ease), transform 600ms var(--ease);
}

.timeline__item.is-visible .timeline__marker {
  background: var(--green);
  box-shadow: 0 0 16px 2px var(--green-glow);
  transform: translateY(-50%) scale(1.15);
}

.timeline__content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.timeline__content p {
  color: var(--text-dim);
}

.todo {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-left: 0.4rem;
}

/* ==========================================================================
   Cards (projects)
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover,
.card:focus-within {
  transform: translateY(-6px);
  border-color: var(--green-dim);
  box-shadow: 0 16px 40px rgba(61, 220, 122, 0.12);
}

.card__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.card__desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

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

.tag {
  font-size: 0.78rem;
  color: var(--green);
  background: rgba(61, 220, 122, 0.08);
  border: 1px solid rgba(61, 220, 122, 0.2);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

.card__link {
  color: var(--accent);
  /*font-weight: 600;*/
  font-size: 0.95rem;
  align-self: flex-start;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

.card__link:hover,
.card__link:focus-visible {
  border-color: var(--accent);
}

/* ==========================================================================
   Interests
   ========================================================================== */
.interests {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.interest {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.interest:hover {
  border-color: var(--green-dim);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(61, 220, 122, 0.1);
}

.interest h3 {
  color: var(--green);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.interest p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Layout variants below are toggled by script.js based on the number of
   .interest items, so the grid stays balanced regardless of how many
   entries the Telegram bot adds or removes. */

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

.interests--count-3 {
  grid-template-columns: 1.4fr 1fr;
  grid-template-areas:
    "featured a"
    "featured b";
}

.interests--count-4 {
  grid-template-columns: 1.4fr 1fr;
  grid-template-areas:
    "featured a"
    "featured b"
    "wide wide";
}

.interests--count-3 .interest:nth-child(1),
.interests--count-4 .interest:nth-child(1) {
  grid-area: featured;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.interests--count-3 .interest:nth-child(1) h3,
.interests--count-4 .interest:nth-child(1) h3 {
  font-size: 1.75rem;
}

.interests--count-3 .interest:nth-child(1) p,
.interests--count-4 .interest:nth-child(1) p {
  font-size: 1.05rem;
}

.interests--count-3 .interest:nth-child(2),
.interests--count-4 .interest:nth-child(2) {
  grid-area: a;
}

.interests--count-3 .interest:nth-child(3),
.interests--count-4 .interest:nth-child(3) {
  grid-area: b;
}

.interests--count-4 .interest:nth-child(4) {
  grid-area: wide;
}

.interests--count-many {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ==========================================================================
   Books
   ========================================================================== */
.book-highlight {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(61, 220, 122, 0.08), rgba(255, 181, 69, 0.04));
  border: 1px solid var(--green-dim);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 0 0 2.5rem;
}

.book-highlight__icon {
  flex-shrink: 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--green);
  letter-spacing: 0.05em;
}

.book-highlight__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.book-highlight__author {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.book-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.book-list__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.book-list__title {
  font-weight: 600;
}

.book-list__author {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ==========================================================================
   Contacts
   ========================================================================== */
.contacts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.contact-link {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.contact-link:hover,
.contact-link:focus-visible {
  transform: translateY(-4px);
  border-color: var(--green);
  box-shadow: 0 12px 32px var(--green-glow);
}

.contact-link__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.contact-link__value {
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.contact-link--featured {
  grid-column: 1 / -1;
  padding: 1.75rem;
  background: linear-gradient(120deg, rgba(61, 220, 122, 0.14), rgba(255, 181, 69, 0.05));
  border-color: var(--green-dim);
}

.contact-link--featured .contact-link__label {
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.95rem;
}

.contact-link--featured .contact-link__value {
  font-size: 1.4rem;
}

.farewell {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green);
}

/* ==========================================================================
   Per-section spacing rhythm — avoids every section reading as the same
   block repeated five times.
   ========================================================================== */
#experience {
  padding-top: 5rem;
  padding-bottom: 7rem;
}

#projects {
  padding-top: 7rem;
  padding-bottom: 7rem;
}

#interests {
  padding-top: 6rem;
  padding-bottom: 5rem;
}

#books {
  padding-top: 5rem;
  padding-bottom: 6rem;
}

#contacts {
  padding-top: 7rem;
  padding-bottom: 8rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .interests--count-2,
  .interests--count-3,
  .interests--count-4 {
    grid-template-columns: 1fr !important;
    grid-template-areas: none !important;
  }

  .interests--count-3 .interest,
  .interests--count-4 .interest {
    grid-area: auto !important;
  }

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

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

@media (max-width: 700px) {
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    padding: 1rem 1.5rem 1.5rem;
    gap: 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
  }

  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav__toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .nav__toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero {
    padding-top: 7rem;
  }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .section {
    padding: 4rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .stats__grid {
    grid-template-columns: 1fr;
  }

  .nav__inner {
    padding: 1rem;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .btn,
  .card,
  .stat,
  .interest,
  .contact-link,
  .nav__links a::after {
    transition: none !important;
  }

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

  .hero__scroll-hint span {
    animation: none;
  }

  .hero__glow {
    animation: none !important;
  }

  .orb {
    transition: none !important;
  }

  .orb::after {
    animation: none !important;
  }

  .cursor-spotlight {
    display: none;
  }
}
