/* ============================================================
   RIMATLAS — design system
   Warm editorial paper / deep forest / brass
   ============================================================ */
@import url('../fonts/fonts-local.css');

:root {
  --paper: #f1ede3;
  --paper-2: #e8e2d3;
  --paper-3: #faf7ef;
  --ink: #111714;
  --ink-2: #1c2620;
  --forest: #1d362b;
  --forest-2: #244335;
  --brass: #a9834d;
  --brass-2: #c8a76c;
  --brass-3: #e3cfa7;
  --oxide: #9b4631;
  --sage: #8d998b;
  --muted: #6f6c60;
  --line: rgba(17, 23, 20, 0.14);
  --line-strong: rgba(17, 23, 20, 0.28);
  --line-soft: rgba(17, 23, 20, 0.07);

  --bg: var(--paper);
  --fg: var(--ink);
  --fg-dim: var(--muted);
  --card: var(--paper-3);
  --card-2: #fffdf8;
  --hair: var(--line);
  --accent: var(--brass);
  --accent-soft: rgba(169, 131, 77, 0.13);
  --ok: #3e6b4f;
  --warn: #9a7130;
  --bad: var(--oxide);

  --serif: 'Instrument Serif', 'Times New Roman', Times, serif;
  --sans: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --gutter: clamp(20px, 4.2vw, 68px);
  --max: 1560px;
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 26px;
  --r-xl: 36px;
  --ease: cubic-bezier(0.22, 0.68, 0.16, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 76px;
  --grain-opacity: 0.05;
  --shadow-sm: 0 1px 2px rgba(17, 23, 20, 0.04), 0 12px 30px -18px rgba(17, 23, 20, 0.22);
  --shadow-md: 0 2px 4px rgba(17, 23, 20, 0.03), 0 30px 80px -34px rgba(17, 23, 20, 0.35);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.58;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01' on, 'cv11' on;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

::selection { background: var(--brass-2); color: var(--ink); }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
p, h1, h2, h3, h4, h5, h6, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--hair); margin: 0; }

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

/* ---------- type ---------- */
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.94;
  font-size: clamp(46px, 7.4vw, 116px);
  text-wrap: balance;
}
.display em,
.serif-italic {
  font-style: italic;
  color: var(--brass);
}
.d1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 5.6vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.d2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 3.8vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.d3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.012em;
}
.lead {
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.62;
  color: var(--fg-dim);
  text-wrap: pretty;
  max-width: 58ch;
}
.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.kicker::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--brass);
  flex: none;
}
.kicker--plain::before { display: none; }
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.dim { color: var(--fg-dim); }
.brass { color: var(--brass); }
.small { font-size: 12.5px; line-height: 1.55; }
.micro { font-size: 11px; line-height: 1.5; }

