/* ============================================
   WebCoderLab - Stylesheet
   ============================================ */

/* ---------- Root tokens ---------- */
:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --secondary: #0c1e3e;
  --accent: #38bdf8;
  --dark: #0c1e3e;
  --darker: #050d20;
  --gray-900: #111827;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50: #f8fafc;
  --white: #ffffff;
  --success: #10b981;
  --danger: #ef4444;

  /* Solid colors (no gradients used anywhere) */
  --gradient-primary: #0ea5e9;
  --gradient-warm: #38bdf8;
  --gradient-dark: #0c1e3e;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(12,30,62,.10);
  --shadow-lg: 0 12px 30px rgba(12,30,62,.14);
  --shadow-xl: 0 20px 50px rgba(14,165,233,.22);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --container: 1200px;
  --header-h: 76px;

  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Poppins', var(--font-sans);

  --transition: .25s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--gray-700);
  background: var(--white);
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--dark);
  line-height: 1.2;
  font-weight: 700;
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 6rem 0;
  position: relative;
  background: var(--white);
}
.section-alt {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .9rem;
}

.gradient-text {
  color: var(--primary);
}

.section-head {
  max-width: 720px;
  margin: 0 auto 3.5rem;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.9rem, 3.3vw, 2.6rem);
  margin-bottom: 1rem;
}
.section-head p { color: var(--gray-600); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.7rem;
  font-weight: 600;
  font-size: .95rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  white-space: nowrap;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(14,165,233,.35);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(14,165,233,.45);
}
.btn-ghost {
  background: transparent;
  color: var(--dark);
  border-color: var(--gray-200);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 1000;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(0,0,0,.05);
  transition: var(--transition);
}
.site-header.scrolled {
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow-md);
}
.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--dark);
}
.logo-mark {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}
.logo-text span { color: var(--primary); }

.nav { display: flex; align-items: center; gap: 2.2rem; }
.nav ul {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}
.nav-link {
  font-weight: 500;
  font-size: .95rem;
  color: var(--gray-700);
  position: relative;
  padding: .25rem 0;
  transition: var(--transition);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-cta { padding: .65rem 1.3rem; font-size: .9rem; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 5rem) 0 5rem;
  background: var(--white);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-bg::before,
.hero-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .35;
}
.hero-bg::before {
  width: 420px; height: 420px;
  top: -80px; right: -120px;
  background: rgba(14,165,233,.20);
}
.hero-bg::after {
  width: 360px; height: 360px;
  bottom: -120px; left: -100px;
  background: rgba(12,30,62,.10);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 3rem;
}
.hero-content h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -.02em;
}
.lead {
  font-size: 1.1rem;
  color: var(--gray-600);
  max-width: 580px;
  margin-bottom: 2rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3rem; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}
.hero-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  color: var(--dark);
  line-height: 1;
}
.hero-stats span { font-size: .85rem; color: var(--gray-500); }

/* Hero visual */
.hero-visual {
  position: relative;
  min-height: 460px;
}
.hero-orb {
  position: absolute;
  top: 50%; left: 50%;
  width: 360px; height: 360px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--gradient-primary);
  opacity: .15;
  filter: blur(40px);
  animation: pulse 5s ease-in-out infinite;
  z-index: 0;
}
.float-card {
  --tx: 0px;
  --ty: 0px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty)));
  background: var(--white);
  padding: .7rem 1rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: var(--shadow-lg);
  animation: float-orbit 6s ease-in-out infinite;
  animation-fill-mode: both;
  z-index: 2;
  white-space: nowrap;
}
.float-card i { font-size: 1.3rem; }

/* 6 cards arranged in a circle (clock positions) around the orb.
   Radius ~240px on desktop; tx = R*cos(θ), ty = R*sin(θ).
   Sized to clear the 310px-wide terminal in the center.              */
