/* ============================================================
   Riddim Lab — landing page styles
   Shared tokens (palette, reset, focus, visually-hidden) live
   in shared/tokens.css, loaded before this file.
   ============================================================ */

:root {
  --glow:         rgba(139, 92, 246, 0.25);
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body:    'Space Grotesk', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--slate);
  color: var(--cloud);
  overflow-x: hidden;
}

/* ── SKIP LINK ────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -4rem; left: 1rem;
  background: var(--violet);
  color: var(--cloud);
  padding: 0.5rem 1rem;
  border-radius: 0 0 0.5rem 0.5rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  text-decoration: none;
  z-index: 200;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* ── HEADER ──────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet-bright);
}

.nav-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--violet-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--cloud); }

/* ── HERO ────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 55% at 50% 52%, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet-muted);
  margin-bottom: 1.75rem;
  animation: hl-enter 0.9s ease-out both;
}

.hero-title {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 20vw, 18rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.025em;
  color: var(--cloud);
  user-select: none;
  position: relative;
  z-index: 1;
}

.hero-letter {
  display: inline-block;
  transform-origin: center bottom;
}

/* ── HERO ENTER (opacity only — doesn't conflict with transform animations) ── */

@keyframes hl-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── HERO AMBIENT KEYFRAMES ───────────────────────────────── */

@keyframes hl-lean     { 0%, 100% { transform: rotate(0deg); }   50% { transform: rotate(-3.5deg); } }
@keyframes hl-compress { 0%, 100% { transform: scaleY(1); }      50% { transform: scaleY(1.09); } }
@keyframes hl-drift    { 0%, 100% { transform: translateY(0); }  50% { transform: translateY(-0.09em); } }
@keyframes hl-breathe  { 0%, 100% { transform: scale(1); }       50% { transform: scale(1.06); } }
@keyframes hl-tilt     { 0%, 100% { transform: skewX(0deg); }    50% { transform: skewX(4.5deg); } }
@keyframes hl-bob      { 0%, 40%  { transform: translateY(0); }  20% { transform: translateY(-0.07em); } }

/* Staggered enter → then each letter runs its own ambient loop */
.hl-r  { animation: hl-enter 0.6s 0.06s ease-out both, hl-lean     4.3s 0.56s ease-in-out infinite; }
.hl-i1 { animation: hl-enter 0.6s 0.16s ease-out both, hl-compress 3.9s 0.66s ease-in-out infinite; transform-origin: center bottom; }
.hl-d1 { animation: hl-enter 0.6s 0.26s ease-out both, hl-drift    5.2s 0.76s ease-in-out infinite; }
.hl-d2 { animation: hl-enter 0.6s 0.36s ease-out both, hl-breathe  3.4s 0.86s ease-in-out infinite; }
.hl-i2 { animation: hl-enter 0.6s 0.46s ease-out both, hl-tilt     4.8s 0.96s ease-in-out infinite; }
.hl-m  { animation: hl-enter 0.6s 0.56s ease-out both, hl-bob      4.0s 1.06s ease-in-out infinite; }

/* ── SCROLL INDICATOR ────────────────────────────────────── */

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}
.scroll-dot {
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--violet);
  animation: scroll-pulse 2.2s ease-in-out 1.8s infinite both;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.5); }
}

/* ── SHARED SECTION UTIL ─────────────────────────────────── */

.eyebrow {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.5rem;
}

/* ── TOOLS SECTION ───────────────────────────────────────── */

.tools {
  padding: 7rem 2rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
}

.tools-header { margin-bottom: 3rem; }

.tools-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--cloud);
  line-height: 1;
  margin-bottom: 1rem;
}

.tools-intro {
  font-size: 0.95rem;
  color: var(--violet-muted);
  line-height: 1.65;
  max-width: 52ch;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* ── CARDS ───────────────────────────────────────────────── */

.card {
  background: var(--slate-panel);
  border: 1px solid var(--slate-raised);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
}

/* Featured card spans full width with horizontal layout */
.card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
}
.card--featured .card-preview {
  width: 44%;
  min-height: 230px;
  border-right: 1px solid var(--slate-raised);
  border-bottom: none;
}

.card-preview {
  flex-shrink: 0;
  background: var(--slate);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 140px;
  border-bottom: 1px solid var(--slate-raised);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  flex: 1;
}
.card--featured .card-body {
  padding: 2rem 2.25rem;
}

.card-tag {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet);
}

.card-name {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 700;
  color: var(--cloud);
  line-height: 1.15;
}
.card--featured .card-name {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
}

.card-desc {
  font-size: 0.825rem;
  color: var(--violet-muted);
  line-height: 1.55;
  max-width: 32ch;
}

.card-cta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--violet-bright);
  letter-spacing: 0.03em;
  transition: color 0.15s, letter-spacing 0.2s;
}
.card:hover .card-cta {
  color: var(--cyan);
  letter-spacing: 0.07em;
}

/* ── MINI STAGE ──────────────────────────────────────────── */

.mini-stage { padding: 1.25rem; }

.mini-word {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2.6rem);
  font-weight: 900;
  color: var(--cloud);
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 0 2.5rem var(--glow);
}

