/* ==========================================================================
   Digital Social — base.css
   Design tokens, reset, typography, primitives, layout, header, footer.
   ========================================================================== */

:root {
  --gold: #DBBE6C;
  --gold-strong: #c9a94f;
  --gold-soft: rgba(219, 190, 108, 0.14);

  --bg-dark: #0A0C0F;
  --dark-2: #111418;
  --dark-3: #171b21;
  --light: #F7F5EF;
  --light-2: #efece3;
  --white: #FFFFFF;

  --ink: #14161a;
  --ink-soft: #3a3f47;
  --muted-text: #9DA3AA;
  --muted-light: #5b6068;
  --border: rgba(255, 255, 255, 0.10);
  --border-dark: rgba(20, 22, 26, 0.12);
  --border-gold: rgba(219, 190, 108, 0.6);

  /* Semantic (themeable) tokens */
  --page-bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #F7F5EF;
  --text: #14161a;
  --text-muted: #5b6068;
  --line: rgba(20, 22, 26, 0.12);

  --container: 1200px;
  --container-narrow: 760px;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(10, 12, 15, 0.06);
  --shadow-md: 0 10px 30px rgba(10, 12, 15, 0.10);
  --shadow-lg: 0 24px 60px rgba(10, 12, 15, 0.18);

  --header-height: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Dark mode tokens (toggled via <html data-theme="dark">) */
[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0B0D10;
  --surface: #14181E;
  --surface-alt: #101317;
  --text: #F1F2F0;
  --text-muted: #9DA3AA;
  --line: rgba(255, 255, 255, 0.12);
  --light-2: #1A1E24;
  --ink-soft: #C7CBD1;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
svg { display: inline-block; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; line-height: 1.12; font-weight: 640; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
figure { margin: 0; }
blockquote { margin: 0; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--gold-strong);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection { background: var(--gold); color: var(--text); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--gold); color: var(--text); padding: 10px 16px;
  border-radius: 8px; font-weight: 600; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 14px; height: 14px; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: block;
  font-size: 0.76rem;
  font-weight: 640;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}
.eyebrow-gold { color: var(--gold); }
.eyebrow a { color: inherit; }

.section-title {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.7rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
  max-width: 20ch;
}
.section-lead { font-size: 1.075rem; color: var(--text-muted); max-width: 62ch; }
.section-lead > p:last-child { margin-bottom: 0; }
.section-lead-lg { font-size: 1.18rem; }
.section-note { margin-top: 1.5rem; font-size: 0.95rem; color: var(--text-muted); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 620;
  font-size: 0.97rem;
  line-height: 1;
  letter-spacing: -0.01em;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
    color 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--gold); color: var(--text); }
.btn-primary:hover { background: var(--gold-strong); box-shadow: 0 10px 24px rgba(219, 190, 108, 0.28); }

.btn-outline { background: transparent; color: inherit; border-color: currentColor; }
.btn-outline:hover { background: rgba(20, 22, 26, 0.05); }
.section-dark .btn-outline:hover, .hero .btn-outline:hover, .cta-band .btn-outline:hover { background: rgba(20, 22, 26, 0.06); }
.site-footer .btn-outline:hover { background: rgba(255, 255, 255, 0.08); }

.btn-ghost { background: transparent; color: inherit; border-color: transparent; opacity: 0.8; }
.btn-ghost:hover { opacity: 1; }

.btn-sm { padding: 0.6rem 1rem; font-size: 0.9rem; }
.btn-lg { padding: 1rem 1.7rem; font-size: 1.03rem; }
.btn-block { width: 100%; }

.btn .btn-spinner {
  display: none; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn-spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.8; }
.btn.is-loading { pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 620; color: var(--text);
}
.link-arrow .icon { transition: transform 0.18s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }
.link-arrow:hover { color: var(--gold-strong); }
.section-dark .link-arrow:hover, .hero .link-arrow:hover, .cta-band .link-arrow:hover { color: var(--gold-strong); }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: clamp(3.75rem, 6.5vw, 6rem) 0; }
/* Light brand band used to separate blocks on the white canvas.
   (Name kept for template compatibility.) */
