/* ===== Xeon Code — Modern Redesign ===== */

:root {
  --bg: #060b14;
  --bg-alt: #0a1120;
  --surface: #0f1729;
  --surface-2: #131d33;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf7;
  --text-dim: #93a1bd;
  --text-dimmer: #5c6a87;
  --accent: #22d3ee;
  --accent-2: #818cf8;
  --accent-3: #34d399;
  --gradient: linear-gradient(120deg, #22d3ee 0%, #818cf8 60%, #a78bfa 100%);
  --gradient-btn: linear-gradient(120deg, #0e7490 0%, #4338ca 55%, #6d28d9 100%);
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --max: 1180px;

  --nav-scrolled-bg: rgba(6, 11, 20, 0.75);
  --ghost-bg: rgba(255, 255, 255, 0.03);
  --ghost-bg-hover: rgba(255, 255, 255, 0.06);
  --ghost-border-hover: rgba(255, 255, 255, 0.25);
  --glow-1: rgba(34, 211, 238, 0.18);
  --glow-2: rgba(129, 140, 248, 0.16);
  --glow-3: rgba(34, 211, 238, 0.14);
  --glow-4: rgba(129, 140, 248, 0.16);
}

:root[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-alt: #eceff5;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --border: rgba(15, 23, 42, 0.09);
  --text: #10172a;
  --text-dim: #4b5568;
  --text-dimmer: #7c869c;
  --accent: #0891b2;
  --accent-2: #6366f1;
  --accent-3: #059669;
  --gradient: linear-gradient(120deg, #06b6d4 0%, #6366f1 60%, #8b5cf6 100%);
  --shadow: 0 20px 60px -20px rgba(15, 23, 42, 0.18);

  --nav-scrolled-bg: rgba(255, 255, 255, 0.75);
  --ghost-bg: rgba(15, 23, 42, 0.03);
  --ghost-bg-hover: rgba(15, 23, 42, 0.06);
  --ghost-border-hover: rgba(15, 23, 42, 0.18);
  --glow-1: rgba(6, 182, 212, 0.14);
  --glow-2: rgba(99, 102, 241, 0.12);
  --glow-3: rgba(6, 182, 212, 0.10);
  --glow-4: rgba(99, 102, 241, 0.10);
}

/* No-JS fallback: honor OS preference via media query when no explicit
   data-theme attribute has been set by script.js yet. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f7fb;
    --bg-alt: #eceff5;
    --surface: #ffffff;
    --surface-2: #eef1f7;
    --border: rgba(15, 23, 42, 0.09);
    --text: #10172a;
    --text-dim: #4b5568;
    --text-dimmer: #7c869c;
    --accent: #0891b2;
    --accent-2: #6366f1;
    --accent-3: #059669;
    --gradient: linear-gradient(120deg, #06b6d4 0%, #6366f1 60%, #8b5cf6 100%);
    --shadow: 0 20px 60px -20px rgba(15, 23, 42, 0.18);

    --nav-scrolled-bg: rgba(255, 255, 255, 0.75);
    --ghost-bg: rgba(15, 23, 42, 0.03);
    --ghost-bg-hover: rgba(15, 23, 42, 0.06);
    --ghost-border-hover: rgba(15, 23, 42, 0.18);
    --glow-1: rgba(6, 182, 212, 0.14);
    --glow-2: rgba(99, 102, 241, 0.12);
    --glow-3: rgba(6, 182, 212, 0.10);
    --glow-4: rgba(99, 102, 241, 0.10);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.02em;
}

p { margin: 0 0 1em; color: var(--text-dim); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.section-head {
  max-width: 640px;
  margin: 0 0 40px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.section-head p { font-size: 17px; }

section { position: relative; padding: 68px 0; }

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-btn);
  color: #ffffff;
  box-shadow: 0 10px 30px -8px rgba(67, 56, 202, 0.45);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(67, 56, 202, 0.6); }
.btn-ghost {
  background: var(--ghost-bg);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--ghost-border-hover); background: var(--ghost-bg-hover); }
.btn-sm { padding: 10px 18px; font-size: 13px; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s ease, color .2s ease, background-color .3s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: rgba(34,211,238,0.4); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: padding .3s ease, background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  padding: 12px 0;
  background: var(--nav-scrolled-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo-wrap { display: flex; align-items: center; }
.brand-logo { width: 128px; height: auto; display: block; }
.brand-logo-light { display: none; }
.brand-logo-dark { display: block; }
:root[data-theme="light"] .brand-logo-light { display: block; }
:root[data-theme="light"] .brand-logo-dark { display: none; }

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a {
  font-size: 14.5px; font-weight: 500; color: var(--text-dim);
  transition: color .2s ease; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px;
  background: var(--gradient); border-radius: 2px;
}

.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }

/* ---------- Hero ---------- */
.hero {
  padding: 150px 0 84px;
  position: relative;
  overflow: hidden;
}
.hero-glow {
  position: absolute; inset: -20% -10% auto -10%; height: 700px;
  background: radial-gradient(60% 60% at 30% 20%, var(--glow-1), transparent 70%),
              radial-gradient(50% 50% at 80% 10%, var(--glow-2), transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5vw, 58px); margin-bottom: 20px; }
.hero-sub { font-size: 18px; max-width: 480px; margin-bottom: 34px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 56px; }

.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-family: "Space Grotesk", sans-serif; font-size: 28px; }
.hero-stats .stat span { font-size: 13px; color: var(--text-dimmer); }

.hero-visual { position: relative; height: 460px; }
.floating-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: float 6s ease-in-out infinite;
}
.card-main {
  inset: 40px 20px auto auto;
  width: 320px;
  top: 10px; right: 10px;
}
.card-code {
  bottom: 20px; left: 0; width: 260px;
  animation-delay: -2s;
}
.card-badge {
  top: 220px; left: -10px; width: 190px;
  animation-delay: -4s;
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}
.card-main .bar { display:flex; gap:6px; margin-bottom: 14px; }
.card-main .bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.card-main .line { height: 9px; border-radius: 4px; background: var(--surface-2); margin-bottom: 8px; }
.card-main .line.short { width: 55%; }
.card-main .chip-row { display:flex; gap:8px; margin-top: 14px; }
.card-main .chip { padding: 5px 10px; border-radius: 8px; font-size: 11px; background: rgba(34,211,238,0.1); color: var(--accent); border: 1px solid rgba(34,211,238,0.2); }

.card-code pre { margin: 0; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--text-dim); white-space: pre-wrap; }
.card-code .dot-r { color: #f87171; } .card-code .dot-y { color: #fbbf24; } .card-code .dot-g { color: #34d399; }
.code-key { color: var(--accent-2); } .code-str { color: var(--accent-3); }

.card-badge { display: flex; align-items: center; gap: 12px; }
.card-badge .icon { width: 38px; height: 38px; border-radius: 10px; background: var(--gradient); display:flex; align-items:center; justify-content:center; font-size: 18px; flex-shrink: 0; }
.card-badge b { display:block; font-size: 22px; font-family: "Space Grotesk", sans-serif; }
.card-badge span { font-size: 12px; color: var(--text-dimmer); }

/* ---------- Logo strip ---------- */
.logo-strip { padding: 40px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.logo-strip .container { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; justify-content: space-between; }
.logo-strip .label { font-size: 13px; color: var(--text-dimmer); white-space: nowrap; }
.marquee { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 52px; width: max-content; animation: scroll-left 30s linear infinite; }
@keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.client-item {
  display: flex; align-items: center; flex-shrink: 0;
  background: #fff; border-radius: 10px; padding: 6px 14px;
  transition: transform .25s ease, background .3s ease;
}
.client-logo { height: 42px; width: auto; max-width: 160px; object-fit: contain; display: block; }
.client-item:hover { transform: translateY(-2px); }
/* Padding/size stay identical across themes — only the chip's fill changes —
   so the marquee track's total width never shifts and the scroll loop stays
   in sync when the theme toggles. */
:root[data-theme="light"] .client-item { background: none; }

/* ---------- About ---------- */
.about .container { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 70px; align-items: center; }
.about-visual { position: relative; }
.about-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.about-grid .g-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px; min-height: 130px; display: flex; flex-direction: column; justify-content: space-between;
  transition: background .3s ease, color .3s ease;
}
.about-grid .g-card b { font-family: "Space Grotesk", sans-serif; font-size: 24px; }
.about-grid .g-card span { font-size: 13px; color: var(--text-dimmer); transition: color .3s ease; }
.about-grid .g-card.accent {
  background: var(--gradient-btn); color: #ffffff; border-color: transparent;
}
.about-grid .g-card.accent span { color: rgba(255,255,255,0.75); }

.about-body h2 { font-size: clamp(26px, 3.6vw, 36px); }
.about-list { display: grid; gap: 14px; margin-top: 24px; }
.about-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--text-dim); }
.about-list svg { flex-shrink: 0; margin-top: 3px; color: var(--accent-3); }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform .3s ease, border-color .3s ease;
}
.service-card:hover { transform: translateY(-6px); border-color: rgba(34,211,238,0.35); }
.service-card .icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(34,211,238,0.1); border: 1px solid rgba(34,211,238,0.22);
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px; color: var(--accent);
}
.service-card h3 { font-size: 19px; margin-bottom: 8px; }
.service-card p { font-size: 14.5px; margin-bottom: 0; }

