/* ==========================================================================
   leçon.fr — Styles de la page de présentation
   CSS natif, sobre, accessible, extensible et sans dépendance externe.
   ========================================================================== */

:root {
  --bg: #f6f5f0;
  --bg-elevated: #ffffff;
  --bg-subtle: #eeece4;
  --bg-stage: #f0eee7;
  --ink: #14181f;
  --ink-secondary: #4a5362;
  --ink-muted: #5d6676;
  --border: rgba(20, 24, 31, 0.11);
  --border-strong: rgba(20, 24, 31, 0.22);
  --accent: #1b49c4;
  --accent-hover: #14399d;
  --accent-soft: rgba(27, 73, 196, 0.10);
  --accent-ring: rgba(27, 73, 196, 0.38);
  --live: #137a4b;
  --live-soft: rgba(19, 122, 75, 0.12);
  --shadow-sm: 0 1px 2px rgba(20, 24, 31, 0.04);
  --shadow-md: 0 12px 32px -12px rgba(20, 24, 31, 0.12), 0 2px 6px rgba(20, 24, 31, 0.04);
  --shadow-stage: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 18px 44px -24px rgba(20, 24, 31, 0.18);
  --grid-line: rgba(20, 24, 31, 0.045);

  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --container-max: 1120px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1016;
    --bg-elevated: #141923;
    --bg-subtle: #1a2130;
    --bg-stage: #111620;
    --ink: #f2f0ea;
    --ink-secondary: #adb6c4;
    --ink-muted: #8c96a8;
    --border: rgba(242, 240, 234, 0.11);
    --border-strong: rgba(242, 240, 234, 0.24);
    --accent: #76a6ff;
    --accent-hover: #96bcff;
    --accent-soft: rgba(118, 166, 255, 0.14);
    --accent-ring: rgba(118, 166, 255, 0.45);
    --live: #48c78e;
    --live-soft: rgba(72, 199, 142, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 16px 38px -14px rgba(0, 0, 0, 0.55);
    --shadow-stage: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 56px -24px rgba(0, 0, 0, 0.65);
    --grid-line: rgba(242, 240, 234, 0.045);
  }
}

:root[data-theme="dark"] {
  --bg: #0d1016;
  --bg-elevated: #141923;
  --bg-subtle: #1a2130;
  --bg-stage: #111620;
  --ink: #f2f0ea;
  --ink-secondary: #adb6c4;
  --ink-muted: #8c96a8;
  --border: rgba(242, 240, 234, 0.11);
  --border-strong: rgba(242, 240, 234, 0.24);
  --accent: #76a6ff;
  --accent-hover: #96bcff;
  --accent-soft: rgba(118, 166, 255, 0.14);
  --accent-ring: rgba(118, 166, 255, 0.45);
  --live: #48c78e;
  --live-soft: rgba(72, 199, 142, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 16px 38px -14px rgba(0, 0, 0, 0.55);
  --shadow-stage: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 56px -24px rgba(0, 0, 0, 0.65);
  --grid-line: rgba(242, 240, 234, 0.045);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 82% 14%, var(--accent-soft), transparent 42%),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  background-attachment: scroll;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

h1,
h2,
h3,
p,
dl,
dd,
ul,
ol {
  margin: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* Layout */
.container {
  width: min(var(--container-max), calc(100% - 2.5rem));
  margin-inline: auto;
}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 1.75rem);
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  flex-shrink: 0;
  transition: transform 0.45s var(--ease-out);
}

.brand:hover .brand-mark {
  transform: rotate(30deg);
}

