/* ============================================================
   FlowThink: flowthink.ai
   Dark, minimal, physics-meets-AI aesthetic.
   ============================================================ */

:root {
  --bg: #070b0a;
  --bg-alt: #0b100f;
  --surface: #101614;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8edeb;
  --text-dim: #9aa6a2;
  --blue: #3aa2e8;
  --green: #4ec97a;
  --grad: linear-gradient(100deg, var(--blue), var(--green));
  --radius: 16px;
  --nav-h: 68px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* Background graph canvas sits behind everything */
#graphCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
main, .nav, .footer { position: relative; z-index: 1; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green);
  margin-bottom: 1rem;
}

.lede, .section-lede {
  color: var(--text-dim);
  font-size: 1.125rem;
  max-width: 620px;
  margin-top: 1.25rem;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(7, 11, 10, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; object-fit: contain; }
.brand-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.brand-name em { font-style: normal; color: var(--green); }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text) !important;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav-cta:hover { border-color: var(--green); background: rgba(78, 201, 122, 0.08); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 64px;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.orb-blue {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(58, 162, 232, 0.55), transparent 65%);
  top: -120px; right: -80px;
  animation: drift 14s ease-in-out infinite alternate;
}
.orb-green {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(78, 201, 122, 0.4), transparent 65%);
  bottom: -140px; left: -100px;
  animation: drift 18s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.08); }
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 75%);
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 48px;
  align-items: center;
}

.hero-actions { display: flex; gap: 14px; margin-top: 2rem; flex-wrap: wrap; }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2.5rem;
}
.chips li {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.hero-visual { display: flex; justify-content: center; }

.logo-glow { position: relative; width: min(380px, 70vw); }
.logo-glow img {
  mix-blend-mode: screen;
  mask-image: radial-gradient(circle at 50% 50%, black 52%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 52%, transparent 72%);
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: var(--grad);
  color: #06110b;
  box-shadow: 0 4px 24px rgba(78, 201, 122, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(78, 201, 122, 0.35); }

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--blue); background: rgba(58, 162, 232, 0.08); }

/* ---------- Sections ---------- */

.section { padding: 120px 0; }
.section-alt {
  background: rgba(11, 16, 15, 0.55);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head { max-width: 720px; margin-bottom: 64px; }

/* ---------- Capability pillars ---------- */

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 32px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}
.pillar:hover {
  transform: translateY(-4px);
  border-color: rgba(78, 201, 122, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.pillar h3 { font-size: 1.3rem; }
.pillar p { color: var(--text-dim); font-size: 0.97rem; }

.tag-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.tag-row li {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--green);
  padding: 4px 12px;
  border: 1px solid rgba(78, 201, 122, 0.25);
  border-radius: 999px;
  background: rgba(78, 201, 122, 0.06);
}

.card-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--green);
  background: linear-gradient(135deg, rgba(58, 162, 232, 0.12), rgba(78, 201, 122, 0.12));
  border: 1px solid var(--border);
}
.card-icon svg { width: 22px; height: 22px; }

/* ---------- Expert AI feature rows ---------- */

.feature-rows { display: flex; flex-direction: column; }

.feature-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 24px;
  padding: 36px 0;
  border-top: 1px solid var(--border);
}
.feature-row:last-child { border-bottom: 1px solid var(--border); }

.feature-num {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.feature-row h3 { font-size: 1.25rem; }
.feature-row p { color: var(--text-dim); max-width: 640px; margin-top: 0.4rem; }

/* ---------- Applications ---------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.app-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), transparent 45%);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.app-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.app-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.app-card:hover::before { opacity: 1; }

.app-card h3 { font-size: 1.05rem; }
.app-card p { color: var(--text-dim); font-size: 0.92rem; }

/* ---------- Principles ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
}

.principle h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  padding-top: 14px;
  border-top: 2px solid;
  border-image: var(--grad) 1;
}
.principle p { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- About ---------- */

.about-inner .section-head { margin-bottom: 32px; }
.about-copy p {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 760px;
  margin-bottom: 1.25rem;
}
.about-copy strong { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */

.contact { padding-bottom: 140px; }

.contact-card {
  position: relative;
  text-align: center;
  padding: 72px 32px;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(ellipse 60% 90% at 50% 0%, rgba(58, 162, 232, 0.14), transparent 70%),
    var(--surface);
  overflow: hidden;
}
.contact-card h2 { margin-bottom: 0.75rem; }
.contact-card p { color: var(--text-dim); max-width: 520px; margin: 0 auto; }

.contact-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.25rem;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.footer-tag { opacity: 0.7; }

/* ---------- Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

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

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .logo-glow { width: min(260px, 60vw); }
  .pillar-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .section { padding: 88px 0; }
}

@media (max-width: 620px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(7, 11, 10, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; font-size: 1.05rem; width: 100%; }
  .nav-cta { text-align: center; margin-top: 8px; }
  .nav-toggle { display: flex; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

  .app-grid, .principles { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; gap: 8px; }
  .contact-card { padding: 56px 20px; }
}
