/* ====== CSS Variables ====== */
:root {
  --bg: #ffffff;
  --bg-warm: #faf8f5;
  --bg-cream: #f5f0eb;
  --surface: #ffffff;
  --fg: #262626;
  --fg-muted: #6b6b6b;
  --fg-subtle: #999999;
  --accent: #ff6038;
  --accent-hover: #e85530;
  --accent-glow: rgba(255, 96, 56, 0.12);
  --btn: #d1b3ff;
  --btn-hover: #c19cff;
  --btn-text: #2a1a5e;
  --border: #e8e4df;
  --border-light: #f0ece8;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
}

/* ====== Reset & Base ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font: 15px/1.65 var(--font-body);
  color: var(--fg);
  background: var(--bg) url('images/hero-section.svg') no-repeat center top / 100% auto;
  overflow-x: hidden;
}

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

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 3.25rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 700;
}

p {
  max-width: 60ch;
}

.lead {
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  line-height: 1.75;
  color: var(--fg-muted);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 64px);
}

.section {
  padding: clamp(80px, 12vw, 140px) 0;
  position: relative;
}



.centered {
  text-align: center;
  margin-inline: auto;
}

.centered p {
  margin-inline: auto;
}

/* ====== Chinese text ====== */
.cn {
  font-family: 'FZZhongDengXian', '方正中等线简体', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
}

html:not([data-lang="cn"]) .cn {
  display: none !important;
}

html[data-lang="cn"] .en {
  display: none !important;
}

/* ====== HEADER ====== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 0.3s;
}

.header.scrolled {
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo img {
  height: 36px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--fg-muted);
  transition: color 0.2s;
  font-weight: 500;
  position: relative;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform 0.25s;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-contact-btn {
  padding: 7px 16px;
  font-size: 0.75rem;
  border-radius: 18px;
}

.lang-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: all 0.2s;
}

.header-lang-btn {
  color: var(--fg-muted);
  border-color: var(--border);
  background: transparent;
}

.lang-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--fg);
  transition: transform 0.3s, opacity 0.3s;
  border-radius: 2px;
}

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

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

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

@media (max-width: 860px) {
  .hamburger {
    display: none;
  }

  .nav {
    display: none;
  }
}

/* ====== HERO ====== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  min-height: min(100svh, 820px);
  max-height: 820px;
  display: flex;
  align-items: center;
  padding-top: 72px;
  position: relative;
  overflow: hidden;
  background: var(--bg-warm);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border-light) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.6;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: center;
}

.hero-text {
  max-width: 640px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(255, 96, 56, 0.2);
  border-radius: 100px;
  margin-bottom: 32px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2.25rem, 4.8vw, 4.25rem);
  margin-bottom: 24px;
  color: var(--fg);
}

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

.hero-sub {
  font-size: 1.125rem;
  color: var(--fg-muted);
  margin-bottom: 40px;
  max-width: 50ch;
  line-height: 1.75;
}

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

.hero-visual {
  position: relative;
  display: flex;
  gap: 16px;
}

.hero-photo-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-photo-stack:first-child {
  margin-top: 40px;
}

.hero-photo {
  border-radius: 12px;
  overflow: hidden;
  background: var(--border);
  position: relative;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-photo.tall {
  height: 280px;
}

.hero-photo.short {
  height: 200px;
}

@media (max-width: 860px) {
  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.25s;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 96, 56, 0.25);
}

.btn-purple {
  background: var(--btn);
  color: var(--btn-text);
}

.btn-purple:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(209, 179, 255, 0.35);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--fg);
  background: transparent;
}

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

.btn-large {
  padding: 18px 36px;
  font-size: 1.0625rem;
  border-radius: 14px;
}

/* ====== ABOUT / HOW — TWO COL ====== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: start;
}

.col-label {
  position: sticky;
  top: 100px;
}

.col-label h2 {
  color: var(--fg);
}

.col-content p {
  margin-bottom: 20px;
  color: var(--fg-muted);
  line-height: 1.75;
}

.col-content .lead {
  color: var(--fg);
}

@media (max-width: 860px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .col-label {
    position: static;
    margin-bottom: 12px;
  }
}

/* ====== PHOTO MARQUEE ====== */
.marquee-section {
  padding: clamp(40px, 6vw, 80px) 0;
  overflow: hidden;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}

