/* Riak Labs — design tokens (see 01-design-synthesis.md) */
:root {
  --canvas: #fbfbf9;
  --paper: #ffffff;
  --mist: #f3f3f1;
  --hairline: #e6e5e1;
  --hairline-strong: #d4d3ce;
  --ink: #111316;
  --graphite: #2a2a2a;
  --body: #5a5955;
  --muted: #8b8a85;
  --orange: #ff5b2e;
  --inverse-bg: #111316;
  --inverse-text: #f2f1ed;
  --inverse-muted: #9a9993;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max: 1200px;
  --gutter: 24px;
  --radius-card: 16px;
  --radius-panel: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--paper); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 128px 0; }
.section--mist { background: var(--mist); }

/* ---------- Type ---------- */
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 400; }
.display {
  font-family: var(--serif);
  font-size: clamp(52px, 8.4vw, 112px);
  line-height: .98;
  letter-spacing: -0.025em;
}
.h2 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.display em, .h2 em { font-style: italic; }
.h3 { font-family: var(--sans); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--body); max-width: 40ch; }
.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }

.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 64px; }
.section-head .h2 { margin-top: 20px; }
.section-head p { margin: 0; max-width: 44ch; justify-self: end; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 8px 0 24px;
  border-radius: 999px;
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #2a2c30; }
.btn .arrow {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--orange); color: var(--paper);
  transition: transform .2s var(--ease);
}
.btn:hover .arrow { transform: translateX(3px); }
.btn--ghost { border: 1px solid var(--hairline-strong); color: var(--ink); padding: 0 24px; }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { height: 40px; font-size: 14px; padding-left: 18px; padding-right: 6px; }
.btn--sm .arrow { width: 28px; height: 28px; }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: #ecebe7; }
.btn--lg { height: 56px; font-size: 16px; padding-left: 28px; }
.btn--lg .arrow { width: 40px; height: 40px; }
.btn:focus-visible, a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.text-link { color: var(--ink); text-decoration: none; font-weight: 500; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Nav ---------- */
.nav-wrap { position: fixed; top: 16px; left: 0; right: 0; z-index: 50; padding: 0 16px; pointer-events: none; }
.nav {
  pointer-events: auto;
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 60px; padding: 0 10px 0 24px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: box-shadow .3s var(--ease);
}
.nav.is-scrolled { box-shadow: 0 8px 24px -12px rgba(17, 19, 22, .18); }
.nav__logo img { height: 22px; width: auto; }
.nav__links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--body); text-decoration: none;
  transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--ink); background: var(--mist); }
.nav__right { display: flex; align-items: center; gap: 8px; }
.nav__toggle {
  display: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--hairline); background: var(--paper); cursor: pointer;
  align-items: center; justify-content: center; padding: 0;
}
.nav__toggle span { display: block; width: 16px; height: 1.5px; background: var(--ink); position: relative; }
.nav__toggle span::before, .nav__toggle span::after { content: ""; position: absolute; left: 0; width: 16px; height: 1.5px; background: var(--ink); transition: transform .2s; }
.nav__toggle span::before { top: -5px; }
.nav__toggle span::after { top: 5px; }
.nav-open .nav__toggle span { background: transparent; }
.nav-open .nav__toggle span::before { transform: translateY(5px) rotate(45deg); }
.nav-open .nav__toggle span::after { transform: translateY(-5px) rotate(-45deg); }
.mobile-menu {
  pointer-events: auto;
  display: none;
  max-width: 1080px; margin: 8px auto 0;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 24px;
  padding: 12px;
}
.mobile-menu a { display: block; padding: 14px 16px; font-size: 17px; color: var(--ink); text-decoration: none; border-radius: 12px; }
.mobile-menu a:hover { background: var(--mist); }
.nav-open .mobile-menu { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 140px var(--gutter) 64px;
  overflow: hidden;
}
.hero::before { /* faint dot grid */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--hairline-strong) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  opacity: .55;
  pointer-events: none;
}
.hero > * { position: relative; }
.hero .display { max-width: 14.5ch; margin: 28px auto 0; text-wrap: balance; }
.hero .lead { margin: 32px auto 0; max-width: 46ch; }
.hero__cta { margin-top: auto; padding-top: 56px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hero__note { font-size: 14px; color: var(--muted); }

/* ---------- Tools marquee ---------- */
.tools { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 28px 0; background: var(--canvas); }
.tools__inner { display: flex; align-items: center; gap: 40px; }
.tools__title { flex: none; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-left: var(--gutter); max-width: 180px; line-height: 1.4; }
.marquee {
  flex: 1; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__list { display: flex; gap: 56px; padding-right: 56px; list-style: none; margin: 0; padding-left: 0; }
.marquee__list li { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; color: var(--muted); white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--hairline); border-radius: var(--radius-panel); background: var(--paper); }
.stat { padding: 40px 36px; }
.stat + .stat { border-left: 1px solid var(--hairline); }
.stat__num { font-family: var(--serif); font-size: clamp(56px, 6vw, 80px); line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.stat__num sup { font-size: .45em; vertical-align: top; position: relative; top: .25em; margin-left: 2px; color: var(--orange); font-family: var(--sans); font-weight: 500; }
.stat__label { margin-top: 16px; font-size: 15px; color: var(--body); max-width: 26ch; }
.stats-section { padding: 96px 0 0; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-card);
  padding: 32px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.service:hover { border-color: var(--hairline-strong); transform: translateY(-2px); }
.service__num { font-family: var(--mono); font-size: 12px; color: var(--orange); letter-spacing: .04em; }
.service .h3 { margin-top: 48px; }
.service p { margin: 12px 0 0; font-size: 15px; }
.service__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--body); border: 1px solid var(--hairline); border-radius: 999px; padding: 4px 10px; }

