/* ============================================================
   RapidAITech — design system
   Palette: Claude clay orange + warm cream + near-black ink
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* brand ramp */
  --clay-50:  #FDF4EF;
  --clay-100: #FBE6DA;
  --clay-200: #F5C9B2;
  --clay-300: #EDA687;
  --clay-400: #E58A66;
  --clay:     #D97757;   /* core Claude clay */
  --clay-600: #C25E3C;
  --clay-700: #9E4A2E;
  --ember:    #F0834E;

  /* neutrals */
  --cream:    #FAF9F5;
  --cream-2:  #F4F1EA;
  --cream-3:  #EBE6DB;
  --white:    #FFFFFF;
  --ink:      #141413;
  --ink-2:    #1C1B19;
  --ink-3:    #262421;
  --ink-4:    #35322D;

  /* themed tokens — overridden per section */
  --bg:        var(--cream);
  --bg-elev:   var(--white);
  --fg:        var(--ink);
  --fg-muted:  #6B6660;
  --fg-faint:  #97918A;
  --line:      #E2DDD2;
  --line-soft: #EDE9E0;
  --accent:    var(--clay-600);
  --accent-2:  var(--clay);
  --shadow:    0 1px 2px rgba(20,20,19,.04), 0 12px 32px -12px rgba(20,20,19,.10);
  --shadow-lg: 0 2px 4px rgba(20,20,19,.05), 0 32px 64px -24px rgba(20,20,19,.22);

  /* type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* geometry */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --pad:  clamp(20px, 5vw, 40px);
  --maxw: 1240px;
  --nav-h: 70px;

  /* motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --t-fast: .18s var(--ease);
  --t: .34s var(--ease);
  --t-slow: .7s var(--ease-out);
}

/* Dark theme block — applied to sections carrying .theme-ink */
.theme-ink {
  --bg:        var(--ink);
  --bg-elev:   var(--ink-3);
  --fg:        #F7F4EE;
  --fg-muted:  #A8A29A;
  --fg-faint:  #7A746C;
  --line:      rgba(247,244,238,.13);
  --line-soft: rgba(247,244,238,.07);
  --accent:    var(--ember);
  --accent-2:  var(--clay-300);
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 16px 40px -16px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 40px 80px -30px rgba(0,0,0,.75);
}
.theme-cream { --bg: var(--cream); --bg-elev: var(--white); }
.theme-white { --bg: var(--white); --bg-elev: var(--cream); --line: var(--line-soft); }
.theme-clay {
  --bg: var(--clay-50);
  --bg-elev: var(--white);
  --line: var(--clay-200);
  --line-soft: var(--clay-100);
  --fg-muted: #7A6154;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
:focus-visible {
  outline: 2px solid var(--clay-600);
  outline-offset: 3px;
  border-radius: 4px;
}
.theme-ink :focus-visible { outline-color: var(--ember); }
::selection { background: var(--clay-200); color: var(--ink); }

/* ---------- 3. Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.wrap-narrow { max-width: 880px; }
section[class*="theme-"] {
  background: var(--bg);
  color: var(--fg);
  position: relative;
}
.section { padding-block: clamp(80px, 11vw, 148px); }
.section-sm { padding-block: clamp(56px, 7vw, 84px); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Grain overlay — soft film texture across the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .04;
  background-image: var(--grain);
  mix-blend-mode: multiply;
}

/* ---------- 4. Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -.028em;
  line-height: 1.06;
  text-wrap: balance;
}
.h-display { font-size: clamp(2.65rem, 7.2vw, 5.1rem); line-height: 1.02; letter-spacing: -.042em; }
.h1 { font-size: clamp(2.15rem, 5.2vw, 3.55rem); }
.h2 { font-size: clamp(1.88rem, 4.2vw, 3rem); }
.h3 { font-size: clamp(1.18rem, 2vw, 1.4rem); letter-spacing: -.02em; line-height: 1.28; }
.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.012em;
}
.grad {
  background: linear-gradient(100deg, var(--ember) 0%, var(--clay) 45%, var(--clay-600) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.66;
  color: var(--fg-muted);
  text-wrap: pretty;
  max-width: 62ch;
}
.muted { color: var(--fg-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .5;
}
.eyebrow.is-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  opacity: 1;
  animation: pulse-dot 2.6s var(--ease) infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(217,119,87,.28); }
  50%      { box-shadow: 0 0 0 8px rgba(217,119,87,0); }
}

.section-head { max-width: 760px; margin-bottom: clamp(40px, 5.5vw, 68px); }
.section-head .h2 { margin-top: 18px; }
.section-head .lede { margin-top: 20px; }
.section-head.is-center { margin-inline: auto; text-align: center; }
.section-head.is-center .lede { margin-inline: auto; }

/* ---------- 5. Buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--cream);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 100px;
  font-size: .93rem;
  font-weight: 550;
  letter-spacing: -.012em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t), background-color var(--t), color var(--t), border-color var(--t);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -10px rgba(20,20,19,.45); }
.btn:active { transform: translateY(0); }
.btn svg { flex: none; transition: transform var(--t); }
.btn:hover svg { transform: translateX(3px); }

.btn-primary {
  background: linear-gradient(135deg, var(--ember), var(--clay-600));
  color: #fff;
  box-shadow: 0 1px 2px rgba(154,74,46,.3), 0 10px 24px -12px rgba(194,94,60,.85);
}
.btn-primary:hover { box-shadow: 0 2px 4px rgba(154,74,46,.3), 0 16px 34px -12px rgba(194,94,60,.95); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: rgba(128,128,128,.08);
  border-color: var(--fg-faint);
  box-shadow: none;
}
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-sm { padding: 9px 16px; font-size: .84rem; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.link-u {
  position: relative;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.link-u::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t);
}
.link-u:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- 6. Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: .8rem;
  font-weight: 500;
  color: var(--fg-muted);
}
.chip b { color: var(--fg); font-weight: 600; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- 7. Scroll progress ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--clay-600), var(--ember), var(--clay-300));
  z-index: 1200;
  pointer-events: none;
}

/* ---------- 8. Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color var(--t), border-color var(--t);
}
.nav.is-stuck {
  background: rgba(250,249,245,.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line-soft);
}
body[data-nav="dark"] .nav.is-stuck {
  background: rgba(20,20,19,.72);
  border-bottom-color: rgba(255,255,255,.1);
}
.nav-inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 1.04rem;
  letter-spacing: -.028em;
  color: var(--ink);
  transition: color var(--t);
}
body[data-nav="dark"] .brand { color: #F7F4EE; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand i { font-style: normal; color: var(--clay-600); }
body[data-nav="dark"] .brand i { color: var(--ember); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  padding: 8px 13px;
  border-radius: 8px;
  font-size: .89rem;
  font-weight: 500;
  color: #58534C;
  transition: color var(--t), background-color var(--t);
}
body[data-nav="dark"] .nav-links a { color: #A8A29A; }
.nav-links a:hover { color: var(--ink); background: rgba(20,20,19,.05); }
body[data-nav="dark"] .nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-links a.is-active { color: var(--clay-600); }
body[data-nav="dark"] .nav-links a.is-active { color: var(--ember); }
.nav-cta { margin-left: 10px; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border-radius: 11px;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 17px;
  height: 1.6px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t-fast);
}
body[data-nav="dark"] .nav-toggle { color: #F7F4EE; border-color: rgba(255,255,255,.18); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }

.nav-mobile {
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  background: rgba(250,249,245,.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 14px var(--pad) 26px;
  display: none;
  flex-direction: column;
  z-index: 999;
  animation: drop .3s var(--ease-out);
}
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }
.nav-mobile.is-open { display: flex; }
.nav-mobile a {
  padding: 14px 4px;
  font-size: 1.1rem;
  font-weight: 550;
  letter-spacing: -.02em;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}
.nav-mobile a:last-of-type { border-bottom: 0; }
.nav-mobile .btn { margin-top: 16px; }
