/* Nesamu — design system.
   Palette carries meaning: teal is the Nesamu option, oxblood is the cost of the
   alternative. Neither is used decoratively anywhere else. */

:root {
  --ink: #14202A;
  --paper: #ECEDE9;
  --paper-deep: #DFE1DC;
  --teal: #10695E;
  --oxblood: #8C2F2A;
  --line: #C7CBC4;
  --mute: #7E867F;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --data: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale. Six sizes, three families. Every size has one job, and hierarchy
     that needs no new size is carried by changing family instead. Adding a size
     means adding a job. */
  --t-hero:  clamp(40px, 7.6vw, 88px);   /* h1 */
  --t-h2:    clamp(27px, 4.2vw, 46px);   /* section headings, the comparison total */
  --t-h3:    clamp(22px, 2.8vw, 30px);   /* named things: markets, routes, commitments */
  --t-lede:  clamp(18px, 2.1vw, 21px);   /* opening paragraphs */
  --t-body:  17px;                       /* all body copy, and column headings in display */
  --t-label: 14px;                       /* every mono label, nav, caption, figure text */

  --wrap: 1040px;
  --gutter: clamp(20px, 5vw, 40px);
  --section: clamp(56px, 9vw, 104px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ---------- type ---------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--t-hero); line-height: 0.97; letter-spacing: -0.028em; }
h2 { font-size: var(--t-h2); letter-spacing: -0.022em; }
h3 { font-size: var(--t-h3); letter-spacing: -0.012em; font-weight: 600; }
h4 { font-size: var(--t-body); letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: var(--t-lede);
  line-height: 1.5;
  max-width: 60ch;
}


.mono { font-family: var(--data); font-variant-numeric: tabular-nums; }

.note {
  font-family: var(--data);
  font-size: var(--t-label);
  line-height: 1.55;
  color: var(--mute);
  letter-spacing: 0.01em;
}

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

/* ---------- layout ---------- */

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

section { padding-block: var(--section); position: relative; }
section + section { border-top: 1px solid var(--line); }

/* The ground — one twelve-column grid, continuous down the whole page. It never
   switches off, so it reads as the sheet the page is drawn on. Superstudio's
   gridded field; a grid that appeared and vanished would read as decoration. */
section > .wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    var(--line) 0 1px,
    transparent 1px calc(100% / 12)
  );
  opacity: 0.42;
}
section > .wrap { position: relative; }
@media (max-width: 700px) {
  section > .wrap::before {
    background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px calc(100% / 4));
  }
}

/* Bays — content placed on the twelve, asymmetrically. Emptiness carries weight. */
.bay {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  position: relative;
}
.bay > * { min-width: 0; }
.b-1-7  { grid-column: 1 / 8; }
.b-1-8  { grid-column: 1 / 9; }
.b-1-9  { grid-column: 1 / 10; }
.b-1-4  { grid-column: 1 / 4; }
.b-10-13 { grid-column: 10 / 13; }
.b-4-12 { grid-column: 4 / 13; }
.b-5-12 { grid-column: 5 / 13; }
.b-6-12 { grid-column: 6 / 13; }
.b-1-12 { grid-column: 1 / 13; }
@media (max-width: 820px) {
  .b-1-7, .b-1-8, .b-1-9, .b-1-4, .b-10-13, .b-4-12, .b-5-12, .b-6-12 { grid-column: 1 / 13; }
}

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; z-index: 10;
  font-family: var(--data); font-size: var(--t-label);
}
.skip:focus { left: var(--gutter); top: 10px; }

/* ---------- header ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 78px;
}
.brand {
  display: block;
  color: var(--ink);
  text-decoration: none;
  line-height: 0;
  padding-block: 4px;
}
.brand svg {
  display: block;
  height: 36px;
  width: auto;
}
@media (max-width: 520px) { .brand svg { height: 28px; } }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 30px); }
.site-nav a {
  white-space: nowrap;
  font-family: var(--data);
  font-size: var(--t-label);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding-block: 6px;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--teal); color: var(--teal); }

/* ---------- hero ---------- */

