/* ===================================================================
   ROVIA — Design System Tokens & Base Styles
   Engineering-inspired transportation & logistics
   =================================================================== */

:root {
  /* --- Surfaces (light, warm) --- */
  --bg-primary:    #F3F1EC;
  --bg-secondary:  #ECE9E3;
  --bg-tertiary:   #F7F5F1;
  --surface-card:  #FCFBF8;
  --bg-footer:     #21333B;

  /* --- Brand --- */
  --brand:         #264653;
  --brand-hover:   #2F5D6B;
  --brand-active:  #1C3640;
  --accent:        #D99041;
  --accent-soft:   #E8B583;

  /* --- Text --- */
  --text-primary:   #1D2939;
  --text-secondary: #667085;
  --text-on-brand:  #F7F5F1;

  /* --- Lines / borders --- */
  --line:          #D8DAD6;
  --line-strong:   #C4C7C0;

  /* --- Radii --- */
  --r-card: 24px;
  --r-ui:   16px;
  --r-pill: 999px;

  /* --- Shadows (minimal) --- */
  --shadow-sm: 0 1px 2px rgba(38,70,83,0.04), 0 1px 1px rgba(38,70,83,0.03);
  --shadow-md: 0 6px 18px rgba(38,70,83,0.07), 0 2px 6px rgba(38,70,83,0.04);
  --shadow-lg: 0 18px 48px rgba(38,70,83,0.12), 0 6px 16px rgba(38,70,83,0.06);

  /* --- Motion --- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 200ms;
  --dur-mid:  300ms;
  --dur-slow: 400ms;

  /* --- Layout --- */
  --maxw: 1440px;
  --margin: 80px;
  --gutter: 32px;

  /* --- Tweak-driven (set by Tweaks panel) --- */
  --grid-op: 1;
  --coord-vis: visible;

  /* --- Fonts --- */
  --font-head: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  color: var(--brand);
  margin: 0;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.h1 { font-size: 72px; font-weight: 700; line-height: 1.10; }
.h2 { font-size: 56px; font-weight: 700; line-height: 1.15; }
.h3 { font-size: 40px; font-weight: 700; line-height: 1.20; }
.h4 { font-size: 28px; font-weight: 600; line-height: 1.30; }
.h5 { font-size: 22px; font-weight: 600; line-height: 1.40; }

.body-lg { font-size: 20px; line-height: 1.6; }
.body    { font-size: 18px; line-height: 1.6; }
.body-sm { font-size: 16px; line-height: 1.5; }
.caption { font-size: 14px; line-height: 1.4; }

p { margin: 0; text-wrap: pretty; }

/* monospace technical annotation */
.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--margin);
  padding-right: var(--margin);
}
.section {
  padding-block: 96px;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

/* eyebrow / kicker label */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  border-radius: var(--r-ui);
  padding: 15px 26px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-hover); box-shadow: var(--shadow-md); }
.btn-primary:active { background: var(--brand-active); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: #C87E30; box-shadow: var(--shadow-md); }

.btn-secondary {
  background: transparent;
  color: var(--brand);
  border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--brand); background: rgba(38,70,83,0.04); }

.btn-ghost {
  background: transparent;
  color: var(--brand);
  padding-inline: 4px;
}
.btn-ghost:hover { color: var(--accent); }

.btn .arrow { transition: transform var(--dur-fast) var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Route / blueprint primitives ---------- */
.node-dot {
  fill: var(--surface-card);
  stroke: var(--brand);
  stroke-width: 2;
}
.node-dot--accent { stroke: var(--accent); }

/* dashed technical guide line */
.guide-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 5; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 80ms; }
.reveal.d2 { transition-delay: 160ms; }
.reveal.d3 { transition-delay: 240ms; }
.reveal.d4 { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Drawing animation for route lines ---------- */
@keyframes flow {
  to { stroke-dashoffset: -1000; }
}

/* moving node along path */
@keyframes pulse {
  0%, 100% { opacity: 0.4; r: 4; }
  50%      { opacity: 1;   r: 6; }
}

/* ---------- Responsive scale ---------- */
@media (max-width: 1100px) {
  :root { --margin: 40px; --gutter: 24px; }
  .h1 { font-size: 54px; }
  .h2 { font-size: 42px; }
  .h3 { font-size: 32px; }
  .section { padding-block: 90px; }
}
@media (max-width: 680px) {
  :root { --margin: 20px; --gutter: 16px; }
  body { font-size: 16px; }
  .h1 { font-size: 38px; }
  .h2 { font-size: 30px; }
  .h3 { font-size: 25px; }
  .h4 { font-size: 22px; }
  .section { padding-block: 64px; }
}

/* hide scrollbar on horizontal rails but keep scroll */
.no-bar::-webkit-scrollbar { height: 6px; }
.no-bar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

::selection { background: var(--accent); color: #fff; }

/* ===================================================================
   TWEAK BRIDGES
   Let literal hex values baked into inline SVG follow the live CSS
   variables, so the Tweaks panel (accent / surface / blueprint)
   reshapes the whole page — backgrounds, route graphics and all.
   =================================================================== */
[stroke="#D99041"] { stroke: var(--accent) !important; }
[fill="#D99041"]   { fill:   var(--accent) !important; }
[stroke="#D8DAD6"] { stroke: var(--line) !important; }
[fill="#ECE9E3"]   { fill:   var(--bg-secondary) !important; }
[fill="#FCFBF8"]   { fill:   var(--surface-card) !important; }

/* technical-density layer driven by data-bp on <html> */
svg rect[fill^="url(#"] { opacity: var(--grid-op); transition: opacity var(--dur-mid) var(--ease); }
.viz-coord, .footer-coord, .map-leg-item, .fleet-sheet { visibility: var(--coord-vis); }

html[data-bp="clean"]     { --grid-op: 0.18; --coord-vis: hidden; }
html[data-bp="standard"]  { --grid-op: 1;    --coord-vis: visible; }
html[data-bp="technical"] { --grid-op: 1;    --coord-vis: visible; }

/* Technical mode: surface every drafting annotation permanently */
html[data-bp="technical"] .region-details,
html[data-bp="technical"] .benefit-annot,
html[data-bp="technical"] .fleet-dims { opacity: 1 !important; }
html[data-bp="technical"] .fleet-hint { opacity: 0 !important; }
