/* Mercamedia: editorial minimal.
   One accent (ultramarine), hairline grid, system type. No external requests,
   no inline styles (CSP style-src 'self'). */

:root {
  --bg: #FBFBF9;
  --surface: #F2F2EE;
  --ink: #0E1116;
  --muted: #575D67;
  --rule: #DEDED8;
  --line-strong: #8A8F98;
  --accent: #1F3BC9;
  --accent-hover: #172E9E;
  --on-accent: #FFFFFF;
  --brand: #1F3BC9;
  --brand-ink: #FFFFFF;
  --band: #1F3BC9;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --gap: clamp(16px, 2vw, 32px);
  --pad: clamp(20px, 4vw, 48px);
  --header-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D0F13;
    --surface: #15181E;
    --ink: #ECECE8;
    --muted: #9AA0AA;
    --rule: #262A32;
    --line-strong: #6B717B;
    --accent: #8EA0FF;
    --accent-hover: #B4C0FF;
    --on-accent: #0D0F13;
    --brand: #3450E4;
    --brand-ink: #FFFFFF;
    --band: #1D36B8;
    color-scheme: dark;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
svg { display: block; }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
main:focus { outline: none; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.lg-tile { fill: var(--brand); }
.lg-m { fill: var(--brand-ink); }
.lg-word { fill: currentColor; }

.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  left: var(--pad);
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-120%);
}
.skip:focus { transform: none; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  padding-block: 8px;
  color: var(--ink);
}
.site-header .logo { width: 184px; height: 21px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}
.nav-list {
  display: flex;
  gap: clamp(16px, 2.2vw, 32px);
}
.nav-list a {
  display: inline-block;
  padding-block: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 4px) / 0 1px no-repeat;
  transition: background-size .2s ease;
}
.nav-list a:hover { background-size: 100% 1px; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 600 0.9375rem/1 var(--font);
  cursor: pointer;
}
.menu-toggle-icon {
  position: relative;
  width: 16px;
  height: 10px;
}
.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform .2s ease, top .2s ease;
}
.menu-toggle-icon::before { top: 0; }
.menu-toggle-icon::after { top: 8px; }
.is-open .menu-toggle-icon::before { top: 4px; transform: rotate(45deg); }
.is-open .menu-toggle-icon::after { top: 4px; transform: rotate(-45deg); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { border-color: var(--ink); color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--bg); }
.btn-small { min-height: 42px; padding: 0 18px; font-size: 0.9375rem; }

/* Shared grid */
.hero-grid,
.section-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}

/* Hero */
.hero {
  --hero-pt: clamp(40px, 5.5vw, 88px);
  --hero-pb: clamp(48px, 6vw, 96px);
  position: relative;
  padding-block: var(--hero-pt) var(--hero-pb);
  overflow: hidden;
}
.hero-grid { position: relative; }
.hero-grid::before {
  /* hairline column guides on columns 1, 4, 7, 10 and the right edge */
  content: "";
  position: absolute;
  inset: calc(-1 * var(--hero-pt)) var(--pad) calc(-1 * var(--hero-pb));
  background:
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / calc((100% + var(--gap)) / 4) 100% repeat-x,
    linear-gradient(90deg, transparent calc(100% - 1px), var(--rule) calc(100% - 1px)) 0 0 / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  pointer-events: none;
}
.hero-grid > * { position: relative; }

