/* Shared styles for landing and how pages */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --color-bg: #000000;
  --color-text: #ffffff;
  --color-text-subtle: #888888;
  --color-accent: #ffffff;
  --color-border: #333333;
  --grid-columns: 12;
  --grid-gap: 24px;
  --container-max: 1440px;
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--color-bg);
}

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

body.how-page {
  overflow: hidden;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp 1s var(--ease-out) forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ==========================================================================
   Layout & Grid
   ========================================================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
}

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

.section-split {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.section-title {
  grid-column: 1 / 5;
  margin-bottom: 8px;
}

.section-body {
  grid-column: 6 / 13;
  margin-top: 8px;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1 {
  font-size: 4.5rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 400;
  margin-bottom: 2.5rem;
  color: #fff;
}

h2 {
  font-size: 2.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  color: #b0b0b0;
}

p.lead {
  font-size: 1.5rem;
  line-height: 1.5;
  font-weight: 300;
  color: #d0d0d0;
  margin-bottom: 2rem;
}

.label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--color-text-subtle);
  margin-bottom: 1.5rem;
  display: block;
  border-left: 1px solid var(--color-accent);
  padding-left: 12px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.7;
}

/* ==========================================================================
   Header
   ========================================================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 40px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-max);
  margin: 0 auto;
}

.logo {
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: #fff;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-links .btn-outline {
  border: none;
  background: transparent;
  padding: 10px 16px;
}
.nav-links .btn-outline:hover {
  background: rgba(255,255,255,0.08);
}
.nav-links .btn-outline {
  border: none;
  background: transparent;
  padding: 10px 16px;
}
.nav-links .btn-outline:hover {
  background: rgba(255,255,255,0.08);
}

.hamburger {
  display: none;
  width: 32px;
  height: 24px;
  flex-direction: column;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  right: 16px;
  background: rgba(0,0,0,0.9);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px;
  z-index: 200;
  min-width: 200px;
}

.mobile-menu a {
  display: block;
  padding: 10px 12px;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
}

.mobile-menu a:hover {
  background: rgba(255,255,255,0.08);
}

.mobile-menu.show {
  display: block;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}

.logo {
  text-decoration: none;
}

/* ==========================================================================
   Sections
   ========================================================================== */
section {
  padding: 80px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
}

section:last-child {
  border-bottom: none;
}

/* ==========================================================================
   Hero (Landing Page)
   ========================================================================== */
.hero {
  padding-top: 20px;
  padding-bottom: 20px;
  min-height: 100vh;
  display: grid;
  align-items: stretch;
  position: relative;
}

.hero-content {
  grid-column: 1 / 7;
  position: relative;
  z-index: 10;
  padding-right: 40px;
  align-self: center;
}

.hero-visual {
  grid-column: 7 / 13;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: clamp(500px, 80vh, 900px);
  z-index: 5;
  overflow: visible;
  background: transparent;
}

.hero-visual canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.flag-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 10px;
  background-color: var(--color-text);
}

/* ==========================================================================
   Lists
   ========================================================================== */
ul.clean-list {
  list-style: none;
  margin-top: 2rem;
}

ul.clean-list li {
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}

ul.clean-list li:hover {
  background: rgba(255,255,255,0.02);
  padding-left: 10px;
  padding-right: 10px;
}

ul.clean-list li:last-child {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

ul.clean-list strong {
  font-weight: 500;
  color: #fff;
}

ul.clean-list span {
  color: var(--color-text-subtle);
  font-size: 0.95rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s var(--ease-out);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
}

.btn-primary:hover {
  background: #e0e0e0;
  border-color: #e0e0e0;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255,255,255,0.1);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.05);
}

.cta-group {
  display: flex;
  gap: 16px;
  margin-top: 40px;
}

/* ==========================================================================
   Features Grid (Landing Page)
   ========================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
  color: #b0b0b0;
  line-height: 1.5;
}

/* ==========================================================================
   Platform List (Landing Page)
   ========================================================================== */
.platform-list {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.platform-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50px;
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
}

.platform-item img {
  width: 24px;
  height: 24px;
  filter: invert(1) brightness(1.2);
}

.platform-item.teams img {
  filter: none;
  width: 24px;
  height: 24px;
}

/* Responsive adjustments for new elements */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  padding: 20px 0;
  background: #000;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ==========================================================================
   HOW PAGE - Layout
   ========================================================================== */
.how-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100dvh;
  min-height: 100vh;
  padding-top: 80px;
  overflow: hidden;
}

.graph-panel {
  position: relative;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
  margin-bottom: 4px;
  flex-shrink: 0;
}

#how-graph {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.legend-how {
  position: relative;
  width: 100%;
  margin-top: 12px;
  font-size: 1.125rem;
  color: #fff;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  display: none;
}

.legend-how.legend-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   HOW PAGE - Steps Container
   ========================================================================== */
.steps {
  position: relative;
  width: 100%;
  z-index: 0;
  margin-top: 4px;
  padding: 0;
  flex: 1;
  min-height: 0;
}

.step-indicators-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  flex-shrink: 0;
}

.step-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.step-dot.active {
  background: #fff;
  transform: scale(1.2);
}

