/* ============================================
   Self-hosted variable fonts (SIL Open Font License 1.1).
   Served from this domain: the site makes no third-party requests.
   Vendored from the upstream projects; see src/assets/fonts/OFL.txt.
   ============================================ */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/inter-normal-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/inter-normal-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Playfair Display';
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/playfair-display-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Playfair Display';
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/playfair-display-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/playfair-display-normal-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/playfair-display-normal-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ============================================
   Forró Moves — forromoves.com
   A reference for how the dance actually works.

   Palette note: wine, gold and teal are the leader / notice /
   follower colours used by every diagram in the database, so the
   site chrome and the illustrations share one vocabulary.
   ============================================ */

/* --- Design tokens (light) --- */
:root {
    --color-primary: #7C2D3E;
    --color-primary-light: #9B4455;
    --color-primary-dark: #5E1F2E;
    --color-secondary: #B8860B;
    --color-secondary-light: #D4A017;
    --color-accent: #2D6A6A;
    --color-accent-light: #3D8B8B;

    --color-bg: #FAF8F5;
    --color-bg-alt: #F0EDE8;
    --color-surface: #FFFFFF;
    --color-surface-hover: #F5F3F0;
    --color-border: #E0DCD5;

    --color-text: #1A1A2E;
    --color-text-secondary: #555566;
    --color-text-muted: #888899;
    --color-text-inverse: #FAF8F5;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --transition: 0.2s ease;
    --max-width: 1200px;
    --nav-height: 70px;
}

/* --- Design tokens (dark) --- */
[data-theme="dark"] {
    --color-bg: #0F0F1A;
    --color-bg-alt: #1A1A2E;
    --color-surface: #1E1E32;
    --color-surface-hover: #2A2A40;
    --color-border: #333350;

    --color-text: #E8E6F0;
    --color-text-secondary: #A0A0B8;
    --color-text-muted: #6E6E88;
    --color-text-inverse: #1A1A2E;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    line-height: 1.3;
    color: var(--color-text);
}

/* --- Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(250, 248, 245, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    height: var(--nav-height);
    transition: background var(--transition);
}

[data-theme="dark"] .navbar {
    background: rgba(15, 15, 26, 0.85);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand:hover {
    color: var(--color-primary);
}

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

.nav-links a {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--color-surface-hover);
    color: var(--color-secondary);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: all var(--transition);
    border-radius: 2px;
}

.mobile-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 999;
    padding: 32px 24px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.mobile-menu.open {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu a {
    display: block;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-text);
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu a.active {
    color: var(--color-primary);
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-accent) 100%);
    color: var(--color-text-inverse);
    padding: 100px 0 120px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

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

.hero h1 {
    font-size: 3.5rem;
    color: var(--color-text-inverse);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-light);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
}

.btn-accent {
    background: var(--color-accent);
    color: white;
}

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

/* --- Sections --- */
.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 48px;
}

/* --- Grid --- */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Cards --- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 24px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.card-text {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(124, 45, 62, 0.12);
    color: var(--color-primary);
}

[data-theme="dark"] .badge-primary {
    background: rgba(155, 68, 85, 0.2);
    color: #E5899A;
}

.badge-green {
    background: rgba(34, 139, 34, 0.12);
    color: #228B22;
}

[data-theme="dark"] .badge-green {
    background: rgba(34, 139, 34, 0.2);
    color: #4CAF50;
}

.badge-blue {
    background: rgba(30, 90, 160, 0.12);
    color: #1E5AA0;
}

[data-theme="dark"] .badge-blue {
    background: rgba(30, 90, 160, 0.2);
    color: #5B9BD5;
}

.badge-purple {
    background: rgba(106, 27, 154, 0.12);
    color: #6A1B9A;
}

[data-theme="dark"] .badge-purple {
    background: rgba(106, 27, 154, 0.2);
    color: #AB47BC;
}

