/* =========================================================
   ScaleMedia Homepage — layout + responsive
   ========================================================= */

:root {
  --map-active: #6DB1F2;       /* light blue: active markets */
  --map-active-soft: #B6D9F5;
  --map-base: oklch(0.36 0.005 60);  /* land mass on dark */
  --map-stroke: var(--ink);
  --max-w: 1280px;
}

.hp-container {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

/* ---------- Section padding ---------- */
.hp-section { padding: 128px 32px; }
.hp-section--tight { padding: 96px 32px; }
.hp-section--xl    { padding: 180px 32px 96px; } /* hero */

@media (max-width: 1024px) {
  .hp-section     { padding: 96px 28px; }
  .hp-section--tight { padding: 72px 28px; }
  .hp-section--xl { padding: 140px 28px 80px; }
}
@media (max-width: 720px) {
  .hp-section     { padding: 72px 20px; }
  .hp-section--tight { padding: 56px 20px; }
  .hp-section--xl { padding: 120px 20px 64px; }
}

/* ---------- Grids ---------- */
.hp-grid { display: grid; gap: 24px; }
.hp-grid-4       { grid-template-columns: repeat(4, 1fr); }
.hp-grid-2       { grid-template-columns: 1fr 1fr; gap: 64px; align-items: end; }
.hp-grid-services{ grid-template-columns: 1fr 1.6fr; gap: 96px; }
.hp-grid-footer  { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
.hp-grid-cta     { grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: end; }

@media (max-width: 1024px) {
  .hp-grid-4        { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .hp-grid-services { grid-template-columns: 1fr; gap: 32px; }
  .hp-grid-footer   { grid-template-columns: 1fr 1fr; gap: 32px 48px; }
  .hp-grid-2        { gap: 40px; }
}
@media (max-width: 720px) {
  .hp-grid-4        { grid-template-columns: 1fr; gap: 0; }
  .hp-grid-2        { grid-template-columns: 1fr; gap: 32px; }
  .hp-grid-cta      { grid-template-columns: 1fr; gap: 32px; align-items: start; }
  .hp-grid-footer   { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Stats: vertical dividers swap to horizontal on mobile ---------- */
.hp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid oklch(0.30 0.005 60); }
.hp-stats > .hp-stat {
  padding: 40px 24px 24px;
  border-right: 1px solid oklch(0.30 0.005 60);
}
.hp-stats > .hp-stat:last-child { border-right: none; }

@media (max-width: 1024px) {
  .hp-stats { grid-template-columns: repeat(2, 1fr); }
  .hp-stats > .hp-stat:nth-child(2) { border-right: none; }
  .hp-stats > .hp-stat:nth-child(1),
  .hp-stats > .hp-stat:nth-child(2) { border-bottom: 1px solid oklch(0.30 0.005 60); }
}
@media (max-width: 720px) {
  .hp-stats { grid-template-columns: 1fr; }
  .hp-stats > .hp-stat { border-right: none; border-bottom: 1px solid oklch(0.30 0.005 60); padding: 28px 16px; }
  .hp-stats > .hp-stat:last-child { border-bottom: none; }
}

/* ---------- Process columns: borders adapt ---------- */
.hp-process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.hp-process > .hp-step {
  padding: 44px 28px 32px 0;
  border-top: 1px solid var(--ink);
  border-right: 1px solid var(--rule);
  position: relative;
}
.hp-process > .hp-step:first-child { padding-left: 0; }
.hp-process > .hp-step:not(:first-child) { padding-left: 28px; }
.hp-process > .hp-step:last-child { border-right: none; }

@media (max-width: 1024px) {
  .hp-process { grid-template-columns: repeat(2, 1fr); }
  .hp-process > .hp-step:nth-child(2) { border-right: none; }
}
@media (max-width: 720px) {
  .hp-process { grid-template-columns: 1fr; }
  .hp-process > .hp-step { border-right: none; padding: 32px 0 24px 0 !important; }
}

/* ---------- Eyebrow row (top of section: title left, meta right) ---------- */
.hp-eyebrow-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 64px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .hp-eyebrow-row { margin-bottom: 40px; gap: 8px; }
  .hp-eyebrow-row > :nth-child(2) { display: none; } /* hide right-side meta on tiny screens */
}

/* ---------- Nav ---------- */
.hp-nav-root {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 18px 32px;
  transition: background 220ms var(--ease-out), border-color 220ms var(--ease-out);
}
.hp-nav-inner { max-width: var(--max-w); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.hp-nav-links { display: flex; gap: 28px; align-items: center; }
.hp-nav-link {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.30em;
  text-transform: uppercase; color: var(--ink); cursor: pointer;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.hp-nav-link.is-cta { border-bottom: 1px solid var(--coral); }

/* Tablet — hide secondary nav, shrink CTA so it fits with wordmark */
@media (max-width: 720px) {
  .hp-nav-root { padding: 14px 18px; }
  .hp-nav-links { gap: 16px; }
  .hp-nav-link.is-secondary { display: none; }
  .hp-nav-link { font-size: 11px; letter-spacing: 0.22em; }
  .hp-brand { gap: 9px !important; }
  .hp-brand svg { height: 38px !important; width: 38px !important; }
  .hp-brand-name { font-size: 17px !important; }
}

/* Phone — drop the wordmark entirely, just the SM circle + CTA */
@media (max-width: 520px) {
  .hp-brand-name { display: none; }
  .hp-brand svg { height: 40px !important; width: 40px !important; }
  .hp-nav-link { font-size: 11px; letter-spacing: 0.20em; }
  .hp-nav-root { padding: 12px 16px; }
}

/* ---------- Hero ---------- */
.hp-hero-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(48px, 9vw, 132px); line-height: 0.94;
  letter-spacing: -0.05em; margin: 0; color: var(--ink);
  max-width: 13ch;
}
.hp-hero-sub {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(17px, 1.6vw, 22px); line-height: 1.4; letter-spacing: -0.02em;
  color: var(--ink-700); margin: 0; max-width: 44ch;
}

/* ---------- Buttons ---------- */
.hp-btn {
  font-family: var(--font-display); font-weight: 500; font-size: 15px;
  letter-spacing: -0.01em; padding: 14px 22px; border-radius: 8px;
  cursor: pointer; transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), background 220ms var(--ease-out);
  border: 1px solid transparent; white-space: nowrap;
}
.hp-btn:hover { transform: translateY(-1px); }
.hp-btn--primary { background: var(--ink); color: var(--cream); box-shadow: 0 2px 6px rgba(14,14,16,0.08); border-color: var(--ink); }
.hp-btn--primary:hover { background: oklch(0.24 0.005 60); box-shadow: 0 8px 20px rgba(14,14,16,0.14); }
.hp-btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); padding: 13px 22px; }
.hp-btn--ghost:hover { background: var(--ink); color: var(--cream); }
.hp-btn--coral { background: var(--coral); color: var(--ink); border-color: var(--coral); padding: 16px 26px; font-size: 16px; }
.hp-btn--coral:hover { background: oklch(0.62 0.15 35); }

/* ---------- Map ---------- */
.hp-map-frame {
  width: 100%;
  border-radius: 14px;
  background: var(--ink);
  background-image:
    radial-gradient(ellipse at 30% 20%, oklch(0.22 0.02 240 / 0.35), transparent 50%),
    radial-gradient(ellipse at 70% 80%, oklch(0.22 0.02 35 / 0.18), transparent 55%);
  padding: 28px;
  position: relative;
  overflow: hidden;
  border: 1px solid oklch(0.20 0.005 60);
  box-shadow: 0 18px 40px rgba(14,14,16,0.10);
}
.hp-map-frame::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(oklch(0.22 0.005 60 / 0.5) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.22 0.005 60 / 0.5) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
  opacity: 0.5;
}
.hp-map-svg { width: 100%; height: auto; display: block; position: relative; z-index: 1; }
.hp-map-svg path.country {
  fill: var(--map-base);
  stroke: var(--map-stroke);
  stroke-width: 0.4;
  transition: fill 320ms var(--ease-out);
}
.hp-map-svg path.country.is-active {
  fill: var(--map-active);
  filter: drop-shadow(0 0 6px rgba(109, 177, 242, 0.55));
}
.hp-map-svg path.country.is-active:hover {
  fill: var(--map-active-soft);
}
.hp-map-loading {
  color: oklch(0.78 0.008 60);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.32em;
  text-transform: uppercase; padding: 96px 24px; text-align: center;
}

