/* ============================================================
   LAB TYPOGRAPHIE WEB — Module styles
   ============================================================ */

/* ---- Contrôles communs (sliders) ---- */
.typo-controls {
  display: grid;
  gap: 0.75rem;
  max-width: 440px;
  margin-top: 1.25rem;
}
.typo-controls label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.typo-controls label span {
  color: var(--accent);
  min-width: 4.5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.typo-controls input[type="range"] {
  flex: 1;
  accent-color: var(--owl-gold);
}

/* ============================================================
   01 Variable fonts
   ============================================================ */
.typo-vf {
  font-family: 'Roboto Flex', sans-serif;
  font-size: clamp(2.2rem, 9vw, 4rem);
  line-height: 1.1;
  color: var(--text-bright);
  font-variation-settings: 'wght' var(--typo-wght, 400), 'slnt' var(--typo-slnt, 0);
}

/* ============================================================
   02 Fluid typography — clamp() + cqi
   ============================================================ */
.typo-fluid {
  container-type: inline-size;
  resize: horizontal;
  overflow: auto;
  width: 280px;
  min-width: 150px;
  max-width: 100%;
  padding: 1.25rem;
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius);
  background: var(--surface-hi);
}
.typo-fluid-text {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 12cqi, 4rem);
  line-height: 1;
  color: var(--owl-gold);
}
.typo-fluid-hint {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================================
   03 text-wrap: pretty & hyphens
   ============================================================ */
.typo-wrap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 540px) {
  .typo-wrap-grid { grid-template-columns: 1fr; }
}
.typo-wrap-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.typo-wrap {
  max-width: 22ch;
  color: var(--text);
}
.typo-wrap--plain {
  text-wrap: wrap;
  hyphens: none;
}
.typo-wrap--pretty {
  text-wrap: pretty;
  hyphens: auto;
}

/* ============================================================
   04 Fonctionnalités OpenType
   ============================================================ */
.typo-ot {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.7rem;
  line-height: 1.35;
  color: var(--text-bright);
  margin-bottom: 1rem;
  font-variant-ligatures: none;
  font-variant-caps: normal;
  font-variant-numeric: normal;
}
.typo-ot.liga { font-variant-ligatures: common-ligatures discretionary-ligatures; }
.typo-ot.smcp { font-variant-caps: small-caps; }
.typo-ot.onum { font-variant-numeric: oldstyle-nums; }

.typo-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.typo-toggle {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-family: var(--font-body);
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 99px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.typo-toggle:hover {
  color: var(--text);
  border-color: var(--border-hi);
}
.typo-toggle.is-on {
  background: color-mix(in oklch, var(--owl-gold) 15%, transparent);
  color: var(--owl-gold-bright);
  border-color: color-mix(in oklch, var(--owl-gold) 30%, transparent);
}

/* ============================================================
   05 Rythme vertical & mesure
   ============================================================ */
.typo-measure {
  max-width: var(--typo-measure, 62ch);
  line-height: var(--typo-lh, 1.6);
  color: var(--text);
  transition: max-width 0.12s ease;
}

/* ============================================================
   06 Texte en dégradé animé
   ============================================================ */
.typo-gradient {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 11vw, 4.5rem);
  line-height: 1;
  background: linear-gradient(100deg, var(--owl-gold), #f7c66b, #c586c0, #4577e8, var(--owl-gold));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: typo-shift 8s linear infinite;
}
@keyframes typo-shift { to { background-position: 300% 0; } }

/* ---- Respect des préférences moteur (a11y) ---- */
@media (prefers-reduced-motion: reduce) {
  .typo-gradient { animation: none; }
}
