/* ============================================
   RIPLEY LABS — Marketing Site
   Editorial luxury + technical precision
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg: #08080a;
  --bg-elevated: #111114;
  --bg-card: #16161a;
  --bg-card-hover: #1c1c21;
  --border: #27272e;
  --border-subtle: #1e1e24;

  --text: #e4e4e7;
  --text-bright: #fafafa;
  --text-muted: #71717a;
  --text-dim: #52525b;

  --accent: #c9a84c;
  --accent-hover: #d4b65e;
  --accent-dim: rgba(201, 168, 76, 0.12);
  --accent-glow: rgba(201, 168, 76, 0.06);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Grain Overlay --- */
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' 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;
}

/* --- Scroll Progress --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  z-index: 10001;
  width: 0%;
  transition: none;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(8, 8, 10, 0.85);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom-color: var(--border-subtle);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--text-bright);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--bg);
  font-weight: 400;
}

.nav-logo-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-bright);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.25s ease;
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  color: var(--text-bright);
}

.nav-cta {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bg) !important;
  background: var(--text-bright);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--bg) !important;
  transform: translateY(-1px);
}

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s ease;
}

/* --- Sections Common --- */
.section {
  padding: clamp(4rem, 10vw, 8rem) clamp(1.5rem, 4vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.65;
}

/* --- Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

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

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

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-height) + 4rem) clamp(1.5rem, 4vw, 3rem) 4rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.hero-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7.5vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--text-bright);
  margin-bottom: 2rem;
  max-width: 800px;
}

.hero-headline .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: wordReveal 0.7s var(--ease-out) forwards;
}

.hero-headline .word:nth-child(1) { animation-delay: 0.4s; }
.hero-headline .word:nth-child(2) { animation-delay: 0.55s; }
.hero-headline .word:nth-child(3) { animation-delay: 0.7s; }

.hero-headline em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-size: clamp(1rem, 1.8vw, 1.1875rem);
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 1s forwards;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 1.15s forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--text-bright);
  padding: 0.75rem 1.75rem;
  border-radius: 100px;
  transition: all 0.3s ease;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-dim);
}

.btn-primary .arrow {
  transition: transform 0.3s ease;
}

.btn-primary:hover .arrow {
  transform: translateX(3px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-muted);
  padding: 0.75rem 0;
  transition: color 0.3s ease;
}

.btn-secondary:hover {
  color: var(--text-bright);
}

.btn-secondary .arrow {
  transition: transform 0.3s ease;
}

.btn-secondary:hover .arrow {
  transform: translateY(3px);
}

/* --- Scroll Indicator --- */
.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 1.5s forwards;
}

.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scrollLine 2s ease-in-out infinite;
}

.hero-scroll-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  writing-mode: vertical-rl;
}

/* ============================================
   HOW IT WORKS
   ============================================ */
.how-it-works {
  border-top: 1px solid var(--border-subtle);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 4rem;
}

.step {
  padding: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  transition: all 0.4s ease;
  position: relative;
}

.step:hover {
  border-color: var(--border);
  background: var(--bg-card);
  transform: translateY(-4px);
}

.step-number {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--accent-dim);
  line-height: 1;
  margin-bottom: 1.5rem;
  transition: color 0.4s ease;
}

.step:hover .step-number {
  color: rgba(201, 168, 76, 0.25);
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.step-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.step-connector {
  display: none;
}

/* ============================================
   USE CASES
   ============================================ */
.use-cases {
  border-top: 1px solid var(--border-subtle);
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 4rem;
}

.case-card {
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.case-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.case-card:hover {
  border-color: var(--border);
  background: var(--bg-card);
}

.case-card:hover::before {
  opacity: 1;
}

.case-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  font-size: 1.25rem;
}

.case-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.case-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.case-roles {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.case-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.case-gate {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.case-example {
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  background: rgba(201, 168, 76, 0.04);
  border-left: 2px solid var(--accent-dim);
}

.case-example p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-style: italic;
}

/* ============================================
   PRICING
   ============================================ */
.pricing {
  border-top: 1px solid var(--border-subtle);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 4rem;
}

.price-card {
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  transition: all 0.4s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  border-color: rgba(201, 168, 76, 0.2);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.04) 0%, var(--bg-elevated) 100%);
}

.price-card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
}

.price-card.featured:hover {
  border-color: rgba(201, 168, 76, 0.35);
}

.price-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  width: fit-content;
}

.price-tier {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.price-amount {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}

.price-currency {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 300;
}

.price-value {
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: var(--text-bright);
  line-height: 1;
}

.price-period {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.price-divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  margin-bottom: 2rem;
}

.price-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 2.5rem;
  flex-grow: 1;
}

.price-features li {
  font-size: 0.9375rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.5;
}

.price-features li::before {
  content: '\25C7';
  color: var(--accent);
  font-size: 0.625rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.price-cta {
  width: 100%;
  padding: 0.875rem;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  display: block;
}

.price-cta-primary {
  background: var(--text-bright);
  color: var(--bg);
}

.price-cta-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-dim);
}

.price-cta-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.price-cta-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text-bright);
  transform: translateY(-2px);
}

/* ============================================
   CTA / SOCIAL PROOF
   ============================================ */
.cta-section {
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.cta-section .section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text-bright);
  margin-bottom: 1.25rem;
  max-width: 600px;
  line-height: 1.15;
}

.cta-title em {
  font-style: italic;
  color: var(--accent);
}

.cta-desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 480px;
  line-height: 1.65;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 4rem clamp(1.5rem, 4vw, 3rem) 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand-text {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 280px;
  margin-top: 1rem;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.25s ease;
}

.footer-links a:hover {
  color: var(--text-bright);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

.footer-legal a {
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: color 0.25s ease;
}

.footer-legal a:hover {
  color: var(--text-muted);
}

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

@keyframes wordReveal {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollLine {
  0% { top: -100%; }
  50% { top: 100%; }
  100% { top: 100%; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

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

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 8, 10, 0.97);
    backdrop-filter: blur(24px);
    padding: 2rem;
    gap: 1.5rem;
    align-items: flex-start;
    z-index: 9999;
  }

  .nav-links.open a {
    font-size: 1.25rem;
    color: var(--text);
  }

  .nav-links.open .nav-cta {
    margin-top: 1rem;
    font-size: 1rem;
    padding: 0.75rem 2rem;
  }

  .nav-mobile-toggle {
    display: flex;
  }

  .hero {
    min-height: 90vh;
  }

  .hero-scroll {
    display: none;
  }

  .case-card {
    padding: 2rem;
  }

  .price-card {
    padding: 2rem;
  }

  .step {
    padding: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-headline {
    font-size: 2.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }
}
