/* ============================================================
   Statefold — marketing site
   Palette: light grey · orange · beige · black
   ============================================================ */
:root {
  --paper:      #F4F3EF;   /* light grey base            */
  --paper-2:    #FBFAF6;   /* lifted surface             */
  --beige:      #EFE7D7;   /* warm beige panel           */
  --beige-2:    #E7DCC6;   /* deeper beige               */
  --ink:        #16140F;   /* near-black text            */
  --ink-soft:   #36322A;   /* soft black                 */
  --muted:      #6E6A5F;   /* muted grey-brown           */
  --faint:      #9A968B;   /* faint                      */
  --orange:     #E5552B;   /* brand orange               */
  --orange-2:   #C2431D;   /* deep orange (hover)        */
  --orange-tint:#FBE7DD;   /* orange wash                */
  --line:       #DCD7CB;   /* hairline                   */
  --line-2:     #C9C3B4;   /* stronger hairline          */
  --white:      #FFFFFF;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --pill: 999px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow: 0 1px 2px rgba(22,20,15,.04), 0 12px 34px -16px rgba(22,20,15,.18);
  --shadow-lg: 0 24px 70px -28px rgba(22,20,15,.34);
  --maxw: 1140px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- type ---------- */
h1, h2, h3, h4, h5 { font-family: var(--serif); font-weight: 600; line-height: 1.08;
  letter-spacing: -.01em; color: var(--ink); }
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--orange); font-weight: 500; margin-bottom: 14px; }
.u { background: linear-gradient(transparent 62%, var(--orange-tint) 62%); padding: 0 .04em; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 14px; line-height: 1;
  padding: 12px 20px; border-radius: var(--pill); cursor: pointer; border: 1px solid transparent;
  transition: .18s var(--ease); white-space: nowrap; }
.btn-lg { padding: 15px 26px; font-size: 15px; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 8px 20px -10px rgba(229,85,43,.7); }
.btn-primary:hover { background: var(--orange-2); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--white); border-color: var(--ink); transform: translateY(-1px); }

/* ============================================================
   NAV
   ============================================================ */