.marquee-label {
  text-align: center;
  margin-bottom: 32px;
}

.marquee-track {
  display: flex;
  gap: 20px;
  animation: marquee 40s linear infinite;
  width: max-content;
}

.marquee-track:hover {
  animation-play-state: paused;
}

.marquee-item {
  flex-shrink: 0;
  width: 320px;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--bg-cream);
}

.marquee-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.marquee-item:hover img {
  transform: scale(1.05);
}

.marquee-item .photo-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg);
}

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

.marquee-row-2 {
  animation-direction: reverse;
  animation-duration: 35s;
  margin-top: 20px;
}

/* ====== LIFE GALLERY ====== */
.gallery-section {
  background: var(--bg-warm);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 120px;
  gap: 16px;
  margin-top: 56px;
}

.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--border-light);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item .photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(38, 38, 38, 0.5) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.gallery-item:hover .photo-overlay {
  opacity: 1;
}

.photo-overlay span {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
}

.gallery-item:nth-child(1) {
  grid-column: 1 / 6;
  grid-row: 1 / 4;
}

.gallery-item:nth-child(2) {
  grid-column: 6 / 9;
  grid-row: 1 / 3;
}

.gallery-item:nth-child(3) {
  grid-column: 9 / 13;
  grid-row: 1 / 3;
}

.gallery-item:nth-child(4) {
  grid-column: 6 / 10;
  grid-row: 3 / 5;
}

.gallery-item:nth-child(5) {
  grid-column: 10 / 13;
  grid-row: 3 / 5;
}

.gallery-item:nth-child(6) {
  grid-column: 1 / 5;
  grid-row: 4 / 6;
}

.gallery-item:nth-child(7) {
  grid-column: 5 / 9;
  grid-row: 5 / 7;
}

.gallery-item:nth-child(8) {
  grid-column: 9 / 13;
  grid-row: 5 / 7;
}

.gallery-item:nth-child(9) {
  grid-column: 1 / 5;
  grid-row: 6 / 8;
}

@media (max-width: 860px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }

  .gallery-item {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .gallery-item:nth-child(1) {
    grid-column: 1 / 3 !important;
    grid-row: span 2 !important;
  }
}

@media (max-width: 520px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }

  .gallery-item {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .gallery-item:nth-child(1) {
    grid-column: auto !important;
  }
}

/* ====== SERVICES ====== */
#engineering {
  background: var(--bg) url('images/hero-section.svg') no-repeat center center / 100% auto;
  overflow: hidden;
}

#engineering > .container {
  position: relative;
  z-index: 1;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}

@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.service-card {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.35s;
  transform-origin: left;
}

.service-card:hover {
  border-color: rgba(255, 96, 56, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card h3 {
  margin-bottom: 10px;
  color: var(--fg);
}

.service-card p {
  color: var(--fg-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.service-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.08em;
}

/* ====== PARTNERSHIP ====== */
.section-partnership {
  background: var(--bg-cream) url('images/hero-section.svg') no-repeat center center / 100% auto;
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 6vw, 80px) 0;
}

.section-partnership::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(209, 179, 255, 0.15), transparent 70%);
  pointer-events: none;
}

.partnership-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.partnership-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(255, 96, 56, 0.08);
  border: 1px solid rgba(255, 96, 56, 0.2);
  border-radius: 100px;
  margin-bottom: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.partnership-content h2 {
  margin-bottom: 16px;
}

.partnership-content h2 .en,
.partnership-content h2 .cn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.18em;
  flex-wrap: wrap;
}