/* ---------- Process ---------- */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.process-step { position: relative; padding: 28px 22px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.process-step .num {
  font-family: "Space Grotesk", sans-serif; font-size: 34px; font-weight: 700;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 14px; display: block;
}
.process-step h3 { font-size: 16.5px; margin-bottom: 6px; }
.process-step p { font-size: 13.5px; margin: 0; }
.process-arrow { position: absolute; top: 34px; right: -30px; color: var(--text-dimmer); display: none; }

/* Steps slide in left-to-right, one after another, so 01 → 02 → 03 → 04
   visibly traces the process order instead of popping in all at once. */
.process-step.reveal { transform: translateX(-32px); transition: opacity .6s ease, transform .6s ease; }
.process-step.reveal.in { transform: translateX(0); }
.process-grid .process-step:nth-child(1) { transition-delay: 0s; }
.process-grid .process-step:nth-child(2) { transition-delay: .15s; }
.process-grid .process-step:nth-child(3) { transition-delay: .3s; }
.process-grid .process-step:nth-child(4) { transition-delay: .45s; }

/* ---------- Portfolio ---------- */
.portfolio-list { display: flex; flex-direction: column; }
.portfolio-row {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 28px;
  padding: 40px 0; border-bottom: 1px solid var(--border);
}
.portfolio-row:first-child { padding-top: 0; }
.portfolio-row:last-child { border-bottom: none; padding-bottom: 0; }
.portfolio-row:nth-child(even) .pr-visual { order: 2; }
.portfolio-row:nth-child(even) .pr-body { order: 1; }
.pr-visual {
  display: flex; align-items: center; justify-content: center;
  height: 260px; padding: 12px;
}
.pr-visual img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  transition: transform .35s ease;
}
.portfolio-row:hover .pr-visual img { transform: translateY(-6px); }
.pr-body { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pr-body h3 { font-size: 24px; margin: 10px 0 12px; }
.pr-body p { font-size: 15px; margin: 0; max-width: 42ch; }
.p-tag { font-size: 11.5px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* Directional scroll-in: visual and text slide in from opposite sides,
   mirrored on alternating rows so motion always follows the row's layout. */
.pr-reveal .pr-visual, .pr-reveal .pr-body {
  opacity: 0; transition: opacity .7s ease, transform .7s ease;
}
.pr-reveal .pr-visual { transform: translateX(-36px); }
.pr-reveal .pr-body { transform: translateX(36px); transition-delay: .08s; }
.pr-reveal:nth-child(even) .pr-visual { transform: translateX(36px); }
.pr-reveal:nth-child(even) .pr-body { transform: translateX(-36px); }
.pr-reveal.in .pr-visual, .pr-reveal.in .pr-body { opacity: 1; transform: translateX(0); }

/* ---------- CTA banner ---------- */
.cta-banner {
  position: relative; overflow: hidden;
  border-radius: 28px;
  padding: 70px 50px;
  background: radial-gradient(120% 140% at 10% 0%, var(--glow-3), transparent 60%),
              radial-gradient(120% 140% at 90% 100%, var(--glow-4), transparent 60%),
              var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.cta-banner h2 { font-size: clamp(24px, 3.4vw, 34px); max-width: 520px; margin-bottom: 10px; }
.cta-banner p { margin: 0; max-width: 460px; }

/* Entrance: settles in with a slight scale-up instead of the plain fade
   used elsewhere, so the CTA reads as a small "arrival" moment. */
.cta-banner.reveal {
  opacity: 0; transform: scale(.94) translateY(18px);
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
}
.cta-banner.reveal.in { opacity: 1; transform: scale(1) translateY(0); }

/* One-time light sweep across the banner right as it lands. */
.cta-banner::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.16), transparent);
  transform: skewX(-20deg); pointer-events: none; opacity: 0;
}
.cta-banner.reveal.in::after { animation: cta-shine 1.2s ease .35s 1; }
@keyframes cta-shine {
  0% { left: -60%; opacity: 0; }
  15% { opacity: .9; }
  55% { opacity: .3; }
  100% { left: 130%; opacity: 0; }
}
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 60px; }
.contact-info { display: grid; gap: 18px; align-content: start; }
.contact-item {
  display: flex; gap: 16px; align-items: flex-start; padding: 20px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
}
.contact-item .icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(34,211,238,0.1); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-item h4 { font-size: 14.5px; margin-bottom: 4px; }
.contact-item p, .contact-item a { font-size: 14px; margin: 0; color: var(--text-dim); }
.social-row { display: flex; gap: 10px; margin-top: 6px; }
.social-row a {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center; transition: border-color .2s ease, color .2s ease; color: var(--text-dim);
}
.social-row a:hover { color: var(--accent); border-color: rgba(34,211,238,0.4); }

