/* CFOrUS.ai — design tokens, layout, motion. No build step. */

:root {
  --bg: #faf8f4;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e6e2da;
  --accent: #4d6bfe;
  --card: #ffffff;
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0f10; --ink: #f3f1ec; --muted: #9a9a9a; --line: #262626; --card: #161617; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  line-height: 1.5; font-size: 16px; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a:not(.btn):focus-visible { border-radius: 4px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* nav */
nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.brand { font-weight: 600; font-size: 22px; letter-spacing: -.02em; }
nav ul { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; align-items: center; }
nav li a { font-size: 15px; color: var(--muted); transition: color .25s var(--ease); }
nav li a:hover { color: var(--ink); }
nav li a.btn, nav li a.btn:hover { color: var(--bg); }

/* buttons */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-weight: 500; font-size: 15px; line-height: 1.3; border: 1px solid var(--ink); cursor: pointer; font-family: inherit;
  transition: transform .25s var(--ease), opacity .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: .85; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }

/* hero */
.hero { text-align: center; padding: 56px 0 40px; }
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.hero h1 {
  font-size: clamp(44px, 8vw, 88px); font-weight: 600; letter-spacing: -.04em; line-height: 1.02;
  margin: 0 0 18px; text-wrap: balance;
}
.hero p { font-size: clamp(18px, 2.2vw, 24px); color: var(--muted); margin: 0 0 36px; text-wrap: balance; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .reveal:nth-child(2) { transition-delay: .1s; }
.hero .reveal:nth-child(3) { transition-delay: .2s; }
.hero .reveal:nth-child(4) { transition-delay: .3s; }

/* diagram */
.diagram { margin: 48px auto 0; max-width: 980px; color: var(--ink); }
.diagram svg { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font); }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.grid .reveal:nth-child(2) { transition-delay: .08s; }
.grid .reveal:nth-child(3) { transition-delay: .16s; }
.grid .reveal:nth-child(4) { transition-delay: .24s; }

/* sections */
section { padding: 96px 0; border-top: 1px solid var(--line); }
section h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.03em; font-weight: 600; line-height: 1.1; margin: 0 0 12px; }
section .lead { color: var(--muted); font-size: 18px; max-width: 640px; margin: 0 0 48px; text-wrap: pretty; }
#about .lead { margin-bottom: 0; }
#adhere .lead { margin-bottom: 32px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: opacity .9s var(--ease), transform .9s var(--ease), border-color .3s var(--ease);
}
.card:hover { border-color: var(--muted); }
.card h3 { margin: 14px 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); }
.card .ic svg { width: 18px; height: 18px; display: block; }

/* outcomes row */
.outcomes { display: flex; justify-content: space-around; gap: 20px; flex-wrap: wrap; margin-top: 56px; }
.outcomes div { text-align: center; color: var(--muted); font-size: 15px; }

/* adhere form */
form.adhere { display: flex; gap: 10px; max-width: 560px; flex-wrap: wrap; position: relative; }
form.adhere input, form.adhere textarea {
  flex: 1 1 240px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; min-width: 0; transition: border-color .25s var(--ease);
}
form.adhere textarea { flex-basis: 100%; resize: vertical; min-height: 72px; line-height: 1.5; }
form.adhere input::placeholder, form.adhere textarea::placeholder, .login input::placeholder { color: var(--muted); opacity: .8; }
form.adhere input:focus, form.adhere textarea:focus, .login input:focus { outline: none; border-color: var(--accent); }
form.adhere .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.note { color: var(--muted); font-size: 14px; margin-top: 12px; min-height: 20px; flex-basis: 100%; }
.note.ok { color: var(--ink); }

