/* ==========================================================================
   Code Corp — design tokens
   ========================================================================== */
:root {
  /* color */
  --ink: #0B0B0F;
  --ink-soft: #16161D;
  --paper: #FFFFFF;
  --surface: #F6F6F9;
  --border: #E6E6EC;
  --border-dark: #2A2A33;
  --text: #131318;
  --text-muted: #57575F;
  --text-on-dark: #F2F2F5;
  --text-on-dark-muted: #A7A7B2;
  --accent: #5B5FEF;
  --accent-2: #7C5CFC;
  --accent-hover: #4649C9;
  --ok: #1F9D66;

  /* spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  --max-w: 1160px;
  --radius-s: 8px; --radius-m: 16px; --radius-l: 24px; --radius-pill: 999px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --shadow-s: 0 1px 2px rgba(16,16,24,0.06), 0 1px 1px rgba(16,16,24,0.04);
  --shadow-m: 0 12px 32px -12px rgba(16,16,24,0.18);
  --shadow-l: 0 30px 60px -20px rgba(16,16,24,0.35);
}

/* ==========================================================================
   Reset
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper);
  padding: 12px 20px; border-radius: 0 0 var(--radius-s) 0; z-index: 200;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-5); }

section { padding: var(--sp-9) 0; scroll-margin-top: 84px; }
.on-surface { background: var(--surface); }

.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: var(--sp-4);
}
.eyebrow-dark { color: #B9B8FF; }
.eyebrow::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: 8px; vertical-align: middle;
}

.section-head { max-width: 60ch; margin: 0 auto var(--sp-8); text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.section-head .lead { margin-top: var(--sp-4); color: var(--text-muted); font-size: 1.08rem; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-weight: 600; font-size: 0.95rem; border-radius: var(--radius-s); border: 1px solid transparent;
  padding: 14px 24px; min-height: 48px; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-sm { padding: 10px 18px; min-height: 40px; font-size: 0.88rem; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: var(--shadow-m);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-l); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--text-on-dark); border-color: rgba(255,255,255,0.22); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.5); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s ease, background 0.2s ease;
}
.site-header.scrolled { border-color: var(--border); background: rgba(255,255,255,0.92); }
.header-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) 0; gap: var(--sp-5); }
.logo { display: inline-flex; align-items: center; gap: var(--sp-3); }
.logo-word { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.main-nav { display: flex; align-items: center; gap: var(--sp-6); }
.main-nav a { font-size: 0.92rem; font-weight: 500; color: var(--text-muted); transition: color 0.15s ease; }
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: var(--sp-4); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-s);
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 0 auto; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero, .final-cta { position: relative; background: var(--ink); color: var(--text-on-dark); overflow: hidden; }
.hero { padding: var(--sp-9) 0 var(--sp-9); }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(560px 420px at 82% 8%, rgba(124,92,252,0.32), transparent 60%),
    radial-gradient(480px 360px at 8% 92%, rgba(91,95,239,0.28), transparent 60%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--sp-8); align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); color: var(--text-on-dark); }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, #A9ACFF, #D3B8FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin-top: var(--sp-5); font-size: 1.12rem; color: var(--text-on-dark-muted); max-width: 46ch; }
.cta-row { margin-top: var(--sp-6); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.hero-cue { margin-top: var(--sp-4); font-size: 0.85rem; color: var(--text-on-dark-muted); }

.hero-visual { position: relative; }
.code-card {
  background: var(--ink-soft); border: 1px solid var(--border-dark); border-radius: var(--radius-l);
  overflow: hidden; box-shadow: var(--shadow-l);
}
.code-card-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border-dark); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #FF5F57; } .dot-y { background: #FEBC2E; } .dot-g { background: #28C840; }
.code-card-title { margin-left: var(--sp-3); font-family: var(--mono); font-size: 0.78rem; color: var(--text-on-dark-muted); }
.code-card-body { margin: 0; padding: var(--sp-6) var(--sp-5); font-family: var(--mono); font-size: 0.86rem; line-height: 1.7; overflow-x: auto; }
.tok-kw { color: #FF7EB6; } .tok-var { color: #E6E6EC; } .tok-key { color: #7CD4FF; } .tok-num { color: #FFC373; } .tok-fn { color: #A9ACFF; }

.float-card {
  position: absolute; left: -20px; bottom: -20px; display: flex; align-items: center; gap: var(--sp-3);
  background: var(--paper); color: var(--text); border-radius: var(--radius-m); padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-l); max-width: 240px;
}
.float-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex-shrink: 0; box-shadow: 0 0 0 4px rgba(31,157,102,0.15); }
.float-txt .k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.float-txt .v { font-size: 0.9rem; font-weight: 600; }

/* ==========================================================================
   Trust bar
   ========================================================================== */
.trust-bar { padding: var(--sp-7) 0; border-bottom: 1px solid var(--border); }
.trust-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-5) var(--sp-7); }
.trust-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.trust-list { display: flex; flex-wrap: wrap; gap: var(--sp-6); }
.trust-list li { font-size: 0.92rem; font-weight: 600; color: var(--text-muted); }

/* ==========================================================================
   Problem
   ========================================================================== */
.problem-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: var(--sp-8); align-items: start; }
.problem-grid h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); margin-top: var(--sp-3); }
.problem-text p { color: var(--text-muted); font-size: 1.06rem; margin-bottom: var(--sp-4); }
.problem-text p:last-child { margin-bottom: 0; color: var(--text); }
.problem-text strong { font-weight: 700; }