.badge-live {
    background: #E53935;
    color: white;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* --- Detail page header --- */
.course-header {
    padding: 60px 0 40px;
    background: var(--color-bg-alt);
}

.course-header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.course-header .subtitle {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

.course-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.course-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.lesson-section {
    margin-bottom: 28px;
}

.lesson-section:last-child {
    margin-bottom: 0;
}

.lesson-section-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.lesson-text {
    font-size: 0.93rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.lesson-text p {
    margin-bottom: 14px;
}

.lesson-text p:last-child {
    margin-bottom: 0;
}

/* Key Concepts */
.lesson-assignment {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.lesson-assignment .lesson-section-title {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 12px;
}

/* --- Filters --- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
    align-items: center;
}

.filter-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition);
}

.filter-search:focus {
    border-color: var(--color-primary);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-pill {
    padding: 6px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    cursor: pointer;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.filter-pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-pill.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* --- Footer --- */
.footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding: 48px 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.footer-desc {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links h4 {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

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

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* --- Page Header (generic) --- */
.page-header {
    padding: 48px 0 32px;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mt-6 { margin-top: 48px; }
.mb-2 { margin-top: 16px; }
.mb-4 { margin-bottom: 32px; }
.gap-sm { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Forró Heuristics: SVG Diagrams --- */
:root {
    --f-lead-c: var(--color-primary);
    --f-follow-c: var(--color-accent);
    --f-accent-c: var(--color-secondary);
    --f-guide-c: var(--color-text-muted);
    --f-no-c: #C62828;
    --f-ok-c: #2E7D32;
}

[data-theme="dark"] {
    --f-lead-c: #E5899A;
    --f-follow-c: #6FC8C8;
    --f-accent-c: #E3B44A;
    --f-no-c: #EF6B6B;
    --f-ok-c: #6BBF6E;
}

.forro-svg {
    display: block;
    width: 100%;
    height: auto;
}

.forro-svg text {
    font-family: var(--font-sans);
}

/* Colour roles — each sets the local --fc that every primitive draws with */
.forro-svg .f-lead   { --fc: var(--f-lead-c); }
.forro-svg .f-follow { --fc: var(--f-follow-c); }
.forro-svg .f-accent { --fc: var(--f-accent-c); }
.forro-svg .f-guide  { --fc: var(--f-guide-c); }
.forro-svg .f-no     { --fc: var(--f-no-c); }
.forro-svg .f-ok     { --fc: var(--f-ok-c); }

/* Primitives */
.forro-svg .f-stroke {
    stroke: var(--fc, currentColor);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.forro-svg .f-fill { fill: var(--fc, currentColor); }
.forro-svg .f-dot { fill: var(--fc, currentColor); opacity: 0.5; }
.forro-svg .f-dashed { stroke-dasharray: 5 4; }
.forro-svg .f-stroke-thick { stroke-width: 4.5; }
.forro-svg .f-arm { stroke-width: 3.2; }
.forro-svg .f-rail { stroke-width: 2; }
.forro-svg .f-box { stroke-width: 2; }
.forro-svg .f-floor { stroke-width: 2; stroke-dasharray: 2 6; }
.forro-svg .f-leader-line { stroke-width: 1.4; stroke-dasharray: 3 3; }

/* Footprints */
.forro-svg .f-foot-solid ellipse {
    fill: var(--fc);
    fill-opacity: 0.85;
}

.forro-svg .f-foot-free ellipse {
    fill: none;
    stroke: var(--fc);
    stroke-width: 2;
    stroke-dasharray: 4 3;
}

.forro-svg .f-beat-badge circle {
    fill: var(--color-surface);
    stroke: var(--fc);
    stroke-width: 2;
}

.forro-svg .f-beat-badge text {
    fill: var(--fc);
    font-size: 10px;
    font-weight: 700;
}

/* Dancers seen from above */
.forro-svg .f-dancer .f-body,
.forro-svg .f-figure .f-body {
    fill: var(--fc);
    fill-opacity: 0.16;
    stroke: var(--fc);
    stroke-width: 2;
}

.forro-svg .f-dancer .f-shoulders {
    stroke: var(--fc);
    stroke-width: 3.4;
    stroke-linecap: round;
}

.forro-svg .f-dancer .f-facing { fill: var(--fc); }

.forro-svg .f-dancer-label {
    fill: var(--fc);
    font-size: 11px;
    font-weight: 700;
}

.forro-svg .f-spine { stroke-width: 3; }

/* Verdict marks */
.forro-svg .f-verdict-disc {
    fill: var(--fc);
    fill-opacity: 0.14;
    stroke: var(--fc);
    stroke-width: 2;
}

/* Labels */
.forro-svg .f-label {
    fill: var(--color-text-secondary);
    font-size: 11px;
}

.forro-svg .f-label-strong {
    fill: var(--color-text);
    font-size: 11.5px;
    font-weight: 600;
}

.forro-svg .f-label-sm {
    fill: var(--color-text-muted);
    font-size: 10px;
}

.forro-svg .f-zone {
    fill: var(--fc);
    fill-opacity: 0.1;
    stroke: var(--fc);
    stroke-width: 1.6;
    stroke-dasharray: 5 4;
}

/* --- Forró Heuristics: Layout --- */
.forro-intro {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 56px;
}

.forro-intro-text h2 {
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.forro-intro-text p {
    color: var(--color-text-secondary);
    margin-bottom: 14px;
}

.forro-legend-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.forro-legend-card h4 {
    font-size: 1rem;
    margin-bottom: 16px;
}

.forro-legend {
    list-style: none;
    display: grid;
    gap: 12px;
}

.forro-legend li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.legend-lead { background: var(--f-lead-c); }
.legend-follow { background: var(--f-follow-c); }
.legend-accent { background: var(--f-accent-c); }

.legend-foot {
    width: 18px;
    flex-shrink: 0;
}

.legend-badge {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid var(--f-lead-c);
    color: var(--f-lead-c);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forro-subhead {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.forro-subhead-note {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    max-width: 70ch;
}

.rhythm-card .card-title {
    margin-bottom: 8px;
}

.heuristic-filters {
    position: sticky;
    top: var(--nav-height);
    z-index: 10;
    background: var(--color-bg-alt);
    padding: 20px 0 4px;
    border-bottom: 1px solid var(--color-border);
}

.heuristic-filters .filters {
    margin-bottom: 12px;
}

.heuristic-count {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 16px 0 20px;
}

/* --- Heuristic cards --- */
.heuristic-figure {
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 20px;
}

/* A fixed figure height keeps the card bodies in a row aligned. The diagrams
   are letterboxed rather than stretched, so the geometry stays true. */
.heuristic-card .heuristic-figure {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heuristic-card .heuristic-figure .forro-svg {
    width: 100%;
    height: 100%;
}

.heuristic-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.heuristic-card .card-body {
    flex: 1;
}

.heuristic-card .badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.heuristic-term {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--color-secondary);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.heuristic-rule {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.heuristic-open {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* --- Heuristic detail --- */
.heuristic-back {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.heuristic-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
}

.heuristic-rule-callout {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-secondary);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 32px;
}

.heuristic-rule-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin-bottom: 8px;
}

.heuristic-rule-callout p {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--color-text);
}

.heuristic-figure-lg {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}

.heuristic-figure-lg .forro-svg {
    max-width: 600px;
    margin: 0 auto;
}

.heuristic-figure-lg figcaption {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.heuristic-cues {
    list-style: none;
    display: grid;
    gap: 12px;
}

.heuristic-cues li {
    position: relative;
    padding-left: 30px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.heuristic-cues li::before {
    content: '◆';
    position: absolute;
    left: 6px;
    color: var(--color-secondary);
    font-size: 0.7rem;
    top: 4px;
}

.heuristic-mistakes {
    display: grid;
    gap: 16px;
}

.heuristic-mistake {
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    padding: 16px 20px;
}

.heuristic-mistake p {
    display: flex;
    gap: 10px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.heuristic-mistake p span {
    font-weight: 700;
    flex-shrink: 0;
}

.mistake-error {
    color: var(--color-text);
    margin-bottom: 8px;
}

.mistake-error span { color: #C62828; }

.mistake-fix {
    color: var(--color-text-secondary);
}

.mistake-fix span { color: #2E7D32; }

[data-theme="dark"] .mistake-error span { color: #EF6B6B; }
[data-theme="dark"] .mistake-fix span { color: #6BBF6E; }

.heuristic-drill {
    padding-left: 20px;
    display: grid;
    gap: 10px;
}

.heuristic-drill li {
    color: var(--color-text-secondary);
    line-height: 1.6;
    padding-left: 6px;
}

/* --- Heuristic sidebar --- */
.heuristic-aside {
    display: grid;
    gap: 20px;
    position: sticky;
    top: calc(var(--nav-height) + 24px);
}

.aside-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.aside-text {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.aside-text strong { color: var(--color-text); }

.aside-pt {
    display: block;
    font-style: italic;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.aside-link {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
}

.aside-link:last-child { border-bottom: none; }

.aside-link strong {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.4;
}

.aside-link:hover strong { color: var(--color-primary); }

.aside-link span {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--color-text-muted);
}

/* --- Previous / next --- */
.heuristic-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.pager-link {
    display: block;
    padding: 16px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: border-color var(--transition);
}

.pager-link:hover { border-color: var(--color-primary); }

.pager-link span {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.pager-link strong {
    color: var(--color-text);
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.4;
}

.pager-next { text-align: right; }

/* --- Glossary --- */
.forro-glossary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 40px;
}

.glossary-item {
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
}

.glossary-item dt {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--color-primary);
    margin-bottom: 6px;
}

.glossary-item dd {
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

.badge-gray {
    background: rgba(120, 120, 140, 0.14);
    color: var(--color-text-secondary);
}

@media (max-width: 900px) {
    .forro-intro,
    .heuristic-layout {
        /* minmax(0, …) not 1fr: a bare 1fr track keeps an automatic minimum of
           min-content, so the wide beat-by-beat table on a step page pushes
           the whole column past the viewport instead of scrolling inside its
           own wrapper. */
        grid-template-columns: minmax(0, 1fr);
    }

    .heuristic-main { min-width: 0; }

    .heuristic-aside { position: static; }

    /* The pill rows wrap onto too many lines here to be worth pinning. */
    .heuristic-filters { position: static; }
}

@media (max-width: 768px) {
    .forro-glossary,
    .heuristic-pager {
        grid-template-columns: 1fr;
    }

    .pager-next { text-align: left; }
}

/* ============================================
   Forró Moves — site-specific additions
   ============================================ */

/* --- Skip link --- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    background: var(--color-primary);
    color: #fff;
    padding: 10px 18px;
    border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

/* --- Logo (src/lib/logo.php) --- */
.brand-logo {
    width: 38px;
    height: 38px;
    flex: none;
    margin: -4px 0;
}

.footer-logo {
    width: 30px;
    height: 30px;
    flex: none;
}

/* In dark mode the name beside the mark takes the mark's light wine, as the
   standalone wordmark does; the base wine is unreadable on the dark ground. */
[data-theme="dark"] .nav-brand,
[data-theme="dark"] .nav-brand:hover,
[data-theme="dark"] .footer-brand { color: var(--m-lead); }

/* The mark's colours come from the figure tokens, so it follows the theme. */
.lm-lead { stroke: var(--m-lead); }
.lm-leadFill { fill: var(--m-lead); }
.lm-leadDeep { stroke: var(--m-lead-deep); }
.lm-follow { stroke: var(--m-follow); }
.lm-followFill { fill: var(--m-follow); }
.lm-followDeep { stroke: var(--m-follow-deep); }
.lm-gold { stroke: var(--m-gold); }
.lm-goldFill { fill: var(--m-gold); }

.nav-brand .brand-name {
    display: block;
    white-space: nowrap;
    line-height: 1.15;
}

.nav-brand .brand-sub {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* --- Home hero --- */
/* The hero sits on a dark wine-to-teal gradient, so everything inside it is
   painted against that rather than against the page background. */
.hero-eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-inverse);
}

/* Wine on a wine gradient disappears — invert the primary button here. */
.hero .btn-primary {
    background: var(--color-text-inverse);
    color: var(--color-primary-dark);
}

.hero .btn-primary:hover {
    background: #fff;
    color: var(--color-primary-dark);
    box-shadow: var(--shadow-lg);
}

.hero .btn-outline {
    color: var(--color-text-inverse);
    border-color: rgba(255, 255, 255, 0.6);
}

.hero .btn-outline:hover {
    background: var(--color-text-inverse);
    color: var(--color-primary-dark);
    border-color: var(--color-text-inverse);
}

.hero-lead {
    max-width: 680px;
    margin: 0 auto 8px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 44px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-stat {
    text-align: center;
}

.hero-stat strong {
    display: block;
    font-family: var(--font-serif);
    font-size: 2rem;
    line-height: 1.1;
    color: var(--color-secondary-light);
}

.hero-stat span {
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

/* --- Section heading pair --- */
.section-head {
    max-width: 720px;
    margin-bottom: 32px;
}

.section-head.centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-head h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.section-head p {
    color: var(--color-text-secondary);
}

/* --- Category tiles --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.category-tile {
    display: block;
    padding: 22px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: inherit;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.category-tile:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.category-tile-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.category-tile h3 {
    margin: 12px 0 2px;
    font-size: 1.12rem;
}

.category-tile .category-pt {
    display: block;
    margin-bottom: 10px;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--color-secondary);
}

.category-tile p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.category-tile-count {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-primary);
}

/* --- Start-here list --- */
.start-list {
    display: grid;
    gap: 12px;
    list-style: none;
    counter-reset: start;
}

.start-list li {
    counter-increment: start;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    transition: border-color var(--transition);
}

.start-list li:hover {
    border-color: var(--color-primary);
}

.start-list li::before {
    content: counter(start);
    flex: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

.start-list a {
    font-weight: 600;
}

.start-list span {
    display: block;
    margin-top: 2px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* --- Rhythm cards --- */
.rhythm-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rhythm-card .rhythm-count {
    margin-top: auto;
    padding-top: 14px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* --- Callout --- */
.callout {
    padding: 24px 28px;
    border-left: 4px solid var(--color-secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--color-bg-alt);
}

.callout h3 {
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.callout p {
    color: var(--color-text-secondary);
}

.callout p + p {
    margin-top: 12px;
}

/* --- Prose (about / 404) --- */
.prose {
    max-width: 720px;
}

.prose h2 {
    margin: 36px 0 12px;
    font-size: 1.5rem;
}

.prose h2:first-child {
    margin-top: 0;
}

.prose p,
.prose li {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.prose p {
    margin-bottom: 16px;
}

.prose ul {
    margin: 0 0 16px 20px;
}

.prose li {
    margin-bottom: 8px;
}

/* --- Filter chips on the database page --- */
.filter-pill {
    cursor: pointer;
}

.heuristic-card:focus-visible,
.category-tile:focus-visible,
.filter-pill:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-content { grid-template-columns: 1fr 1fr; }
}

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

    .nav-links { display: none; }
    .mobile-toggle { display: flex; }
    .mobile-menu { display: block; }

    .nav-brand { font-size: 1.25rem; gap: 6px; }
    .brand-logo { width: 32px; height: 32px; }
    .nav-brand .brand-sub { display: none; }
    .nav-actions .btn { display: none; }

    .hero { padding: 60px 0 80px; }
    .hero h1 { font-size: 2.2rem; }
    .hero .subtitle { font-size: 1.05rem; }

    .hero-stats { gap: 28px; }
    .hero-stat strong { font-size: 1.6rem; }

    .section { padding: 48px 0; }
    .section-title,
    .section-head h2 { font-size: 1.8rem; }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .course-header h1 {
        font-size: 1.8rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .hero-cta { flex-direction: column; align-items: center; }
    .section-title { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* The filter pass toggles [hidden]; card display rules would otherwise win. */
[hidden] { display: none !important; }

/* Visually hidden, still announced. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* A page header already ends in 32px of padding, so a following section's full
   80px reads as a hole rather than breathing room — most visible on the
   heuristics page, where the sticky filter strip is really a continuation of
   the header rather than a new section. */
.page-header + .section {
    padding-top: 36px;
}

/* The filter strip carries its own padding; the count line under it does not
   need a further 16px on top of that. */
.heuristic-filters + .heuristic-count {
    margin-top: 12px;
}

/* --- Tags ---
   Tags are a second axis over the categories, so they are styled quieter than
   the category badge: no fill, no icon, just an outlined word. */
.tag-chip {
    display: inline-block;
    padding: 2px 9px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: transparent;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

a.tag-chip-link {
    color: var(--color-text-secondary);
    transition: border-color var(--transition), color var(--transition);
}

a.tag-chip-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 20px 14px;
}

.heuristic-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: -16px 0 28px;
}

.heuristic-tags-label {
    margin-right: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* The tag row is the longest of the filter rows — let it breathe. */
.filter-pills-tags {
    row-gap: 8px;
}

/* --- Tag legend on the about page --- */
.tag-legend {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.tag-legend li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 4px 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

.tag-legend em {
    font-family: var(--font-serif);
    font-size: 0.88rem;
    color: var(--color-secondary);
}

.tag-legend li > span:not(.tag-legend-count) {
    grid-column: 1 / -1;
    font-size: 0.88rem;
    color: var(--color-text-secondary);
}

.tag-legend-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.aside-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* --- Steps --- */
.forro-legend-holds li {
    display: block;
    margin-bottom: 12px;
}

.forro-legend-holds em {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--color-secondary);
    margin-left: 6px;
}

.forro-legend-holds span {
    display: block;
    margin-top: 2px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

/* The in → out route on a step card */
.step-route {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 0 20px 12px;
    padding: 10px 12px;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-alt);
    font-size: 0.82rem;
}

.route-point {
    flex: 1;
    min-width: 0;
    color: var(--color-text);
}

.route-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.route-in .route-label { color: var(--f-follow-c); }
.route-out .route-label { color: var(--f-lead-c); }

.route-arrow {
    align-self: center;
    color: var(--color-secondary);
    font-size: 1.1rem;
}

/* Entry / exit panels on a step page */
.step-points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.step-point {
    padding: 20px 22px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.step-point-in { border-top: 4px solid var(--f-follow-c); }
.step-point-out { border-top: 4px solid var(--f-lead-c); }

.step-point-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.step-point h2 {
    margin: 4px 0 12px;
    font-size: 1.2rem;
}

.step-point-facts {
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.step-point-facts > div {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--color-border);
}

.step-point-facts dt {
    font-weight: 600;
    color: var(--color-text-muted);
}

.step-point-facts dd { color: var(--color-text); }
.step-point-facts em { font-family: var(--font-serif); color: var(--color-secondary); }

.step-point > p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

/* Beat-by-beat table */
.step-counts-wrap { overflow-x: auto; }

.step-counts {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 520px;
}

.step-counts th,
.step-counts td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
}

.step-counts thead th {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.step-counts tbody th {
    width: 72px;
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--color-primary);
}

.step-counts td:nth-child(2) { color: var(--f-lead-c); }
.step-counts td:nth-child(3) { color: var(--f-follow-c); }

/* Sources */
.step-sources {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.step-sources li {
    padding-left: 14px;
    border-left: 3px solid var(--color-border);
    font-size: 0.92rem;
    line-height: 1.6;
}

.step-sources a { font-weight: 600; }
.step-sources cite { font-style: italic; }
.step-source-read { color: var(--color-text-secondary); font-size: 0.85rem; }
.step-source-note { display: block; margin-top: 2px; color: var(--color-text-secondary); }

/* Chaining */
.step-chain-note {
    margin-bottom: 14px;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.step-chain {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.step-chain-link {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    transition: border-color var(--transition), transform var(--transition);
}

.step-chain-link:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.step-chain-link strong {
    display: block;
    font-size: 0.92rem;
    color: var(--color-text);
}

.step-chain-link span {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.82rem;
    color: var(--color-secondary);
}

@media (max-width: 768px) {
    .step-points { grid-template-columns: 1fr; }
}

/* Alternate figure names — forró vocabulary is not standardised. */
.step-aka {
    display: block;
    margin-top: 4px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.step-aka-inline {
    font-size: 0.85em;
    opacity: 0.75;
}

/* --- Couple figures (src/lib/couple-svg.php) --- */
.forro-svg .f-figure2 .f-torso,
.forro-svg .f-figure2 .f-head {
    fill: var(--fc);
    fill-opacity: 0.14;
    stroke: var(--fc);
    stroke-width: 2;
    stroke-linejoin: round;
}

.forro-svg .f-figure2 .f-limb {
    stroke-width: 2.6;
}

.forro-svg .f-figure2 .f-arm-far {
    stroke-width: 2.2;
    opacity: 0.45;
}

.forro-svg .f-figure2 .f-foot-line {
    stroke-width: 3.2;
}

.forro-svg .f-figure2 .f-hand {
    fill: var(--fc);
}

/* A previous position, shown behind the current one. */
.forro-svg .f-ghost { opacity: 0.28; }

.forro-svg .f-floorline {
    stroke-width: 1.6;
    stroke-dasharray: 3 5;
}

.forro-svg .f-contact {
    fill: var(--fc, currentColor);
    opacity: 0.14;
    stroke: none;
}

.forro-svg .f-phase-box {
    fill: none;
    stroke: var(--fc, currentColor);
    stroke-width: 1.4;
    stroke-dasharray: 4 4;
    opacity: 0.55;
}

/* --- Posed figures (src/lib/rig.php) ---
   Every part is filled with a gradient across its own axis — lit, mid, shade —
   in a material: skin, shirt, trousers, shoes or hair. Materials are what make
   a figure read as a person at a glance: a skin-coloured hand stands out
   against a coloured shirt, and hair shows which way a head is facing.

   The shirts carry the site's role colours (wine leads, teal follows), so the
   diagram vocabulary survives. Skin and hair are not UI colours and do not
   change with the theme; clothing lightens in dark mode so it does not vanish
   into the card. The two dancers get different skin tones and hair, which
   separates them in a close hold. */
.forro-svg .rm-skin-lead-lit    { stop-color: #C08A64; }
.forro-svg .rm-skin-lead-mid    { stop-color: #9C6844; }
.forro-svg .rm-skin-lead-shade  { stop-color: #6E452B; }
.forro-svg .rm-skin-follow-lit   { stop-color: #F0C8A6; }
.forro-svg .rm-skin-follow-mid   { stop-color: #D8A57E; }
.forro-svg .rm-skin-follow-shade { stop-color: #AA7651; }

.forro-svg .rm-hair-lead-lit    { stop-color: #4E3C33; }
.forro-svg .rm-hair-lead-mid    { stop-color: #2E221D; }
.forro-svg .rm-hair-lead-shade  { stop-color: #17110E; }
.forro-svg .rm-hair-follow-lit   { stop-color: #8A4E34; }
.forro-svg .rm-hair-follow-mid   { stop-color: #5E2F1F; }
.forro-svg .rm-hair-follow-shade { stop-color: #3A1B11; }

/* Each dancer is dressed head to foot in their own colour family — wine for
   the leader, teal for the follower — so any limb can be traced to its owner
   where two bodies overlap. Within a person, the shirt is lighter than the
   trousers and the shoes darkest, so the parts of one body still separate. */
.forro-svg .rm-shirt-lead-lit    { stop-color: #CC6C80; }
.forro-svg .rm-shirt-lead-mid    { stop-color: #A8445A; }
.forro-svg .rm-shirt-lead-shade  { stop-color: #7C2D3E; }
.forro-svg .rm-shirt-follow-lit   { stop-color: #62B8B6; }
.forro-svg .rm-shirt-follow-mid   { stop-color: #3A8E8C; }
.forro-svg .rm-shirt-follow-shade { stop-color: #2A6868; }

.forro-svg .rm-pants-lead-lit    { stop-color: #74293A; }
.forro-svg .rm-pants-lead-mid    { stop-color: #561C2A; }
.forro-svg .rm-pants-lead-shade  { stop-color: #37101A; }
.forro-svg .rm-pants-follow-lit   { stop-color: #25615F; }
.forro-svg .rm-pants-follow-mid   { stop-color: #184645; }
.forro-svg .rm-pants-follow-shade { stop-color: #0E2D2C; }

.forro-svg .rm-shoe-lead-lit     { stop-color: #4A1A24; }
.forro-svg .rm-shoe-lead-mid     { stop-color: #2E0F16; }
.forro-svg .rm-shoe-lead-shade   { stop-color: #19070B; }
.forro-svg .rm-shoe-follow-lit   { stop-color: #173F3E; }
.forro-svg .rm-shoe-follow-mid   { stop-color: #0D2828; }
.forro-svg .rm-shoe-follow-shade { stop-color: #061515; }

[data-theme="dark"] .forro-svg .rm-shirt-lead-lit    { stop-color: #F7BAC6; }
[data-theme="dark"] .forro-svg .rm-shirt-lead-mid    { stop-color: #E890A1; }
[data-theme="dark"] .forro-svg .rm-shirt-lead-shade  { stop-color: #B9687A; }
[data-theme="dark"] .forro-svg .rm-shirt-follow-lit   { stop-color: #AEEAE9; }
[data-theme="dark"] .forro-svg .rm-shirt-follow-mid   { stop-color: #78CECD; }
[data-theme="dark"] .forro-svg .rm-shirt-follow-shade { stop-color: #4A9695; }
[data-theme="dark"] .forro-svg .rm-pants-lead-lit    { stop-color: #C0707F; }
[data-theme="dark"] .forro-svg .rm-pants-lead-mid    { stop-color: #9C5061; }
[data-theme="dark"] .forro-svg .rm-pants-lead-shade  { stop-color: #733745; }
[data-theme="dark"] .forro-svg .rm-pants-follow-lit   { stop-color: #5FAAA8; }
[data-theme="dark"] .forro-svg .rm-pants-follow-mid   { stop-color: #3F8886; }
[data-theme="dark"] .forro-svg .rm-pants-follow-shade { stop-color: #2A6260; }
[data-theme="dark"] .forro-svg .rm-shoe-lead-lit     { stop-color: #8A4A58; }
[data-theme="dark"] .forro-svg .rm-shoe-lead-mid     { stop-color: #6A3441; }
[data-theme="dark"] .forro-svg .rm-shoe-lead-shade   { stop-color: #4A222C; }
[data-theme="dark"] .forro-svg .rm-shoe-follow-lit   { stop-color: #3F7A79; }
[data-theme="dark"] .forro-svg .rm-shoe-follow-mid   { stop-color: #2B5C5B; }
[data-theme="dark"] .forro-svg .rm-shoe-follow-shade { stop-color: #1C403F; }
[data-theme="dark"] .forro-svg .rm-hair-lead-mid    { stop-color: #4E3C33; }
[data-theme="dark"] .forro-svg .rm-hair-follow-mid   { stop-color: #8A4E34; }

/* A part behind the middle of the scene sits back a step, so a far arm or leg
   reads as behind the near one instead of merging with it. */
.forro-svg .rig.rig-far { filter: brightness(0.8); }

/* Each part is drawn twice: a fattened halo in the surrounding background,
   then the part itself. Drawing back to front, a near limb's halo cuts a
   clean gap out of whatever sits behind it. */
.forro-svg .rig-halo {
    fill: var(--rig-halo, var(--color-bg-alt));
}

/* A contact is ringed rather than dotted, so the hand stays visible inside it. */
.forro-svg .rig-mark {
    stroke-width: 2.2;
}

/* --- Steps without a drawing --- */
.step-placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    min-height: 200px;
    width: 100%;
    text-align: center;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
}

.step-placeholder span {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.step-placeholder strong {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.step-varies-note {
    margin-top: 16px;
    padding: 14px 18px;
    border-left: 3px solid var(--color-secondary);
    background: var(--color-bg-alt);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

/* The row of the beat the viewer is showing */
.step-counts tbody tr { transition: background var(--transition); }
.step-counts tbody tr.is-now { background: color-mix(in srgb, var(--color-secondary) 14%, transparent); }
.step-counts tbody tr.is-now th { color: var(--color-secondary); }

/* --- The 3D step viewer (src/assets/js/motion.js) --- */
:root {
    --m-lead: #A8445A;
    --m-lead-deep: #5E1F2E;
    --m-follow: #3A8E8C;
    --m-follow-deep: #1A4B4A;
    --m-gold: #A87A0A;
    --m-halo: var(--color-bg-alt);
    --m-line: var(--color-border);
}

[data-theme="dark"] {
    --m-lead: #E890A1;
    --m-lead-deep: #9C5061;
    --m-follow: #78CECD;
    --m-follow-deep: #3F8886;
    --m-gold: #E3B44A;
}

.motion-svg { display: block; width: 100%; height: 100%; }

.motion-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    max-height: 520px;
    width: 100%;
    margin: 0 auto;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}

.motion-stage.is-dragging { cursor: grabbing; }
.motion-stage:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }

.motion-hint {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    pointer-events: none;
}

.motion-bar,
.motion-views {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 12px;
}

.motion-beat-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

.motion-beat-buttons button,
.motion-views button {
    font: 600 0.8rem var(--font-sans);
    font-variant-numeric: tabular-nums;
    min-width: 34px;
    padding: 5px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
}

.motion-views button { font-weight: 500; }

.motion-beat-buttons button.active {
    background: var(--m-gold);
    border-color: var(--m-gold);
    color: var(--color-surface);
}

.motion-beat-buttons button:hover,
.motion-views button:hover { border-color: var(--color-primary); }

.motion-tempo {
    margin-left: auto;
    font: 500 0.8rem var(--font-sans);
    padding: 5px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text);
}

.motion-now {
    display: grid;
    gap: 2px;
    margin-top: 14px;
    min-height: 5.4em;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.motion-now strong { color: var(--color-text); }
.motion-now-lead { color: var(--f-lead-c); }
.motion-now-follow { color: var(--f-follow-c); }
.motion-now-touch { color: var(--m-gold); font-weight: 600; }

.motion-legend {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.motion-legend li { display: inline-flex; align-items: center; gap: 6px; }

.motion-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.motion-sw-lead { background: var(--m-lead); }
.motion-sw-follow { background: var(--m-follow); }
.motion-sw-joint { border-radius: 50%; width: 10px; height: 10px; background: var(--m-halo); border: 2px solid var(--m-lead-deep); }
.motion-sw-touch { border-radius: 50%; border: 2px solid var(--m-gold); box-shadow: inset 0 0 0 3px var(--color-surface), inset 0 0 0 6px var(--m-gold); }
.motion-sw-print { border-radius: 50%; width: 18px; height: 8px; background: var(--m-lead); opacity: 0.6; }

/* A card still on the steps index */
.heuristic-card .heuristic-figure.motion-on { padding: 8px; }
.motion-thumb { max-height: 224px; }

@media print {
    .motion-stage, .motion-bar, .motion-views, .motion-legend { display: none; }
    .motion-on .motion-fallback { display: block !important; }
}
