/* =============================================================================
   RABAMBA — main.css
   Locked design system: dark-first graphite, single mint-teal signal,
   blueprint grid, Space Grotesk display, Apple-grade restraint.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. TOKENS
---------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg:            #07090E;
  --bg-2:          #0A0D14;
  --surface:       #10141D;
  --surface-2:     #161B27;
  --surface-glass: rgba(18, 23, 33, 0.55);

  /* Borders / hairlines */
  --border:        #1C2230;
  --border-strong: #2A3344;
  --hairline:      rgba(255,255,255,0.06);
  --grid-line:     rgba(120,150,200,0.05);

  /* Text */
  --text:          #EAEEF6;
  --text-2:        #AEB6C6;
  --muted:         #828B9E;  /* AA-safe (~4.9:1 on bg-2 / ~4.6:1 on surface) */
  --muted-faint:   #6B7488;  /* reserved for decorative / aria-hidden only */

  /* Accent */
  --accent:        #46E0C0;
  --accent-press:  #2FB89C;
  --accent-ink:    #03171A;
  --accent-glow:   rgba(70,224,192,0.35);
  --accent2:       #7AA2FF;
  --warm:          #FFB454;

  /* Gradients */
  --mesh:
    radial-gradient(60% 50% at 18% 12%,  rgba(70,224,192,0.10), transparent 70%),
    radial-gradient(55% 45% at 82% 60%,  rgba(122,162,255,0.08), transparent 70%);
  --grad-brand: linear-gradient(135deg, #46E0C0 0%, #7AA2FF 100%);
  --grad-text:  linear-gradient(100deg, #EAEEF6 0%, #9FE9DA 55%, #46E0C0 100%);

  /* Fonts */
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans:    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, "JetBrains Mono", "Roboto Mono", monospace;

  /* Type scale */
  --fs-h1:      clamp(2.6rem, 6.5vw, 5.25rem);
  --fs-h2:      clamp(1.9rem, 4vw, 3rem);
  --fs-h3:      clamp(1.25rem, 2vw, 1.6rem);
  --fs-lede:    clamp(1.15rem, 1.6vw, 1.45rem);
  --fs-body:    clamp(1rem, 1.05vw, 1.175rem);
  --fs-small:   0.9rem;
  --fs-eyebrow: 0.78rem;
  --fs-label:   0.75rem;
  --fs-mono:    0.8rem;

  /* Spacing */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;   --s-7: 3rem;    --s-8: 4rem;
  --s-9: 6rem;    --s-10: 8rem;
  --section-pad: clamp(6rem, 12vh, 10rem);
  --gutter: clamp(1.25rem, 5vw, 4rem);

  /* Radius */
  --r-sm: 6px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;

  /* Shadows */
  --shadow-card:  0 1px 0 rgba(255,255,255,0.03) inset, 0 12px 30px -12px rgba(0,0,0,0.6);
  --shadow-lift:  0 1px 0 rgba(255,255,255,0.05) inset, 0 20px 50px -16px rgba(0,0,0,0.7);
  --shadow-glass: 0 8px 40px -12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
  --glow-accent:  0 0 0 1px rgba(70,224,192,0.30), 0 8px 30px -8px rgba(70,224,192,0.25);

  /* Layout */
  --maxw: 1200px;
  --maxw-narrow: 760px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-micro: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------------------------------------------
   2. RESET / BASE
---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text-2);
  background-color: var(--bg-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
/* Pills/rounded controls: let the focus ring hug the real shape. */
.lang-switch__opt:focus-visible,
.chip:focus-visible,
.btn:focus-visible,
.nav-toggle:focus-visible,
.copy-btn:focus-visible,
.intent-btn:focus-visible { outline-offset: 4px; border-radius: inherit; }

::selection { background: var(--accent-glow); color: var(--text); }

/* ----------------------------------------------------------------------------
   3. TYPOGRAPHY HELPERS
---------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.h1 { font-size: var(--fs-h1); letter-spacing: -0.03em; line-height: 1.02; }
.h2 { font-size: var(--fs-h2); letter-spacing: -0.02em; line-height: 1.08; }
.h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; line-height: 1.15; }

.lede {
  font-size: var(--fs-lede);
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--text-2);
}

p { max-width: 62ch; }

.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-5);
}

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

/* ----------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
---------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-pad); position: relative; }
/* Lighter top than bottom so adjacent sections don't stack two full pads of
   dead space — tighter, more composed rhythm without losing the breathing room. */
.section:not(.hero) { padding-top: clamp(4.5rem, 9vh, 7.5rem); }
.section--tight { padding-block: clamp(4rem, 8vh, 7rem); }
.section--tight:not(.hero) { padding-top: clamp(3.5rem, 7vh, 6rem); }
.section--narrow { padding-block: clamp(5rem, 10vh, 8rem); }

.section__head { max-width: 680px; margin-bottom: var(--s-8); }
.section__head--split {
  display: grid; gap: var(--s-5);
  max-width: none;
  grid-template-columns: 1fr;
  align-items: end;
}
.section__sub { color: var(--text-2); margin-top: var(--s-4); }
.section__sub--right { margin-top: 0; }

.prose { max-width: var(--maxw-narrow); margin-inline: auto; }

/* ----------------------------------------------------------------------------
   5. FIXED BACKGROUND LAYERS (grid / grain / mesh)
---------------------------------------------------------------------------- */
.bg-grid, .bg-grain, .bg-mesh {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-grid {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  /* The ever-present blueprint grid: felt full-height, breathing in/out at the
     very top and bottom edges so it never hard-cuts but persists everywhere. */
  mask-image: linear-gradient(to bottom, transparent 0, #000 8%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 8%, #000 88%, transparent 100%);
}
/* Global mesh is now a faint, uniform atmospheric vignette only — the hero
   carries its own content-anchored mesh (see .hero::before) for real depth. */
.bg-mesh {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(70,224,192,0.05), transparent 60%),
    radial-gradient(100% 70% at 100% 100%, rgba(122,162,255,0.035), transparent 60%);
  opacity: 0.9;
}
.bg-grain {
  opacity: 0.04;
  mix-blend-mode: soft-light;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* keep content above bg layers */
.site-header, .site-main, .site-footer, .skip-link, .mobile-nav { position: relative; z-index: 1; }
.site-header { z-index: 50; }
.mobile-nav { z-index: 60; }

/* ----------------------------------------------------------------------------
   6. SKIP LINK + SCANLINE
---------------------------------------------------------------------------- */
.skip-link {
  position: fixed; top: var(--s-3); left: var(--s-3);
  transform: translateY(-200%);
  background: var(--surface-2);
  color: var(--text);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  z-index: 200;
  transition: transform .2s var(--ease-micro);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
}
.skip-link:focus { transform: translateY(0); }

.scanline {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  z-index: 999; opacity: 0; pointer-events: none;
  animation: scan 1.2s var(--ease) .15s 1 forwards;
}
@keyframes scan {
  0%   { opacity: 0; transform: translateY(0) scaleX(0.2); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(2px) scaleX(1); }
}

/* ----------------------------------------------------------------------------
   7. BUTTONS
---------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: 0.85em 1.4em;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: 1;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform .2s var(--ease-micro), box-shadow .24s var(--ease-micro),
              background-color .2s var(--ease-micro), border-color .2s var(--ease-micro),
              color .2s var(--ease-micro);
  will-change: transform;
}
.btn__arrow { transition: transform .2s var(--ease-micro); display: inline-block; }
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn--accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--glow-accent);
}
.btn--accent:hover { background: var(--accent-press); box-shadow: 0 0 0 1px var(--accent), 0 12px 36px -8px var(--accent-glow); }
.btn--accent:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  position: relative;
  overflow: hidden;
}
.btn--ghost::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--grad-brand);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--text); }
.btn--ghost:hover::after { transform: scaleX(1); }

/* ----------------------------------------------------------------------------
   8. CHIPS
---------------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.chip {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: var(--fs-mono);
  color: var(--text-2);
  padding: 0.45em 0.85em;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.015);
  transition: border-color .2s var(--ease-micro), color .2s var(--ease-micro), background-color .2s var(--ease-micro);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chips--lg .chip { font-size: var(--fs-small); padding: 0.6em 1.1em; }
.chips--wall { gap: var(--s-3) var(--s-3); }
.chips--wall .chip:hover { border-color: var(--accent); }

/* ----------------------------------------------------------------------------
   9. HEADER / NAV
---------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background-color .35s var(--ease), backdrop-filter .35s var(--ease),
              border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom-color: var(--hairline);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-5); width: 100%;
}

.brand { display: inline-flex; align-items: center; color: var(--text); }
.brand__full { display: none; }
.brand__mark { display: inline-flex; }
.brand .rb-logo { height: 34px; width: auto; }
.brand .rb-mark { height: 28px; width: 28px; }

.site-nav { display: none; }
.site-nav__list { display: flex; gap: var(--s-6); }
.site-nav__link {
  position: relative;
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: var(--fs-small);
  color: var(--text-2);
  transition: color .2s var(--ease-micro);
}
.site-nav__link::before {
  content: ""; position: absolute; left: 50%; top: 8px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); opacity: 0; transform: translateX(-50%) scale(0.4);
  transition: opacity .2s var(--ease-micro), transform .2s var(--ease-micro);
}
.site-nav__link::after {
  content: ""; position: absolute; left: 0; bottom: 9px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.site-nav__link:hover { color: var(--text); }
.site-nav__link:hover::before { opacity: 1; transform: translateX(-50%) scale(1); }
.site-nav__link.is-active { color: var(--text); }
.site-nav__link.is-active::after { transform: scaleX(1); }

.site-header__actions { display: flex; align-items: center; gap: var(--s-4); }
.site-header__cta { display: none; padding: 0.6em 1.1em; font-size: var(--fs-small); }

/* Language switch */
.lang-switch {
  display: inline-flex; align-items: center; gap: 0;
  font-family: var(--font-mono); font-size: var(--fs-mono);
  padding: 0 0.55em;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.015);
}
.lang-switch__opt {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 36px;
  color: var(--muted); letter-spacing: 0.06em;
  padding: 0 0.3em;
  transition: color .2s var(--ease-micro);
}
.lang-switch__opt::after {
  content: ""; position: absolute; left: 0.3em; right: 0.3em; bottom: 9px; height: 1.5px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transition: transform .25s var(--ease);
}
.lang-switch__opt:hover { color: var(--text-2); }
.lang-switch__opt.is-active { color: var(--text); }
.lang-switch__opt.is-active::after { transform: scaleX(1); }
.lang-switch__sep { color: var(--border-strong); }

/* Nav toggle (hamburger) */
.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 9px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: rgba(255,255,255,0.02);
}
.nav-toggle__bar {
  display: block; height: 1.5px; width: 100%;
  background: var(--text); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease-micro);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

/* ----------------------------------------------------------------------------
   10. MOBILE NAV SHEET
---------------------------------------------------------------------------- */
.mobile-nav {
  position: fixed; inset: 0;
  visibility: hidden; opacity: 0;
  transition: opacity .3s var(--ease), visibility .3s var(--ease);
  background: rgba(7,9,14,0.6);
}
.mobile-nav.is-open { visibility: visible; opacity: 1; }
.mobile-nav__panel {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + var(--s-6)) var(--gutter) var(--s-8);
  background: var(--surface-glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-left: 1px solid var(--hairline);
}
.mobile-nav__list { display: flex; flex-direction: column; gap: var(--s-2); }
.mobile-nav__item {
  opacity: 0; transform: translateY(12px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  transition-delay: calc(var(--i) * 50ms + 80ms);
  border-bottom: 1px solid var(--hairline);
}
.mobile-nav.is-open .mobile-nav__item { opacity: 1; transform: translateY(0); }
.mobile-nav__link {
  display: flex; align-items: baseline; gap: var(--s-4);
  padding: var(--s-5) 0;
  font-family: var(--font-display); font-size: clamp(1.6rem, 7vw, 2.4rem);
  color: var(--text); font-weight: 500; letter-spacing: -0.02em;
}
.mobile-nav__index { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); }
.mobile-nav__footer {
  margin-top: var(--s-8);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-4);
}
.mobile-nav__email { color: var(--text-2); }

/* ----------------------------------------------------------------------------
   11. HERO
---------------------------------------------------------------------------- */
.hero {
  padding-top: clamp(3rem, 8vh, 6rem); padding-bottom: var(--section-pad);
  position: relative; isolation: isolate;
}
.hero--compact { padding-bottom: clamp(3rem, 7vh, 5rem); }
/* Content-anchored hero mesh — travels with the hero, giving real depth. */
.hero::before {
  content: ""; position: absolute; inset: -10% 0 0 0;
  background: var(--mesh);
  pointer-events: none; z-index: -1;
}
.hero__inner {
  display: grid; gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: 1fr;
  align-items: center;
}
.hero__title {
  font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -0.03em;
  margin-block: var(--s-4) var(--s-5);
  max-width: 22ch;
  overflow-wrap: break-word;   /* never let a long word overflow narrow screens */
  hyphens: none;
}
.hero--compact .hero__title { max-width: 18ch; }
.hero__subhead { max-width: 54ch; margin-bottom: var(--s-7); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-bottom: var(--s-6); }
.hero__coords { color: var(--muted); font-size: var(--fs-mono); margin-bottom: var(--s-5); }
.hero__visual { width: 100%; }

.contact-hero { max-width: 720px; }
.hero--contact { padding-bottom: 0; }

/* Hero diagram */
.hero-diagram { width: 100%; }
.hero-diagram__frame {
  position: relative; width: 100%;
  aspect-ratio: 420 / 360;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 100% at 30% 10%, rgba(70,224,192,0.06), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.hero-diagram__frame::before {
  /* corner coordinate ticks */
  content: ""; position: absolute; inset: 12px;
  border: 1px dashed var(--border); border-radius: var(--r-lg);
  pointer-events: none; opacity: 0.5;
}
.hero-diagram__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-diagram__static { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
/* No-JS: the canvas never draws, so show the finished static blueprint. */
.no-js .hero-diagram__static { opacity: 1; }
.no-js .hero-diagram__canvas { display: none; }
.hero-diagram__caption {
  position: absolute; left: 16px; bottom: 14px;
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-mono); color: var(--muted);
}
.hero-diagram__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* App phone motif */
.app-motif {
  width: 100%;
  border: 1px solid var(--border); border-radius: var(--r-xl);
  background:
    radial-gradient(120% 100% at 30% 10%, rgba(70,224,192,0.05), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  aspect-ratio: 360 / 380;
}
.app-motif__svg { width: 100%; height: 100%; }
.app-motif__phone { animation: float 7s var(--ease) infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ----------------------------------------------------------------------------
   12. WHAT WE DO / PRINCIPLES
---------------------------------------------------------------------------- */
.what__grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); grid-template-columns: 1fr; }
.what__body { color: var(--text-2); margin-top: var(--s-5); }
.principles { display: flex; flex-direction: column; gap: var(--s-5); }
.principle {
  display: flex; gap: var(--s-4);
  padding: var(--s-5) 0;
  border-top: 1px solid var(--hairline);
}
.principle__tick {
  flex: none; width: 10px; height: 10px; margin-top: 6px;
  border: 1.5px solid var(--accent); border-radius: 3px;
  position: relative;
}
.principle__tick::after {
  content: ""; position: absolute; inset: 2px; border-radius: 1px;
  background: var(--accent); opacity: 0.5;
}
.principle__title {
  font-family: var(--font-mono); font-size: var(--fs-small);
  letter-spacing: 0.04em; color: var(--text);
  text-transform: none; margin-bottom: var(--s-2);
}
.principle__desc { color: var(--text-2); font-size: var(--fs-small); }

/* ----------------------------------------------------------------------------
   13. CARDS (services / values / quality)
---------------------------------------------------------------------------- */
.cards { display: grid; gap: var(--s-5); grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--s-4);
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card__top { display: flex; align-items: center; justify-content: space-between; }
.card__index { font-size: var(--fs-mono); color: var(--muted); }
.card__icon { color: var(--accent); }
.card__icon svg { width: 26px; height: 26px; }
.card__title { color: var(--text); }
.card__body { color: var(--text-2); font-size: var(--fs-small); flex: 1; }
.card__more {
  align-self: flex-start; margin-top: var(--s-2);
  color: var(--muted); font-size: 1.1rem; line-height: 1;
  transition: transform .2s var(--ease-micro), color .2s var(--ease-micro);
}
.card:hover .card__more { color: var(--accent); transform: translateX(4px); }
.card__node {
  position: absolute; top: -30px; right: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  opacity: 0; transition: opacity .35s var(--ease);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card:hover .card__node { opacity: 0.5; }

.card--value .card__index { color: var(--accent); }
.card--quality { gap: var(--s-3); }
.card__qtick {
  width: 24px; height: 24px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  position: relative;
}
.card__qtick::after {
  content: ""; position: absolute; left: 7px; top: 11px; width: 5px; height: 9px;
  border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  transform: rotate(40deg);
}

/* ----------------------------------------------------------------------------
   14. TIMELINE / APPROACH
---------------------------------------------------------------------------- */
.timeline {
  position: relative;
  display: grid; gap: var(--s-6);
  grid-template-columns: 1fr;
}
.timeline__line {
  position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px;
  background: var(--border);
}
.timeline__line i {
  display: block; width: 100%; height: 0;
  background: var(--grad-brand);
  transition: height 1.1s var(--ease);
}
.timeline.is-drawn .timeline__line i { height: 100%; }
.step { position: relative; padding-left: var(--s-7); }
.step__node {
  position: absolute; left: 0; top: 6px;
  width: 11px; height: 11px; border-radius: 3px;
  background: var(--surface); border: 1.5px solid var(--border-strong);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.timeline.is-drawn .step__node {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(70,224,192,0.10);
}
.step__num {
  font-size: clamp(2rem, 4vw, 3rem); color: var(--text-2); opacity: 0.7;
  font-variant-numeric: tabular-nums; display: block; line-height: 1;
  transition: color .5s var(--ease), opacity .5s var(--ease);
}
.timeline.is-drawn .step__num { color: var(--accent); opacity: 1; }
.step__title { color: var(--text); margin-block: var(--s-3) var(--s-2); }
.step__body { color: var(--text-2); font-size: var(--fs-small); max-width: 40ch; }

/* ----------------------------------------------------------------------------
   15. PROOF / STATS / CREDS
---------------------------------------------------------------------------- */
.proof__grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); grid-template-columns: 1fr; }
.proof__body { color: var(--text-2); margin-top: var(--s-5); }
.stats { display: flex; flex-wrap: wrap; gap: var(--s-7); margin-top: var(--s-7); }
.stat { display: flex; flex-direction: column; gap: var(--s-2); }
.stat__value {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3rem); color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.stat__label { font-size: var(--fs-small); color: var(--muted); max-width: 18ch; }

.creds { display: flex; flex-direction: column; gap: 0; }
.cred {
  display: flex; gap: var(--s-4);
  padding: var(--s-5) 0;
  border-top: 1px solid var(--hairline);
}
.cred:last-child { border-bottom: 1px solid var(--hairline); }
.cred__dot {
  flex: none; width: 8px; height: 8px; margin-top: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
}
.cred__title { color: var(--text); font-size: var(--fs-body); font-family: var(--font-display); font-weight: 500; margin-bottom: var(--s-1); }
.cred__desc { color: var(--text-2); font-size: var(--fs-small); }

/* ----------------------------------------------------------------------------
   16. CTA BAND
---------------------------------------------------------------------------- */
.cta-band { position: relative; padding-block: var(--section-pad); overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: var(--bg);
}
.cta-band__mesh {
  position: absolute; inset: 0; opacity: 1;
  background:
    radial-gradient(60% 60% at 30% 0%, rgba(70,224,192,0.16), transparent 70%),
    radial-gradient(55% 55% at 80% 100%, rgba(122,162,255,0.12), transparent 70%);
}
.cta-band .wrap { position: relative; }
.cta-band__panel {
  text-align: center;
  max-width: var(--maxw-narrow); margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-glass), 0 0 60px -20px var(--accent-glow);
}
.cta-band__title { font-size: var(--fs-h2); margin-bottom: var(--s-4); }
.cta-band__body { color: var(--text-2); max-width: 48ch; margin: 0 auto var(--s-6); }
.cta-band__btn { margin-inline: auto; }
.cta-band__addr { margin-top: var(--s-5); color: var(--muted); font-size: var(--fs-mono); }

/* ----------------------------------------------------------------------------
   17. APP PAGE: platforms / why / arch layers / tech / process / quality
---------------------------------------------------------------------------- */
.platforms__inner { display: grid; gap: var(--s-6); align-items: center; }
.platforms__head .h3 { color: var(--text); }

.arch__grid { display: grid; gap: clamp(2.5rem, 6vw, 4rem); grid-template-columns: 1fr; }
.arch__body { color: var(--text-2); margin-top: var(--s-5); }
.layers { display: flex; flex-direction: column; gap: var(--s-4); }
.layer { position: relative; }
.layer__panel {
  padding: var(--s-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.layer:hover .layer__panel { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.layer__connector {
  position: absolute; left: 50%; top: -16px; height: 16px; width: 1px;
  background: var(--border); transform: translateX(-50%);
}
.layer:first-child .layer__connector { display: none; }
.layer.is-revealed .layer__connector { background: var(--grad-brand); }
.layer__num { font-size: var(--fs-mono); color: var(--accent); }
.layer__title { color: var(--text); margin-block: var(--s-2) var(--s-2); }
.layer__desc { color: var(--text-2); font-size: var(--fs-small); }

.process-list {
  position: relative;
  display: flex; flex-direction: column; gap: var(--s-7);
  margin-top: var(--s-7);
}
.process-list__line {
  position: absolute; left: 6px; top: 10px; bottom: 10px; width: 1px;
  background: var(--border);
}
.process-list__line i { display: block; width: 100%; height: 0; background: var(--grad-brand); transition: height 1.2s var(--ease); }
.process-list.is-drawn .process-list__line i { height: 100%; }
.process-step { position: relative; padding-left: var(--s-7); display: flex; flex-direction: column; gap: var(--s-2); }
.process-step__node {
  position: absolute; left: 0; top: 6px;
  width: 13px; height: 13px; border-radius: 4px;
  background: var(--surface); border: 1.5px solid var(--border-strong);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.process-list.is-drawn .process-step__node { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(70,224,192,0.10); }
.process-step__num {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem); color: var(--text-2); opacity: 0.7;
  font-variant-numeric: tabular-nums; line-height: 1;
  transition: color .5s var(--ease), opacity .5s var(--ease);
}
.process-list.is-drawn .process-step__num { color: var(--accent); opacity: 1; }
.process-step__title { color: var(--text); }
.process-step__body { color: var(--text-2); font-size: var(--fs-small); max-width: 52ch; }

.process__note {
  display: flex; gap: var(--s-4); align-items: flex-start;
  margin-top: var(--s-8);
  padding: var(--s-6);
  background: linear-gradient(180deg, rgba(70,224,192,0.04), transparent), var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--r-lg);
  color: var(--text-2);
  font-size: var(--fs-small);
  max-width: 70ch;
}
.process__note-spark {
  flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%;
  background: var(--warm); box-shadow: 0 0 12px rgba(255,180,84,0.5);
}

/* ----------------------------------------------------------------------------
   18. CONTACT
---------------------------------------------------------------------------- */
.contact__grid { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
.contact-card, .contact-map {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.contact-card { padding: clamp(1.75rem, 4vw, 2.75rem); }
.contact-card__heading {
  font-size: var(--fs-eyebrow); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--s-6);
}
.contact-card__rows { display: flex; flex-direction: column; }
.contact-row {
  display: grid; grid-template-columns: 1fr; gap: var(--s-1);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--hairline);
}
.contact-row:first-child { border-top: none; padding-top: 0; }
.contact-row__label {
  font-size: var(--fs-mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.contact-row__value { color: var(--text); }
.contact-row__value--email { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.contact-row__value--email a { color: var(--accent); }
.contact-row__value--email a:hover { text-decoration: underline; }

.copy-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 40px; padding: 0.5em 0.85em;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-2); font-family: var(--font-mono); font-size: var(--fs-mono);
  transition: border-color .2s var(--ease-micro), color .2s var(--ease-micro);
}
.copy-btn:hover { border-color: var(--border-strong); color: var(--text); }
.copy-btn.is-copied { border-color: var(--accent); color: var(--accent); }
.contact-card__cta { margin-top: var(--s-7); }

.contact-map { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-5); }
.contact-map__frame {
  position: relative; aspect-ratio: 4 / 3;
  border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--border);
}
.contact-map__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.contact-map__tag {
  position: absolute; left: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: 0.5em 0.85em;
  background: var(--surface-glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--hairline); border-radius: var(--r-pill);
  font-size: var(--fs-mono); color: var(--text);
}
.contact-map__pin-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 2.4s var(--ease) infinite;
}
.contact-map__coords { color: var(--muted); }
.contact-note { padding: var(--s-4) var(--s-3) var(--s-3); }
.contact-note__heading {
  font-size: var(--fs-eyebrow); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--s-3);
}
.contact-note__body { color: var(--text-2); font-size: var(--fs-small); }

