/*
 * Reworc marketing site — shared styles (2026)
 * Sits on top of chrome.css (tokens + base). This file:
 *   - re-skins the type tokens to the brand fonts (Poppins + Spectral)
 *   - adds warmth + depth the portal doesn't have (marketing surface)
 *   - defines the shared marketing chrome (header, footer) and component vocabulary
 * Page-specific CSS stays inline in each page's <style>.
 */

/* ============ TOKEN RE-SKIN ============ */
:root {
  /* brand fonts: Poppins is the Reworc brand font; Spectral is the editorial accent */
  --type-family-ui:        "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --type-family-editorial: "Spectral", Georgia, "Times New Roman", serif;

  /* warmth: a soft off-white page ground + a faint warm tint band */
  --color-surface-page:  #FAF9F7;
  --color-surface-warm:  #F5F2EE;
  --color-brand-tint:    #FFF1F3;   /* faintest red wash */

  --max-content: 1180px;
  --site-header-h: 68px;

  /* fill the gaps chrome.css leaves in the spacing scale */
  --space-7: 28px;
  --space-9: 36px;
}

/* ============ BASE OVERRIDES ============ */
body { background: var(--color-surface-page); font-size: 15.5px; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--max-content); margin: 0 auto; padding: 0 var(--space-6); }
section { position: relative; }
::selection { background: var(--color-brand-tint); }

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4 { margin: 0; }
.display {
  font-family: var(--type-family-editorial);
  font-weight: 500; letter-spacing: -0.005em; line-height: 1.12;
  color: var(--color-text-default);
}
.display em, .display .it { font-style: italic; font-weight: 500; }
.h1 { font-size: clamp(36px, 5.2vw, 60px); }
.h2 { font-size: clamp(27px, 3.6vw, 42px); }
.h3 { font-size: clamp(20px, 2vw, 25px); }
.lede {
  font-size: clamp(17px, 1.55vw, 20px); line-height: 1.62;
  color: var(--color-text-muted); font-weight: 400;
}

/* eyebrow — Reworc red, bold, no mark */
.eyebrow {
  display: block;
  font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-brand-logo);
  margin: 0 0 var(--space-4);
}
.eyebrow.on-dark { color: var(--color-brand-logo); }

/* ============ MARKETING HEADER ============ */
.site-header {
  position: sticky; top: 0; z-index: 300;
  height: var(--site-header-h);
  background: rgba(250,249,247,0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex; align-items: center;
}
.site-header .wrap { display: flex; align-items: center; gap: var(--space-6); width: 100%; }
.brand-logo { display: inline-flex; align-items: center; height: var(--site-header-h); }
.brand-logo img { height: 22px; width: auto; display: block; }
.site-nav { display: flex; gap: 2px; margin-left: var(--space-4); }
.site-nav a {
  padding: 8px var(--space-3); border-radius: var(--radius-md);
  color: var(--color-text-muted); font-size: 14.5px; font-weight: 500; text-decoration: none;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--color-surface-warm); color: var(--color-text-default); text-decoration: none; }