/* Navigation hint chevrons */
.nav-hint {
  font-size: 1.5rem;
  color: rgba(255,255,255,0.4);
  font-weight: 300;
  user-select: none;
  transition: color 0.4s ease, opacity 0.4s ease;
  transform: translateY(-1px);
}

/* First frame state: left hidden, right white + animated */
.nav-hint-left.first-frame {
  opacity: 0;
}

/* Right chevron on first frame starts grey, animates after text completes via hint-animate */

/* Bounce animation for frames 2+ after text completes */
.nav-hint-right.hint-animate {
  color: #fff;
  animation: pulseIn 0.4s ease-out, bounceRight 1.5s ease-in-out 0.4s infinite;
}

@keyframes pulseIn {
  0% {
    transform: translate(0, -1px) scale(1);
    opacity: 0.4;
  }
  50% {
    transform: translate(0, -1px) scale(1.5);
    opacity: 1;
  }
  100% {
    transform: translate(0, -1px) scale(1);
    opacity: 1;
  }
}

@keyframes bounceRight {
  0%, 100% { transform: translate(0, -1px); }
  50% { transform: translate(4px, -1px); }
}

/* Word-by-word text animation */
.word {
  opacity: 0;
  display: inline;
  filter: blur(4px);
}

/* Hide list markers until animation */
.step li::marker {
  color: transparent;
  transition: color 0.6s ease;
}

.step li.list-visible::marker {
  color: #c5c5c5;
  transition-delay: var(--marker-delay, 0ms);
}

.word.word-visible {
  animation: wordReveal 0.6s ease forwards;
}

@keyframes wordReveal {
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* ==========================================================================
   HOW PAGE - Individual Step
   ========================================================================== */
.step {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 28px 24px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  pointer-events: none;
  visibility: hidden;
}

.step.step-active {
  pointer-events: auto;
  visibility: visible;
}

.step p,
.step ul {
  max-width: 720px;
  width: 100%;
}

.step ul {
  list-style: disc;
  list-style-position: inside;
  margin: 0 0 18px 0;
  padding: 0;
  text-align: center;
}

.step ul li {
  margin-bottom: 10px;
  color: #c5c5c5;
  font-size: 1.05rem;
  line-height: 1.5;
}

.scenario-text {
  font-style: italic;
  color: #cfcfcf;
}

.adjectives {
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  color: #fff;
  margin: 1rem 0 1.5rem;
}

.adjectives strong {
  color: #fff;
}

/* Ensure CTA is always visible on last frame */
.step:last-child {
  padding-bottom: 24px;
}

.step .cta-group {
  margin-top: 24px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.step .cta-group.cta-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   HOW PAGE - Orientation Responsive (Graph Panel Size)
   ========================================================================== */
@media (orientation: landscape) {
  .graph-panel {
    width: 50%;
    max-width: 50vw;
    height: 35vh;
    max-height: 35vh;
    min-height: 120px;
    margin-top: 12px;
  }
}

@media (orientation: portrait) {
  .graph-panel {
    width: 95%;
    max-width: 95vw;
    height: 35vh;
    max-height: 35vh;
    min-height: 100px;
    margin-top: 10px;
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  h1 { font-size: 3.5rem; }
  .hero-content { grid-column: 1 / 7; }
  .hero-visual { grid-column: 7 / 13; height: 500px; }
}

@media (max-width: 900px) {
  /* Hero adjustments */
  .hero {
    display: block;
    padding-top: 160px;
    height: auto;
    min-height: auto;
  }
  .hero-content {
    width: 100%;
    padding-right: 0;
    margin-bottom: 60px;
  }
  .hero-visual {
    width: 100%;
    height: 400px;
    min-height: 400px;
  }

  /* Grid adjustments */
  .grid,
  .section-split {
    display: block;
  }
  .container { padding: 0 24px; }
  .section-title { margin-bottom: 40px; }

  /* Typography */
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2rem; }

  /* How page */
  .how-layout {
    padding-top: 70px;
    height: calc(100vh - 70px);
  }

  .step {
    padding: 8px 16px;
  }

  .step p {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }

  .how-layout {
    padding-top: 60px;
    height: calc(100vh - 60px);
  }

  .graph-panel {
    border-radius: 12px;
    margin-bottom: 6px;
  }

  .steps {
    margin-top: 4px;
  }

  .step {
    padding: 4px 12px;
  }

  .step p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }

  .step ul {
    margin: 0 0 12px 18px;
  }

  .step ul li {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .cta-group {
    margin-top: 20px;
  }
}

@media (max-width: 420px) {
  .how-layout {
    padding-top: 56px;
    height: calc(100vh - 56px);
  }

  .graph-panel {
    border-radius: 10px;
    margin-bottom: 4px;
  }

  .step {
    padding: 2px 10px;
  }

  .step p {
    font-size: 0.85rem;
    line-height: 1.35;
    margin-bottom: 0.4rem;
  }

  .step ul li {
    font-size: 0.8rem;
    margin-bottom: 2px;
  }

  header {
    padding: 12px 16px;
  }

  .logo {
    font-size: 0.9rem;
  }

  .btn-outline {
    padding: 8px 14px !important;
    font-size: 0.75rem !important;
  }
}