.partnership-title-logo {
  display: inline-block;
  width: min(430px, 70vw);
  height: auto;
  transform: translateY(0.08em);
}

.partnership-body {
  margin-bottom: 24px;
}

.partnership-body p {
  color: var(--fg-muted);
  margin-inline: auto;
  margin-bottom: 0;
  line-height: 1.8;
}

.partnership-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ====== GUANGZHOU ====== */
.guangzhou-section {
  background-image: url('images/kude_plumeria.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.guangzhou-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(250, 248, 245, 0.75);
  z-index: 0;
}

.guangzhou-section > * {
  position: relative;
  z-index: 1;
}

/* ====== PROJECTS ====== */
.projects-section {
  background-image: url('images/homepage03.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.projects-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
  z-index: 0;
}

.projects-section > * {
  position: relative;
  z-index: 1;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 56px;
}

@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.project-card {
  padding: 40px 24px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  transition: all 0.3s;
}

.project-card:hover {
  border-color: rgba(255, 96, 56, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.project-card h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.project-card .project-domain {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* ====== COUNTER / STATS ====== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 56px;
}

@media (max-width: 640px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-item {
  text-align: center;
  padding: 24px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--fg-muted);
  font-weight: 500;
}

/* ====== FOOTER ====== */
.footer {
  padding: 48px 0 40px;
  border-top: 1px solid var(--border-light);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 0;
}

.footer > * {
  position: relative;
  z-index: 1;
}

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

.footer-brand {
  max-width: 350px;
}

.footer-brand img {
  height: 28px;
  width: auto;
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--fg-muted);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  width: 100%;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom p {
  color: var(--fg-subtle);
  font-size: 0.8125rem;
}

/* ====== LIGHTBOX ====== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  cursor: zoom-out;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ====== SCROLL ANIMATIONS ====== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

.stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger.visible > *:nth-child(1) {
  transition-delay: 0s;
  opacity: 1;
  transform: translateY(0);
}

.stagger.visible > *:nth-child(2) {
  transition-delay: 0.06s;
  opacity: 1;
  transform: translateY(0);
}

.stagger.visible > *:nth-child(3) {
  transition-delay: 0.12s;
  opacity: 1;
  transform: translateY(0);
}

.stagger.visible > *:nth-child(4) {
  transition-delay: 0.18s;
  opacity: 1;
  transform: translateY(0);
}

.stagger.visible > *:nth-child(5) {
  transition-delay: 0.24s;
  opacity: 1;
  transform: translateY(0);
}

.stagger.visible > *:nth-child(6) {
  transition-delay: 0.30s;
  opacity: 1;
  transform: translateY(0);
}

/* ====== CURSOR BLOB ====== */
.cursor-blob {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 96, 56, 0.04), transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: left 0.4s ease, top 0.4s ease;
}

/* ====== BACK TO TOP ====== */
.back-to-top {
  position: fixed;
  right: clamp(20px, 4vw, 40px);
  bottom: clamp(20px, 4vw, 40px);
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 96, 56, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  box-shadow: 0 12px 36px rgba(38, 38, 38, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.24s ease, transform 0.24s ease, background 0.2s ease, color 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: #fff;
}

/* ====== FOCUS STYLES ====== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ====== CONTACT MODAL ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 24px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg);
  border-radius: 20px;
  padding: clamp(32px, 5vw, 48px);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-warm);
  color: var(--fg-muted);
  font-size: 22px;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: var(--border);
  color: var(--fg);
}

.modal-content h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.modal-subtitle {
  color: var(--fg-muted);
  font-size: 0.9375rem;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}

.form-group label .optional {
  font-weight: 400;
  color: var(--fg-subtle);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 96, 56, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-submit {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}

.form-success {
  text-align: center;
  padding: 40px 0;
}

.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.success-text h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.success-text p {
  color: var(--fg-muted);
  margin-inline: auto;
}