/* "(EN)" hint on nav items that lead to another language (e.g. English-only insights) */
.nav-lang-badge { margin-left: 4px; font-size: 0.72em; font-weight: 600; letter-spacing: .02em; color: var(--color-text-subtle); vertical-align: baseline; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
/* Mobile nav toggle (hamburger) — hidden on desktop, shown ≤900px */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-surface-default); color: var(--color-text-default); cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .i-close { display: none; }
.site-nav .nav-cta { display: none; }
/* Language switcher — native <details> dropdown of autonyms, no JS required */
.lang-switch { position: relative; }
.lang-switch > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; font-size: 13px; font-weight: 600;
  color: var(--color-text-subtle);
  border: 1px solid var(--color-border-default); border-radius: 9999px;
  background: var(--color-surface-default);
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary::after {
  content: ''; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); opacity: .55;
}
.lang-switch[open] > summary { color: var(--color-text-default); background: var(--color-surface-warm); }
.lang-switch .lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 168px; padding: 6px;
  background: var(--color-surface-page, #fff);
  border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg, 12px);
  box-shadow: var(--elevation-2, 0 10px 28px rgba(20,23,31,.14));
  display: flex; flex-direction: column; gap: 2px;
}
.lang-switch .lang-menu a {
  padding: 8px 12px; border-radius: var(--radius-md, 8px);
  font-size: 14px; font-weight: 500; text-decoration: none;
  color: var(--color-text-muted); white-space: nowrap;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.lang-switch .lang-menu a:hover { background: var(--color-surface-warm); color: var(--color-text-default); }
.lang-switch .lang-menu a[aria-current="true"] { color: var(--color-text-default); font-weight: 600; }
.lang-switch .lang-menu a[aria-current="true"]::after { content: '✓'; color: var(--color-palette-red-500, #FF183F); }

/* ============ BUTTONS (extend chrome.btn) ============ */
.btn { transition: background .15s, border-color .15s, transform .05s; font-weight: 500; }
.btn:active { transform: translateY(1px); }
.btn.lg { padding: 13px var(--space-6); font-size: 15.5px; border-radius: var(--radius-lg); }
.btn.ghost { border: none; background: none; color: var(--color-text-default); }
.btn.ghost:hover { background: var(--color-surface-warm); }
.btn.accent {
  background: var(--color-brand-logo); border-color: var(--color-brand-logo); color: #fff;
}
.btn.accent:hover { background: #E00E33; border-color: #E00E33; }
.btn.outline { background: none; }

/* ============ BANDS / SECTIONS ============ */
.band { padding: clamp(56px, 8vw, 104px) 0; }
.band.warm { background: var(--color-surface-warm); border-top: 1px solid var(--color-border-subtle); border-bottom: 1px solid var(--color-border-subtle); }
.band.white { background: var(--color-surface-default); border-top: 1px solid var(--color-border-subtle); border-bottom: 1px solid var(--color-border-subtle); }
.band.ink { background: var(--color-palette-ink-800); color: #fff; }
.section-head { max-width: 62ch; margin-bottom: var(--space-10); }
.section-head .lede { margin-top: var(--space-4); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ============ VIZ CARD ============ */
.viz-card {
  background: var(--color-surface-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-2xl);
  box-shadow: var(--elevation-2);
  padding: var(--space-8);
  position: relative; overflow: hidden;
}
.viz-card::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, var(--color-brand-tint), transparent 70%);
  opacity: 0.7; pointer-events: none;
}
.viz-card figcaption { margin-top: var(--space-5); font-size: 13.5px; color: var(--color-text-subtle); text-align: center; position: relative; }
.viz-card svg { position: relative; z-index: 1; width: 100%; height: auto; }

/* ============ GENERIC CARD ============ */
.card {
  background: var(--color-surface-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card.hover:hover { box-shadow: var(--elevation-2); transform: translateY(-2px); border-color: var(--color-border-default); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.step { padding: var(--space-6); border-radius: var(--radius-xl); background: var(--color-surface-default); border: 1px solid var(--color-border-subtle); position: relative; }
.step .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--color-palette-ink-700); color: #fff;
  font-family: var(--type-family-editorial); font-weight: 600; font-size: 16px;
  margin-bottom: var(--space-4);
}
.step h3 { font-size: 18px; margin-bottom: var(--space-2); letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--color-text-muted); font-size: 15px; }

/* feature split */
.feature-grid { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.feature-grid.reverse .feature-text { order: 2; }
.feature-text .lede { margin-top: var(--space-4); }

/* check list */
.check-list { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: grid; gap: var(--space-4); }
.check-list li { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 15.5px; color: var(--color-text-default); line-height: 1.5; }
.check-list li svg { width: 20px; height: 20px; color: var(--color-palette-green-500); flex-shrink: 0; margin-top: 2px; }

/* ============ CTA BAND ============ */
.cta-band { background: var(--color-palette-ink-800); color: #fff; padding: clamp(56px, 8vw, 96px) 0; text-align: center; position: relative; overflow: hidden; }
.cta-band::before {
  content: ''; position: absolute; left: 50%; top: -120px; transform: translateX(-50%);
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,24,63,0.18), transparent 65%);
  pointer-events: none;
}
.cta-band .display, .cta-band h2 { color: #fff; position: relative; }
.cta-band .lede { color: rgba(255,255,255,0.74); margin: var(--space-4) auto var(--space-8); max-width: 50ch; position: relative; }
.cta-band .cta-row { position: relative; justify-content: center; }
.cta-band .btn { background: #fff; color: var(--color-palette-ink-800); border-color: #fff; }
.cta-band .btn:hover { background: var(--color-palette-neutral-100); }
.cta-band .btn.outline { background: none; color: #fff; border-color: rgba(255,255,255,0.38); }
.cta-band .btn.outline:hover { background: rgba(255,255,255,0.1); }

.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ============ FOOTER ============ */
.site-footer { background: var(--color-palette-ink-800); color: rgba(255,255,255,0.8); padding: var(--space-16) 0 var(--space-8); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--space-8); }
.site-footer .brand-logo img { height: 22px; }
.foot-tag { max-width: 32ch; font-size: 14.5px; color: rgba(255,255,255,0.6); margin: var(--space-4) 0 0; line-height: 1.55; }
.foot-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.5); margin: 0 0 var(--space-3); font-weight: 600; }
.foot-col a { display: block; padding: 5px 0; color: rgba(255,255,255,0.72); font-size: 14.5px; text-decoration: none; }
.foot-col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot-bottom { margin-top: var(--space-12); padding-top: var(--space-5); border-top: 1px solid rgba(255,255,255,0.12); display: flex; justify-content: space-between; gap: var(--space-4); font-size: 13px; color: rgba(255,255,255,0.5); flex-wrap: wrap; }

/* ============ AI CHAT STUB ============ */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 400;
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 13px var(--space-5); border-radius: 9999px;
  background: var(--color-brand-logo); color: #fff; border: none;
  box-shadow: 0 6px 20px rgba(255,24,63,0.35); font-size: 14.5px; font-weight: 600;
  transition: transform .15s, box-shadow .15s;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255,24,63,0.42); }
.chat-fab svg { width: 18px; height: 18px; }
.chat-panel {
  position: fixed; right: 22px; bottom: 84px; z-index: 400;
  width: 350px; max-width: calc(100vw - 44px);
  background: #fff; border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl); box-shadow: var(--elevation-3); overflow: hidden; display: none;
}
.chat-panel.open { display: block; }
.chat-panel .chat-head { padding: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); display: flex; align-items: center; gap: var(--space-2); }
.chat-panel .chat-head .av { width: 30px; height: 30px; border-radius: 8px; background: url("/assets/reworc-monogram-white.png") center/16px no-repeat, var(--color-brand-logo); }
.chat-panel .chat-head .t { font-weight: 600; font-size: 14.5px; }
.chat-panel .chat-body { padding: var(--space-4); font-size: 14.5px; color: var(--color-text-muted); line-height: 1.55; }
.chat-panel .stub-note { margin-top: var(--space-3); font-size: 12.5px; color: var(--color-text-subtle); background: var(--color-surface-warm); padding: var(--space-3); border-radius: var(--radius-md); }

/* ============ SVG token helpers ============ */
.s-people { fill: var(--color-palette-blue-400); }
.s-build  { fill: var(--color-palette-neutral-400); }
.s-match  { fill: var(--color-brand-logo); }

/* ============ MOTION ============ */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity .55s ease, transform .55s ease; }
  [data-reveal].in { opacity: 1; transform: none; }
}