.eyebrow {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(20px, 2.4vw, 32px);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow-mark {
  width: 10px;
  height: 10px;
  background: var(--accent);
  flex: none;
}
h1 {
  grid-column: 1 / -1;
  justify-self: start;
  width: fit-content;
  max-width: 21ch;
  font-size: clamp(2.5rem, 1.1rem + 5.4vw, 5.5rem);
  line-height: 1;
  background: var(--bg);           /* guides pass behind the headline box, never through the letters */
  letter-spacing: -0.04em;
}
.hero-foot {
  grid-column: 4 / span 7;
  margin-top: clamp(32px, 3.6vw, 52px);
  padding-top: 24px;
  border-top: 1px solid var(--ink);
  background: var(--bg);           /* column guides stop behind the lead so text never sits on a line */
  box-shadow: 0 0 0 1px var(--bg);
}
.lead {
  max-width: 44ch;
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Hero facts: four short lines that sit on the 1/4/7/10 column guides */
.facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  margin: clamp(56px, 7vw, 104px) 0 0;
  border-top: 1px solid var(--ink);
  background: var(--bg);
}
.fact { padding-top: 16px; padding-right: 12px; }
.fact dt {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fact dd {
  margin: 6px 0 0;
  font-size: 1rem;
  line-height: 1.45;
}
.fact a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.fact a:hover { color: var(--accent); }

/* Sections */
.section {
  padding-block: clamp(72px, 9vw, 136px);
  border-top: 1px solid var(--rule);
}
.section-tint { background: var(--surface); border-top-color: transparent; }

/* Brand band: the contact section is set in solid ultramarine.
   Tokens are re-scoped so every child rule keeps working unchanged. */
.section-brand {
  --bg: var(--band);
  --surface: var(--band);
  --ink: #FFFFFF;
  --muted: #D6DBF7;
  --rule: rgba(255, 255, 255, 0.28);
  --accent: #FFFFFF;
  --accent-hover: #FFFFFF;
  --on-accent: var(--band);
  background: var(--bg);
  color: var(--ink);
  border-top-color: transparent;
}
.section-brand ::selection { background: #FFFFFF; color: var(--band); }

.kicker {
  grid-column: 1 / span 3;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 32px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 0.55em;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  flex: none;
}
.section-body { grid-column: 4 / span 8; }

h2 {
  font-size: clamp(2.125rem, 1.2rem + 3.3vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.intro {
  max-width: 40ch;
  margin-top: 20px;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.5;
  color: var(--muted);
}

/* About */
.about-text {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 24px;
  margin-top: clamp(32px, 4vw, 56px);
}
.about-text p { grid-column: 1 / span 7; max-width: 62ch; color: var(--muted); }
.about-text .about-first {
  font-size: clamp(1.25rem, 1.05rem + 0.75vw, 1.625rem);
  line-height: 1.42;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.about-text p:not(.about-first) { grid-column: 3 / span 6; }

/* Services: numbered list */
.services {
  grid-column: 4 / -1;
  margin-top: clamp(40px, 5vw, 72px);
  counter-reset: svc;
  border-bottom: 1px solid var(--rule);
}
.service {
  counter-increment: svc;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 5fr) minmax(0, 7fr);
  column-gap: var(--gap);
  padding-block: 28px 30px;
  border-top: 1px solid var(--rule);
}
.service::before {
  content: counter(svc, decimal-leading-zero);
  padding-top: 0.3em;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
}
.service h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.45vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.service p { color: var(--muted); max-width: 52ch; }

/* Process */
.steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 48px;
  margin-top: clamp(48px, 6vw, 88px);
}
.step {
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}
.step-num {
  display: block;
  margin-bottom: clamp(28px, 4vw, 56px);
  font-size: clamp(2.5rem, 1.6rem + 2.6vw, 4rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.step h3 {
  font-size: 1.375rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.step p { margin-top: 10px; color: var(--muted); max-width: 34ch; }

/* Principles */
.principles {
  grid-column: 4 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 40px;
  margin-top: clamp(40px, 5vw, 72px);
}
.principle {
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}
.principle h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.45vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.principle p { margin-top: 12px; }

/* Contact */
.contact-mail {
  margin-top: clamp(36px, 5vw, 64px);
  font-size: clamp(1.375rem, 0.5rem + 3.9vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.contact-mail a {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.14em;
  transition: color .15s ease;
}
.contact-mail a:hover { text-decoration-thickness: 0.1em; }
.arrow {
  width: 0.62em;
  height: 0.62em;
  flex: none;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  transition: transform .2s ease;
}
.contact-mail a:hover .arrow { transform: translate(0.06em, -0.06em); }
.hint {
  max-width: 46ch;
  margin-top: 28px;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--ink);
  background: var(--bg);
  padding-block: 48px 40px;
  font-size: 0.9375rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 32px;
}
.site-footer-plain { border-top-color: transparent; }
.footer-brand { grid-column: 1 / span 3; color: var(--ink); }
.site-footer .logo { width: 158px; height: 18px; }
.tagline { margin-top: 12px; color: var(--muted); }
.footer-nav { grid-column: 4 / span 6; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer-nav a,
.to-top {
  display: inline-block;
  padding-block: 4px;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}
.footer-nav a:hover,
.to-top:hover { text-decoration-color: currentColor; }
.footer-meta { grid-column: 10 / -1; text-align: right; }
.copyright { margin-top: 8px; color: var(--muted); }

/* 404 */
.notfound { --hero-pt: clamp(72px, 12vw, 176px); --hero-pb: clamp(72px, 12vw, 176px); }
.notfound .eyebrow { color: var(--muted); }
.notfound h1 { max-width: 12ch; }
.notfound .hero-foot { grid-column: 1 / span 8; }
.notfound .lead { max-width: 44ch; }
.notfound .hint { margin-top: 28px; }
.notfound .hint a { text-underline-offset: 3px; }

/* Responsive */
@media (max-width: 1080px) {
  .service { grid-template-columns: 3rem minmax(0, 1fr); }
  .service p { grid-column: 2; margin-top: 10px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .fact { border-top: 1px solid var(--rule); }
  .fact:nth-child(-n+2) { border-top: 0; }
}

@media (max-width: 899px) {
  :root { --header-h: 60px; }
  .js .menu-toggle { display: inline-flex; }
  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 8px var(--pad) 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--ink);
  }
  .js .is-open .site-nav { display: flex; }
  .js .nav-list { flex-direction: column; gap: 0; }
  .js .nav-list a {
    display: block;
    padding-block: 14px;
    border-bottom: 1px solid var(--rule);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    background: none;
  }
  .js .site-nav .btn { min-height: 50px; }

  .no-js .header-bar { flex-wrap: wrap; padding-block: 10px; }
  .no-js .site-nav { flex-wrap: wrap; }
  .no-js .nav-list { flex-wrap: wrap; }

  .site-header .logo { width: 166px; height: 19px; }

  .kicker,
  .section-body,
  .services,
  .principles,
  .hero-foot,
  .notfound .hero-foot { grid-column: 1 / -1; }
  .kicker { position: static; margin-bottom: 20px; padding-top: 0; }
  h1 { max-width: none; }
  .about-text p,
  .about-text p:not(.about-first) { grid-column: 1 / -1; }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .footer-brand,
  .footer-nav,
  .footer-meta { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 560px) {
  .steps { grid-template-columns: minmax(0, 1fr); row-gap: 36px; }
  .step-num { margin-bottom: 20px; }
  .service { grid-template-columns: 2.5rem minmax(0, 1fr); padding-block: 22px 24px; }
  .actions .btn { flex: 1 1 auto; }
  .facts { grid-template-columns: minmax(0, 1fr); row-gap: 0; margin-top: 48px; }
  .fact { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: 12px; padding-block: 12px; }
  .fact:nth-child(2) { border-top: 1px solid var(--rule); }
  .fact dt { padding-top: 0.2em; }
  .fact dd { margin: 0; }
  .hero-grid::before { background-size: 100% 100%, 100% 100%; }
  h1 { font-size: clamp(2.125rem, 9.4vw, 2.75rem); line-height: 1.02; letter-spacing: -0.035em; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .eyebrow-mark, .kicker::before { forced-color-adjust: none; background: CanvasText; }
  .section-brand { border-top: 1px solid CanvasText; }
  .btn { border-color: ButtonText; }
}

@media print {
  .site-header, .skip, .actions, .hero-grid::before { display: none; }
  .section-brand { --bg: #FFFFFF; --ink: #000000; --muted: #333333; --accent: #000000; }
  .section { padding-block: 32px; }
}