/* ---------- layout ---------- */
.shell {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(68px, 8.6vw, 138px); position: relative; }
.section--tight { padding-block: clamp(48px, 5.6vw, 84px); }
.section--paper2 { background: var(--paper-2); }
.section--paper3 { background: var(--paper-3); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--forest { background: var(--forest); color: var(--paper); }
.section--ink .dim, .section--forest .dim { color: rgba(241, 237, 227, 0.6); }
.section--ink .kicker, .section--forest .kicker { color: rgba(241, 237, 227, 0.55); }
.section--ink .lead, .section--forest .lead { color: rgba(241, 237, 227, 0.7); }
.section--ink .hair, .section--forest .hair { border-color: rgba(241, 237, 227, 0.14); }

.hair { border-top: 1px solid var(--hair); }
.stack-6 > * + * { margin-top: 6px; }
.stack-10 > * + * { margin-top: 10px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.stack-32 > * + * { margin-top: 32px; }
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--tight { gap: 8px; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.46fr);
  gap: clamp(24px, 5vw, 88px);
  align-items: end;
  margin-bottom: clamp(34px, 4.4vw, 64px);
}
.section-head .kicker { margin-bottom: 20px; }
.section-head__aside { justify-self: end; text-align: left; max-width: 38ch; }
.section-head__aside .lead { font-size: 15px; }
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; align-items: start; }
  .section-head__aside { justify-self: start; }
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  --btn-bd: var(--line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.015em;
  line-height: 1;
  white-space: nowrap;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.btn .ico { width: 15px; height: 15px; flex: none; transition: transform .35s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:hover .ico { transform: translate(2px, -2px); }
.btn:active { transform: translateY(0); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--paper); --btn-bd: var(--ink); }
.btn--ink:hover { --btn-bg: var(--forest-2); --btn-bd: var(--forest-2); }
.btn--brass { --btn-bg: var(--brass); --btn-fg: #15130e; --btn-bd: var(--brass); }
.btn--brass:hover { --btn-bg: var(--brass-2); --btn-bd: var(--brass-2); }
.btn--ghost:hover { background: rgba(17, 23, 20, 0.05); border-color: var(--line-strong); }
.btn--light { --btn-fg: var(--paper); --btn-bd: rgba(241, 237, 227, 0.28); }
.btn--light:hover { background: rgba(241, 237, 227, 0.08); border-color: rgba(241, 237, 227, 0.5); }
.btn--sm { padding: 10px 16px; font-size: 11.5px; gap: 8px; }
.btn--lg { padding: 16px 27px; font-size: 13.5px; }
.btn--full { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  transition: background .3s, border-color .3s, color .3s;
}
.icon-btn:hover { background: rgba(17, 23, 20, .05); border-color: var(--line-strong); }
.icon-btn .ico { width: 17px; height: 17px; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .3s, color .3s;
}
.link .ico { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.link:hover { color: var(--brass); border-color: var(--brass); }
.link:hover .ico { transform: translate(2px, -2px); }
.link--light { border-color: rgba(241, 237, 227, .35); }

/* ---------- tags / chips ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  line-height: 1;
  white-space: nowrap;
}
.tag--solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tag--brass { background: var(--accent-soft); border-color: rgba(169, 131, 77, .3); color: #7a5a2c; }
.tag--ok { background: rgba(62, 107, 79, .1); border-color: rgba(62, 107, 79, .25); color: var(--ok); }
.tag--warn { background: rgba(154, 113, 48, .1); border-color: rgba(154, 113, 48, .25); color: var(--warn); }
.tag--bad { background: rgba(155, 70, 49, .09); border-color: rgba(155, 70, 49, .22); color: var(--bad); }
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.dot--live { box-shadow: 0 0 0 3px rgba(62, 107, 79, .14); animation: pulse 2.6s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(62, 107, 79, .16); }
  50% { box-shadow: 0 0 0 5px rgba(62, 107, 79, .05); }
}

/* ---------- brand mark ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
}
.brand__mark {
  width: 30px;
  height: 30px;
  color: var(--fg);
  flex: none;
}
.brand__word {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1;
}
.brand__sup {
  align-self: flex-start;
  margin-top: -2px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: .1em;
  color: var(--brass);
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(241, 237, 227, .82);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color .35s, background .35s;
}
.masthead.is-scrolled { border-bottom-color: var(--hair); background: color-mix(in srgb, var(--paper) 91%, transparent); }
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  width: 100%;
}
.masthead__nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  margin-left: clamp(8px, 2vw, 30px);
  margin-right: auto;
}
.masthead__nav a {
  position: relative;
  font-size: 12px;
  font-weight: 450;
  color: var(--fg-dim);
  padding-block: 8px;
  transition: color .3s;
  white-space: nowrap;
}
.masthead__nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--brass);
  transition: right .4s var(--ease);
}
.masthead__nav a:hover, .masthead__nav a[aria-current='page'] { color: var(--fg); }
.masthead__nav a:hover::after, .masthead__nav a[aria-current='page']::after { right: 0; }
.masthead__actions { display: flex; align-items: center; gap: 12px; }
.masthead__domain {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--fg-dim);
  margin-right: 6px;
}
.menu-btn { display: none; }
@media (max-width: 1080px) {
  .masthead__domain { display: none; }
}
@media (max-width: 940px) {
  .masthead__nav { display: none; }
  .menu-btn { display: inline-flex; }
  .masthead__actions .btn--ink { display: none; }
}

/* mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--forest);
  color: var(--paper);
  padding: 26px var(--gutter) 34px;
  transform: translateY(-102%);
  transition: transform .6s var(--ease-out);
  overflow-y: auto;
}
.drawer.is-open { transform: translateY(0); }
.drawer__top { display: flex; justify-content: space-between; align-items: center; }
.drawer__top .brand__mark { color: var(--paper); }
.drawer__nav { display: flex; flex-direction: column; gap: 4px; margin-top: 12vh; }
.drawer__nav a {
  font-family: var(--serif);
  font-size: clamp(34px, 9vw, 56px);
  line-height: 1.16;
  border-bottom: 1px solid rgba(241, 237, 227, .13);
  padding-block: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer__nav a span { font-family: var(--mono); font-size: 10px; color: var(--brass-2); letter-spacing: .12em; }
.drawer__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; padding-top: 22px; }
.drawer__foot .small { color: rgba(241, 237, 227, .55); }
@media (max-width: 520px) {
  .drawer__foot { flex-direction: column; align-items: flex-start; gap: 12px; }
}
.drawer .icon-btn { border-color: rgba(241, 237, 227, .25); color: var(--paper); }
body.is-locked { overflow: hidden; }

/* ---------- footer ---------- */
.colophon {
  background: var(--ink);
  color: var(--paper);
  padding-top: clamp(64px, 8vw, 120px);
  padding-bottom: 30px;
  position: relative;
  overflow: hidden;
}
.colophon .display { font-size: clamp(42px, 6.2vw, 92px); max-width: 18ch; }
.colophon__lead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: clamp(48px, 6vw, 88px);
  border-bottom: 1px solid rgba(241, 237, 227, .13);
}
.colophon__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(140px, 0.55fr));
  gap: clamp(24px, 4vw, 60px);
  padding-block: clamp(38px, 5vw, 64px);
}
.colophon .brand { color: var(--paper); }
.colophon .brand__mark { color: var(--paper); }
.colophon .brand__sup { color: var(--brass-2); }
.colophon__col h4 {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(241, 237, 227, .42);
  margin-bottom: 18px;
}
.colophon__col a, .colophon__col p {
  display: block;
  font-size: 13px;
  color: rgba(241, 237, 227, .72);
  padding-block: 5px;
  transition: color .25s;
}
.colophon__col a:hover { color: var(--brass-2); }
.colophon__blurb { max-width: 34ch; font-size: 13px; line-height: 1.65; color: rgba(241, 237, 227, .58); }
.colophon__base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid rgba(241, 237, 227, .1);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(241, 237, 227, .38);
}
.colophon__base .row { gap: 22px; }
@media (max-width: 860px) {
  .colophon__lead { flex-direction: column; align-items: start; }
  .colophon__grid { grid-template-columns: 1fr 1fr; }
  .colophon__col:first-child { grid-column: 1 / -1; margin-bottom: 10px; }
}

