/* ---- Design tokens ---------------------------------------------------- */

:root {
    --bg: #faf8f4;
    --bg-elevated: #ffffff;
    --text: #26241f;
    --text-muted: #6b675f;
    --accent: #a9663f;
    --accent-text: #ffffff;
    --border: #e6e1d8;
    --geometry-stroke: #26241f;
    --geometry-opacity: 0.06;

    --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --nav-height: 4.5rem;
    --content-max: 68rem;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #17150f;
        --bg-elevated: #201d16;
        --text: #ede8de;
        --text-muted: #a29c8e;
        --accent: #d68a5c;
        --accent-text: #17150f;
        --border: #322e25;
        --geometry-stroke: #ede8de;
        --geometry-opacity: 0.08;
    }
}

:root[data-theme="dark"] {
    --bg: #17150f;
    --bg-elevated: #201d16;
    --text: #ede8de;
    --text-muted: #a29c8e;
    --accent: #d68a5c;
    --accent-text: #17150f;
    --border: #322e25;
    --geometry-stroke: #ede8de;
    --geometry-opacity: 0.08;
}

/* ---- Reset & base ------------------------------------------------------ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.15;
    margin: 0;
}

a {
    color: inherit;
}

.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;
}

/* ---- Header / nav ------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.site-nav {
    max-width: var(--content-max);
    margin: 0 auto;
    height: var(--nav-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}

.wordmark-mark {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text);
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--text);
}

.lang-toggle.pulse-attention {
    animation: lang-toggle-pulse 0.9s ease-in-out 3;
}

@keyframes lang-toggle-pulse {
    0%, 100% { border-color: var(--border); color: var(--text-muted); transform: scale(1); }
    50% { border-color: var(--accent); color: var(--text); transform: scale(1.08); }
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.theme-toggle svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.theme-toggle .icon-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun {
        display: none;
    }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon {
        display: inline-flex;
    }
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
    display: inline-flex;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.nav-toggle-bar {
    width: 100%;
    height: 1.5px;
    background: var(--text);
}

@media (max-width: 720px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: fixed;
        inset: var(--nav-height) 0 0 0;
        background: var(--bg);
        flex-direction: column;
        align-items: flex-start;
        gap: 1.75rem;
        padding: 2rem 1.5rem;
        transform: translateX(100%);
        transition: transform 0.2s ease;
    }

    .nav-links.is-open {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 1.1rem;
    }

    .lang-toggle,
    .theme-toggle {
        margin-top: 0.5rem;
    }
}

/* ---- Hero --------------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    min-height: calc(100dvh - var(--nav-height));
    display: flex;
    align-items: center;
    padding: 4rem 1.5rem;
}

.hero-geometry {
    position: absolute;
    top: 0;
    right: 0;
    width: min(60vw, 32rem);
    height: auto;
    fill: none;
    stroke: var(--geometry-stroke);
    stroke-width: 1;
    opacity: var(--geometry-opacity);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    text-align: left;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    max-width: 34rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-muted);
    margin: 0 0 2.5rem;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

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

.btn-primary:hover {
    opacity: 0.88;
}

.btn-secondary {
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--accent);
}

/* ---- Mantras page ------------------------------------------------------- */

.mantras-page {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 5rem;
}

.mantras-header h1 {
    font-size: clamp(2.25rem, 5vw, 3rem);
    margin-bottom: 0.75rem;
}

.mantras-subtitle {
    max-width: 40rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0;
}

.mantras-status {
    color: var(--text-muted);
    margin-top: 3rem;
}

.mantras-content {
    margin-top: 3rem;
}

.mantra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1.25rem;
}

.mantra-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.mantra-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.6rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
}

.mantra-sanskrit {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin: 0 0 0.25rem;
}

.mantra-translit {
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}

.mantra-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.4rem;
    line-height: 1.5;
}

.mantra-meta-label {
    color: var(--text);
    font-weight: 600;
}

.mantra-watch-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.mantra-watch-link {
    display: inline-block;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
    cursor: pointer;
}

/* ---- Video modal -------------------------------------------------------- */

.video-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.video-modal[hidden] {
    display: none;
}

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.video-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 40rem;
    max-height: 90vh;
    overflow: auto;
    background: var(--bg-elevated);
    border-radius: 0.75rem;
    padding: 1rem;
}

.video-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
}

.video-modal-body {
    margin-top: 1rem;
}

.video-modal-body .video-embed-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.video-modal-body .video-embed-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-modal-body .tiktok-embed {
    margin: 0 auto;
}

/* ---- Breathwork page ----------------------------------------------------- */

.breathwork-page {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 5rem;
}

.breathwork-header h1 {
    font-size: clamp(2.25rem, 5vw, 3rem);
    margin-bottom: 0.75rem;
}

.breathwork-subtitle {
    max-width: 40rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0;
}

.breathwork-status {
    color: var(--text-muted);
    margin-top: 3rem;
}

.breathwork-content {
    margin-top: 3rem;
}

.breathwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1.25rem;
}

.breathwork-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.breathwork-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.6rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
}

.breathwork-name {
    font-size: 1.15rem;
    margin: 0 0 0.25rem;
}

.breathwork-subtitle-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 0.6rem;
    font-style: italic;
}

.breathwork-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.4rem;
    line-height: 1.5;
}

.breathwork-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.4rem;
    line-height: 1.5;
}

.breathwork-meta-label {
    color: var(--text);
    font-weight: 600;
}

.breathwork-watch-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.breathwork-watch-link {
    display: inline-block;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
    cursor: pointer;
}