/* ============ CAPACITY CHART (reusable) ============ */
.cap-chart .bar { transform: scaleY(0); transform-box: fill-box; transform-origin: 50% 100%; }
.cap-chart .gfx { opacity: 0; }
.cap-chart .dl { stroke-dasharray: 470; stroke-dashoffset: 470; }
.cap-chart.go .bar { transform: scaleY(1); transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.cap-chart.go .gfx { opacity: 1; transition: opacity .6s ease .5s; }
.cap-chart.go .dl { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s ease .5s; }
@media (prefers-reduced-motion: reduce) {
  .cap-chart .bar { transform: none; }
  .cap-chart .gfx { opacity: 1; }
  .cap-chart .dl { stroke-dashoffset: 0; }
}

/* ============ PIXEL GRID on dark surfaces ============ */
.cta-band, .band.ink, .site-footer {
  background-color: var(--color-palette-ink-800);
  background-image:
    linear-gradient(rgba(255,255,255,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .feature-grid, .feature-grid.reverse { grid-template-columns: 1fr; }
  .feature-grid.reverse .feature-text { order: 0; }
  .steps { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }

  /* Mobile navigation: hamburger reveals a dropdown panel with the links + CTA. */
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .site-nav {
    display: none;
    position: absolute; top: var(--site-header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--color-surface-page, #fff);
    border-bottom: 1px solid var(--color-border-subtle);
    box-shadow: var(--elevation-2, 0 14px 30px rgba(20,23,31,.14));
  }
  .site-header.nav-open .site-nav { display: flex; }
  .site-header.nav-open .nav-toggle .i-bars { display: none; }
  .site-header.nav-open .nav-toggle .i-close { display: inline; }
  .site-nav a:not(.nav-cta) { padding: 12px; font-size: 16px; border-radius: var(--radius-md); }
  .site-nav .nav-cta { display: inline-flex; justify-content: center; margin-top: 10px; padding: 13px; font-size: 15.5px; }
}
