/* =============================================================================
   IO Patina Labs — iopatina.org
   =============================================================================

   The research division of IO Patina LLC. It is not a sibling brand with its
   own palette; it is the same brand, and the division is marked in the logo
   by the LABS qualifier rather than by changing any value here. So every
   token below is IO Patina's own: Mineral White paper, Ink, Deep Patina for
   dark surfaces, and Patina green as the single accent.

   The one thing that belongs to the Labs alone is the hero's attention map —
   a device drawn from what the division actually studies, standing where the
   parent site puts its oxidation field.

   Fonts are the same three self-hosted woff2 files, 65 KB in total. There
   are no third-party requests on this site of any kind.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: Archivo;
  src: url('/fonts/archivo-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('/fonts/source-serif-4-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Martian Mono';
  src: url('/fonts/martian-mono-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  --mineral: #f6f4f0;
  --paper: #fdfcf9;
  --ink: #1b1915;
  --deep: #1d221d;

  --accent: #516b54;
  --accent-deep: #364f3b;
  --accent-light: #9eba9e;

  --graphite: #56534f;
  --ash: #716e69;
  --hairline: #e1dfda;
  --hairline-strong: #d1cfca;

  --dark-body: #c9c6c0;
  --dark-label: #949790;
  --dark-rule: #333a33;
  --dark-border-strong: #4a524a;

  --font-ui: Archivo, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'Martian Mono', ui-monospace, monospace;

  --measure: 1240px;
  --gutter: clamp(20px, 5vw, 56px);
}

/* --- Reset ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--mineral);
  color: var(--graphite);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

::selection {
  background: #e7f0e6;
}

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

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

/* --- Layout --------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(60px, 7.5vw, 112px) 0;
}
.section--rule {
  border-top: 1px solid var(--hairline);
}
.section--cta {
  padding: clamp(56px, 7vw, 104px) 0;
  border-top: 1px solid var(--hairline);
}

/* The house two-column pattern: a label rail beside the content. At tablet
   the rail wraps above, so every section still reads label, heading, body. */
.split {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 5vw, 80px);
}
.split__rail {
  flex: 0 1 240px;
  min-width: 190px;
}
.split__body {
  flex: 1 1 520px;
  min-width: 280px;
}
.split--wide {
  gap: clamp(28px, 5vw, 96px);
}

.mt-24 {
  margin-top: 24px;
}
.mt-28 {
  margin-top: 28px;
}

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  /* Taller than iopatina.com's 70px: the lockup is three stacked elements
     rather than a single-line mark, and needs the room. */
  height: 86px;
  display: flex;
  align-items: center;
  background: rgb(246 244 240 / 94%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* --- The lockup ----------------------------------------------------------- */
/*
 * IO Patina's master logo with a qualifier: the mark, a hairline rule, the
 * wordmark, and LABS beneath it in Patina green. The construction above the
 * qualifier is the parent's unchanged — the rule is what reframes the mark as
 * a seal so the eye reads symbol-then-name, and removing it makes the mark's
 * "IO" stutter against the wordmark's.
 *
 * Proportions follow scripts/logo.mjs in the parent repository: the wordmark's
 * cap height is 0.46 of the mark's, and the mark-to-wordmark gap is 0.4 mark
 * cap heights. Archivo's cap height is 0.73em, which is why the wordmark's
 * font-size is the cap height divided by 0.73.
 */

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  /* Mark cap height. Everything else is derived from it. */
  --cap: 30px;
}

.brand__mark {
  display: flex;
  flex: none;
}
.brand__mark img,
.brand__mark svg {
  height: calc(var(--cap) * 1.032);
  width: auto;
  display: block;
}

.brand__rule {
  flex: none;
  width: 1px;
  height: calc(var(--cap) * 1.032);
  margin: 0 calc(var(--cap) * 0.208);
  background: currentColor;
  opacity: 0.3;
}