.hero { padding-block: clamp(64px, 13vw, 150px) clamp(56px, 9vw, 110px); }
.hero h1 { max-width: 13ch; }
.markets-line {
  font-family: var(--data);
  font-size: var(--t-body);
  letter-spacing: 0.03em;
  color: var(--teal);
  margin: 26px 0 30px;
  line-height: 1.9;
  max-width: none;
}

/* ---------- the cost comparison ---------- */

.math { background: var(--paper-deep); }

.market-select {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--paper);
}
.market-select button {
  flex: 1 1 auto;
  min-width: 92px;
  appearance: none;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 13px 10px;
  font-family: var(--data);
  font-size: var(--t-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms linear, color 120ms linear;
}
.market-select button:last-child { border-right: 0; }
.market-select button:hover { background: var(--paper-deep); }
.market-select button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* Both columns share one set of row tracks, so a label that wraps in one column
   opens the matching row in the other. --rows is set by the build from the data. */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(var(--rows, 9), auto);
  column-gap: 1px;
  row-gap: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.col {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: 1 / -1;
  background: var(--paper);
  padding: clamp(20px, 3vw, 32px);
}
.col > * { align-self: start; }
.col > .total { align-self: end; }

.col-head {
  font-family: var(--data);
  font-size: var(--t-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.col-a .col-head { color: var(--oxblood); }
.col-b .col-head { color: var(--teal); }

.row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-body);
}
.row-label { color: var(--ink); }
.row-figure {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-body);
  white-space: nowrap;
  min-width: 6.5em;
  text-align: right;
  flex: none;
}
.col-a .row-figure { color: var(--ink); }
.col-b .row-figure { color: var(--mute); letter-spacing: 0.02em; }

.total {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px;
  padding-top: 22px;
  margin-top: 4px;
}
.total-label {
  font-family: var(--data);
  font-size: var(--t-label);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mute);
}
.total-figure {
  font-family: var(--data);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: var(--t-h2);
  letter-spacing: -0.02em;
  line-height: 1;
}
.col-a .total-figure { color: var(--oxblood); }
.col-b .total-figure { color: var(--teal); font-size: var(--t-lede); letter-spacing: -0.005em; }

.time-row {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}
.time-row .row-label { font-size: var(--t-body); color: var(--mute); }
.time-figure { font-family: var(--data); font-size: var(--t-body); }
.col-a .time-figure { color: var(--oxblood); }
.col-b .time-figure { color: var(--teal); }

.math-foot {
  display: flex; flex-wrap: wrap; gap: 12px 32px;
  justify-content: space-between; align-items: baseline;
  margin-top: 20px;
}

@media (max-width: 720px) {
  .columns { grid-template-columns: 1fr; grid-template-rows: none; }
  .col { display: block; grid-row: auto; }
  .col > * { align-self: auto; }
  .market-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .market-select button {
    min-width: 0;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
  .market-select button:nth-child(3n) { border-right: 0; }
  .market-select button:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
}

/* ---------- services ---------- */

.service {
  display: block;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--line);
  padding-block: 26px;
}
.service:first-of-type { border-top: 0; padding-top: 0; }
.service h3 { transition: color 120ms linear; }
.service:hover h3 { color: var(--teal); }
.service p { color: var(--ink); margin-top: 8px; }
.service .arrow { font-family: var(--body); font-size: var(--t-label); color: var(--teal); }