.section-dark { background: var(--surface-alt); color: var(--text); }
.section-dark .section-lead, .section-dark .section-note { color: var(--text-muted); }
.section-dark .eyebrow { color: var(--text-muted); }
.section-dark .eyebrow-gold { color: var(--gold-strong); }
.section:nth-of-type(even).section-alt { background: var(--surface-alt); }

.section-head { margin-bottom: clamp(1.75rem, 3vw, 2.75rem); }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.section-cta { margin-top: var(--space-5); display: flex; gap: 0.75rem; flex-wrap: wrap; }

.split { display: grid; grid-template-columns: 1fr; gap: var(--space-5); align-items: start; }
.three-col { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.section-dark .three-col { background: var(--line); }
.three-col-item { background: var(--surface); padding: 1.6rem; }
.section-dark .three-col-item { background: var(--surface); }
.three-col-item h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.three-col-item p { margin: 0; color: var(--text-muted); }
.section-dark .three-col-item p { color: var(--text-muted); }

.card-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 12, 15, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
  color: var(--white);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: var(--header-height);
}
.site-header.is-scrolled { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.site-header.is-scrolled .header-inner { min-height: 60px; }

.brand { display: inline-flex; align-items: center; }
.brand-logo { width: 150px; height: auto; }

.primary-nav { display: none; }
.nav-list { display: flex; align-items: center; gap: 0.1rem; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.5rem 0.62rem; border-radius: 8px;
  font-size: 0.93rem; font-weight: 560; color: rgba(255, 255, 255, 0.82);
  background: none; border: none;
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease);
}
.nav-link:hover { color: var(--white); background: rgba(255, 255, 255, 0.06); }
.nav-link.is-active { color: var(--gold); }
.nav-caret { transition: transform 0.2s var(--ease); }
.nav-item.has-children:hover .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 320px;
  background: var(--dark-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.6rem; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
}
.nav-item.has-children:hover .nav-dropdown,
.nav-item.has-children:focus-within .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown-link { display: block; padding: 0.65rem 0.75rem; border-radius: 9px; }
.nav-dropdown-link:hover { background: rgba(255, 255, 255, 0.06); }
.nav-dropdown-title { display: block; font-weight: 620; color: var(--white); }
.nav-dropdown-desc { display: block; font-size: 0.85rem; color: var(--muted-text); }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.header-cta { display: none; }
/* Keep the bar roomy while the nav is visible but the viewport is tight. */
@media (min-width: 960px) and (max-width: 1199px) {
  .header-whatsapp { display: none; }
}
.header-whatsapp {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--gold);
  transition: background-color 0.16s var(--ease);
}
.header-whatsapp:hover { background: rgba(219, 190, 108, 0.12); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.06); color: var(--white);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.12); color: var(--gold); }
.theme-icon { display: inline-flex; align-items: center; justify-content: center; }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: inline-flex; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); color: var(--white);
}
.nav-toggle-close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-close { display: inline-flex; }