.card-5 { --tx:    0px; --ty: -240px; animation-delay: 0s;   color: #777bb4; } /* 12 — PHP */
.card-2 { --tx:  208px; --ty: -120px; animation-delay: .8s;  color: #61dafb; } /*  2 — React */
.card-4 { --tx:  208px; --ty:  120px; animation-delay: 1.6s; color: #339933; } /*  4 — Node */
.card-6 { --tx:    0px; --ty:  240px; animation-delay: 2.4s; color: #02569b; } /*  6 — Flutter */
.card-3 { --tx: -208px; --ty:  120px; animation-delay: 3.2s; color: #21759b; } /*  8 — WordPress */
.card-1 { --tx: -208px; --ty: -120px; animation-delay: 4.0s; color: #e34c26; } /* 10 — HTML5 */

.hero-code {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(310px, 75%);
  background: var(--darker);
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1rem 1rem .85rem;
  font-family: 'Fira Code', monospace;
  font-size: .78rem;
  line-height: 1.55;
  z-index: 1;
}
.hero-code pre { white-space: pre-wrap; }
.code-dots { display: flex; gap: 6px; margin-bottom: .8rem; }
.code-dots span {
  width: 11px; height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.code-dots span:nth-child(1) { background: #ff5f56; }
.code-dots span:nth-child(2) { background: #ffbd2e; }
.code-dots span:nth-child(3) { background: #27c93f; }
.c-key { color: #c084fc; }
.c-var { color: #60a5fa; }
.c-str { color: #34d399; }

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-14px); }
}
@keyframes float-orbit {
  0%,100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))); }
  50%     { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty) - 14px)); }
}
@keyframes pulse {
  0%,100% { opacity: .15; transform: translate(-50%,-50%) scale(1); }
  50%     { opacity: .25; transform: translate(-50%,-50%) scale(1.08); }
}

/* ---------- Trust bar ---------- */
.trust-bar {
  background: var(--gray-50);
  padding: 2rem 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}
.trust-bar p { text-align: center; color: var(--gray-500); font-size: .85rem; margin-bottom: 1.25rem; letter-spacing: .08em; text-transform: uppercase; }
.trust-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5rem;
  color: var(--gray-500);
  font-weight: 600;
}
.trust-logos span {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.05rem;
  opacity: .75;
  transition: var(--transition);
}
.trust-logos span:hover { opacity: 1; color: var(--primary); }
.trust-logos i { font-size: 1.4rem; }

/* ---------- About ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-visual { position: relative; }
.about-img {
  height: 440px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 9rem;
  box-shadow: var(--shadow-xl);
}
.about-badge {
  position: absolute;
  bottom: -22px;
  right: -22px;
  background: var(--white);
  padding: 1.2rem 1.6rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.about-badge strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--primary);
  line-height: 1;
}
.about-badge span { font-size: .85rem; color: var(--gray-500); }

.about-content h2 {
  font-size: clamp(1.9rem, 3.3vw, 2.5rem);
  margin: 1rem 0 1.25rem;
}
.about-content p { color: var(--gray-600); margin-bottom: 1.5rem; }
.about-points { margin-bottom: 2rem; }
.about-points li {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem 0;
  color: var(--gray-700);
  font-weight: 500;
}
.about-points i {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(14,165,233,.12);
  color: var(--primary);
  border-radius: 50%;
  font-size: .75rem;
  flex-shrink: 0;
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.service-card {
  background: var(--white);
  padding: 2.2rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}
.service-card:hover::before { transform: scaleX(1); }

.service-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 6px 14px rgba(14,165,233,.35);
}
.service-card h3 { font-size: 1.25rem; margin-bottom: .6rem; }
.service-card p { color: var(--gray-600); margin-bottom: 1.25rem; font-size: .95rem; }
.service-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  font-size: .9rem;
  color: var(--primary);
  transition: var(--transition);
}
.service-link:hover { gap: .65rem; }

/* ---------- Process ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}
.process-step {
  position: relative;
  padding: 2.2rem 1.5rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  text-align: center;
  transition: var(--transition);
}
.process-step:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.step-no {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: .5rem;
}
.process-step h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.process-step p { color: var(--gray-600); font-size: .9rem; }

/* ---------- Portfolio ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.portfolio-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-100);
  transition: var(--transition);
}
.portfolio-item:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
.portfolio-thumb {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: var(--white);
  font-size: 4rem;
}
.portfolio-info { padding: 1.5rem; }
.portfolio-info span {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .5rem;
}
.portfolio-info h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.portfolio-info p { color: var(--gray-600); font-size: .9rem; }

/* ---------- Testimonials ---------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
}
.testimonial {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  transition: var(--transition);
}
.testimonial:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.quote-mark {
  font-size: 2rem;
  color: var(--primary);
  opacity: .25;
  margin-bottom: .5rem;
}
.testimonial p { color: var(--gray-700); margin-bottom: 1.5rem; font-style: italic; }
.testimonial-author {
  display: flex;
  align-items: center;
  gap: .9rem;
}
.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
}
.testimonial-author strong { display: block; color: var(--dark); }
.testimonial-author span { font-size: .85rem; color: var(--gray-500); }

/* ---------- Contact ---------- */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2.5rem;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-100);
}

.contact-info h3 {
  font-size: 1.4rem;
  margin-bottom: .75rem;
}
.contact-info > p { color: var(--gray-600); margin-bottom: 1.75rem; }

.contact-list { margin-bottom: 1.75rem; }
.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: .85rem 0;
}
.ci-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(14,165,233,.12);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-list strong { display: block; color: var(--dark); margin-bottom: 2px; }
.contact-list span { color: var(--gray-600); font-size: .92rem; }

