/* ============================================================
   ORTHANCIQ — Customer-Risk Intelligence
   Shared design system
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Hanken+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---------- Tokens ---------- */
:root {
  /* palette experiment — Coolors: 65DEF1 / A8DCD1 / DCE2C8 / F96900 / F17F29 */
  --aqua:       #65DEF1;
  --pearl:      #A8DCD1;
  --beige:      #DCE2C8;
  --pumpkin:    #F96900;
  --harvest:    #F17F29;

  /* surfaces — light research-lab warmth */
  --bg:        #f4f0df;
  --bg-2:      #e9edd7;
  --surface:   #fffdf4;
  --surface-2: #edf6eb;
  --surface-3: #d8ece2;
  --elevated:  #ffffff;

  /* lines */
  --line:    rgba(31, 55, 55, 0.13);
  --line-2:  rgba(31, 55, 55, 0.075);
  --line-3:  rgba(31, 55, 55, 0.22);

  /* text */
  --text:    #162523;
  --muted:   #56645f;
  --muted-2: #79847b;
  --faint:   #a6b09f;

  /* accents */
  --amber:        var(--pumpkin);
  --amber-strong: #d95800;
  --amber-soft:   rgba(249, 105, 0, 0.13);
  --teal:         #087f90;
  --teal-soft:    rgba(101, 222, 241, 0.24);

  /* risk semantics */
  --red:      #c84700;
  --red-soft: rgba(249, 105, 0, 0.15);
  --green:    #247967;
  --green-soft: rgba(168, 220, 209, 0.34);
  --grey-state: #7f877a;

  /* type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Hanken Grotesk', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  /* layout */
  --maxw: 1200px;
  --pad:  clamp(20px, 5vw, 48px);
  --radius:   16px;
  --radius-lg: 22px;
  --radius-sm: 10px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--amber-soft); color: var(--text); }

/* page ambient backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(780px 540px at 78% -8%, rgba(249, 105, 0, 0.16), transparent 62%),
    radial-gradient(760px 620px at 4% 2%, rgba(101, 222, 241, 0.24), transparent 64%),
    linear-gradient(180deg, rgba(168, 220, 209, 0.2), transparent 34%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.wrap-wide { max-width: 1320px; }
section { position: relative; z-index: 1; }
section[id] { scroll-margin-top: 96px; }
.section { padding-block: clamp(72px, 11vw, 140px); }
.section-tight { padding-block: clamp(56px, 8vw, 96px); }

.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
          mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  opacity: 0.5;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; }
.display {
  font-size: clamp(2.5rem, 5.4vw, 4.35rem);
  letter-spacing: -0.035em;
  line-height: 1.0;
  font-weight: 600;
}
.h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); letter-spacing: -0.03em; }
.h3 { font-size: clamp(1.35rem, 2.4vw, 1.9rem); letter-spacing: -0.02em; }
.lead { font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: var(--muted); line-height: 1.5; font-weight: 400; }
.balance { text-wrap: balance; }
.pretty { text-wrap: pretty; }

.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--amber);
}
.kicker::before {
  content: ""; width: 22px; height: 1px; background: var(--amber); opacity: 0.7;
}
.kicker.center::before { display: none; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2);
}
.amber-text { color: var(--amber); }
.teal-text { color: var(--teal); }
.muted { color: var(--muted); }

.section-head { max-width: none; position: relative; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .h2 { margin-top: 18px; }
.section-head .lead { margin-top: 20px; }
.section-head:not(.center) {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(280px, 0.68fr);
  column-gap: clamp(32px, 6vw, 72px);
  align-items: end;
}
.section-head:not(.center) .kicker {
  grid-column: 1 / -1;
}
.section-head:not(.center) .h2 {
  max-width: 820px;
  font-size: clamp(2.15rem, 3.85vw, 3.7rem);
  line-height: 1.03;
}
.section-head:not(.center) .lead {
  max-width: 470px;
  margin-top: 0;
  padding: clamp(18px, 2.5vw, 30px) 0 clamp(2px, 0.6vw, 8px) clamp(22px, 3vw, 36px);
  border-left: 1px solid var(--line-3);
  font-size: clamp(1rem, 1.22vw, 1.16rem);
}
@supports selector(:has(*)) {
  .section-head:not(.center):not(:has(.lead)) .h2 {
    grid-column: 1 / -1;
    max-width: 1060px;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.97rem;
  padding: 14px 22px; border-radius: 12px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap; position: relative; letter-spacing: -0.01em;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(180deg, var(--harvest), var(--pumpkin));
  color: #231000;
  box-shadow: 0 1px 0 rgba(255,255,255,0.42) inset, 0 14px 34px -18px rgba(249, 105, 0, 0.75);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,0.48) inset, 0 20px 44px -18px rgba(249, 105, 0, 0.9); }

.btn-ghost {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-3);
}
.btn-ghost:hover { background: var(--surface-3); border-color: rgba(31,55,55,0.26); transform: translateY(-2px); }

.btn-line { background: transparent; color: var(--text); border: 1px solid var(--line-3); }
.btn-line:hover { background: var(--surface-2); transform: translateY(-2px); }

.btn-lg { padding: 17px 28px; font-size: 1.02rem; border-radius: 13px; }
.btn-sm { padding: 10px 16px; font-size: 0.86rem; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--text); font-size: 0.97rem;
  transition: gap 0.25s var(--ease), color 0.25s var(--ease);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.link-arrow:hover { color: var(--amber); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.04em; padding: 5px 11px; border-radius: 100px;
  border: 1px solid var(--line-3); color: var(--muted); background: var(--surface-2);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em;
  padding: 7px 14px; border-radius: 100px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--muted);
}

/* risk state badge */
.state {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 500;
  padding: 4px 10px 4px 8px; border-radius: 7px; white-space: nowrap;
  border: 1px solid transparent;
}
.state .dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 3px transparent; }
.state.critical    { color: #9e3100; background: rgba(249, 105, 0, 0.15); border-color: rgba(249, 105, 0, 0.34); }
.state.critical .dot   { background: var(--red); box-shadow: 0 0 8px 0 rgba(249, 105, 0, 0.52); }
.state.recoverable { color: #9a4c00; background: rgba(241, 127, 41, 0.15); border-color: rgba(241, 127, 41, 0.34); }
.state.recoverable .dot{ background: var(--harvest); box-shadow: 0 0 8px 0 rgba(241, 127, 41, 0.5); }
.state.futile      { color: var(--muted); background: rgba(22, 37, 35, 0.045); border-color: var(--line); }
.state.futile .dot     { background: var(--grey-state); }
.state.healthy     { color: #226c5d; background: var(--green-soft); border-color: rgba(36, 121, 103, 0.28); }
.state.healthy .dot    { background: var(--green); box-shadow: 0 0 8px 0 rgba(36, 121, 103, 0.45); }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.card:hover { border-color: var(--line-3); transform: translateY(-3px); }
.card-pad-lg { padding: 34px; }

.surface-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(255, 253, 244, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-size: 0.92rem; color: var(--muted); font-weight: 500;
  transition: color 0.2s; position: relative; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 14px; }

.logo { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; letter-spacing: -0.02em; color: var(--text); }
.logo .mark { width: 30px; height: 30px; flex: none; }
.logo .mark svg { width: 100%; height: 100%; }

.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-3); background: var(--surface-2); align-items: center; justify-content: center; }
.nav-toggle svg { width: 20px; height: 20px; }
.mobile-menu { display: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; padding-block: 64px 44px; }
.footer h5 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; margin-bottom: 18px; }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 26px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.footer-bottom p { font-size: 0.85rem; color: var(--muted-2); }