/* ---------- Photo break ---------- */
.photo-break { padding: 0 var(--gutter); }
.photo-break figure {
  position: relative; margin: 0 auto; max-width: 1360px;
  height: clamp(360px, 52vw, 640px);
  border-radius: var(--radius-panel); overflow: hidden;
}
.photo-break img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.75) contrast(.96); }
.photo-break figcaption {
  position: absolute; left: 32px; bottom: 32px; right: 32px;
  font-family: var(--serif); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1; color: var(--paper);
  max-width: 18ch; text-shadow: 0 1px 24px rgba(0, 0, 0, .25);
}
.photo-break figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(17, 19, 22, .45)); }
.photo-break figcaption { z-index: 1; }

/* ---------- Work ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.work { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.work__visual {
  background: var(--mist); border-bottom: 1px solid var(--hairline);
  height: 300px; display: grid; place-items: center; padding: 32px; position: relative;
}
.work__body { padding: 28px 32px 32px; }
.work__meta { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.work .h3 { margin-top: 14px; font-size: 22px; }
.work p { margin: 10px 0 0; font-size: 15px; }
.work__stack { margin-top: 20px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Mock UI fragments (floating artifacts) */
.mock {
  width: 100%; max-width: 360px;
  background: var(--paper); border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(17, 19, 22, .05), 0 20px 25px -5px rgba(17, 19, 22, .08), 0 8px 10px -6px rgba(17, 19, 22, .06);
  padding: 16px; font-size: 13px; color: var(--graphite); text-align: left;
}
.mock__head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); display: inline-block; margin-right: 6px; vertical-align: middle; }
.bubble { padding: 9px 12px; border-radius: 14px; max-width: 82%; margin-top: 6px; line-height: 1.4; }
.bubble--in { background: var(--mist); border-bottom-left-radius: 4px; }
.bubble--out { background: var(--ink); color: var(--paper); margin-left: auto; border-bottom-right-radius: 4px; }
.sys { text-align: center; font-size: 11px; color: var(--muted); margin: 2px 0 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--hairline); color: var(--ink); background: var(--paper); }
.pill--ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2f9e5b; }
.pill--wait::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.row:last-of-type { border-bottom: 0; }
.row span:last-child { font-variant-numeric: tabular-nums; color: var(--ink); }
.flag { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: #fff3ee; color: #8a2f12; font-size: 12px; }
.mock__actions { display: flex; gap: 6px; margin-top: 12px; }
.mini-btn { font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hairline); }
.mini-btn--dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { border: 1px solid var(--hairline); border-radius: 10px; padding: 10px; }
.kpi b { display: block; font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--ink); line-height: 1.1; }
.kpi small { font-size: 11px; color: var(--muted); }
.kpi .up { color: #2f9e5b; font-size: 11px; }
.insight { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--mist); font-size: 12px; line-height: 1.45; }
.email-line { display: flex; gap: 8px; font-size: 12px; padding: 4px 0; color: var(--muted); }
.email-line b { color: var(--graphite); font-weight: 500; }
.email-body { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--hairline); line-height: 1.5; }
.skeleton { height: 8px; border-radius: 4px; background: var(--mist); margin-top: 8px; }

.work-note { margin-top: 24px; font-size: 14px; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  border: 1px solid var(--hairline); border-radius: var(--radius-panel);
  background: var(--paper); padding: 40px 48px;
}
.cta-band .h2 { font-size: clamp(30px, 3.4vw, 42px); max-width: 22ch; }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.step { padding: 28px 28px 0 0; }
.step + .step { padding-left: 28px; border-left: 1px solid var(--hairline); }
.step__num { font-family: var(--mono); font-size: 13px; color: var(--orange); }
.step .h3 { margin-top: 40px; }
.step p { margin: 12px 0 0; font-size: 15px; }
.step__time { margin-top: 20px; }

