/* ==========================================================================
   Ecomersky — styles.css
   Mobile-first. Design tokens live in :root — change colours/spacing there.
   ========================================================================== */

:root {
  /* Colours */
  --bg: #F7F8FA;
  --text: #101114;
  --muted: #667085;
  --border: #E6E8EC;
  --card: #FFFFFF;
  --accent: #356BFF;        /* brand accent: visuals, large text, focus ring */
  --accent-ink: #2A5BE0;    /* accent for small text + button backgrounds (AA contrast) */
  --accent-ink-hover: #1F4BC7;
  --dark: #101114;
  --on-dark: #FFFFFF;
  --on-dark-muted: #A3ACBD;
  --accent-on-dark: #8EA8FF;
  --faint: #B8C0CC;          /* decorative only (large step numbers) */

  /* Type */
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-lead: clamp(1.125rem, 1rem + .5vw, 1.3125rem);
  --fs-h3: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --fs-h2: clamp(2.125rem, 1.4rem + 3vw, 3.75rem);
  --fs-h1: clamp(2.625rem, 1.2rem + 6.4vw, 6rem);

  /* Layout */
  --max: 1200px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section: clamp(5.5rem, 3.5rem + 8vw, 11rem);
  --radius: 24px;
  --radius-sm: 12px;
  --header-h: 68px;
  --shadow: 0 1px 2px rgba(16, 17, 20, .03), 0 24px 48px -28px rgba(16, 17, 20, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  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: 1rem; top: -100px;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  font-size: var(--fs-h2);
  line-height: 1.04;
  letter-spacing: -.04em;
  font-weight: 700;
  text-wrap: balance;
}
.section-title-sm { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); letter-spacing: -.03em; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--muted);
  max-width: 34em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 52px;
  padding: .875rem 1.75rem;
  border: 0;
  border-radius: 999px;
  font: 600 1rem/1.2 var(--font);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

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

.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.btn-ghost:hover { background: var(--card); }

