/* ==========================================================================
   Brooks Digital — styles.css
   ========================================================================== */

/* --- Fonts --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
  size-adjust: 107%;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/space-grotesk-latin.woff2) format('woff2');
}

/* --- Design Tokens --- */
:root {
  --bg:         hsl(0, 0%, 4%);
  --bg-raised:  hsl(0, 0%, 7%);
  --bg-subtle:  hsl(0, 0%, 10%);
  --border:     hsl(0, 0%, 14%);
  --border-top: hsl(0, 0%, 20%);
  --text:       hsl(0, 0%, 95%);
  --text-muted: hsl(0, 0%, 55%);
  --white:      hsl(0, 0%, 100%);
  --black:      hsl(0, 0%, 0%);

  --container:  1080px;
  --radius:     0.5rem;
  --radius-lg:  0.75rem;

  --font: 'Inter', 'Inter Fallback', system-ui, -apple-system, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

/* Global fine grid overlay — software/IDE feel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(hsla(0, 0%, 100%, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, hsla(0, 0%, 100%, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Scroll Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.35s; }

/* --- CTA Button --- */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn-cta:hover {
  opacity: 0.9;
  box-shadow: 0 0 24px hsla(0, 0%, 100%, 0.15);
}

.btn-cta:active {
  transform: scale(0.98);
}

.btn-cta--xl {
  font-size: 1.0625rem;
  padding: 1rem 2.5rem;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: hsla(0, 0%, 4%, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  contain: layout style;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.header__name {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}

.header__logo {
  height: 5.5rem;
  width: auto;
}

/* --- Hero --- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Decorative chart background */
.hero__chart {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  max-width: 1400px;
  height: 70%;
  pointer-events: none;
  opacity: 0;
  animation: chartFadeIn 1.5s ease 0.3s forwards;
  mask-image: radial-gradient(ellipse 70% 80% at 50% 60%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 60%, black 20%, transparent 100%);
}

.hero__chart svg {
  width: 100%;
  height: 100%;
}

.hero__chart-line {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawLine 2.5s ease 0.6s forwards;
}

@keyframes chartFadeIn {
  to { opacity: 1; }
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* Dot grid pattern */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, hsla(0, 0%, 100%, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 100%);
}

/* Radial glow */
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, hsla(0, 0%, 100%, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  text-align: center;
  z-index: 1;
}

.hero__tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding: 0.375rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
}

.hero__title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
  max-width: 48rem;
  margin: 0 auto 1.5rem;
}

.hero__subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* --- Section (shared) --- */
.section {
  padding: 5rem 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
  position: relative;
}

.section__tag {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.75rem;
}

.section__title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--white);
  text-align: center;
  margin-bottom: 3.5rem;
}

/* Gradient line divider between sections */
.section + .section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(80%, 600px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-top), transparent);
}

/* --- Section Dashboard Backgrounds --- */
.section__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 10%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 10%, transparent 80%);
}

.section__bg svg {
  width: 100%;
  height: 100%;
}

.section .container {
  position: relative;
  z-index: 1;
}

/* --- Section background tints --- */
.benefits {
  background: linear-gradient(180deg, var(--bg) 0%, hsl(0, 0%, 6%) 50%, var(--bg) 100%);
}

.section--how {
  background: linear-gradient(180deg, var(--bg) 0%, hsl(0, 0%, 5.5%) 50%, var(--bg) 100%);
}

.faq-section {
  background: linear-gradient(180deg, var(--bg) 0%, hsl(0, 0%, 6%) 50%, var(--bg) 100%);
}

/* --- Benefits --- */
.benefits__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.benefit {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.benefit:hover {
  border-color: var(--border-top);
  transform: translateY(-2px);
}

.benefit__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  margin-bottom: 1.25rem;
}

.benefit__title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.benefit__desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- Steps (How It Works) --- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.step {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-top);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.step:hover {
  border-color: var(--border-top);
  transform: translateY(-2px);
}

.step__number {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(180deg, var(--border-top), var(--border));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 1rem;
}

.step__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.step__desc {
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- FAQ --- */
.faq {
  max-width: 680px;
  margin: 0 auto;
}

.faq__item {
  border-bottom: 1px solid var(--border);
}

.faq__item:first-child {
  border-top: 1px solid var(--border);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.5rem 0;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  transition: color 0.15s ease;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq__item[open] .faq__question::after {
  transform: rotate(45deg);
}

.faq__question:hover {
  color: var(--white);
}

.faq__answer {
  padding: 0 0 1.5rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.9375rem;
}

/* --- Final CTA --- */
.final-cta {
  text-align: center;
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
}

/* Override the gradient line for final-cta — use full-width border instead */
.final-cta.section::before {
  width: 100%;
  background: var(--border);
}

.final-cta::after {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, hsla(0, 0%, 100%, 0.025) 0%, transparent 70%);
  pointer-events: none;
}

.final-cta__title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.final-cta__subtitle {
  color: var(--text-muted);
  max-width: 32rem;
  margin: 0 auto 2rem;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.final-cta .btn-cta {
  position: relative;
  z-index: 1;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer__logo {
  height: 3.5rem;
  width: auto;
  opacity: 0.6;
}

.footer__copy {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (min-width: 768px) {
  .hero {
    padding: 6rem 0 5rem;
  }

  .hero__title {
    font-size: 3rem;
  }

  .hero__subtitle {
    font-size: 1.25rem;
  }

  .section {
    padding: 6rem 0;
  }

  .section__title {
    font-size: 2.25rem;
  }

  .benefits__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }

  .final-cta {
    padding: 7rem 0;
  }

  .final-cta__title {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 8rem 0 6rem;
  }

  .hero__title {
    font-size: 3.75rem;
  }

  .section {
    padding: 7rem 0;
  }
}

@media (max-width: 767px) {
  .btn-cta {
    min-height: 3rem;
  }

  .btn-cta--xl {
    min-height: 3.5rem;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn-cta,
  .benefit,
  .step {
    transition: none;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