/* Country chips below map */
.hp-chip-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.hp-chip {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--ink);
  border: 1px solid var(--rule); background: var(--cream);
  padding: 7px 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
}
.hp-chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: var(--map-active); display: inline-block;
}

/* Map legend */
.hp-map-legend {
  display: flex; gap: 24px; flex-wrap: wrap; margin-top: 20px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.28em;
  text-transform: uppercase; color: oklch(0.78 0.008 60);
}
.hp-legend-dot { display: inline-flex; align-items: center; gap: 8px; }
.hp-legend-dot::before {
  content: ""; width: 10px; height: 10px; border-radius: 999px;
  background: var(--map-active);
}
.hp-legend-dot.is-base::before { background: var(--map-base); }

/* ---------- Marquee responsiveness ---------- */
@media (max-width: 720px) {
  .hp-marquee-reel { font-size: 24px !important; gap: 36px !important; }
  .hp-marquee-reel span > span { gap: 36px !important; }
}

/* ---------- Footer ---------- */
.hp-footer-cta {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px;
  align-items: end; padding-bottom: 96px;
  border-bottom: 1px solid oklch(0.30 0.005 60);
}
@media (max-width: 720px) {
  .hp-footer-cta { grid-template-columns: 1fr; gap: 32px; padding-bottom: 56px; }
}

/* ---------- Process step number scales ---------- */
.hp-step-num {
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(72px, 11vw, 168px); letter-spacing: -0.06em;
  line-height: 0.85; color: var(--ink); margin-bottom: 24px;
}