.contact-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px; display: grid; gap: 16px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--text-dimmer); }
.field input, .field textarea, .field select {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); font-family: inherit; font-size: 14.5px; resize: vertical;
  transition: border-color .2s ease;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238792a8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: rgba(34,211,238,0.5); }
.form-note { font-size: 12.5px; color: var(--text-dimmer); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 60px 0 30px; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; margin-bottom: 50px; }
.footer-brand p { max-width: 280px; font-size: 14px; }
.footer-col h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dimmer); margin-bottom: 16px; }
.footer-col ul { display: grid; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--text-dim); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 26px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-dimmer);
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  display: flex; align-items: center; justify-content: center; z-index: 90;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all .3s ease;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { border-color: rgba(34,211,238,0.4); color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero .container, .about .container, .contact-grid { grid-template-columns: 1fr; }
  .hero-visual { height: 380px; margin-top: 20px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-row { gap: 22px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links, .nav-actions .btn-ghost { display: none; }
  .nav-toggle { display: flex; }
  .navbar.open .nav-links {
    display: flex; position: fixed; inset: 70px 16px auto 16px; flex-direction: column; gap: 4px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; box-shadow: var(--shadow);
  }
  .navbar.open .nav-links a { padding: 12px 10px; }
  .hero { padding: 120px 0 60px; }
  .hero-visual { height: auto; display: flex; flex-direction: column; gap: 16px; }
  .floating-card { position: static; width: 100% !important; animation: none; }
  .services-grid, .process-grid { grid-template-columns: 1fr; }
  .portfolio-row {
    grid-template-columns: 1fr; gap: 18px; padding: 28px 0;
  }
  .portfolio-row .pr-visual, .portfolio-row .pr-body { order: unset; }
  .pr-visual { height: 190px; }
  .pr-reveal .pr-visual, .pr-reveal .pr-body,
  .pr-reveal:nth-child(even) .pr-visual, .pr-reveal:nth-child(even) .pr-body {
    transform: translateY(24px);
  }
  .pr-reveal.in .pr-visual, .pr-reveal.in .pr-body { transform: translateY(0); }
  .cta-banner { padding: 40px 26px; flex-direction: column; align-items: flex-start; }
  .footer-top { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  section { padding: 52px 0; }
  .hero-stats { gap: 24px; }
}