.service-lead h3 { font-size: var(--t-h3); }
.service-lead p { font-size: var(--t-lede); max-width: 56ch; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.service-grid .service {
  background: var(--paper);
  border-top: 0;
  padding: 24px 20px 24px 0;
}
.service-grid .service h3 { font-size: var(--t-body); font-family: var(--display); }
.service-grid .service p { font-size: var(--t-body); color: var(--mute); }
@media (max-width: 860px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .service-grid { grid-template-columns: 1fr; } }

/* ---------- markets, typographic. no map. ---------- */

.market-row {
  display: grid;
  grid-template-columns: minmax(190px, 26%) 1fr;
  gap: clamp(16px, 4vw, 48px);
  padding-block: 24px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.market-row:first-of-type { border-top: 0; }
.market-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-h3);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.market-meta { font-family: var(--data); font-size: var(--t-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); display: block; margin-top: 8px; }
.market-note { font-size: var(--t-body); line-height: 1.55; margin: 0; max-width: 56ch; }
@media (max-width: 620px) { .market-row { grid-template-columns: 1fr; gap: 10px; } }

/* ---------- process ---------- */

/* Three steps, set on the page ground with hairline dividers. The cost comparison
   is the only element on the site permitted a box. */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: clamp(20px, 3vw, 40px);
  border-top: 1px solid var(--line);
}
.step { padding: 26px 0 4px; }
.step + .step {
  border-left: 1px solid var(--line);
  padding-left: clamp(20px, 3vw, 40px);
  margin-left: calc(clamp(20px, 3vw, 40px) * -0.5);
}
.step-n { font-family: var(--data); font-size: var(--t-label); letter-spacing: 0.14em; color: var(--teal); display: block; margin-bottom: 14px; }
.step h3 { font-size: var(--t-body); font-family: var(--display); margin-bottom: 8px; }
.step p { font-size: var(--t-body); margin: 0; color: var(--ink); }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .step + .step {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    margin-left: 0;
  }
}

/* ---------- contact / closing ---------- */

.closing h2 { max-width: 18ch; }
.mailto {
  font-family: var(--data);
  font-size: var(--t-lede);
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid var(--teal);
  padding-bottom: 3px;
  display: inline-block;
  margin-top: 22px;
}
.mailto:hover { background: var(--teal); color: var(--paper); border-bottom-color: var(--teal); }