/* ---------- Why ---------- */
.why { display: grid; grid-template-columns: 5fr 6fr; gap: 64px; align-items: stretch; }
.why__photo { border-radius: var(--radius-panel); overflow: hidden; min-height: 520px; }
.why__photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7); }
.why .h2 { margin-top: 20px; }
.why__intro { margin: 24px 0 0; max-width: 46ch; }
.points { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px 40px; }
.point { border-top: 1px solid var(--hairline); padding-top: 20px; }
.point .h3 { font-size: 18px; }
.point p { margin: 8px 0 0; font-size: 15px; }

/* ---------- FAQ ---------- */
.faq-wrap { display: grid; grid-template-columns: 4fr 7fr; gap: 64px; }
.faq-wrap .h2 { margin-top: 20px; }
.faq-side p { margin: 24px 0 32px; max-width: 34ch; }
.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 24px 0; font-size: 18px; font-weight: 500; color: var(--ink); letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--hairline); display: grid; place-items: center;
  font-weight: 400; font-size: 18px; color: var(--ink); transition: transform .2s var(--ease), background .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--mist); }
.faq details p { margin: 0 0 24px; max-width: 60ch; }

/* ---------- Contact / final CTA ---------- */
.contact { padding: 0 var(--gutter) 24px; }
.contact__panel {
  max-width: 1360px; margin: 0 auto;
  background: var(--inverse-bg); color: var(--inverse-text);
  border-radius: var(--radius-panel); overflow: hidden; position: relative;
  padding: 128px 48px; text-align: center;
}
.contact__panel::before {
  content: ""; position: absolute; inset: 0;
  background: url("https://images.unsplash.com/photo-1521811628991-7a3ea581f7d1?w=1600&q=60&auto=format") center/cover;
  opacity: .08; filter: grayscale(1);
}
.contact__panel > * { position: relative; }
.contact__panel .label { color: var(--inverse-muted); }
.contact__panel .display { color: var(--inverse-text); font-size: clamp(56px, 9vw, 128px); margin-top: 24px; }
.contact__panel p { color: var(--inverse-muted); max-width: 44ch; margin: 24px auto 40px; font-size: 18px; }
.contact__alt { margin-top: 24px; font-size: 14px; color: var(--inverse-muted); }
.contact__alt a { color: var(--inverse-text); text-decoration: none; border-bottom: 1px solid #3a3c40; }
.contact__alt a:hover { border-color: var(--inverse-text); }

/* ---------- Footer ---------- */
.footer { padding: 72px 0 40px; }
.footer__top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer__brand img { height: 22px; width: auto; }
.footer__brand p { margin: 20px 0 0; max-width: 32ch; font-size: 15px; }
.footer h4 { margin: 0 0 16px; font-family: var(--mono); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer ul a { text-decoration: none; font-size: 15px; color: var(--graphite); }
.footer ul a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.footer__bottom {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--hairline);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  font-size: 13px; color: var(--muted);
}
.footer__bottom a { color: var(--muted); text-decoration: none; }
.footer__bottom a:hover { color: var(--ink); }
.footer__legal { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- Legal pages ---------- */
.legal { padding: 160px 0 96px; }
.legal .container { max-width: 760px; }
.legal h1 { font-family: var(--serif); font-size: clamp(44px, 6vw, 72px); line-height: 1.02; letter-spacing: -0.02em; margin-top: 20px; }
.legal .updated { margin-top: 16px; color: var(--muted); font-size: 14px; }
.legal h2 { font-family: var(--sans); font-size: 20px; font-weight: 500; margin: 48px 0 12px; letter-spacing: -0.01em; }
.legal p, .legal li { font-size: 16px; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--ink); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); border-top: 0; }
  .step, .step + .step { padding: 28px 24px 28px 0; border-left: 0; border-top: 1px solid var(--ink); }
  .step:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--hairline); }
  .why { grid-template-columns: 1fr; gap: 48px; }
  .why__photo { min-height: 360px; }
  .faq-wrap { grid-template-columns: 1fr; gap: 40px; }
  .footer__top { grid-template-columns: 1fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
  .section { padding: 88px 0; }
  .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
  .section-head p { justify-self: start; }
  .work-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 32px; }
  .tools__title { display: none; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .nav { padding-left: 18px; height: 56px; }
  .nav__logo img { height: 18px; }
  .hero { padding-top: 120px; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--hairline); }
  .stat { padding: 28px; }
  .stats-section { padding-top: 64px; }
  .services { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .service .h3 { margin-top: 32px; }
  .work__visual { height: auto; padding: 24px 16px; }
  .work__body { padding: 24px; }
  .steps { grid-template-columns: 1fr; }
  .step:nth-child(even) { padding-left: 0; border-left: 0; }
  .points { grid-template-columns: 1fr; gap: 24px; }
  .photo-break figcaption { left: 20px; right: 20px; bottom: 20px; }
  .contact__panel { padding: 88px 20px; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .marquee__list li { font-size: 17px; }
  .marquee__list { gap: 40px; padding-right: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}
