/* ==========================================================================
   Soonmao — base.css
   Design tokens, reset, typography, utilities
   ========================================================================== */

:root {
  /* colour */
  --ink: #14130f;
  --ink-80: rgba(20, 19, 15, 0.8);
  --ink-60: rgba(20, 19, 15, 0.6);
  --ink-45: rgba(20, 19, 15, 0.45);
  --line: rgba(20, 19, 15, 0.14);
  --line-strong: rgba(20, 19, 15, 0.28);
  --paper: #f5f2ec;
  --paper-2: #ebe6dc;
  --paper-3: #e2dcd0;
  --white: #ffffff;
  --clay: #a6552f;
  --clay-soft: #c07a52;
  --moss: #4a5245;

  /* type */
  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-0: clamp(0.94rem, 0.9rem + 0.18vw, 1.02rem);
  --step-1: clamp(1.1rem, 1rem + 0.45vw, 1.32rem);
  --step-2: clamp(1.36rem, 1.15rem + 1vw, 1.9rem);
  --step-3: clamp(1.7rem, 1.3rem + 1.9vw, 2.8rem);
  --step-4: clamp(2.1rem, 1.5rem + 3vw, 4rem);
  --step-5: clamp(2.6rem, 1.5rem + 5.2vw, 6.2rem);

  /* layout */
  --gut: clamp(20px, 4.6vw, 64px);
  --max: 1560px;
  --header-h: 74px;
  --topbar-h: 38px;
  --radius: 0px;

  /* motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.55s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img,
svg,
video {
  max-width: 100%;
  display: block;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure,
blockquote,
p,
h1,
h2,
h3,
h4,
h5 {
  margin: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
.display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.h1 {
  font-size: var(--step-5);
  font-weight: 500;
}

.h2 {
  font-size: var(--step-4);
}

.h3 {
  font-size: var(--step-3);
}

.h4 {
  font-size: var(--step-2);
  line-height: 1.12;
}

.h5 {
  font-size: var(--step-1);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-80);
  max-width: 62ch;
  text-wrap: pretty;
}

.body-sm {
  font-size: var(--step--1);
  line-height: 1.7;
  color: var(--ink-60);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.eyebrow--plain::before {
  display: none;
}

.mono {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose p {
  color: var(--ink-80);
  max-width: 68ch;
}

.prose h2 {
  font-size: var(--step-2);
  margin-top: 2.2em;
}

.prose h3 {
  font-size: var(--step-1);
  margin-top: 1.8em;
}

.prose ul {
  max-width: 68ch;
}

.prose li {
  position: relative;
  padding-left: 20px;
  color: var(--ink-80);
}

.prose li + li {
  margin-top: 0.5em;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 1px;
  background: var(--clay);
}

.prose a {
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s;
}

.prose a:hover {
  border-color: var(--ink);
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.container--narrow {
  max-width: 1060px;
}

.section {
  padding-block: clamp(56px, 8vw, 132px);
}

.section--tight {
  padding-block: clamp(40px, 5vw, 76px);
}

.section--paper2 {
  background: var(--paper-2);
}

.section--ink {
  background: var(--ink);
  color: var(--paper);
}

.section--ink .lead,
.section--ink .prose p,
.section--ink .body-sm {
  color: rgba(245, 242, 236, 0.72);
}

.section--ink .eyebrow {
  color: rgba(245, 242, 236, 0.6);
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

.grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 28px);
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid--12 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 96px);
  align-items: start;
}

.split--wide-left {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.6vw, 22px);
}

.st-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 56px);
}

.sec-head__text {
  max-width: 720px;
}

.sec-head h2 + p {
  margin-top: 14px;
}

/* utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.aspect {
  position: relative;
  overflow: hidden;
  background: var(--paper-3);
}

.aspect > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

.aspect--4x3 {
  aspect-ratio: 4 / 3;
}

.aspect--1x1 {
  aspect-ratio: 1 / 1;
}

.aspect--3x2 {
  aspect-ratio: 3 / 2;
}

.aspect--16x9 {
  aspect-ratio: 16 / 9;
}

.aspect--3x4 {
  aspect-ratio: 3 / 4;
}

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.no-js .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .aspect > img {
    transition: none;
  }
}

@media (max-width: 900px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split,
  .split--wide-left {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }
}
