/* ==========================================================================
   roofai.pro — public marketing site.

   Deliberately a STATIC site: no framework, no runtime, no build step. It is
   served straight off nginx from a versioned release directory, which is why
   it cannot affect app.roofai.pro and why it is fast by construction.

   The visual language is the product's own — "Futuristic Premium" from
   src/app/globals.css. Tokens below mirror that file's .dark block so the
   marketing layer and the app read as one product. Both typefaces are the
   same ones the app self-hosts (Space Grotesk display, Inter body), served
   from this origin as latin-subset woff2 — no third-party font request.

   All motion is transform/opacity only and is disabled wholesale under
   prefers-reduced-motion at the foot of this file.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  font-style: normal;
}

:root {
  --canvas: oklch(0.145 0.02 268);
  --canvas-deep: oklch(0.10 0.018 268);
  --surface: oklch(0.205 0.022 264);
  --surface-2: oklch(0.24 0.024 264);

  --violet: oklch(0.70 0.17 292);
  --violet-deep: oklch(0.55 0.20 292);
  --cyan: oklch(0.75 0.14 215);

  --ink: oklch(0.96 0.008 250);
  --ink-muted: oklch(0.78 0.02 256);
  --ink-dim: oklch(0.64 0.02 256);

  --line: oklch(0.98 0.01 260 / 0.09);
  --line-soft: oklch(0.98 0.01 260 / 0.055);

  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1180px;

  --nav-h: 68px;
}

/* ---------- base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* The sticky bar must not cover the heading an in-page link jumps to. */
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas-deep);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Decorative layers (aurora blooms, the grid, the phone's glow) are wider
     than the viewport by design. `clip` contains them WITHOUT making the body
     a scroll container — which `hidden` would, breaking the sticky nav. The
     `hidden` line is the fallback for engines without `overflow: clip`. */
  overflow-x: hidden;
}
@supports (overflow: clip) {
  body { overflow-x: clip; }
}

h1, h2, h3, .display {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

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

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2rem);
}

.section {
  position: relative;
  padding-block: clamp(4.5rem, 9vw, 8rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--violet));
}

.section-title { font-size: clamp(1.9rem, 3.6vw, 3rem); }

.section-lede {
  margin-top: 1.1rem;
  max-width: 46ch;
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.15vw, 1.1rem);
}

/* ---------- shared backdrop ---------- */

.backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.grid-layer {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 20%, transparent 100%);
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 20%, transparent 100%);
  animation: grid-drift 78s linear infinite;
}
@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(64px, 64px, 0); }
}

