/* ============================================
   ATTORA — Revenue Intelligence System
   ============================================ */

:root {
  --black: #0B0B0B;
  --black-deep: #050505;
  --white: #FFFFFF;
  --white-muted: rgba(255, 255, 255, 0.6);
  --white-dim: rgba(255, 255, 255, 0.45);
  --red: #E11B22;
  --red-glow: rgba(225, 27, 34, 0.3);
  --red-faint: rgba(225, 27, 34, 0.08);
  --gray-surface: #111111;
  --gray-border: rgba(255, 255, 255, 0.06);
  --gray-border-hover: rgba(255, 255, 255, 0.1);

  --font: 'Inter', -apple-system, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.6;
  overflow-x: hidden;
}

body.loading {
  overflow: hidden;
}

a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--white-muted);
}

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

::selection {
  background: var(--red);
  color: var(--white);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--black);
}

::-webkit-scrollbar-thumb {
  background: rgba(225, 27, 34, 0.3);
  border-radius: 2px;
}

/* ============================================
   LOADER
   ============================================ */

.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--black);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__dot {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 30px 10px var(--red-glow);
  animation: loaderPulse 1.2s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 1; }
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */

.cursor {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}

@media (pointer: fine) {
  body.cursor-ready { cursor: none; }
  body.cursor-ready a,
  body.cursor-ready button,
  body.cursor-ready [data-hover] { cursor: none; }
  .cursor { display: block; }
}

.cursor__core {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
}

.cursor__ring {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 1px solid var(--red-glow);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              border-color 0.3s ease,
              opacity 0.3s ease;
}

.cursor.is-hovering .cursor__ring {
  width: 52px;
  height: 52px;
  border-color: var(--red);
}

.cursor.is-hovering .cursor__core {
  transform: translate(-50%, -50%) scale(1.5);
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.nav.scrolled {
  background: rgba(11, 11, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo-img {
  height: 18px;
  width: auto;
  object-fit: contain;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.nav__logo-img:hover {
  opacity: 1;
}

@media (min-width: 768px) {
  .nav__logo-img {
    height: 22px;
  }
}

.nav__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-dim);
}

.nav__status-dot {
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  animation: urgencyPulse 2s ease-in-out infinite;
}

/* ============================================
   HERO
   ============================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  overflow: hidden;
}

.hero__logo-visual {
  position: relative;
  display: block;
  margin: 0 auto var(--space-md);
  width: fit-content;
  overflow: visible;
}

.hero__ring,
.hero__glow {
  pointer-events: none;
}

.hero__logo-img {
  display: block;
  width: clamp(280px, 40vw, 500px);
  height: auto;
  position: relative;
  z-index: 2;
  opacity: 0;
}

.hero__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(225, 27, 34, 0.5) 0%, rgba(225, 27, 34, 0) 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0;
}

.hero__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(225, 27, 34, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero__tagline {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-dim);
  margin-bottom: var(--space-sm);
  opacity: 0;
  transform: translateY(10px);
}

.hero__headline {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  opacity: 0;
  transform: translateY(20px);
}

.hero__sub {
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  color: var(--white-muted);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: var(--space-md);
  opacity: 0;
  transform: translateY(20px);
}

.hero__invite-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--red-faint);
  border-radius: 100px;
  opacity: 0;
  transform: translateY(10px);
}

.hero__invite-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  animation: urgencyPulse 2s ease-in-out infinite;
}

.hero__invite-text {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-muted);
}

/* Scroll indicator */
.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
}

.hero__scroll-line {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, var(--white-dim), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
  padding: var(--space-2xl) var(--space-md);
}

.section--light {
  padding: var(--space-xl) var(--space-md);
}

.section__inner {
  max-width: 1000px;
  margin: 0 auto;
}

.section__inner--narrow {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.section__label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-dim);
  margin-bottom: var(--space-sm);
}

.section__headline {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  max-width: 700px;
}

.section__body {
  max-width: 640px;
}

.section__body p {
  color: var(--white-muted);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.section__accent {
  color: var(--white) !important;
  font-weight: 500 !important;
}

.section__body--system {
  max-width: 700px;
  color: var(--white-muted);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

/* ============================================
   PROOF STRIP
   ============================================ */

.proof-strip {
  padding: var(--space-xl) var(--space-md);
  border-top: 1px solid var(--gray-border);
  border-bottom: 1px solid var(--gray-border);
}

.proof-strip__inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
}

.proof-strip__stat {
  text-align: center;
}

.proof-strip__number {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--white);
  display: inline-block;
  position: relative;
}

.proof-strip__number.is-counting {
  animation: statGlitch 0.15s steps(2) infinite;
}

.proof-strip__number.is-idle {
  animation: statGlitchIdle 4s step-end infinite;
}

@keyframes statGlitch {
  0% { text-shadow: 2px 0 var(--red), -2px 0 rgba(0,255,255,0.3); }
  25% { text-shadow: -2px 0 var(--red), 2px 0 rgba(0,255,255,0.3); }
  50% { text-shadow: 1px 0 var(--red), -1px 0 rgba(0,255,255,0.3); }
  75% { text-shadow: -1px 0 var(--red), 1px 0 rgba(0,255,255,0.3); }
  100% { text-shadow: 2px 0 var(--red), -2px 0 rgba(0,255,255,0.3); }
}