.intent-list { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
.intent-btn {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-5) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text);
  transition: border-color .25s var(--ease), transform .25s var(--ease), background-color .25s var(--ease);
}
.intent-btn:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--surface-2); }
.intent-btn__index { color: var(--accent); font-size: var(--fs-mono); }
.intent-btn__label { flex: 1; font-family: var(--font-display); font-weight: 500; }
.intent-btn__arrow { color: var(--muted); transition: transform .2s var(--ease-micro), color .2s var(--ease-micro); }
.intent-btn:hover .intent-btn__arrow { transform: translateX(4px); color: var(--accent); }

/* ----------------------------------------------------------------------------
   19. FOOTER
---------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-block: var(--s-9) var(--s-6);
  margin-top: var(--s-8);
}
.site-footer__top {
  display: grid; gap: var(--s-7);
  grid-template-columns: 1fr;
  padding-bottom: var(--s-7);
  border-bottom: 1px solid var(--hairline);
}
.site-footer__brand { display: flex; flex-direction: column; gap: var(--s-3); }
.site-footer__logo { color: var(--text-2); }
.site-footer__logo .rb-mark { width: 26px; height: 26px; }
.site-footer__wordmark {
  font-family: var(--font-display); font-weight: 500; font-size: 1.4rem;
  color: var(--text); letter-spacing: -0.02em;
}
.site-footer__tagline { color: var(--text-2); font-size: var(--fs-small); max-width: 40ch; }
.site-footer__heading {
  font-size: var(--fs-label); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--s-4);
}
.site-footer__list { display: flex; flex-direction: column; gap: var(--s-3); }
.site-footer__list a { color: var(--text-2); font-size: var(--fs-small); transition: color .2s var(--ease-micro); }
.site-footer__list a:hover { color: var(--accent); }
.site-footer__address { font-style: normal; display: flex; flex-direction: column; gap: var(--s-2); }
.site-footer__company { color: var(--text); font-weight: 500; }
.site-footer__addr-line { color: var(--text-2); font-size: var(--fs-small); }
.site-footer__email { color: var(--accent); font-size: var(--fs-small); width: max-content; }
.site-footer__email:hover { text-decoration: underline; }
.site-footer__region { color: var(--muted); font-size: var(--fs-mono); }

.site-footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4);
  justify-content: space-between;
  padding-top: var(--s-6);
}
.site-footer__copy, .site-footer__legal { color: var(--muted); font-size: var(--fs-mono); }
.site-footer__baseline {
  margin-top: var(--s-6); color: var(--border-strong); font-size: 0.7rem;
  letter-spacing: 0.1em; opacity: 0.6;
}

/* ----------------------------------------------------------------------------
   20. SCROLL-REVEAL (JS adds .is-visible)
---------------------------------------------------------------------------- */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ----------------------------------------------------------------------------
   21. RESPONSIVE