.bloom {
  position: absolute;
  border-radius: 9999px;
  will-change: transform;
}
.bloom-violet {
  width: 52rem; height: 52rem; top: -20rem; left: -14rem;
  background: radial-gradient(circle, color-mix(in oklch, var(--violet) 34%, transparent), transparent 68%);
  animation: drift-a 40s var(--ease) infinite alternate;
}
.bloom-cyan {
  width: 40rem; height: 40rem; right: -16rem; top: 18rem;
  background: radial-gradient(circle, color-mix(in oklch, var(--cyan) 20%, transparent), transparent 78%);
  animation: drift-b 48s var(--ease) infinite alternate;
}
@keyframes drift-a {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(5rem,3rem,0) scale(1.1); }
}
@keyframes drift-b {
  from { transform: translate3d(0,0,0) scale(1.06); }
  to   { transform: translate3d(-4rem,-3rem,0) scale(1); }
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
/* 90%, not 82%: the hero screenshot is bright and passes directly under
   the bar, and at 82% its content ghosted through behind the nav links. */
.nav[data-stuck="true"] {
  background: color-mix(in oklch, var(--canvas-deep) 90%, transparent);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand img { width: 34px; height: 34px; border-radius: 22%; }
.brand span {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.075rem;
  letter-spacing: -0.02em;
}

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  font-size: 0.9rem;
  color: var(--ink-muted);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: 0.85rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.925rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn svg { width: 1.05em; height: 1.05em; }

.btn-primary {
  background: linear-gradient(180deg, var(--violet), var(--violet-deep));
  color: oklch(0.16 0.03 292);
  box-shadow: 0 8px 24px -10px color-mix(in oklch, var(--violet) 70%, transparent);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -12px color-mix(in oklch, var(--violet) 85%, transparent);
}
.btn-primary svg { transition: transform 0.25s var(--ease); }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-ghost { color: var(--ink); border-color: var(--line); background: transparent; }
.btn-ghost:hover {
  border-color: color-mix(in oklch, var(--violet) 55%, transparent);
  background: color-mix(in oklch, var(--violet) 10%, transparent);
}

.btn-lg { padding: 0.9rem 1.6rem; font-size: 1rem; }

/* ---------- hero ---------- */

.hero { padding-top: clamp(3.5rem, 7vw, 6rem); padding-bottom: 0; }
.hero-inner { text-align: center; max-width: 52rem; margin-inline: auto; }

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  margin-bottom: 1.5rem;
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .hero h1 {
    background: linear-gradient(180deg, var(--ink) 30%, color-mix(in oklch, var(--ink) 62%, var(--violet)));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.hero-lede {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--ink-muted);
  max-width: 40rem;
  margin-inline: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-top: 1.75rem;
}

.hero-note {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

/* pill of capability names under the hero */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.hero-tags span {
  font-size: 0.78rem;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: color-mix(in oklch, var(--surface) 40%, transparent);
}

/* ---------- product shot ---------- */

/* Tight on purpose. At 1440x900 — an extremely common laptop — a larger gap
   put the entire screenshot below the fold, so the first thing a visitor saw
   ended on bare backdrop instead of on the product. */
.shot-wrap {
  margin-top: clamp(1.25rem, 3vw, 2.25rem);
  perspective: 1800px;
}

.shot {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  box-shadow:
    0 40px 90px -30px oklch(0.02 0.01 265 / 0.85),
    0 0 0 1px oklch(0.98 0.01 260 / 0.04);
}

.shot-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 70%, black);
}
.shot-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--line); }
.shot-url {
  margin-left: 0.75rem;
  font-size: 0.75rem;
  color: var(--ink-dim);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* The capture ends mid-card; fading it beats an arbitrary crop. */
.shot-img {
  display: block;
  width: 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
}

/* ---------- capability grid ---------- */

.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.cap {
  position: relative;
  padding: 1.6rem 1.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 55%, transparent);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
              background-color 0.35s var(--ease);
}
.cap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 0%, color-mix(in oklch, var(--violet) 18%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.cap:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklch, var(--violet) 42%, transparent);
  background: color-mix(in oklch, var(--surface) 78%, transparent);
}
.cap:hover::after { opacity: 1; }

.cap-icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.7rem;
  margin-bottom: 1rem;
  color: var(--violet);
  background: color-mix(in oklch, var(--violet) 15%, transparent);
  border: 1px solid color-mix(in oklch, var(--violet) 28%, transparent);
}
.cap-icon svg { width: 1.3rem; height: 1.3rem; }

.cap h3 { font-size: 1.075rem; margin-bottom: 0.45rem; letter-spacing: -0.02em; }
.cap p { font-size: 0.9rem; color: var(--ink-muted); line-height: 1.55; }

/* ---------- workflow ---------- */