.mobile-nav {
  background: var(--bg-dark); border-top: 1px solid var(--border);
  max-height: calc(100vh - var(--header-height)); overflow-y: auto;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav-inner { padding: 1.25rem 20px 2rem; }
.mobile-nav-list { display: flex; flex-direction: column; gap: 0.35rem; }
.mobile-nav-heading {
  display: block; padding: 0.7rem 0; font-size: 0.75rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted-text);
}
.mobile-nav-link {
  display: block; padding: 0.85rem 0; font-size: 1.1rem; font-weight: 560;
  color: var(--white); border-bottom: 1px solid var(--border);
}
.mobile-nav-link.is-active { color: var(--gold); }
.mobile-nav-sublist { margin-bottom: 0.5rem; }
.mobile-nav-sublist .mobile-nav-link { font-size: 1rem; padding-left: 0.75rem; }
.mobile-nav-actions { display: grid; gap: 0.6rem; margin-top: 1.25rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--bg-dark); color: var(--white); padding: var(--space-7) 0 6rem; }
.footer-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  flex-wrap: wrap; padding-bottom: var(--space-6); border-bottom: 1px solid var(--border);
}
.footer-headline { font-size: clamp(1.4rem, 1rem + 1.8vw, 2.1rem); margin: 0; max-width: 22ch; letter-spacing: -0.03em; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; padding: var(--space-6) 0; }
.footer-brand { display: inline-block; margin-bottom: 1rem; }
.footer-desc { color: var(--muted-text); max-width: 34ch; margin-bottom: 0.5rem; }
.footer-scale { color: var(--text-muted); font-size: 0.9rem; max-width: 34ch; }
.footer-social { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border); color: rgba(255, 255, 255, 0.82);
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.footer-social a:hover { color: var(--gold); border-color: rgba(219, 190, 108, 0.5); background: rgba(219, 190, 108, 0.1); }
.footer-title { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-text); margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { color: rgba(255, 255, 255, 0.86); font-size: 0.95rem; transition: color 0.16s var(--ease); }
.footer-links a:hover { color: var(--gold); }
.footer-contact li { display: flex; flex-direction: column; gap: 0.15rem; }
.footer-contact-label { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted-text); font-size: 0.8rem; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; padding-top: var(--space-5); border-top: 1px solid var(--border);
}
.footer-bottom p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.footer-legal { display: flex; gap: 1.25rem; }
.footer-legal a { color: var(--muted-text); font-size: 0.88rem; }
.footer-legal a:hover { color: var(--gold); }

/* ==========================================================================
   Mobile sticky bar
   ========================================================================== */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: grid; grid-template-columns: 1fr auto; gap: 0.5rem;
  padding: 0.55rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom));
  background: rgba(10, 12, 15, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  animation: barUp 0.5s var(--ease) both;
  animation-delay: 0.3s;
}
@keyframes barUp {
  from { transform: translateY(115%); }
  to { transform: translateY(0); }
}
.mobile-bar-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.8rem 1rem; border-radius: 999px; font-weight: 620; font-size: 0.95rem;
}
.mobile-bar-whatsapp { background: rgba(255, 255, 255, 0.08); color: var(--white); border: 1px solid var(--border); }
.mobile-bar-primary { background: var(--gold); color: var(--text); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 700px) {
  .card-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .three-col { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .container { padding: 0 32px; }
  .primary-nav { display: block; }
  .header-cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-bar { display: none; }
  .site-footer { padding-bottom: var(--space-7); }
  .split { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
}

@media (min-width: 1100px) {
  .card-grid { gap: 1.25rem; }
}

/* ==========================================================================
   Scroll reveal
   Selector list mirrors REVEAL_SELECTOR in public/js/main.js.
   Only active when <html> has .js, so content is always visible without JS.
   ========================================================================== */
.js :where(
  .section-head,
  .service-card,
  .cap-card,
  .value-card,
  .industry-card,
  .case-card,
  .work-card,
  .insight-card,
  .price-card,
  .testimonial,
  .process-step,
  .three-col,
  .logo-slider,
  .flow-step,
  .before-after,
  .split-copy,
  .split-visual,
  .cta-band-inner,
  .case-block,
  .contact-option,
  .site-mock,
  .connection-grid,
  .service-detail,
  [data-reveal]
) {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.js :where(
  .section-head,
  .service-card,
  .cap-card,
  .value-card,
  .industry-card,
  .case-card,
  .work-card,
  .insight-card,
  .price-card,
  .testimonial,
  .process-step,
  .three-col,
  .logo-slider,
  .flow-step,
  .before-after,
  .split-copy,
  .split-visual,
  .cta-band-inner,
  .case-block,
  .contact-option,
  .site-mock,
  .connection-grid,
  .service-detail,
  [data-reveal]
).is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js :where(
    .section-head,
    .service-card,
    .cap-card,
    .value-card,
    .industry-card,
    .case-card,
    .work-card,
    .insight-card,
    .price-card,
    .testimonial,
    .process-step,
    .three-col,
    .logo-slider,
    .flow-step,
    .before-after,
    .split-copy,
    .split-visual,
    .cta-band-inner,
    .case-block,
    .contact-option,
    .site-mock,
    .connection-grid,
    .service-detail,
    [data-reveal]
  ) {
    opacity: 1 !important;
    transform: none !important;
  }
}
