/* ------------------------------------------------------------------
   Intermex Group — corporate site
   Grotesque type (Schibsted Grotesk / Instrument Sans) on the
   palette taken from the official plaque: deep navy, antique gold.
------------------------------------------------------------------- */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-italic-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-italic-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #1b2438;
  --ink-soft: #45506b;
  --navy: #26304a;
  --navy-deep: #182034;
  --gold: #b3913f;
  --gold-bright: #d8bc72;
  --paper: #fdfdfb;
  --ivory: #f6f4ee;
  --line: rgba(27, 36, 56, 0.14);
  --line-light: rgba(246, 244, 238, 0.18);

  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --w-max: 1180px;
  --pad-x: clamp(1.25rem, 4vw, 2.5rem);
  --sec-y: clamp(5.5rem, 11vw, 9.5rem);

  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
}

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

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

body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

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

::selection {
  background: rgba(179, 145, 63, 0.22);
}

.container {
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

/* ---------- Type ---------- */
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 620;
  line-height: 1.06;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.h1 {
  font-size: clamp(2.75rem, 6.2vw, 4.75rem);
  font-weight: 640;
}

.h2 {
  font-size: clamp(2rem, 4.1vw, 3.15rem);
}

.h3 {
  font-size: clamp(1.35rem, 2.3vw, 1.7rem);
}

.lede {
  font-weight: 400;
  font-size: clamp(1.125rem, 1.7vw, 1.28rem);
  line-height: 1.58;
  color: var(--ink-soft);
  max-width: 58ch;
}

.kicker {
  font-family: var(--sans);
  font-weight: 550;
  font-size: 0.875rem;
  letter-spacing: 0.015em;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  transition: background 0.35s ease, box-shadow 0.35s ease;
  background: transparent;
}

.nav.is-scrolled {
  background: rgba(253, 253, 251, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 1px 0 var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand img {
  height: 40px;
  width: auto;
}

.brand-name {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.15rem, 2.2vw, 2rem);
  list-style: none;
}

.nav-links a:not(.btn) {
  font-size: 0.9375rem;
  font-weight: 480;
  color: var(--ink-soft);
  transition: color 0.25s ease;
}

.nav-links a:not(.btn):hover {
  color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-weight: 550;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  padding: 0.8125rem 1.75rem;
  border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease-out,
    box-shadow 0.25s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--navy);
  color: var(--paper);
  box-shadow: 0 1px 2px rgba(24, 32, 52, 0.2);
}

.btn-primary:hover {
  background: var(--navy-deep);
  box-shadow: 0 6px 18px rgba(24, 32, 52, 0.18);
}

.btn-gold {
  background: var(--gold);
  color: #fff;
}

.btn-gold:hover {
  background: #a3802f;
}

.link-quiet {
  font-weight: 520;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.link-quiet:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(9rem, 16vh, 12rem);
  padding-bottom: var(--sec-y);
  background: var(--ivory);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.hero .kicker {
  display: inline-flex;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin-bottom: 1.75rem;
}

.hero .lede {
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-proof {
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.hero-proof strong {
  font-family: var(--display);
  font-weight: 640;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.hero-proof span {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* The plaque, floating transparent */
.hero-logo {
  display: grid;
  place-items: center;
}

.hero-logo img {
  width: min(340px, 78%);
  height: auto;
  filter: drop-shadow(0 34px 44px rgba(24, 32, 52, 0.28))
    drop-shadow(0 6px 14px rgba(24, 32, 52, 0.12));
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--sec-y);
}

.section-ivory {
  background: var(--ivory);
}

.section-head {
  max-width: 780px;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.section-head .kicker {
  display: inline-flex;
  margin-bottom: 1rem;
}

.section-head p {
  margin-top: 1.5rem;
}

/* Two-column editorial (who we are) */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.split-body p + p {
  margin-top: 1.25rem;
}

/* ---------- What we do ---------- */
.pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
}

.pillar {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}

.pillar h3 {
  margin-bottom: 1rem;
}

.pillar > p {
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 1.75rem;
}

.pillar ul {
  list-style: none;
}

.pillar li {
  padding-block: 0.8125rem;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.pillar li strong {
  font-weight: 550;
}

.pillar li span {
  color: var(--ink-soft);
  font-weight: 400;
  text-align: right;
  font-size: 0.9375rem;
}

.footnote {
  margin-top: 3rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.footnote a {
  border-bottom: 1px solid var(--line);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.footnote a:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ---------- Why Spain (navy band) ---------- */
.band {
  background: var(--navy);
  color: var(--paper);
}

.band .kicker {
  color: var(--gold-bright);
}

.band .lede {
  color: rgba(246, 244, 238, 0.74);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
}

.stat {
  border-top: 1px solid var(--line-light);
  padding-top: 1.5rem;
}

.stat-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5vw, 4.35rem);
  line-height: 0.98;
  color: var(--gold-bright);
  letter-spacing: -0.028em;
}

.stat-label {
  margin-top: 0.95rem;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(246, 244, 238, 0.86);
  line-height: 1.55;
}

.band .footnote {
  color: rgba(246, 244, 238, 0.55);
}

.band .footnote a:hover {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}

/* ---------- Charts ---------- */
.charts {
  display: grid;
  gap: clamp(3.5rem, 7vw, 5.5rem);
}

.chart-title {
  font-size: clamp(1.3rem, 2.1vw, 1.6rem);
}

.chart-sub {
  margin-top: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.9875rem;
}

.chart-canvas {
  margin-top: 1.75rem;
}

.chart-canvas svg {
  width: 100%;
  height: auto;
}

.chart-src {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.chart-src a {
  border-bottom: 1px solid var(--line);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.chart-src a:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.pies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
}

.pie-wrap {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 2.25rem;
  align-items: center;
  margin-top: 1.75rem;
}

.pie-canvas svg {
  width: 100%;
  height: auto;
}

.pie-legend {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.pie-legend li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.pie-legend .chip {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  transform: translateY(1px);
}

.pie-legend em {
  font-style: normal;
  color: var(--ink-soft);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* ---------- Case studies ---------- */
.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

.case {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

/* Browser window */
.browser {
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(27, 36, 56, 0.1);
  box-shadow: 0 34px 70px -28px rgba(24, 32, 52, 0.38),
    0 4px 14px rgba(24, 32, 52, 0.06);
  overflow: hidden;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 16px;
  background: #f1efe8;
  border-bottom: 1px solid rgba(27, 36, 56, 0.08);
}

.browser-dots {
  display: flex;
  gap: 6px;
  flex: none;
}

.browser-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.browser-dots span:nth-child(1) { background: #e2726b; }
.browser-dots span:nth-child(2) { background: #e4b95f; }
.browser-dots span:nth-child(3) { background: #6fbf73; }

.browser-url {
  flex: 1;
  display: flex;
  justify-content: center;
}

.url-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid rgba(27, 36, 56, 0.1);
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 480;
}

.url-pill svg {
  width: 11px;
  height: 11px;
  flex: none;
}

.browser img {
  width: 100%;
  display: block;
  border-top: 0;
}

.case h3 {
  font-size: clamp(1.45rem, 2.3vw, 1.8rem);
}

.case-cat {
  color: var(--gold);
  font-weight: 550;
  font-size: 0.85rem;
  margin-top: 0.65rem;
  display: block;
}

.case p {
  color: var(--ink-soft);
}

.case ul {
  list-style: none;
  border-top: 1px solid var(--line);
}

.case li {
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.case li strong {
  font-weight: 550;
}

.case li span {
  color: var(--ink-soft);
  text-align: right;
}

.case-link {
  font-weight: 550;
  font-size: 0.95rem;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  width: fit-content;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.case-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* ---------- Process ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(2rem, 4vw, 3rem);
}

.step {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.step-n {
  font-family: var(--display);
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--gold);
  display: block;
  margin-bottom: 0.8rem;
  letter-spacing: 0.02em;
}

.step h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.step p {
  font-size: 0.9875rem;
  color: var(--ink-soft);
}

/* ---------- Contact ---------- */
.contact {
  background: var(--navy-deep);
  color: var(--paper);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: end;
}

.contact .kicker {
  color: var(--gold-bright);
  display: inline-flex;
  margin-bottom: 1rem;
}

.contact p {
  color: rgba(246, 244, 238, 0.75);
  max-width: 46ch;
  margin-top: 1.5rem;
}

.contact-person strong {
  font-family: var(--display);
  font-weight: 640;
  font-size: 1.4rem;
  display: block;
  letter-spacing: -0.01em;
}

.contact-person span {
  font-size: 0.9375rem;
  color: rgba(246, 244, 238, 0.65);
}

.contact-actions {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-deep);
  color: rgba(246, 244, 238, 0.65);
  border-top: 1px solid var(--line-light);
  padding-block: 2.75rem;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer .brand-name {
  font-size: 1.1rem;
  color: var(--paper);
}

.footer a:hover {
  color: var(--gold-bright);
}

.footer-nav {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  flex-wrap: wrap;
}

.footer-legal {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-light);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-legal ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

/* ---------- Mobile menu ---------- */
.menu-btn {
  display: none;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  position: relative;
  cursor: pointer;
}

.menu-btn span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease-out), top 0.35s var(--ease-out);
}

.menu-btn span:nth-child(1) {
  top: 17px;
}

.menu-btn span:nth-child(2) {
  top: 26px;
}

.menu-btn[aria-expanded="true"] span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.menu-btn[aria-expanded="true"] span:nth-child(2) {
  top: 21px;
  transform: rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--ivory);
  display: grid;
  place-content: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu ul {
  list-style: none;
  display: grid;
  gap: 1.6rem;
}

.mobile-menu a {
  font-family: var(--display);
  font-weight: 640;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s var(--ease-out);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 404 ---------- */
.notfound {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 1.5rem;
  padding: var(--pad-x);
}

/* ---------- Legal / content pages ---------- */
.page-hero {
  background: var(--ivory);
  padding-top: clamp(9rem, 16vh, 12rem);
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

.page-hero .kicker {
  display: inline-flex;
  margin-bottom: 1rem;
}

.page-hero .lede {
  margin-top: 1.25rem;
}

.prose {
  padding-block: var(--sec-y);
}

.prose-body {
  max-width: 72ch;
}

.prose-body h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.prose-body h2:first-child {
  margin-top: 0;
}

.prose-body p {
  margin-bottom: 1.1rem;
}

.prose-body ul {
  margin: 0 0 1.1rem 1.25rem;
}

.prose-body li {
  margin-bottom: 0.4rem;
}

.prose-body a {
  color: var(--gold);
  border-bottom: 1px solid rgba(179, 145, 63, 0.4);
}

.prose-body a:hover {
  color: #a3802f;
}

.prose-body strong {
  font-weight: 550;
}

.prose-body .todo {
  font-style: italic;
  color: var(--gold);
}

.prose-foot {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .case-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .split,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-logo {
    max-width: 430px;
  }

  .stats,
  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .pillars {
    grid-template-columns: 1fr;
  }

  .pies {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .nav-links {
    display: none;
  }

  .menu-btn {
    display: block;
  }
}

@media (max-width: 700px) {
  .brand img {
    height: 34px;
  }

  .stats,
  .steps {
    grid-template-columns: 1fr;
  }

  .pie-wrap {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pie-canvas {
    max-width: 300px;
  }

  .pillar li {
    flex-direction: column;
    gap: 0.25rem;
  }

  .pillar li span {
    text-align: left;
  }

  .case li {
    flex-direction: column;
    gap: 0.2rem;
  }

  .case li span {
    text-align: left;
  }
}

/* ---------- Reduced motion / transparency ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .menu-btn span {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .nav.is-scrolled {
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