.mini-letter {
  display: inline-block;
  animation: k-wave 1.9s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.12s);
}

@keyframes k-wave {
  0%, 100% { transform: translateY(0) rotate(0); }
  30%      { transform: translateY(-0.32em) rotate(-5deg); }
  70%      { transform: translateY(0.18em) rotate(5deg); }
}

/* ── CARD PREVIEW: VARIABLE FONT ─────────────────────────── */

.vf-preview {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.vf-a {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--cloud);
  text-shadow: 0 0 1.5rem var(--glow);
}
.vf-thin  { font-weight: 300; opacity: 0.5; }
.vf-mid   { font-weight: 600; opacity: 0.75; }
.vf-bold  { font-weight: 900; }

/* ── CARD PREVIEW: SOUND REACTIVE (EQ bars) ──────────────── */

.eq-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 60px;
}
.eq-bar {
  width: 7px;
  background: var(--violet);
  border-radius: 2px 2px 0 0;
  animation: eq-dance 1.2s ease-in-out infinite;
  transform-origin: bottom;
}
.eq-bar:nth-child(1) { animation-delay: 0s;     animation-duration: 1.1s; }
.eq-bar:nth-child(2) { animation-delay: 0.1s;   animation-duration: 0.9s; }
.eq-bar:nth-child(3) { animation-delay: 0.05s;  animation-duration: 1.3s; }
.eq-bar:nth-child(4) { animation-delay: 0.15s;  animation-duration: 0.8s; }
.eq-bar:nth-child(5) { animation-delay: 0.08s;  animation-duration: 1.0s; }
.eq-bar:nth-child(6) { animation-delay: 0.2s;   animation-duration: 1.4s; }
.eq-bar:nth-child(7) { animation-delay: 0.03s;  animation-duration: 1.1s; }
@keyframes eq-dance {
  0%, 100% { height: 8px;  background: var(--violet-deep); }
  50%      { height: 52px; background: var(--violet-bright); }
}

/* ── CARD PREVIEW: GENERATIVE (dot grid) ─────────────────── */

.gen-grid {
  width: 72px;
  height: 72px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 3px;
}
.gen-dot {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--violet);
  animation: gen-pulse 2.5s ease-in-out infinite;
}
@keyframes gen-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.7); }
  50%      { opacity: 1;   transform: scale(1); }
}

/* ── CARD PREVIEW: OPENTYPE ──────────────────────────────── */

.ot-demo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 2rem;
  line-height: 1;
}
.ot-off {
  font-family: var(--font-body);
  color: var(--violet-muted);
  font-feature-settings: "liga" 0;
}
.ot-on {
  font-family: var(--font-body);
  color: var(--cloud);
  font-feature-settings: "liga" 1;
  text-shadow: 0 0 1.5rem var(--glow);
}
.ot-arrow {
  font-size: 0.9rem;
  color: var(--violet);
}

/* ── CARD PREVIEW: PAIRING ───────────────────────────────── */

.pair-demo {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  padding: 0 0.5rem;
}
.pair-display {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--cloud);
  line-height: 1;
}
.pair-body {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--violet-muted);
  line-height: 1.4;
  max-width: 18ch;
}

/* ── CARD PREVIEW: PHYSICS ───────────────────────────────── */

.phys-demo {
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  line-height: 1;
  color: var(--cloud);
}
.ph-letter { display: inline-block; }
.ph-a { transform: rotate(-12deg) translateY(4px);  opacity: 0.8; }
.ph-b { transform: rotate(5deg)   translateY(-8px); color: var(--violet-bright); }
.ph-c { transform: rotate(18deg)  translateY(10px); opacity: 0.7; }

/* ── ABOUT ───────────────────────────────────────────────── */

.about {
  padding: 6rem 2rem 8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.about-quote {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--violet-bright);
  border: none;
  margin-bottom: 2.5rem;
}
.about-quote em {
  font-style: italic;
  color: var(--cloud);
}

.about-link {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--violet-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.15s;
}
.about-link:hover { color: var(--cloud); }

/* ── FOOTER ──────────────────────────────────────────────── */

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

.footer-brand {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
}

.footer-meta { font-size: 0.7rem; color: var(--violet-muted); }
.footer-meta a { color: var(--violet-muted); text-decoration: none; transition: color 0.15s; }
.footer-meta a:hover { color: var(--cloud); }

/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 960px) {
  .tools-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 840px) {
  .tools { padding: 5.5rem 1.5rem 5rem; }
  .card--featured {
    flex-direction: column;
  }
  .card--featured .card-preview {
    width: 100%;
    min-height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--slate-raised);
  }
}

@media (max-width: 600px) {
  .tools-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header { padding: 1rem 1.25rem; }
  .card-body { padding: 1.25rem; }
  .about { padding: 4.5rem 1.25rem 6rem; }
  .site-footer { padding: 1.5rem 1.25rem; }
}

/* ── REDUCED MOTION ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-letter,
  .scroll-dot,
  .mini-letter,
  .dot-field,
  .line-field { animation: none !important; }
  .hero-eyebrow { animation: none; opacity: 1; }
}