/* footer */
footer {
  border-top: 1px solid var(--line); padding: 48px 0; color: var(--muted); font-size: 14px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
footer a:hover { color: var(--ink); }

/* ---- diagram animation ----
   .d-draw  solid hairline that draws in, then fades out
   .d-line  the dashed connector underneath, fades in and slowly flows toward the hub / outcomes
   .d-tile / .d-hub / .d-out  stagger-pop; hub pulses gently                                   */
.d-draw { stroke: var(--ink); stroke-width: 1.4; fill: none; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; }
.d-line { stroke: var(--ink); stroke-width: 1.4; fill: none; stroke-dasharray: 6 6; opacity: 0; }
.d-tile, .d-hub, .d-out { opacity: 0; transform: translateY(8px); transform-box: fill-box; transform-origin: center; }

.play .d-draw { animation: draw 1.4s var(--ease) forwards; }
.play .d-line { animation: fadein .6s ease forwards, flow 28s linear infinite; animation-delay: 1s, 1.2s; }
.play .d-hub  { animation: pop .7s var(--ease) forwards, pulse 6s ease-in-out 2.4s infinite; }
.play .d-tile { animation: pop .7s var(--ease) forwards; }
.play .d-out  { animation: pop .7s var(--ease) forwards; animation-delay: 1.6s; }

/* draw order: hub, then plugin connectors, then the outcomes bus */
.play .d-draw.bus { animation-delay: .9s; }
.play .d-line.bus { animation-delay: 1.9s, 2.1s; }
.play .d-tile:nth-of-type(1) { animation-delay: .3s; }
.play .d-tile:nth-of-type(2) { animation-delay: .45s; }
.play .d-tile:nth-of-type(3) { animation-delay: .6s; }
.play .d-tile:nth-of-type(4) { animation-delay: .75s; }
.play .d-tile:nth-of-type(5) { animation-delay: .9s; }
.play .d-tile:nth-of-type(6) { animation-delay: 1.05s; }

@keyframes draw {
  0%   { stroke-dashoffset: 100; opacity: .9; }
  70%  { stroke-dashoffset: 0;   opacity: .9; }
  100% { stroke-dashoffset: 0;   opacity: 0; }
}
@keyframes fadein { to { opacity: .9; } }
@keyframes flow { to { stroke-dashoffset: -120; } }
@keyframes pop { to { opacity: 1; transform: none; } }
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(77, 107, 254, 0)); }
  50%      { filter: drop-shadow(0 0 14px rgba(77, 107, 254, .35)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .d-line, .d-tile, .d-hub, .d-out { opacity: 1 !important; transform: none !important; animation: none !important; stroke-dashoffset: 0 !important; }
  .d-line { opacity: .9 !important; }
  .d-draw { display: none; }
  .btn, .card, nav li a { transition: none; }
}

@media (max-width: 720px) {
  nav { padding: 20px 0; }
  nav ul { gap: 20px; }
  nav ul li:not(:last-child) { display: none; }
  .hero { padding: 64px 0 24px; }
  /* the diagram keeps its proportions and scrolls sideways instead of shrinking to illegibility */
  .diagram { margin-top: 36px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .diagram::-webkit-scrollbar { display: none; }
  .diagram svg { min-width: 720px; }
  section { padding: 64px 0; }
  footer { padding: 36px 0; }
}

/* login / 404 */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login form, .login > div { width: min(360px, 92vw); display: grid; gap: 12px; }
.login .brand { margin-bottom: 20px; }
.login input { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; transition: border-color .25s var(--ease); }
.login h1 { font-size: 28px; letter-spacing: -.03em; font-weight: 600; margin: 0 0 8px; }
.login .err { color: #c0392b; font-size: 14px; min-height: 18px; }
.login .btn { margin-top: 4px; text-align: center; }
.login > div .btn { justify-self: start; }

/* ---------- opening sequence ---------- */
.intro { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 24px; overflow: hidden; background: var(--bg); cursor: default; }
.intro .stage { position: relative; width: min(900px, 92vw); min-height: 46vh; display: grid; place-items: center; }
.intro .slide { grid-area: 1 / 1; margin: 0; opacity: 0; transform: translateY(12px); transition: opacity .9s var(--ease), transform .9s var(--ease); font-size: clamp(30px, 5.2vw, 66px); font-weight: 600; letter-spacing: -.035em; line-height: 1.08; text-wrap: balance; will-change: opacity, transform; }
.intro .slide.on { opacity: 1; transform: none; }
.intro .slide.off { opacity: 0; transform: translateY(-12px); transition-duration: .7s; }
.intro .slide small { display: block; font-weight: 400; color: var(--muted); font-size: clamp(15px, 1.6vw, 21px); letter-spacing: -.01em; line-height: 1.45; margin: .7em auto 0; max-width: 640px; }
.intro .final { grid-area: 1 / 1; opacity: 0; transform: translateY(10px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); pointer-events: none; }
.intro .final.on { opacity: 1; transform: none; pointer-events: auto; }
.intro .wordmark { font-size: clamp(44px, 7.5vw, 92px); font-weight: 600; letter-spacing: -.045em; line-height: 1; margin: 0 0 14px; }
.intro .tag { color: var(--muted); font-size: clamp(18px, 2.2vw, 24px); margin: 0 0 34px; }
.intro .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.intro .skip { position: absolute; top: 22px; right: 24px; font-size: 13px; color: var(--muted); opacity: .75; transition: opacity .4s; }
.intro .skip:hover { opacity: 1; color: var(--ink); }
.intro.done .skip { opacity: 0; pointer-events: none; }
.intro .cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; opacity: 0; transition: opacity 1s var(--ease); }
.intro.done .cue { opacity: .8; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) {
  .intro .slide { transition: none; }
  .intro .final { transition: none; }
  .intro.done .cue { animation: none; }
}