/* ---------- reveal / motion ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal='left'] { transform: translateX(-26px); }
.js [data-reveal='right'] { transform: translateX(26px); }
.js [data-reveal='scale'] { transform: scale(.96); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@supports (animation-timeline: view()) {
  .scroll-rotate { animation: scroll-spin linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  @keyframes scroll-spin { to { transform: rotate(28deg); } }
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade-out .22s ease both; }
::view-transition-new(root) { animation: fade-in .32s ease both; }
@keyframes fade-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- shared bits ---------- */
.crosshair {
  position: relative;
}
.crosshair::before, .crosshair::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: var(--line-strong);
  border-style: solid;
  opacity: .7;
  pointer-events: none;
}
.crosshair::before { top: 14px; left: 14px; border-width: 1px 0 0 1px; }
.crosshair::after { bottom: 14px; right: 14px; border-width: 0 1px 1px 0; }

.grid-dots {
  background-image: radial-gradient(rgba(17, 23, 20, .18) .6px, transparent .6px);
  background-size: 18px 18px;
}
.grid-lines {
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 72px 72px;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  transform: translateY(-150%);
  transition: transform .2s;
  font-size: 12px;
}
.skip-link:focus { transform: none; }
.noscript { padding: 20px; background: var(--paper-2); text-align: center; font-size: 13px; }
.conf { position: relative; display: inline-grid; place-items: center; width: 58px; height: 58px; flex: none; color: var(--brass); }
.conf svg { position: absolute; inset: 0; }
.conf__val { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: -.04em; }
.conf__val small { font-size: 7px; opacity: .55; margin-left: 1px; }
.conf--lg { width: 88px; height: 88px; }
.conf--lg .conf__val { font-size: 22px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
