/* ============================================================
   PALADIO — Foundational layers for enterprise AI
   Design system: Palladian architecture meets AI-native SaaS
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces — one warm paper-and-ink family, inverted for dark sections */
  --paper: #F2F0EA;
  --paper-2: #EAE7DE;
  --surface: #FDFCFA;
  --ink: #17140E;
  --ink-800: #2A2620;
  --ink-700: #443F35;
  --ink-500: #6F6A5E;
  --ink-400: #948F81;
  --ink-300: #BEB9AD;

  /* Hairlines */
  --line: rgba(23, 20, 14, 0.12);
  --line-soft: rgba(23, 20, 14, 0.07);
  --line-strong: rgba(23, 20, 14, 0.22);

  /* Brand — palladium indigo (accent is tweakable; soft variants derive from it) */
  --accent: #4A3AFF;
  --accent-ink: color-mix(in srgb, var(--accent) 80%, #000 20%);
  --accent-soft: color-mix(in srgb, var(--accent) 8%, transparent);
  --accent-soft-2: color-mix(in srgb, var(--accent) 14%, transparent);
  --hero-scale: 1;

  /* Layer coding (muted, harmonious) */
  --flux:    #4A3AFF;  /* connect  — indigo */
  --fabric:  #7C3AED;  /* understand — violet */
  --fidelity:#0E8A6B;  /* trust — green */
  --forge:   #C2591B;  /* build — amber */

  /* Dark surfaces — warm deep ink, same family as paper */
  --dark: #17140E;
  --dark-2: #221E16;
  --dark-3: #2B261C;
  --dark-line: rgba(242, 240, 234, 0.13);
  --dark-line-soft: rgba(242, 240, 234, 0.07);
  --dark-ink-500: #A8A293;
  --dark-ink-300: #D8D3C7;
  --on-dark: #F2F0EA; /* warm paper-white for text on ink (never pure #fff) */
  --accent-on-dark: color-mix(in srgb, var(--accent) 58%, #ffffff); /* lightened accent legible on ink */

  /* Type */
  --sans: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 80px);
  --section-y: clamp(80px, 12vh, 168px);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv01";
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: 1440px; }
.section { padding-block: var(--section-y); position: relative; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.eyebrow.no-dot::before { display: none; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 0.98; text-wrap: balance; }
.display {
  font-size: clamp(2.9rem, 8vw, 7.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.92;
}
.h-xl { font-size: clamp(2.4rem, 5.5vw, 4.6rem); letter-spacing: -0.04em; line-height: 0.96; }
.h-lg { font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -0.035em; }
.h-md { font-size: clamp(1.5rem, 2.4vw, 2.1rem); letter-spacing: -0.025em; line-height: 1.04; }
.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  line-height: 1.45;
  color: var(--ink-700);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.muted { color: var(--ink-500); }
.measure { max-width: 36ch; }
.measure-wide { max-width: 52ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px;
  border-radius: 100px;
  font-size: 15px; font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform .25s cubic-bezier(.2,.7,.3,1), background .2s, color .2s, box-shadow .25s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); box-shadow: 0 10px 30px -10px var(--accent); }
.btn-ghost { color: var(--ink); border: 1px solid var(--line-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.btn .arr { transition: transform .25s cubic-bezier(.2,.7,.3,1); }
.btn:hover .arr { transform: translateX(4px); }
.btn-lg { padding: 16px 28px; font-size: 16px; }

/* on-dark variants */
.on-dark .btn-primary { background: var(--on-dark); color: var(--ink); }
.on-dark .btn-primary:hover { background: var(--accent); color: var(--on-dark); }
.on-dark .btn-ghost { color: var(--on-dark); border-color: var(--dark-line); }
.on-dark .btn-ghost:hover { background: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }

/* ---------- Reveal animation ----------
   Content is visible by default. Hiding only applies once <html> has
   .anim-ready, which is removed if the animation timeline is frozen. */
.anim-ready .reveal { opacity: 0; transform: translateY(26px); }
@media (prefers-reduced-motion: no-preference) {
  .anim-ready .reveal { transition: opacity .9s cubic-bezier(.2,.7,.3,1), transform .9s cubic-bezier(.2,.7,.3,1); }
}
.anim-ready .reveal.in { opacity: 1; transform: none; }
.anim-ready .reveal.d1 { transition-delay: .07s; }
.anim-ready .reveal.d2 { transition-delay: .14s; }
.anim-ready .reveal.d3 { transition-delay: .21s; }
.anim-ready .reveal.d4 { transition-delay: .28s; }

/* ---------- Tag / chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
  padding: 7px 12px; border-radius: 100px;
  border: 1px solid var(--line); color: var(--ink-700);
  background: var(--surface);
  white-space: nowrap; flex: none;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-400); flex:none; }

/* dark section base */
.dark { background: var(--dark); color: var(--on-dark); }
.dark .lead { color: var(--dark-ink-300); }
.dark .muted { color: var(--dark-ink-500); }
.dark .eyebrow { color: var(--dark-ink-500); }
.dark .chip { background: rgba(255,255,255,.04); border-color: var(--dark-line); color: var(--dark-ink-300); }

/* utility */
.divider { height: 1px; background: var(--line); width: 100%; }
.kicker-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; }
.center { text-align: center; }
.mono { font-family: var(--mono); }

/* ============================================================
   RESPONSIVE — global guards (loaded on every page)
   ============================================================ */
/* Wide fixed-viewBox diagrams: let them keep a readable size and scroll
   horizontally on small screens instead of shrinking into illegibility. */
@media (max-width: 680px) {
  .flow-stage, .frag-stage { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .flow-stage > svg, .frag-stage > svg { min-width: 620px; }
  .flow-stage, .frag-stage { scrollbar-width: thin; }
}

/* Nav: shed secondary items before the logo + primary CTA crowd. */
@media (max-width: 560px) {
  .nav-login { display: none; }
  .nav-cta { gap: 10px; }
  .nav-cta .btn { padding: 9px 15px; }
  .pnav-back { display: none; }
}

/* Pipelines (product narratives) already stack < 760px; keep their arrows tidy.
   Outcome / metric numbers shouldn't overflow their cells on phones. */
@media (max-width: 460px) {
  .out-cell .om { font-size: clamp(2.6rem, 16vw, 3.4rem); }
  .cs-metrics .mv { font-size: clamp(2.2rem, 13vw, 3rem); }
}

/* Tighten section rhythm + gutters on small screens. */
@media (max-width: 560px) {
  :root { --section-y: clamp(56px, 9vh, 96px); }
  .hero { padding-top: 120px; }
  .phero, .about-hero { padding-top: 112px; }
}

/* ---------- Mobile nav (hamburger + dropdown) ---------- */
.nav-burger { display: none; width: 42px; height: 42px; border-radius: 11px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; border: 1px solid var(--line-strong); background: var(--surface); flex: none; }
.nav-burger span { display: block; width: 16px; height: 1.7px; background: var(--ink); border-radius: 2px; transition: transform .28s cubic-bezier(.2,.7,.3,1), opacity .2s; }
.nav.menu-open .nav-burger span:nth-child(1) { transform: translateY(5.7px) rotate(45deg); }
.nav.menu-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.menu-open .nav-burger span:nth-child(3) { transform: translateY(-5.7px) rotate(-45deg); }
.nav-mobile { display: none; position: absolute; top: 100%; left: 0; right: 0; background: rgba(244,243,239,.97); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); padding: 10px var(--gutter) 22px; flex-direction: column; }
.nav-mobile a { padding: 14px 2px; font-size: 17px; letter-spacing: -0.01em; color: var(--ink-800); border-bottom: 1px solid var(--line-soft); }
.nav-mobile a:last-of-type { border-bottom: none; }
.nav-mobile .btn { margin-top: 16px; justify-content: center; }
.nav.menu-open .nav-mobile { display: flex; }
@media (max-width: 920px) {
  .nav-burger { display: flex; }
}
@media (min-width: 921px) {
  .nav-mobile { display: none !important; }
}
@media (max-width: 760px) {
  .pnav .pnav-back { display: none; }
}