.brand__words {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand__name {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: calc(var(--cap) * 0.46 / 0.73);
  letter-spacing: 0.2em;
  line-height: 1;
  white-space: nowrap;
}

.brand__qualifier {
  margin-top: 0.52em;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: calc(var(--cap) * 0.23 / 0.73);
  letter-spacing: 0.42em;
  line-height: 1;
  color: var(--accent);
  white-space: nowrap;
}

/* --- Navigation ----------------------------------------------------------- */

.nav {
  display: flex;
  gap: clamp(18px, 2.4vw, 32px);
}
.nav a {
  font-size: 14px;
  letter-spacing: 0.005em;
  color: var(--graphite);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

@media (max-width: 620px) {
  .brand {
    --cap: 23px;
  }
  .nav {
    gap: 16px;
  }
  .nav a {
    font-size: 13px;
  }
}

/* --- Type ----------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--graphite);
}
.eyebrow--light {
  color: var(--accent-light);
}

.hero-title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(42px, 6.4vw, 78px);
  line-height: 1.01;
  letter-spacing: -0.022em;
  color: var(--ink);
  max-width: 18ch;
  text-wrap: pretty;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(27px, 3.1vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 22ch;
  text-wrap: pretty;
}
.section-title--light {
  color: var(--mineral);
}

.hero-lead {
  margin-top: 22px;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.62;
  max-width: 56ch;
  text-wrap: pretty;
}

.body {
  margin-top: 18px;
  max-width: 56ch;
  text-wrap: pretty;
}
.body--wide {
  max-width: 62ch;
  line-height: 1.7;
}
.body--light {
  color: var(--dark-body);
  font-size: 17px;
  max-width: 60ch;
}

.note {
  font-size: 15px;
  color: var(--ash);
  max-width: 56ch;
}

.legal-body .body + .body {
  margin-top: 16px;
}

/* --- Links ---------------------------------------------------------------- */

.link {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--hairline-strong);
  transition: background-size 0.42s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.link:hover {
  background-size: 100% 1px;
}

.ext {
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.85em;
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding: clamp(56px, 8vw, 120px) 0 clamp(52px, 6vw, 92px);
}

/* The artwork sits beside the copy on wide screens and drops below it on
   narrow ones, where it is the first thing worth losing to the fold. */
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.08fr 0.92fr;
  }
}

.hero__art {
  margin: 0;
  min-width: 0;
}

.hero__art img {
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  background: var(--paper);
}

.hero__art figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
}

/* --- Record list ---------------------------------------------------------- */
/* Facts set as records: mono key on the left, value on the right, a hairline
   between. This is the pattern that reads as a real operating entity. */

.record {
  margin-top: clamp(36px, 4.5vw, 56px);
  border-top: 1px solid var(--ink);
  max-width: 640px;
}

.record__row {
  display: flex;
  gap: 24px;
  padding: 15px 0;
  border-bottom: 1px solid var(--hairline);
}

.record__key {
  flex: 0 0 128px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
  padding-top: 5px;
}

.record__val {
  flex: 1;
  color: var(--ink);
  font-size: 15.5px;
}

@media (max-width: 520px) {
  .record__row {
    display: block;
  }
  .record__key {
    margin-bottom: 4px;
  }
}

/* --- Pillars -------------------------------------------------------------- */

/* Two columns, stated rather than auto-fitted. There are four pillars, and
   auto-fit resolves to three at this container width, stranding the fourth
   on a row of its own. */
.pillar-grid {
  margin-top: clamp(30px, 3.6vw, 46px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px 40px;
}

@media (min-width: 620px) {
  .pillar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pillar {
  border-top: 1px solid var(--ink);
  padding-top: 16px;
}

.pillar__title {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
}

.pillar__text {
  margin-top: 8px;
  font-size: 15.5px;
  text-wrap: pretty;
}

/* --- Dark band ------------------------------------------------------------ */
/* Not a theme — a compositional island inside a light page. */

.band-dark {
  background: var(--deep);
  padding: clamp(64px, 8vw, 124px) 0;
}
.band-dark :focus-visible {
  outline-color: var(--accent-light);
}

.stack {
  margin-top: clamp(30px, 3.6vw, 44px);
}

.stack__item {
  padding: 26px 0;
  border-top: 1px solid var(--dark-rule);
}
.stack__item:last-child {
  border-bottom: 1px solid var(--dark-rule);
}

.stack__title {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--mineral);
}

.stack__text {
  margin-top: 10px;
  color: var(--dark-body);
  font-size: 15.5px;
  max-width: 56ch;
  text-wrap: pretty;
}

/* --- Buttons -------------------------------------------------------------- */
/* The fill wipes up over the ink rather than the colour switching. */

.btn {
  display: inline-block;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 18px;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--mineral);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: border-color 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.btn:hover {
  border-color: var(--accent);
}
.btn:hover::before {
  transform: translateY(0);
}

.btn--onDark {
  background: transparent;
  border-color: var(--dark-border-strong);
  color: var(--mineral);
}
.btn--onDark:hover {
  border-color: var(--accent-light);
}
.btn--onDark::before {
  background: var(--accent-deep);
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  background: var(--deep);
  color: var(--dark-body);
  padding: clamp(52px, 6vw, 84px) 0 30px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--dark-rule);
}

/* The same lockup, one step up in size, reversed. The endorsement's 9.5px
   against the name's 38px lands the two lines at the same width again. */
.brand--footer {
  --cap: 40px;
  color: var(--mineral);
}
.brand--footer .brand__qualifier {
  color: var(--accent-light);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.footer-nav a {
  font-size: 14px;
  color: var(--dark-body);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.footer-nav a:hover {
  color: var(--mineral);
  border-bottom-color: var(--accent-light);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 22px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--dark-label);
}

/* --- Motion --------------------------------------------------------------- */

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