/* Lalalang site — colour tokens mirror src/utils/theme.ts
   Type system: one family, two weights (400 / 600), roles fix size+leading+weight. */

:root {
  --bg: #0d0a19;
  --bg-card: #171327;
  --gray-700: #3a3550;
  --gray-400: #9a93b5;
  --gray-300: #c4bedb;
  --white: #fff;
  --mint: #00ffa3;
  --purple: #b15cff;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --w-normal: 400;
  --w-strong: 600;

  /* Six roles. Each fixes size + leading together, so applying type is one
     decision. 12/14/16 cluster on purpose and separate by weight and colour. */
  --t-display: clamp(38px, 9vw, 64px);
  --t-title: 32px;
  --t-heading: 20px;
  --t-body: 16px;
  --t-label: 14px;
  --t-caption: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--gray-300);
  font-family: var(--font);
  font-size: var(--t-body);
  font-weight: var(--w-normal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--mint); text-decoration: none; border-bottom: 1px solid rgba(0, 255, 163, 0.35); }
a:hover { border-bottom-color: var(--mint); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- wordmark */

.mark { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; border: 0; }

.glyph {
  width: 0; height: 0;
  border-style: solid;
  border-width: 0.62rem 0 0.62rem 1.05rem;
  border-color: transparent transparent transparent var(--mint);
  filter: drop-shadow(0 0 12px rgba(177, 92, 255, 0.75));
  flex: none;
}

.mark span { font-size: var(--t-heading); font-weight: var(--w-strong); color: var(--white); letter-spacing: -0.01em; }

/* ============================================================== LANDING === */

.landing { height: 100dvh; overflow: hidden; position: relative; }

/* full-bleed grid of word videos */
#grid {
  position: fixed;
  inset: -2%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #120e22;
  border: 1px solid transparent;
  transition: border-color 0.25s, transform 0.35s, box-shadow 0.35s;
}

.tile video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.62;
  filter: saturate(0.95);
  transition: opacity 0.35s, filter 0.35s, transform 0.6s;
}

/* revealed state: flashy border + the word pops up */
.tile.on {
  border-color: var(--mint);
  box-shadow: 0 0 0 1px var(--mint), 0 0 26px rgba(0, 255, 163, 0.42), 0 0 60px rgba(177, 92, 255, 0.3);
  transform: scale(1.045);
  z-index: 3;
}
.tile.on video { opacity: 1; filter: saturate(1.12); transform: scale(1.06); }

.tag {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.6rem 0.7rem 0.6rem;
  background: linear-gradient(to top, rgba(9, 7, 18, 0.94), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
}
.tile.on .tag { opacity: 1; transform: none; }

.tag b {
  display: block;
  font-size: var(--t-label);
  font-weight: var(--w-strong);
  line-height: 1.3;
  color: var(--white);
}

.tag i {
  display: block;
  font-style: normal;
  font-size: var(--t-caption);
  font-weight: var(--w-normal);
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mint);
}

/* legibility scrim over the grid */
.scrim {
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(44% 44% at 50% 50%, rgba(13, 10, 25, 0.93) 0%, rgba(13, 10, 25, 0.62) 55%, transparent 82%),
    linear-gradient(to bottom, rgba(13, 10, 25, 0.6), rgba(13, 10, 25, 0.22) 45%, rgba(13, 10, 25, 0.7));
  z-index: 2;
}

.hero {
  position: relative;
  z-index: 4;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 2rem 1.25rem;
  text-align: center;
  pointer-events: none;
}
.hero > * { pointer-events: auto; }

.hero h1 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-size: var(--t-display);
  font-weight: var(--w-strong);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--white);
}

.hero h1 .glyph { border-width: 0.5em 0 0.5em 0.84em; }

.hero p {
  margin: 0;
  max-width: 26ch;
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--gray-400);
}

/* App Store badge */
.badge { display: inline-block; border: 0; line-height: 0; transition: transform 0.2s; }
.badge:hover { transform: translateY(-2px); }
.badge svg { display: block; height: 54px; width: auto; }

.hero footer {
  position: absolute;
  bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.3rem;
  font-size: var(--t-label);
  color: var(--gray-400);
}
.hero footer a { color: var(--gray-400); border-bottom-color: rgba(154, 147, 181, 0.4); }
.hero footer a:hover { color: var(--mint); border-bottom-color: var(--mint); }

@media (max-width: 60rem) { #grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 34rem) {
  #grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .badge svg { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile video, .tag, .badge { transition: none; }
  .tile.on { transform: none; }
  .tile.on video { transform: none; }
}

/* ================================================== CONTENT (docs pages) === */

.wrap { max-width: 42rem; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }

header { margin-bottom: 3rem; }

h1 {
  color: var(--white);
  font-size: var(--t-title);
  font-weight: var(--w-strong);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.6rem;
}

h2 {
  color: var(--white);
  font-size: var(--t-heading);
  font-weight: var(--w-strong);
  line-height: 1.3;
  margin: 2.75rem 0 0.7rem;
  letter-spacing: -0.01em;
}

.lede { line-height: 1.5; color: var(--gray-400); margin-top: 0; }
.meta { color: var(--gray-400); font-size: var(--t-label); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--gray-700);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0;
}
.card p:first-child { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card strong { color: var(--white); font-weight: var(--w-strong); }

.toc { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin: 1.25rem 0 0; padding: 0; list-style: none; font-size: var(--t-label); }

dl { margin: 0; }
dt { color: var(--white); font-weight: var(--w-strong); margin-top: 1.5rem; }
dd { margin: 0.35rem 0 0; }

ul { padding-left: 1.15rem; }
li { margin: 0.4rem 0; }

.wrap footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-700);
  color: var(--gray-400);
  font-size: var(--t-label);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
}

@media (max-width: 34rem) {
  :root { --t-title: 26px; }
  .wrap { padding: 2.5rem 1.15rem 4rem; }
}