.brand-wordmark {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand-tld {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
  padding: 0;
}

.nav-list a {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  text-decoration: none;
  padding-block: 0.25rem;
  transition: color 0.2s ease;
}

.nav-list a:hover {
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.theme-toggle-icon {
  width: 0.82rem;
  height: 0.82rem;
  border-radius: 50%;
  border: 1.6px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  display: inline-block;
  transition: transform 0.35s var(--ease-out);
}

.theme-toggle[aria-pressed="true"] .theme-toggle-icon {
  transform: rotate(180deg);
}

@media (max-width: 560px) {
  .nav-list {
    display: none;
  }
}

/* Hero */
.hero {
  padding-block: clamp(2.75rem, 6vw, 5.25rem) clamp(3rem, 6vw, 4.75rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4.25rem);
  align-items: center;
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.hero-copy h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 4.5vw, 3.65rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 600;
  max-width: 14ch;
}

.hero-lead {
  margin-top: 1.3rem;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  color: var(--ink-secondary);
  max-width: 46ch;
}

.hero-lead strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-actions {
  margin-top: 1.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.78rem 1.3rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-out), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 20px -10px var(--accent-ring);
}

:root[data-theme="dark"] .btn-primary {
  color: #0b1220;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary {
    color: #0b1220;
  }
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-arrow {
  transition: transform 0.25s var(--ease-out);
}

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

.btn-ghost {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.hero-meta {
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

@media (max-width: 560px) {
  .hero-meta {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

.meta-item dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.meta-item dd {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px var(--live-soft);
  flex-shrink: 0;
}

/* 3D Sculpture Stage */
.hero-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.96;
  max-height: 490px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 32% 24%, color-mix(in srgb, var(--bg-elevated) 85%, transparent), transparent 60%),
    radial-gradient(circle at 72% 78%, var(--accent-soft), transparent 52%),
    var(--bg-stage);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-stage);
  overflow: hidden;
}

.stage-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.55;
}

.stage-corner--tl {
  top: 14px;
  left: 14px;
  border-top: 1.5px solid var(--ink-muted);
  border-left: 1.5px solid var(--ink-muted);
}

.stage-corner--tr {
  top: 14px;
  right: 14px;
  border-top: 1.5px solid var(--ink-muted);
  border-right: 1.5px solid var(--ink-muted);
}

.stage-corner--bl {
  bottom: 14px;
  left: 14px;
  border-bottom: 1.5px solid var(--ink-muted);
  border-left: 1.5px solid var(--ink-muted);
}

.stage-corner--br {
  bottom: 14px;
  right: 14px;
  border-bottom: 1.5px solid var(--ink-muted);
  border-right: 1.5px solid var(--ink-muted);
}

.sculpture-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}

.sculpture-canvas:active {
  cursor: grabbing;
}

.stage-hud {
  position: absolute;
  inset-inline: 1rem;
  bottom: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  pointer-events: none;
  z-index: 3;
}

.stage-caption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
}

.stage-controls {
  pointer-events: auto;
}

.stage-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.stage-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.stage-btn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.stage-btn[aria-pressed="true"] .stage-btn-dot {
  background: var(--ink-muted);
}

.stage-hint {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
}

/* CSS 3D fallback when JS is disabled */
.sculpture-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 720px;
}

.fallback-prism {
  position: relative;
  width: 140px;
  height: 140px;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(34deg);
}

.fallback-face {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
}

.fallback-face--front  { transform: translateZ(70px); }
.fallback-face--back   { transform: rotateY(180deg) translateZ(70px); }
.fallback-face--right  { transform: rotateY(90deg) translateZ(70px); }
.fallback-face--left   { transform: rotateY(-90deg) translateZ(70px); }
.fallback-face--top    { transform: rotateX(90deg) translateZ(70px); }
.fallback-face--bottom { transform: rotateX(-90deg) translateZ(70px); }

/* Sections */
.disciplines,
.principles {
  padding-block: clamp(3rem, 6vw, 4.75rem);
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2.25rem;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.section-note {
  max-width: 44ch;
  font-size: 0.95rem;
  color: var(--ink-secondary);
}

/* Extensible Discipline Grid */
.discipline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
}

.discipline-slot {
  display: flex;
}

.discipline-card {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-out), border-color 0.25s ease, box-shadow 0.35s var(--ease-out);
}