.nav { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.nav-links { display: flex; gap: 26px; margin-left: 8px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--ink-soft); transition: color .15s; }
.nav-links a:hover { color: var(--orange); }
.nav-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.nav-burger { display: none; margin-left: auto; background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.nav-burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
.nav-mobile { display: none; flex-direction: column; gap: 4px; padding: 10px 24px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.nav-mobile a { padding: 11px 6px; font-weight: 500; border-bottom: 1px solid var(--line); }
.nav-mobile a.btn { border: 0; margin-top: 10px; justify-content: center; }
.nav-mobile.open { display: flex; }

/* ---------- brand logo lockup (dragonfly + statefold wordmark) ---------- */
.brandlogo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.brandlogo .brand-df { width: 34px; height: 34px; flex: none; }
.brandlogo .brand-word { height: 17px; width: 129px; display: block; }
.brandlogo.sm .brand-df { width: 28px; height: 28px; }
.brandlogo.sm .brand-word { height: 14px; width: 106px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: 74px 0 64px;
  background:
    radial-gradient(120% 90% at 88% -10%, var(--beige) 0%, transparent 52%),
    radial-gradient(90% 70% at 0% 0%, var(--paper-2) 0%, transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 54px; align-items: center; }
.hero-copy h1 { font-size: clamp(40px, 6vw, 68px); margin: 6px 0 18px; }
.lede { font-size: clamp(17px, 1.7vw, 20px); color: var(--ink-soft); max-width: 38ch; }
.lede em { font-style: italic; color: var(--ink); }
.hero-actions { display: flex; gap: 12px; margin: 30px 0 22px; flex-wrap: wrap; }
.hero-trust { list-style: none; display: flex; gap: 22px; flex-wrap: wrap; }
.hero-trust li { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; font-weight: 500; }
.hero-trust .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }

/* hero brand visual — the giant animated dragonfly */
.hero-visual { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 360px; }
.hero-glow { position: absolute; inset: 6% 4% 10% 4%; z-index: 0;
  background: radial-gradient(58% 58% at 50% 42%, rgba(229,85,43,.20), transparent 70%); filter: blur(10px); }
.hero-df { position: relative; z-index: 1; width: min(440px, 88%); height: auto; display: block; color: var(--ink); }
.hero-df .p { stroke-width: 3.1; }
.hero-cap { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 7px 18px; margin-top: 24px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hero-cap span { display: inline-flex; align-items: baseline; gap: 6px; }
.hero-cap b { color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 600; }

/* console card visual (retained styles; bubble styles still used by the Hive demo) */
.console-card { position: relative; z-index: 1; background: var(--paper-2); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 18px; transform: rotate(.4deg); }
.console-card { position: relative; z-index: 1; background: var(--paper-2); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 18px; transform: rotate(.4deg); }
.cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cc-eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.cc-live { font-family: var(--mono); font-size: 10px; color: var(--orange); display: inline-flex; align-items: center; gap: 6px; }
.ping { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 0 rgba(229,85,43,.5); animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(229,85,43,.5); } 70% { box-shadow: 0 0 0 7px rgba(229,85,43,0); } 100% { box-shadow: 0 0 0 0 rgba(229,85,43,0); } }
.cc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.cc-stats > div { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 10px; }
.cc-stats b { font-family: var(--serif); font-size: 21px; display: block; }
.cc-stats span { font-size: 10.5px; color: var(--muted); }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cc-chips span { font-size: 10.5px; font-family: var(--mono); color: var(--ink-soft); background: var(--beige);
  border: 1px solid var(--line); border-radius: var(--pill); padding: 4px 10px; }
.cc-chat { display: flex; flex-direction: column; gap: 8px; }
.bub { border-radius: 12px; padding: 9px 13px; font-size: 13px; line-height: 1.5; max-width: 90%; }
.bub.user { align-self: flex-end; background: var(--orange); color: #fff; border-bottom-right-radius: 4px; }
.bub.hive { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bub.hive b { color: var(--ink); }
.frow { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ============================================================
   TRUST BAND
   ============================================================ */
.band { background: var(--ink); color: var(--paper); }
.band-inner { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: center;
  padding: 16px 24px; font-size: 13px; font-weight: 500; text-align: center; }
.band .sep { color: var(--orange); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 84px 0; }
.section.alt { background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { max-width: 720px; margin-bottom: 44px; }
.sec-head h2 { font-size: clamp(28px, 3.6vw, 42px); margin-bottom: 14px; }
.sec-sub { font-size: 17px; color: var(--ink-soft); }
.sec-sub em { font-style: italic; }

/* problem cards */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow); transition: .2s var(--ease); }
.card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.card .ic { font-size: 24px; color: var(--orange); margin-bottom: 14px; }
.card h3 { font-size: 21px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; }

/* architecture */
.arch { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 0; margin-bottom: 52px; }
.arch-node { background: var(--paper-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.arch-node.console { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.arch-node.console h4, .arch-node.console .tag { color: var(--paper); }
.arch-node.console p { color: color-mix(in srgb, var(--paper) 80%, transparent); }
.arch-node .tag { font-family: var(--mono); font-size: 11px; color: var(--orange); letter-spacing: .04em; }
.arch-node h4 { font-size: 22px; margin: 8px 0 10px; }
.arch-node p { color: var(--muted); font-size: 14.5px; }
.arch-link { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 0 18px; }
.arch-link span { width: 30px; height: 2px; background: var(--line-2); border-radius: 2px; }
.arch-link span:nth-child(2) { width: 30px; background: var(--orange); }

/* capability grid */
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cap { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: .2s var(--ease); }
.cap:hover { transform: translateY(-3px); border-color: var(--orange); box-shadow: var(--shadow); }
.cap-ic { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px;
  background: var(--orange-tint); color: var(--orange-2); font-size: 20px; margin-bottom: 14px; }
.cap h3 { font-size: 19px; margin-bottom: 7px; }
.cap p { color: var(--muted); font-size: 14.5px; }
.cap strong { color: var(--ink); }

/* ============================================================
   DRAGONFLY MARK — the Hive Mind symbol
   ============================================================ */
.df { display: block; color: var(--ink); }
.df .p { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
  stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.df .df-hover { transform-box: view-box; transform-origin: 60px 60px; animation: df-float 6s ease-in-out infinite; }
.df .df-body .p { stroke-dasharray: 260; animation: df-draw 1.6s ease forwards; }
.df .df-body .c1 { animation-delay: .05s; } .df .df-body .c2 { animation-delay: .2s; } .df .df-body .c3 { animation-delay: .35s; }
.df .w { transform-box: view-box; } .df .w.up { transform-origin: 60px 43px; } .df .w.lo { transform-origin: 60px 49px; }
.df .uf { animation: df-unfold 1.1s cubic-bezier(.2,.7,.2,1) both; }
.df .uf.d-ul { animation-delay: .12s; } .df .uf.d-ur { animation-delay: .24s; }
.df .uf.d-ll { animation-delay: .36s; } .df .uf.d-lr { animation-delay: .48s; }
.df .fl-ul { animation: df-flutter-l 3.6s ease-in-out infinite; }
.df .fl-ur { animation: df-flutter-r 3.6s ease-in-out infinite; }
.df .fl-ll { animation: df-flutter-lo-l 3.6s ease-in-out .3s infinite; }
.df .fl-lr { animation: df-flutter-lo-r 3.6s ease-in-out .3s infinite; }
@keyframes df-draw   { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }
@keyframes df-float  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes df-unfold { from { opacity: 0; transform: rotate(var(--uf)) scale(.45); } to { opacity: 1; transform: rotate(0) scale(1); } }
@keyframes df-flutter-l    { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-5deg); } }
@keyframes df-flutter-r    { 0%,100% { transform: rotate(0); } 50% { transform: rotate(5deg); } }
@keyframes df-flutter-lo-l { 0%,100% { transform: rotate(0); } 50% { transform: rotate(4deg); } }
@keyframes df-flutter-lo-r { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) {
  .df .df-hover, .df .df-body .p, .df .uf, .df .fl-ul, .df .fl-ur, .df .fl-ll, .df .fl-lr { animation: none; }
  .df .df-body .p { stroke-dashoffset: 0; }
}

/* ============================================================
   HIVE MIND
   ============================================================ */
.hive { background:
  radial-gradient(90% 80% at 100% 0%, var(--beige) 0%, transparent 55%),
  var(--paper); border-top: 1px solid var(--line); }
.hive-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hive-copy h2 { font-size: clamp(28px, 3.6vw, 44px); margin-bottom: 16px; }
.ticks { list-style: none; margin: 22px 0; display: flex; flex-direction: column; gap: 11px; }
.ticks li { position: relative; padding-left: 30px; font-size: 15px; color: var(--ink-soft); }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: -1px; color: var(--orange);
  font-weight: 700; width: 20px; height: 20px; }
.ticks b { color: var(--ink); }
.corpus-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.corpus-chips span { font-size: 12px; font-weight: 500; color: var(--ink-soft); background: var(--paper-2);
  border: 1px solid var(--line-2); border-radius: var(--pill); padding: 6px 13px; }

/* demo card */
.demo-card { background: var(--paper-2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.demo-top { display: flex; align-items: center; gap: 9px; padding: 15px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.demo-top .hex { color: var(--orange); font-size: 14px; }
.demo-log { padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 210px; max-height: 320px; overflow-y: auto; }
.demo-log .bub { max-width: 88%; }
.demo-log .bub.hive .frow { display: block; }
.demo-log .head { font-weight: 600; }
.demo-suggest { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 14px; }
.demo-suggest button { font: inherit; font-size: 12px; color: var(--ink-soft); background: var(--white);
  border: 1px solid var(--line-2); border-radius: var(--pill); padding: 6px 12px; cursor: pointer; transition: .15s; }
.demo-suggest button:hover { border-color: var(--orange); color: var(--orange); }
.demo-input { display: flex; gap: 9px; padding: 0 18px 12px; }
.demo-input input { flex: 1; font: inherit; font-size: 14px; padding: 11px 14px; border: 1px solid var(--line-2);
  border-radius: var(--pill); background: var(--white); color: var(--ink); outline: none; transition: .15s; }
.demo-input input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.demo-foot { padding: 0 18px 16px; font-size: 11px; color: var(--faint); font-family: var(--mono); }

/* ============================================================
   TRUST GRID
   ============================================================ */
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.t-item { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; border-left: 3px solid var(--orange); }
.t-item h3 { font-size: 18px; margin-bottom: 8px; }
.t-item p { color: var(--muted); font-size: 14.5px; }
.t-item em { font-style: italic; color: var(--ink-soft); }

/* ============================================================
   STEPS
   ============================================================ */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.steps li { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.steps .num { font-family: var(--mono); font-size: 13px; color: var(--orange); font-weight: 500; }
.steps h3 { font-size: 20px; margin: 8px 0 7px; }
.steps p { color: var(--muted); font-size: 14.5px; }

/* ============================================================
   COMPARE TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.cmp { width: 100%; border-collapse: collapse; background: var(--paper-2); min-width: 760px; }
.cmp th, .cmp td { text-align: center; padding: 15px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cmp th { font-family: var(--sans); font-weight: 600; color: var(--muted); font-size: 12.5px; background: var(--beige); }
.cmp thead th:first-child, .cmp td:first-child { text-align: left; color: var(--ink); font-weight: 500; }
.cmp th.me { background: var(--ink); color: #fff; }
.cmp td.me { color: var(--orange); font-size: 17px; background: color-mix(in srgb, var(--orange-tint) 55%, transparent); font-weight: 700; }
.cmp tbody tr:last-child td { border-bottom: 0; }
.cmp td { color: var(--faint); font-size: 16px; }
.cmp-legend { display: flex; gap: 18px; justify-content: flex-end; padding: 12px 16px; background: var(--paper-2); font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* ============================================================
   CTA
   ============================================================ */
.cta { background: var(--ink); color: var(--paper); padding: 88px 0; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 120% at 80% 0%, rgba(229,85,43,.28), transparent 60%); }
.cta-inner { position: relative; text-align: center; max-width: 640px; margin: 0 auto; }
.cta-inner h2 { color: #fff; font-size: clamp(30px, 4.4vw, 50px); margin-bottom: 14px; }
.cta-inner p { color: color-mix(in srgb, var(--paper) 82%, transparent); font-size: 18px; margin-bottom: 28px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.cta .btn-ghost:hover { background: rgba(255,255,255,.08); border-color: #fff; }
.cta-mail { margin-top: 20px; font-size: 14px; color: var(--faint); }
.cta-mail a { color: var(--orange); border-bottom: 1px solid transparent; }
.cta-mail a:hover { border-color: var(--orange); }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { background: var(--paper-2); border-top: 1px solid var(--line); padding-top: 56px; }
.foot-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; padding-bottom: 40px; }
.foot-brand p { color: var(--muted); font-size: 14px; max-width: 38ch; margin-top: 12px; }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.foot-cols h5 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; font-weight: 500; }
.foot-cols a { display: block; font-size: 14px; color: var(--ink-soft); padding: 5px 0; transition: color .15s; }
.foot-cols a:hover { color: var(--orange); }
.foot-base { display: flex; justify-content: space-between; padding: 20px 24px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: 2; }
  .cards-3, .cap-grid, .trust-grid { grid-template-columns: 1fr 1fr; }
  .arch { grid-template-columns: 1fr; gap: 16px; }
  .arch-link { flex-direction: row; padding: 4px 0; justify-content: center; }
  .arch-link span { width: 2px; height: 22px; }
  .arch-link span:nth-child(2) { height: 22px; }
  .hive-grid { grid-template-columns: 1fr; gap: 34px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .foot-inner { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .section { padding: 60px 0; }
  .cards-3, .cap-grid, .trust-grid, .steps { grid-template-columns: 1fr; }
  .cc-stats { grid-template-columns: repeat(2, 1fr); }
  .foot-base { flex-direction: column; gap: 8px; text-align: center; }
}