.btn-sm { min-height: 40px; padding: .5rem 1.125rem; font-size: .9375rem; }
.btn-lg { min-height: 58px; padding: 1rem 2.25rem; font-size: 1.0625rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

@media (max-width: 479.98px) {
  .btn-row { flex-direction: column; justify-self: stretch; }
  .btn-row .btn, .cta-box .btn { width: 100%; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 248, 250, .82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  margin-right: auto;
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -.025em;
  text-decoration: none;
}
.brand img { width: 30px; height: 30px; }

/* Header CTA stays neutral so the blue accent is reserved for the page's main actions */
.header-cta { background: var(--text); }
.header-cta:hover { background: #2A2D34; }

.nav-menu { display: flex; flex-wrap: wrap; gap: .25rem 2rem; }
.nav-menu a {
  display: inline-block;
  padding: .5rem 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.nav-menu a:hover { color: var(--text); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle[hidden] { display: none; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile menu (only once JS has enhanced the header; without JS links stay visible) */
@media (max-width: 767.98px) {
  .header-inner { flex-wrap: wrap; gap: .5rem; }
  .header-cta { order: 1; }
  .site-nav { order: 3; width: 100%; }
  .js-nav .site-nav { order: 2; width: auto; margin-right: -10px; }
  .nav-menu { padding-bottom: .75rem; gap: .25rem 1.5rem; }

  .js-nav .nav-menu {
    position: absolute;
    top: 100%; left: 0; right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 1rem var(--gutter) 2rem;
    background: var(--bg);
    box-shadow: 0 24px 32px -24px rgba(16, 17, 20, .18);
  }
  .js-nav .nav-menu.is-open { display: flex; }
  .js-nav .nav-menu a { display: block; padding: .75rem 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
}
@media (max-width: 419.98px) {
  .header-cta { display: none; }
}
@media (min-width: 768px) {
  .nav-toggle { display: none !important; }
  .site-nav { margin-right: 1rem; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3.5rem, 2rem + 5vw, 7rem) clamp(5rem, 3rem + 8vw, 10rem); }

.hero-grid { display: grid; gap: clamp(3.5rem, 6vw, 5rem); }

.hero-copy { display: grid; gap: 1.75rem; justify-items: start; }
.hero .eyebrow { color: var(--accent-ink); }

.hero-title {
  font-size: var(--fs-h1);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 800;
  text-wrap: balance;
}
.hero-title-sub { display: block; color: var(--muted); font-weight: 700; }

.hero-copy .btn-row { margin-top: .75rem; }

.hero-visual {
  width: 100%;
  max-width: 560px;
  justify-self: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--card);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow);
}
.hv { width: 100%; height: auto; overflow: visible; }
.hv text { font: 600 17px/1 var(--font); text-anchor: middle; dominant-baseline: central; fill: var(--text); }
.hv-grid path { fill: none; stroke: #EEF0F3; stroke-width: 1; }
.hv-line { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.hv-area { opacity: .7; }
.hv-links path { fill: none; stroke: #D5DAE2; stroke-width: 1.25; stroke-dasharray: 2 4; }
.hv-node rect { fill: var(--bg); stroke: none; }
.hv-dot { fill: var(--card); stroke: var(--accent); stroke-width: 3; }
.hv-end { fill: var(--accent); }
.hv-pulse { fill: var(--accent); opacity: .25; transform-box: fill-box; transform-origin: center; }
.hv-float rect { fill: var(--dark); }
.hv-float text { fill: #fff; }
.hv-float path { fill: none; stroke: #fff; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }

/* Desktop: headline spans the full width; lead + CTAs sit beside the visual */
@media (min-width: 960px) {
  .hero-copy { display: contents; }
  .hero-grid {
    grid-template-columns: 1fr minmax(0, 480px);
    grid-template-areas:
      "eyebrow eyebrow"
      "title   title"
      "lead    visual"
      "cta     visual";
    grid-template-rows: auto auto auto 1fr;
    column-gap: clamp(3rem, 6vw, 6rem);
    row-gap: 0;
  }
  .hero .eyebrow { grid-area: eyebrow; margin-bottom: 1.75rem; }
  .hero-title { grid-area: title; margin-bottom: 3.5rem; }
  .hero .lead { grid-area: lead; align-self: start; }
  .hero-copy .btn-row { grid-area: cta; align-self: start; margin-top: 2.5rem; }
  .hero-visual { grid-area: visual; justify-self: end; max-width: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section-tight { padding-block: clamp(4rem, 3rem + 5vw, 7.5rem); }
.section-alt { background: var(--card); }
.section-head { display: grid; gap: 1.25rem; margin-bottom: clamp(3rem, 2rem + 4vw, 6rem); max-width: 48rem; }

/* Positioning */
.positioning-grid { display: grid; gap: 2.5rem; }
.positioning-copy { display: grid; gap: 1.5rem; font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); max-width: 36rem; }
.positioning-copy .strong { color: var(--text); font-weight: 600; }
.highlight {
  display: flex;
  flex-wrap: wrap;
  gap: 0 .35em;
  margin-top: 1.5rem;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.035em;
  color: var(--text);
}

@media (min-width: 960px) {
  .positioning-grid { grid-template-columns: 1fr 1fr; gap: 6rem; align-items: start; }
}

/* Service cards */
.cards { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(2rem, 1.25rem + 3vw, 3.5rem);
  background: var(--card);
  border-radius: var(--radius);
  container-type: inline-size;
}
.card h3 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -.025em; }
.card-lead { color: var(--muted); max-width: 26em; }
.card-icon { margin-bottom: 1rem; color: var(--text); }
.card-icon svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card-note { margin-top: auto; padding-top: 1.5rem; font-size: var(--fs-sm); color: var(--muted); }

/* Service lists: plain text, no chips */
.tags { margin-top: 1rem; columns: 1; column-gap: 2rem; }
.tags li {
  padding-block: .3125rem;
  font-size: var(--fs-sm);
  line-height: 1.4;
  break-inside: avoid;
}

@container (min-width: 400px) { .tags { columns: 2; } }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(2, 1fr); } }

/* Approach steps */
.steps { display: grid; gap: 3.5rem; }
.step { display: grid; gap: .875rem; align-content: start; color: var(--muted); }
.step-num {
  font-size: clamp(4rem, 3rem + 4vw, 6.5rem);
  line-height: .9;
  font-weight: 700;
  letter-spacing: -.06em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  margin-bottom: 1.25rem;
}
.step h3 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); letter-spacing: -.03em; color: var(--text); }

@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 4vw, 4.5rem); }
}

/* Benefits */
.benefits { display: grid; gap: 3rem; }
.benefit { display: grid; gap: .75rem; align-content: start; max-width: 22rem; }
.benefit h3 { font-size: 1.25rem; letter-spacing: -.02em; }
.benefit p { color: var(--muted); }

@media (min-width: 640px) { .benefits { grid-template-columns: repeat(2, 1fr); gap: 3.5rem 3rem; } }
@media (min-width: 1024px) { .benefits { grid-template-columns: repeat(3, 1fr); gap: 4.5rem 4rem; } }

/* Platforms */
.platforms { display: grid; gap: 2.5rem; }
.badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.badges li { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }

@media (min-width: 768px) { .badges { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .platforms { grid-template-columns: 1fr 2fr; gap: 6rem; align-items: start; }
}

/* Brand statement */
.statement { padding-block: calc(var(--section) * 1.1); background: var(--dark); color: var(--on-dark-muted); }
.statement-text {
  display: grid;
  gap: .2em;
  font-size: clamp(2rem, 1.1rem + 4.4vw, 4.75rem);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.statement-text span { display: block; }
.statement-text em { font-style: normal; color: var(--on-dark); }

/* CTA */
.cta-box {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
  padding: clamp(3.5rem, 2rem + 7vw, 7.5rem) clamp(1.5rem, 1rem + 4vw, 5rem);
  background: var(--card);
  border-radius: calc(var(--radius) + 8px);
}
.cta-box .lead { margin-inline: auto; }
.cta-box .btn { margin-top: 1rem; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 4rem 3rem; font-size: var(--fs-sm); color: var(--muted); }
.footer-grid { display: grid; gap: 2.5rem; }
.footer-brand { display: grid; gap: .25rem; }
.footer-name { font-size: 1.125rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.footer-tagline { color: var(--text); font-weight: 500; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.footer-links a { text-decoration: none; padding-block: .25rem; display: inline-block; }
.footer-links a:hover { color: var(--text); }

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1fr auto; align-items: start; }
  .copyright { grid-column: 1 / -1; padding-top: 2rem; }
}

/* ---------- Simple content pages (privacy, 404) ---------- */
.page { padding-block: clamp(3rem, 2rem + 5vw, 6rem) var(--section); }
.page-narrow { max-width: 46rem; }
.page h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.75rem); line-height: 1.05; letter-spacing: -.04em; margin-bottom: 1.5rem; }
.prose { display: grid; gap: 1rem; color: var(--muted); overflow-wrap: anywhere; }
.prose h2 { margin-top: 1.75rem; font-size: 1.375rem; letter-spacing: -.02em; color: var(--text); }
.prose ul { list-style: disc; padding-left: 1.25rem; display: grid; gap: .375rem; }
.prose a { color: var(--accent-ink); text-underline-offset: 3px; }
.prose strong { color: var(--text); }

.notice {
  padding: 1rem 1.25rem;
  border: 1px dashed #D97706;
  border-radius: var(--radius-sm);
  background: #FFFBEB;
  color: #92400E;
  font-size: var(--fs-sm);
}
.todo { background: #FEF3C7; color: #92400E; padding: 0 .25em; border-radius: 4px; font-weight: 600; }

/* ---------- Motion ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { transform: translateY(12px); } to { transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .35; } 100% { transform: scale(2.6); opacity: 0; } }

.anim { animation: fade-up .7s var(--ease) both; }
.anim-rise { animation: rise .7s var(--ease) both; }
.anim-2 { animation-delay: .1s; }
.anim-3 { animation-delay: .18s; }
.anim-4 { animation-delay: .25s; }

.hv-line { animation: draw 1.6s .35s var(--ease) both; }
.hv-node, .hv-goal { animation: pop .5s var(--ease) both; }
.hv-node-1 { animation-delay: .7s; }
.hv-node-2 { animation-delay: 1s; }
.hv-node-3 { animation-delay: 1.3s; }
.hv-goal { animation-delay: 1.6s; }
.hv-float { animation: float 5s 2.2s ease-in-out infinite; }
.hv-pulse { animation: pulse 2.4s 2.2s ease-out infinite; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hv-pulse { opacity: 0; }
}