/* Contact form */
.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
}
.form-group label {
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .4rem;
  color: var(--gray-700);
}
.form-group label span { color: var(--danger); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: var(--transition);
  font-size: .95rem;
  outline: none;
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(14,165,233,.18);
}
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(239,68,68,.15);
}
.error-msg {
  font-size: .8rem;
  color: var(--danger);
  margin-top: .35rem;
  min-height: 1em;
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.form-note { font-size: .82rem; color: var(--gray-500); }
.btn-loader { display: inline-flex; align-items: center; gap: .4rem; }
.btn-text[hidden], .btn-loader[hidden] { display: none; }
#submitBtn[disabled] { opacity: .75; cursor: not-allowed; }

.form-status {
  margin-top: 1.25rem;
  padding: 0;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .92rem;
}
.form-status.show { padding: .9rem 1rem; }
.form-status.success {
  background: rgba(16,185,129,.12);
  color: #047857;
  border: 1px solid rgba(16,185,129,.3);
}
.form-status.error {
  background: rgba(239,68,68,.10);
  color: #b91c1c;
  border: 1px solid rgba(239,68,68,.3);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark);
  color: var(--gray-300);
  padding-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
.logo-footer { color: var(--white); margin-bottom: 1rem; }
.site-footer p { color: var(--gray-400); font-size: .92rem; margin-bottom: 1.25rem; }
.site-footer h4 { color: var(--white); margin-bottom: 1.1rem; font-size: 1rem; }
.footer-list li { margin-bottom: .65rem; }
.footer-list a {
  color: var(--gray-400);
  font-size: .92rem;
  transition: var(--transition);
}
.footer-list a:hover { color: var(--primary); padding-left: 4px; }

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin-bottom: .8rem;
  color: var(--gray-400);
  font-size: .92rem;
  line-height: 1.5;
}
.footer-contact i {
  color: var(--primary);
  margin-top: 4px;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.footer-contact a {
  color: var(--gray-400);
  transition: var(--transition);
  word-break: break-word;
}
.footer-contact a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1.4rem 0;
}
.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-bottom p { margin: 0; color: var(--gray-400); font-size: .88rem; }
.footer-bottom ul { display: flex; gap: 1.25rem; }
.footer-bottom a {
  color: var(--gray-400);
  font-size: .88rem;
  transition: var(--transition);
}
.footer-bottom a:hover { color: var(--primary); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 999;
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover { transform: translateY(-3px); }

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .hero-inner, .grid-2 { grid-template-columns: 1fr; }
  .hero-visual { min-height: 360px; order: -1; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-wrapper { grid-template-columns: 1fr; padding: 2rem; }
  .about-badge { right: 0; }

  /* Shrink the orbital ring on tablets */
  .card-5 { --tx:    0px; --ty: -200px; }
  .card-2 { --tx:  173px; --ty: -100px; }
  .card-4 { --tx:  173px; --ty:  100px; }
  .card-6 { --tx:    0px; --ty:  200px; }
  .card-3 { --tx: -173px; --ty:  100px; }
  .card-1 { --tx: -173px; --ty: -100px; }
}

@media (max-width: 560px) {
  /* Tighter ring on phones — terminal still fits the longest line */
  .hero-code { width: min(260px, 75%); font-size: .7rem; padding: .85rem .85rem .75rem; }
  .card-5 { --tx:    0px; --ty: -160px; }
  .card-2 { --tx:  139px; --ty:  -80px; }
  .card-4 { --tx:  139px; --ty:   80px; }
  .card-6 { --tx:    0px; --ty:  160px; }
  .card-3 { --tx: -139px; --ty:   80px; }
  .card-1 { --tx: -139px; --ty:  -80px; }
  .float-card { padding: .45rem .65rem; font-size: .72rem; }
  .float-card i { font-size: 1rem; }
}

@media (max-width: 768px) {
  .section { padding: 4.5rem 0; }
  .nav-toggle { display: flex; align-items: center; }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    padding: 1.25rem 1.25rem 1.75rem;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--gray-100);
    transform: translateY(-150%);
    transition: var(--transition);
  }
  .nav.open { transform: translateY(0); }
  .nav ul {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  .nav ul li { border-bottom: 1px solid var(--gray-100); }
  .nav-link { display: block; padding: .9rem 0; }
  .nav-cta { margin-top: 1rem; justify-content: center; }
  .contact-form .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .btn { padding: .8rem 1.3rem; font-size: .88rem; }
  .hero { padding: calc(var(--header-h) + 3rem) 0 3.5rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .contact-wrapper { padding: 1.5rem; }
  .about-img { height: 320px; font-size: 6rem; }
}

/* ============================================
   Legal pages (Privacy, Terms)
   ============================================ */
.page-hero {
  padding: calc(var(--header-h) + 4rem) 0 3rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: .5rem;
}
.page-hero p { color: var(--gray-600); }

.legal {
  padding: 4rem 0 6rem;
  background: var(--white);
}
.legal-content {
  max-width: 860px;
  margin: 0 auto;
  background: var(--white);
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}
.legal-content h2 {
  font-size: 1.4rem;
  margin: 2.2rem 0 .75rem;
  color: var(--dark);
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gray-100);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 .5rem;
  color: var(--dark);
}
.legal-content p,
.legal-content li {
  color: var(--gray-700);
  margin-bottom: .8rem;
  line-height: 1.75;
}
.legal-content ul {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
  list-style: disc;
}
.legal-content ul li { padding-left: .25rem; }
.legal-content a {
  color: var(--primary);
  font-weight: 500;
}
.legal-content a:hover { text-decoration: underline; }
.legal-meta {
  display: inline-block;
  padding: .35rem .8rem;
  background: rgba(14,165,233,.10);
  color: var(--primary);
  font-size: .85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .legal-content { padding: 1.75rem 1.25rem; }
  .legal { padding: 2.5rem 0 4rem; }
}