/* ---------- Reveal animations ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(8px);
  transition:
    opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-out),
    filter 0.85s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
[data-reveal].in { opacity: 1; transform: none; filter: none; }
[data-reveal="scale"] { transform: translateY(30px) scale(0.965); }
[data-reveal="left"]  { transform: translateX(-38px); }
[data-reveal="right"] { transform: translateX(38px); }
[data-reveal].in[data-reveal] { transform: none; filter: none; }

.section-head[data-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}
.section-head[data-reveal] > * {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(8px);
  transition:
    opacity 0.82s var(--ease-out),
    transform 0.82s var(--ease-out),
    filter 0.82s var(--ease-out);
}
.section-head[data-reveal].in > * {
  opacity: 1;
  transform: none;
  filter: none;
}
.section-head[data-reveal].in > .kicker { transition-delay: 0ms; }
.section-head[data-reveal].in > .h2,
.section-head[data-reveal].in > .display { transition-delay: 90ms; }
.section-head[data-reveal].in > .lead { transition-delay: 190ms; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; transition: none; }
  .section-head[data-reveal] > * { opacity: 1 !important; transform: none !important; filter: none !important; transition: none; }
}

/* ---------- Misc utilities ---------- */
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.divider { height: 1px; background: var(--line); border: none; }
.glow-amber { box-shadow: 0 24px 80px -44px rgba(249, 105, 0, 0.55); }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* meter (saveability / confidence) */
.meter { width: 100%; height: 6px; border-radius: 100px; background: rgba(22,37,35,0.1); overflow: hidden; position: relative; }
.meter > span { display: block; height: 100%; border-radius: 100px; transform-origin: left; }
.meter.amber > span { background: linear-gradient(90deg, var(--pumpkin), var(--harvest)); }
.meter.teal > span  { background: linear-gradient(90deg, var(--teal), var(--aqua)); }
.meter.green > span { background: linear-gradient(90deg, var(--green), var(--pearl)); }
.meter.red > span   { background: linear-gradient(90deg, var(--red), var(--pumpkin)); }

/* responsive */
@media (max-width: 900px) {
  .section-head:not(.center) {
    grid-template-columns: 1fr;
  }
  .section-head:not(.center) .h2 {
    max-width: 100%;
    font-size: clamp(2.2rem, 8vw, 3.35rem);
  }
  .section-head:not(.center) .lead {
    max-width: 680px;
    margin-top: 20px;
    padding: 0;
    border-left: 0;
  }
  .nav-links, .nav-cta .btn-line { display: none; }
  .nav-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  [data-reveal="left"],
  [data-reveal="right"] {
    transform: translateY(22px);
  }
}