.flow {
  position: relative;
  margin-top: clamp(2.75rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

/* the connecting rail, drawn behind the nodes */
.flow::before {
  content: "";
  position: absolute;
  top: 1.55rem;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg,
    color-mix(in oklch, var(--violet) 70%, transparent),
    color-mix(in oklch, var(--cyan) 60%, transparent));
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.6s var(--ease);
}
.flow.is-visible::before { transform: scaleX(1); }

.flow-step { position: relative; text-align: center; }

.flow-node {
  position: relative;
  z-index: 1;
  width: 3.1rem;
  height: 3.1rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--canvas);
  border: 1px solid color-mix(in oklch, var(--violet) 45%, transparent);
  color: var(--violet);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.flow-step:hover .flow-node {
  transform: translateY(-3px);
  box-shadow: 0 0 0 5px color-mix(in oklch, var(--violet) 12%, transparent);
}

.flow-step h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.flow-step p { font-size: 0.85rem; color: var(--ink-muted); line-height: 1.5; }

/* The shared .section padding is right for its siblings but wrong here: the
   rail is only ~170px tall, so a fixed 128px top and bottom left it stranded
   in a large empty field (36.6% padding-to-content against 24-29% elsewhere).
   Desktop only — stacked on mobile the section is already the tightest. */
@media (min-width: 941px) {
  #workflow.section { padding-block: clamp(3.5rem, 6vw, 5.5rem); }
}

/* ---------- field / mobile ---------- */

.field {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}

.field-list { margin-top: 1.9rem; display: grid; gap: 1.1rem; }
.field-item { display: flex; gap: 0.9rem; align-items: flex-start; }
.field-item .tick {
  flex: none;
  margin-top: 0.15rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in oklch, var(--violet) 18%, transparent);
  border: 1px solid color-mix(in oklch, var(--violet) 40%, transparent);
  color: var(--violet);
  font-size: 0.7rem;
  font-weight: 700;
}
.field-item strong { display: block; font-size: 0.975rem; font-weight: 600; }
.field-item span { font-size: 0.9rem; color: var(--ink-muted); }

.phone {
  position: relative;
  justify-self: center;
  width: min(300px, 78vw);
  padding: 0.6rem;
  border-radius: 2.4rem;
  background: linear-gradient(160deg, oklch(0.30 0.02 264), oklch(0.16 0.02 264));
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -32px oklch(0.02 0.01 265 / 0.9);
}
/* Deliberately NO notch overlay. The capture is a full-bleed app screenshot
   with no status bar, so a drawn notch would sit on top of the app's own
   header and cover the first line of real UI. */
.phone img { border-radius: 1.9rem; width: 100%; }

.phone-glow {
  position: absolute;
  inset: -14%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklch, var(--violet) 30%, transparent), transparent 62%);
}

/* ---------- final CTA ---------- */

.cta-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(2.75rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 3rem);
  border-radius: var(--radius-xl);
  border: 1px solid color-mix(in oklch, var(--violet) 30%, transparent);
  background:
    radial-gradient(90% 130% at 50% 0%, color-mix(in oklch, var(--violet) 22%, transparent), transparent 65%),
    color-mix(in oklch, var(--surface) 55%, transparent);
}
.cta-card h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); }
.cta-card p { margin: 1.1rem auto 0; max-width: 38rem; color: var(--ink-muted); }
.cta-card .hero-actions { margin-top: 2rem; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.75rem, 5vw, 4rem) 2rem;
  background: var(--canvas-deep);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}
.footer-brand p {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-dim);
  max-width: 30ch;
}
.footer h4 {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 1rem;
  font-weight: 600;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.footer li a {
  font-size: 0.9rem;
  color: var(--ink-muted);
  transition: color 0.2s var(--ease);
}
.footer li a:hover { color: var(--ink); }

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--ink-dim);
}

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
/* Staggering is applied per-index by main.js via --i. */
.reveal { transition-delay: calc(var(--i, 0) * 70ms); }

/* No JS? Nothing may stay hidden. */
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .field { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .flow { grid-template-columns: 1fr; gap: 0; text-align: left; }
  .flow::before { display: none; }
  .flow-step {
    text-align: left;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 1rem;
    padding-bottom: 1.75rem;
  }
  .flow-node { margin: 0; grid-row: span 2; }
  /* vertical rail between the stacked nodes */
  .flow-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 1.55rem;
    top: 3.1rem;
    bottom: 0.35rem;
    width: 2px;
    background: linear-gradient(180deg, color-mix(in oklch, var(--violet) 55%, transparent), transparent);
  }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  :root { --nav-h: 60px; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
}

/* On the narrowest phones the brand plus two nav buttons no longer fit on one
   line. The ghost "Sign in" is the one to drop: it points at the same origin
   as "Get started", and both the hero and the footer still offer it. */
@media (max-width: 420px) {
  .nav-actions .btn-ghost { display: none; }
  .nav-actions .btn { padding: 0.6rem 1rem; font-size: 0.875rem; }
  .brand span { font-size: 1rem; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .flow::before { transform: scaleX(1); }
}