.discipline-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--accent-soft) 75%, var(--bg-elevated)), var(--bg-elevated) 55%);
}

.discipline-card.is-active:hover,
.discipline-card.is-active:focus-within {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.discipline-card.is-soon {
  background: color-mix(in srgb, var(--bg-elevated) 72%, var(--bg-subtle));
  border-style: dashed;
}

.discipline-card.is-soon:hover {
  border-color: var(--border-strong);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.26rem 0.65rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--live {
  background: var(--live-soft);
  color: var(--live);
}

.badge--soon {
  background: var(--bg-subtle);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

.card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.38rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-body p {
  font-size: 0.93rem;
  color: var(--ink-secondary);
}

/* Stretched accessible link for active cards only */
.card-link {
  text-decoration: none;
  color: var(--ink);
}

.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

@supports selector(:has(*)) {
  .card-link:focus-visible {
    outline: none;
  }

  .discipline-card.is-active:has(.card-link:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.card-domain {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

.card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: var(--accent);
}

.card-action svg {
  transition: transform 0.25s var(--ease-out);
}

.discipline-card.is-active:hover .card-action svg,
.discipline-card.is-active:focus-within .card-action svg {
  transform: translate(2px, -2px);
}

.card-status-text {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   CSS 3D Architectural Emblems (per-discipline layered geometry)
   ========================================================================== */

.emblem {
  position: relative;
  width: 52px;
  height: 52px;
  perspective: 220px;
  transform-style: preserve-3d;
  flex-shrink: 0;
}

/* 1. Mathématiques — stacked isometric planes */
.emblem--maths .emblem-plane {
  position: absolute;
  inset: 10px;
  border-radius: 5px;
  border: 1.5px solid var(--accent);
  transform-style: preserve-3d;
  transition: transform 0.45s var(--ease-out);
}

.emblem--maths .emblem-plane--1 {
  background: var(--accent-soft);
  transform: rotateX(56deg) rotateZ(45deg) translateZ(10px);
}

.emblem--maths .emblem-plane--2 {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  transform: rotateX(56deg) rotateZ(45deg) translateZ(0px);
}

.emblem--maths .emblem-plane--3 {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transform: rotateX(56deg) rotateZ(45deg) translateZ(-10px);
}

/* 2. Physique-Chimie — crossed orbital rings */
.emblem--orbit .emblem-ring {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1.4px solid var(--ink-muted);
  transition: transform 0.5s var(--ease-out);
}

.emblem--orbit .emblem-ring--1 {
  transform: rotateX(64deg) rotateY(22deg);
}

.emblem--orbit .emblem-ring--2 {
  transform: rotateX(64deg) rotateY(-46deg);
}

.emblem--orbit .emblem-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-muted);
  transform: translate(-50%, -50%);
}

/* 3. Informatique — tiered isometric matrix */
.emblem--grid .emblem-tile {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1.4px solid var(--ink-muted);
  border-radius: 4px;
  transition: transform 0.45s var(--ease-out);
}

.emblem--grid .emblem-tile--1 {
  top: 8px;
  left: 8px;
  transform: skewY(-14deg);
  background: color-mix(in srgb, var(--ink-muted) 12%, transparent);
}

.emblem--grid .emblem-tile--2 {
  top: 15px;
  left: 16px;
  transform: skewY(-14deg);
}

.emblem--grid .emblem-tile--3 {
  top: 22px;
  left: 24px;
  transform: skewY(-14deg);
}

/* 4. Français — angled folio pages */
.emblem--folio .emblem-sheet {
  position: absolute;
  top: 8px;
  left: 13px;
  width: 26px;
  height: 34px;
  border: 1.4px solid var(--ink-muted);
  border-radius: 3px;
  background: var(--bg-elevated);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-out);
}

.emblem--folio .emblem-sheet--1 {
  transform: rotateY(-18deg) translateZ(6px);
}

.emblem--folio .emblem-sheet--2 {
  transform: rotateY(-34deg) translateZ(0px);
}

.emblem--folio .emblem-sheet--3 {
  transform: rotateY(-48deg) translateZ(-6px);
}

/* 5. Histoire-Géographie — meridian arcs */
.emblem--meridian .emblem-arc {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1.4px solid var(--ink-muted);
  transition: transform 0.45s var(--ease-out);
}

.emblem--meridian .emblem-arc--2 {
  transform: rotateY(54deg);
}

.emblem--meridian .emblem-arc--3 {
  transform: rotateX(70deg);
}

/* 6. Sciences de la vie — double hexagonal prism */
.emblem--prism .emblem-hex {
  position: absolute;
  inset: 9px;
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  transition: transform 0.45s var(--ease-out);
}

.emblem--prism .emblem-hex--1 {
  background: color-mix(in srgb, var(--ink-muted) 26%, transparent);
  transform: translate(-3px, -3px);
}

.emblem--prism .emblem-hex--2 {
  background: color-mix(in srgb, var(--ink-muted) 16%, transparent);
  transform: translate(4px, 4px);
}

@media (prefers-reduced-motion: no-preference) {
  .discipline-card:hover .emblem--maths .emblem-plane--1,
  .discipline-card:focus-within .emblem--maths .emblem-plane--1 {
    transform: rotateX(56deg) rotateZ(45deg) translateZ(16px);
  }

  .discipline-card:hover .emblem--maths .emblem-plane--3,
  .discipline-card:focus-within .emblem--maths .emblem-plane--3 {
    transform: rotateX(56deg) rotateZ(45deg) translateZ(-16px);
  }

  .discipline-card:hover .emblem--orbit .emblem-ring--1 {
    transform: rotateX(56deg) rotateY(42deg);
  }

  .discipline-card:hover .emblem--orbit .emblem-ring--2 {
    transform: rotateX(56deg) rotateY(-64deg);
  }

  .discipline-card:hover .emblem--grid .emblem-tile--1 {
    transform: skewY(-14deg) translate(-2px, -3px);
  }

  .discipline-card:hover .emblem--grid .emblem-tile--3 {
    transform: skewY(-14deg) translate(2px, 3px);
  }

  .discipline-card:hover .emblem--folio .emblem-sheet--1 {
    transform: rotateY(-8deg) translateZ(9px);
  }

  .discipline-card:hover .emblem--folio .emblem-sheet--3 {
    transform: rotateY(-58deg) translateZ(-8px);
  }

  .discipline-card:hover .emblem--meridian .emblem-arc--2 {
    transform: rotateY(72deg);
  }

  .discipline-card:hover .emblem--prism .emblem-hex--1 {
    transform: translate(-5px, -5px);
  }

  .discipline-card:hover .emblem--prism .emblem-hex--2 {
    transform: translate(6px, 6px);
  }
}

/* Principles Section */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
}

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

.principle-item {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.principle-index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.principle-item h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.principle-item p {
  font-size: 0.93rem;
  color: var(--ink-secondary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.75rem;
  background: color-mix(in srgb, var(--bg-elevated) 55%, var(--bg));
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  font-size: 0.9rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.footer-sep,
.footer-desc {
  color: var(--ink-secondary);
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Respect strict de prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .brand:hover .brand-mark,
  .btn-primary:hover,
  .btn-primary:hover .btn-arrow,
  .discipline-card.is-active:hover,
  .discipline-card.is-active:focus-within,
  .discipline-card.is-active:hover .card-action svg,
  .discipline-card.is-active:focus-within .card-action svg,
  .discipline-card:hover .emblem *,
  .discipline-card:focus-within .emblem * {
    transition: none !important;
  }

  .brand:hover .brand-mark,
  .btn-primary:hover,
  .btn-primary:hover .btn-arrow,
  .discipline-card.is-active:hover,
  .discipline-card.is-active:focus-within,
  .discipline-card.is-active:hover .card-action svg,
  .discipline-card.is-active:focus-within .card-action svg {
    transform: none;
  }
}