/* ---------- Utility: hide on small ---------- */
.hp-hide-sm { display: initial; }
@media (max-width: 720px) { .hp-hide-sm { display: none; } }

/* ---------- Anchor scroll offset (for fixed nav) ---------- */
#verticals, #process, #map, #reach, #work {
  scroll-margin-top: 80px;
}

/* ---------- Buttons used as links: kill global a:hover border + underline ---------- */
a.hp-btn {
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
a.hp-btn--primary,
a.hp-btn--primary:hover { border: 1px solid var(--ink); }
a.hp-btn--ghost,
a.hp-btn--ghost:hover { border: 1px solid var(--ink); }
a.hp-btn--coral,
a.hp-btn--coral:hover { border: 1px solid var(--coral); }
a.hp-btn--primary { color: var(--cream); }
a.hp-btn--primary:hover { color: var(--cream); background: oklch(0.24 0.005 60); }
a.hp-btn--ghost { color: var(--ink); }
a.hp-btn--ghost:hover { color: var(--cream); background: var(--ink); }
a.hp-btn--coral { color: var(--ink); }
a.hp-btn--coral:hover { color: var(--ink); background: oklch(0.62 0.15 35); }

/* ---------- Brand lockup in nav (kill default underline) ---------- */
a.hp-brand,
a.hp-brand:hover {
  display: flex; align-items: center; gap: 10px;
  border: none !important; text-decoration: none;
  color: var(--ink);
}

/* ---------- Nav links: anchor styling ---------- */
a.hp-nav-link,
a.hp-nav-link:hover { text-decoration: none; }
a.hp-nav-link:hover { color: var(--coral-700); }

/* ---------- Footer links ---------- */
a.hp-footer-link {
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 220ms var(--ease-out), color 220ms var(--ease-out);
}
a.hp-footer-link:hover {
  border-bottom-color: var(--coral);
  color: var(--cream);
}

/* ---------- Form styles (contact page) ---------- */
.hp-form { display: flex; flex-direction: column; gap: 24px; }
.hp-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .hp-form-row { grid-template-columns: 1fr; gap: 20px; }
  .hp-form { gap: 20px; }
}

.hp-field {
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--font-display);
}
.hp-field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-700);
}
.hp-field input,
.hp-field select,
.hp-field textarea {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.01em;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 16px;
  width: 100%;
  outline: none;
  transition: border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.hp-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%230E0E10' stroke-width='1.5' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}
.hp-field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.5;
}
.hp-field input::placeholder,
.hp-field textarea::placeholder {
  color: var(--ink-400);
}
.hp-field input:hover,
.hp-field select:hover,
.hp-field textarea:hover {
  border-color: var(--ink-500);
}
.hp-field input:focus,
.hp-field select:focus,
.hp-field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(232, 144, 96, 0.18);
}

.hp-form-error {
  font-family: var(--font-display);
  font-size: 14px;
  color: oklch(0.45 0.18 28);
  background: oklch(0.96 0.05 30);
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid oklch(0.85 0.10 30);
}

button.hp-btn:disabled,
.hp-btn[disabled] {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

/* Mailto link inside the helper text */
.hp-form a {
  color: inherit;
  border-bottom: 1px solid var(--coral);
  text-decoration: none;
}

/* ---------- Legal pages (Privacy / Terms / Descriptions) ---------- */
.hp-legal {
  font-family: var(--font-display);
  color: var(--ink-700);
  font-size: 16px;
  line-height: 1.7;
  max-width: 70ch;
  letter-spacing: -0.005em;
}
.hp-legal h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 56px 0 16px;
  line-height: 1.2;
}
.hp-legal h2:first-child { margin-top: 0; }
.hp-legal h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 28px 0 12px;
}
.hp-legal p { margin: 0 0 16px; }
.hp-legal ul, .hp-legal ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.hp-legal li { margin-bottom: 8px; }
.hp-legal a {
  color: var(--ink);
  border-bottom: 1px solid var(--coral);
  text-decoration: none;
  transition: color 220ms var(--ease-out), border-color 220ms var(--ease-out);
}
.hp-legal a:hover {
  color: var(--coral-700);
  border-color: var(--coral-700);
}
.hp-legal strong { color: var(--ink); font-weight: 500; }

@media (max-width: 720px) {
  .hp-legal { font-size: 15px; line-height: 1.65; }
  .hp-legal h2 { margin-top: 44px; }
}

/* ---------- Footer legal pill-button row ---------- */
.hp-legal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}
a.hp-legal-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: oklch(0.78 0.008 60);
  background: transparent;
  padding: 9px 16px;
  border: 1px solid oklch(0.30 0.005 60);
  border-radius: 999px;
  text-decoration: none;
  transition: color 220ms var(--ease-out), border-color 220ms var(--ease-out), background 220ms var(--ease-out);
  white-space: nowrap;
}
a.hp-legal-link:hover {
  color: var(--cream);
  border-color: var(--coral);
  background: oklch(0.22 0.005 60);
}