/* ==========================================================================
   Services
   ========================================================================== */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.service-card {
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: var(--sp-6); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: transparent; }
.service-icon {
  width: 44px; height: 44px; border-radius: var(--radius-s); margin-bottom: var(--sp-5);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(91,95,239,0.12), rgba(124,92,252,0.12)); color: var(--accent);
}
.service-icon svg { width: 22px; height: 22px; }
.service-card h3 { font-size: 1.08rem; margin-bottom: var(--sp-2); }
.service-card p { color: var(--text-muted); font-size: 0.96rem; }

/* ==========================================================================
   Differentiators (dark band — page-level rhythm break)
   ========================================================================== */
.differentiators { background: var(--ink); color: var(--text-on-dark); }
.diff-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--sp-8); align-items: start; }
.diff-copy h2 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); color: var(--text-on-dark); }
.diff-copy h2 em { font-style: normal; background: linear-gradient(135deg, #A9ACFF, #D3B8FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.diff-copy .lead { margin-top: var(--sp-4); color: var(--text-on-dark-muted); font-size: 1.05rem; }
.diff-list { display: flex; flex-direction: column; }
.diff-list li { display: grid; grid-template-columns: 48px 1fr; gap: var(--sp-5); padding: var(--sp-5) 0; border-top: 1px solid var(--border-dark); }
.diff-list li:last-child { border-bottom: 1px solid var(--border-dark); }
.diff-mark { font-family: var(--mono); font-size: 0.85rem; color: #8A8AFF; padding-top: 2px; }
.diff-list h3 { font-size: 1.05rem; color: var(--text-on-dark); margin-bottom: var(--sp-2); }
.diff-list p { color: var(--text-on-dark-muted); font-size: 0.95rem; }

/* ==========================================================================
   Cases
   ========================================================================== */
.cases-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.case-card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-m); padding: var(--sp-6); }
.case-tag { display: inline-block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; color: var(--accent); margin-bottom: var(--sp-4); }
.case-card p { color: var(--text-muted); font-size: 0.96rem; margin-bottom: var(--sp-3); }
.case-fix { color: var(--text) !important; }

/* ==========================================================================
   Testimonials (honest placeholder)
   ========================================================================== */
.testimonial-placeholder {
  max-width: 620px; margin: 0 auto; text-align: center; padding: var(--sp-8) var(--sp-6);
  border: 1px dashed var(--border); border-radius: var(--radius-l); background: var(--surface);
}
.ph-quote { font-size: 2.4rem; color: var(--border); font-family: Georgia, serif; line-height: 1; margin-bottom: var(--sp-3); }
.testimonial-placeholder p { color: var(--text-muted); font-size: 1.02rem; margin-bottom: var(--sp-4); }
.link-arrow { color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.link-arrow:hover { text-decoration: underline; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); padding: var(--sp-5) 0; }
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 1.02rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus { color: var(--accent); font-size: 1.4rem; flex-shrink: 0; font-weight: 300; transition: transform 0.2s ease; }
.faq-item[open] summary .plus { transform: rotate(45deg); }
.faq-item p { margin-top: var(--sp-3); color: var(--text-muted); font-size: 0.98rem; max-width: 64ch; }

/* ==========================================================================
   Final CTA + form
   ========================================================================== */
.final-cta { padding: var(--sp-9) 0; }
.final-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: start; }
.final-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: var(--sp-3) 0 var(--sp-4); color: var(--text-on-dark); }
.final-copy h2 em { font-style: normal; background: linear-gradient(135deg, #A9ACFF, #D3B8FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.final-copy p { color: var(--text-on-dark-muted); font-size: 1.06rem; margin-bottom: var(--sp-5); max-width: 44ch; }
.whatsapp-link { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-on-dark); font-weight: 600; font-size: 0.92rem; border-bottom: 1px solid var(--border-dark); padding-bottom: 4px; }

form { background: var(--paper); color: var(--text); border-radius: var(--radius-l); padding: var(--sp-6); box-shadow: var(--shadow-l); }
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: var(--sp-2); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s);
  color: var(--text); padding: 12px 14px; font-size: 16px; font-family: var(--font); resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form-note { font-size: 0.78rem; color: var(--text-muted); margin-top: var(--sp-3); text-align: center; }
#form-success { display: none; text-align: center; padding: var(--sp-7) 0; }
#form-success.show { display: block; }
#form-success .check { font-size: 2.2rem; margin-bottom: var(--sp-3); color: var(--ok); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: var(--text-on-dark-muted); padding-top: var(--sp-8); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-7); padding-bottom: var(--sp-7); border-bottom: 1px solid var(--border-dark); }
.footer-brand .logo-word { color: var(--text-on-dark); }
.footer-brand p { margin-top: var(--sp-3); font-size: 0.92rem; max-width: 34ch; }
.footer-col h4 { color: var(--text-on-dark); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: var(--sp-4); }
.footer-col { display: flex; flex-direction: column; gap: var(--sp-3); }
.footer-col a { font-size: 0.92rem; transition: color 0.15s ease; }
.footer-col a:hover { color: var(--text-on-dark); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3); padding: var(--sp-5) 0; font-size: 0.82rem; }

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .services-grid, .cases-grid { grid-template-columns: repeat(2, 1fr); }
  .problem-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .site-header.menu-open .main-nav {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--border); padding: var(--sp-5); gap: var(--sp-4); box-shadow: var(--shadow-m);
  }
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-7); }
  .hero-visual { order: -1; }
  .float-card { position: static; margin-top: var(--sp-5); max-width: none; }
  .diff-grid, .final-grid { grid-template-columns: 1fr; }
  .services-grid, .cases-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  section { padding: var(--sp-7) 0; }
}

@media (max-width: 420px) {
  .wrap { padding: 0 var(--sp-4); }
  .cta-row .btn, .btn-lg { width: 100%; justify-content: center; }
  .trust-bar .wrap { flex-direction: column; align-items: flex-start; }
  code { font-size: 0.78rem; }
}