---------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .brand__full { display: inline-flex; }
  .brand__mark { display: none; }
  .site-nav { display: block; }
  .nav-toggle { display: none; }
  .site-header__cta { display: inline-flex; }
  .mobile-nav { display: none; }

  .cards--3 { grid-template-columns: repeat(2, 1fr); }
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  /* 3 short value cards go straight to 3-up at md (no lonely trailing card). */
  .why .cards { grid-template-columns: repeat(3, 1fr); }
  .contact__grid { grid-template-columns: 1.05fr 0.95fr; }
  .intent-list { grid-template-columns: repeat(3, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .timeline__line { display: none; }
  .step { padding-left: 0; padding-top: var(--s-6); border-top: 1px solid var(--hairline); }
  .step__node { left: 0; top: -6px; }
  .platforms__inner { grid-template-columns: auto 1fr; align-items: center; }
  .platforms__inner .chips { margin-top: 0; justify-content: flex-end; }
  .section__head--split { grid-template-columns: 1.1fr 0.9fr; }

  /* Controlled, even hero line-breaks only where the viewport is wide enough
     that balancing can't push a line past the edge. */
  .hero__title { text-wrap: balance; }
}

@media (min-width: 1024px) {
  .hero__inner { grid-template-columns: 1.05fr 0.95fr; }
  .hero__inner--compact { grid-template-columns: 1.1fr 0.9fr; }
  .what__grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .proof__grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .cards--3 { grid-template-columns: repeat(3, 1fr); }
  .cards--4 { grid-template-columns: repeat(4, 1fr); }
  .timeline { grid-template-columns: repeat(4, 1fr); }
  .arch__grid { grid-template-columns: 0.95fr 1.05fr; align-items: start; }
  .arch__sticky { position: sticky; top: calc(var(--nav-h) + var(--s-6)); }
}

@media (min-width: 1200px) {
  /* ---- Ruler gutter: the drafting-sheet section indices (01 02 03…). ----
     A persistent thin left index column, the signature of the whole concept.
     Uses ::after so it never collides with the hero's ::before mesh. */
  [data-index]::after {
    content: attr(data-index);
    position: absolute;
    left: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + 0.75rem));
    top: clamp(4.5rem, 9vh, 7.5rem);
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    letter-spacing: 0.14em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    opacity: 0.85;
  }
  .hero[data-index]::after { top: clamp(3rem, 8vh, 6rem); }
  .section--tight[data-index]::after { top: clamp(3.5rem, 7vh, 6rem); }
  .cta-band[data-index]::after { top: var(--section-pad); }

  /* A 1px vertical hairline drawn at the ruler edge, full page height. */
  body::before {
    content: ""; position: fixed; top: 0; bottom: 0;
    left: max(calc(var(--gutter) + 2.6rem), calc((100vw - var(--maxw)) / 2 + 3.2rem));
    width: 1px; background: var(--hairline);
    z-index: 0; pointer-events: none;
  }
}

/* ----------------------------------------------------------------------------
   22. PREFERS-REDUCED-MOTION
---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .scanline { display: none !important; }
  .hero-diagram__canvas { display: none; }
  .hero-diagram__static { opacity: 1 !important; }
  .app-motif__phone { animation: none !important; }
  .timeline__line i, .process-list__line i { height: 100% !important; transition: none !important; }
  .timeline .step__node, .process-list .process-step__node { border-color: var(--accent); }
  .hero-diagram__dot, .contact-map__pin-dot { animation: none !important; }
}

/* Fallback for browsers without color-mix (graceful, not broken). */
@supports not (background: color-mix(in srgb, red, blue)) {
  .card:hover, .layer:hover .layer__panel { border-color: var(--border-strong); }
  .cta-band__panel { border-color: var(--border-strong); }
}