@keyframes statGlitchIdle {
  0%, 100% { text-shadow: none; }
  10% { text-shadow: 2px 0 var(--red), -2px 0 rgba(0,255,255,0.3); }
  10.5% { text-shadow: -1px 0 var(--red), 1px 0 rgba(0,255,255,0.3); }
  11% { text-shadow: none; }
  45% { text-shadow: -2px 0 var(--red), 2px 0 rgba(0,255,255,0.3); }
  45.5% { text-shadow: 1px 0 var(--red), -1px 0 rgba(0,255,255,0.3); }
  46% { text-shadow: none; }
  78% { text-shadow: 2px 0 var(--red), -2px 0 rgba(0,255,255,0.3); }
  78.3% { text-shadow: none; }
  78.6% { text-shadow: -1px 0 var(--red), 1px 0 rgba(0,255,255,0.3); }
  79% { text-shadow: none; }
}

.proof-strip__symbol {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 300;
  color: var(--red);
}

.proof-strip__label {
  font-size: 0.8rem;
  color: var(--white-dim);
  font-weight: 300;
  margin-top: var(--space-xs);
  max-width: 200px;
  line-height: 1.5;
}

/* ============================================
   TRUST / THE SHIFT
   ============================================ */

.section--trust {
  padding: var(--space-xl) var(--space-md);
  border-top: 1px solid var(--gray-border);
}

.section__inner--trust {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.section__body--trust {
  max-width: none;
  text-align: center;
}

.section__body--trust p {
  color: var(--white-muted);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.trust__closer {
  border-top: 1px solid var(--red-faint);
  padding-top: var(--space-md);
  margin-top: var(--space-lg);
}

/* ============================================
   FILM GRAIN
   ============================================ */

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ============================================
   SYSTEM DIAGRAM
   ============================================ */

.system__diagram {
  margin-top: var(--space-lg);
  padding: var(--space-lg) 0;
}

.system__svg {
  width: 100%;
  height: auto;
  max-height: 320px;
}

.system__line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1.5;
}

.system__dot {
  fill: var(--red);
  opacity: 0;
}

.system__core-ring {
  fill: none;
  stroke: rgba(225, 27, 34, 0.3);
  stroke-width: 1;
  opacity: 0;
}

.system__core-center {
  fill: var(--red);
  opacity: 0;
}

.system__core-label {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  fill: var(--white-dim);
  text-anchor: middle;
  opacity: 0;
}

.system__text {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--white-muted);
  opacity: 0;
}

.system__text--output {
  text-anchor: start;
}

/* ============================================
   CAPABILITIES
   ============================================ */

.section--capabilities {
  border-top: 1px solid var(--gray-border);
}

.capabilities__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.capability-card {
  position: relative;
  background: var(--gray-surface);
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  padding: var(--space-md);
  transition: background 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.capability-card:hover {
  background: #141414;
  border-color: var(--gray-border-hover);
}

.capability-card__accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: var(--red);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.capability-card:hover .capability-card__accent {
  opacity: 1;
}

.capability-card__icon {
  color: var(--white-dim);
  margin-bottom: var(--space-md);
  transition: color 0.3s ease;
}

.capability-card:hover .capability-card__icon {
  color: var(--red);
}

.capability-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.capability-card__desc {
  font-size: 0.85rem;
  color: var(--white-muted);
  font-weight: 300;
  line-height: 1.7;
}

/* ============================================
   CLOSING SECTION
   ============================================ */

.section--closing {
  padding: var(--space-xl) var(--space-md);
  border-top: 1px solid var(--gray-border);
}

.closing__contact {
  font-size: 0.95rem;
  color: var(--white-dim);
  font-weight: 300;
  margin-top: var(--space-md);
}

.closing__contact a {
  color: var(--white);
  border-bottom: 1px solid var(--red-faint);
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.closing__contact a:hover {
  color: var(--red);
  border-color: var(--red);
}

@keyframes urgencyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 27, 34, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(225, 27, 34, 0); }
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: var(--space-lg) var(--space-md);
  border-top: 1px solid var(--gray-border);
}

.footer__inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__logo {
  height: 16px;
  width: auto;
  opacity: 0.55;
}

.footer__links {
  display: flex;
  gap: var(--space-md);
}

.footer__link {
  font-size: 0.8rem;
  color: var(--white-dim);
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: color 0.3s ease;
}

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

.footer__copy {
  font-size: 0.75rem;
  color: var(--white-dim);
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out-quart),
              transform 0.8s var(--ease-out-quart);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .capabilities__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .proof-strip__inner {
    flex-direction: column;
    gap: var(--space-lg);
    align-items: center;
  }

  .hero {
    padding: var(--space-xl) var(--space-sm) var(--space-lg);
  }

  .hero__logo-img {
    width: clamp(260px, 80vw, 400px);
  }

  .hero__logo-visual {
    margin-bottom: var(--space-md);
  }

  .capabilities__grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: var(--space-xl) var(--space-sm);
  }

  .section--light,
  .section--trust,
  .section--closing {
    padding: var(--space-lg) var(--space-sm);
  }

  .footer__inner {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  /* Hide SVG diagram on mobile, show simplified text */
  .system__diagram {
    display: none;
  }

  .nav {
    padding: var(--space-xs) var(--space-sm);
  }

  .nav__logo-img {
    height: 16px;
  }
}

@media (max-width: 480px) {
  .section__headline {
    font-size: 1.6rem;
  }

  .hero__headline {
    font-size: 1.8rem;
  }

  .hero__logo-img {
    width: 85vw;
  }
}

/* ============================================
   GSAP FALLBACK (if JS fails to load)
   ============================================ */

.no-js .hero__headline,
.no-js .hero__tagline,
.no-js .hero__sub,
.no-js .hero__invite-badge,
.no-js .hero__logo-img,
.no-js .hero__scroll-indicator,
.no-js .reveal {
  opacity: 1;
  transform: none;
}