.cta-line { margin-top: 26px; font-size: var(--t-label); }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding-block: 34px 44px;
  font-family: var(--data);
  font-size: var(--t-label);
  letter-spacing: 0.05em;
  color: var(--mute);
}
.site-foot .wrap { display: flex; }
.site-foot a { color: var(--mute); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ---------- prose (insights, inner pages) ---------- */

.prose h2 { margin-top: 2em; margin-bottom: 0.5em; }
.prose h3 { margin-top: 1.7em; margin-bottom: 0.4em; }
.prose ul, .prose ol { max-width: 68ch; padding-left: 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose blockquote {
  margin: 1.6em 0; padding-left: 20px;
  border-left: 2px solid var(--teal);
  font-size: var(--t-lede);
}
.prose code { font-family: var(--data); font-size: 0.9em; background: var(--paper-deep); padding: 1px 5px; border-radius: 2px; }

.post-list { border-top: 1px solid var(--line); }
.post-item { display: block; text-decoration: none; color: inherit; padding-block: 26px; border-bottom: 1px solid var(--line); }
.post-item h3 { transition: color 120ms linear; }
.post-item:hover h3 { color: var(--teal); }
.post-item time { font-family: var(--data); font-size: var(--t-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); display: block; margin-bottom: 10px; }
.post-item p { margin: 8px 0 0; color: var(--ink); font-size: var(--t-body); }

/* ---------- utilities ---------- */

.stack-l > * + * { margin-top: 40px; }
.measure { max-width: 62ch; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- routes ----------
   The service follows the product, so each row states the condition first and the
   route second. Same hairline grammar as every other list on the site. */
.route-row {
  display: grid;
  grid-template-columns: minmax(200px, 30%) 1fr;
  gap: clamp(16px, 4vw, 48px);
  padding-block: 26px;
  border-top: 1px solid var(--line);
  align-items: baseline;
  text-decoration: none;
  color: inherit;
}
.route-row:first-of-type { border-top: 0; }
.route-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-h3);
  letter-spacing: -0.016em;
  line-height: 1.08;
  transition: color 120ms linear;
}
.route-row:hover .route-name { color: var(--teal); }
.route-why { font-size: var(--t-body); line-height: 1.55; max-width: 52ch; }
.route-why .arrow {
  display: block;
  margin-top: 10px;
  font-family: var(--body);
  font-size: var(--t-label);
  color: var(--teal);
}
@media (max-width: 820px) {
  .route-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- platform map ---------- */

.platform-row {
  display: grid;
  grid-template-columns: minmax(140px, 20%) minmax(180px, 26%) 1fr;
  gap: clamp(14px, 3vw, 38px);
  padding-block: 22px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.platform-row:first-of-type { border-top: 0; }
.platform-market {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-h3);
  letter-spacing: -0.016em;
  line-height: 1.05;
}
.platform-list {
  font-family: var(--data);
  font-size: var(--t-label);
  letter-spacing: 0.02em;
  color: var(--teal);
  line-height: 1.7;
}
.platform-note { font-size: var(--t-body); line-height: 1.55; margin: 0; max-width: 54ch; }
@media (max-width: 760px) {
  .platform-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- pull quote ----------
   A line lifted from the section, set in the left bay. It fills the margin with the
   argument instead of with decoration. */
.pull {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-h3);
  line-height: 1.12;
  letter-spacing: -0.014em;
  color: var(--ink);
  margin: 0;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
  max-width: 14ch;
}
@media (max-width: 820px) {
  .pull { max-width: 26ch; margin-bottom: 30px; }
}

/* ---------- figures ---------- */

.figure { display: block; width: 100%; height: auto; overflow: visible; }
.figure text { font-family: var(--data); fill: var(--mute); }
.fig-label { font-size: var(--t-label); letter-spacing: 0.06em; fill: var(--ink); }
.fig-caption { font-size: var(--t-label); letter-spacing: 0.08em; text-transform: uppercase; }
.figure-wide { max-width: 100%; }
.figure-hero {
  max-height: 600px;
  width: auto;
  max-width: 100%;
  margin-left: auto;
}

/* Hero placement: the plate occupies the right of the bay, the text runs beneath it
   on the left. */
.hero .bay { align-items: start; row-gap: 0; }
.hero .bay > h1 { grid-column: 1 / 9; grid-row: 1; }
.hero .bay > .markets-line { grid-column: 1 / 9; grid-row: 2; }
.hero .bay > .lede { grid-column: 4 / 9; grid-row: 3; }
.hero .bay > .hero-fig { grid-column: 9 / 13; grid-row: 1 / 4; align-self: start; padding-top: 6px; }

@media (max-width: 980px) {
  .hero .bay > h1,
  .hero .bay > .markets-line { grid-column: 1 / 9; }
  .hero .bay > .lede { grid-column: 4 / 10; }
  .hero .bay > .hero-fig { grid-column: 10 / 13; }
  .figure-hero { max-height: 460px; }
}
@media (max-width: 820px) {
  .hero .bay > h1,
  .hero .bay > .markets-line,
  .hero .bay > .lede { grid-column: 1 / 13; }
  .hero .bay > .hero-fig { display: none; }
}

.fig-block {
  margin-top: 46px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.fig-block .figure { max-width: 620px; }
.fig-block .figure-wide { max-width: 760px; }

/* ---------- header at narrow widths ----------
   The mark and five nav items need about 940px on one line. Below that the header
   becomes two rows: the mark, then the navigation beneath it. */
@media (max-width: 940px) {
  .site-head { position: static; }
  .site-head .wrap {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
    padding-block: 12px 4px;
    min-height: 0;
  }
  .site-nav {
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-block: 10px 8px;
  }
  .site-nav a { font-size: var(--t-label); letter-spacing: 0.07em; padding-block: 2px; }
}
