/* ==========================================================================
   Noesis Ghost theme
   Brand: dark cosmos, MuseoModerno reserved for the Noesis wordmark only,
   Sansation for titles + accents, purple accent.
   ========================================================================== */

:root {
    --void: #000000;
    --cosmos-1: #0E0E12;
    --cosmos-2: #16161d;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-raised: rgba(255, 255, 255, 0.10);
    --surface-raised-hover: rgba(255, 255, 255, 0.14);
    --surface-border: rgba(245, 245, 247, 0.10);
    --starlight: #F5F5F7;
    --muted: rgba(245, 245, 247, 0.62);
    --faint: rgba(245, 245, 247, 0.45);
    --hairline: rgba(245, 245, 247, 0.18);
    --accent: #8E4EC6;
    --accent-bright: #AB68DB;

    --font-display: 'MuseoModerno', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-accent: 'Sansation', -apple-system, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;

    --measure: 42rem;
    --wrap: 68rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: var(--font-body);
    color: var(--starlight);
    background: var(--void);
    line-height: 1.65;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-bright); text-decoration: none; transition: color 160ms ease, opacity 160ms ease; }
a:hover { color: var(--starlight); }

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

canvas#stars {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: -1;
    pointer-events: none;
}

.site-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.site-main { flex: 1 0 auto; width: 100%; }
.sep { color: var(--hairline); margin: 0 0.5rem; }

/* ==========================================================================
   Top navigation (content pages)
   ========================================================================== */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    background: rgba(0, 0, 0, 0.55);
    border-bottom: 1px solid var(--surface-border);
}

.site-nav-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-nav-brand { display: flex; align-items: center; gap: 2px; }
.site-nav-mark { width: 28px; height: 28px; }
.site-nav-wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.06em;
    font-size: 22px;
    color: var(--starlight);
}

.site-nav-menu { display: flex; align-items: center; gap: 22px; }
.nav-item {
    font-family: var(--font-accent);
    font-size: 15px;
    color: var(--muted);
    letter-spacing: 0.01em;
}
.nav-item:hover, .nav-item--current { color: var(--starlight); }
.nav-appstore { display: inline-flex; align-items: center; line-height: 0; transition: opacity 160ms ease, transform 160ms ease; }
.nav-appstore img { height: 36px; width: auto; }
.nav-appstore:hover { opacity: 0.9; transform: translateY(-1px); }
.nav-appstore:active { transform: scale(0.98); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 40px 24px calc(28px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--surface-border);
}
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.footer-nav a {
    color: var(--faint);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--font-body);
}
.footer-nav a:hover { color: var(--starlight); }
.footer-nav .nav-item:not(:last-child)::after { content: "·"; color: var(--hairline); margin: 0 0.7rem; display: inline-block; }
.footer-legal { margin-top: 14px; color: var(--hairline); font-size: 12px; letter-spacing: 0.04em; }

/* ==========================================================================
   Home splash — faithful port of the original trynoesis.app landing page,
   now the opening scene of the scrollytelling home. The nav floats
   transparent over it and gains its glass back once the journey begins.
   ========================================================================== */
.home-template .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: background 360ms ease, border-color 360ms ease;
}
.home-template.nav-scrolled .site-nav {
    background: rgba(0, 0, 0, 0.55);
    border-bottom-color: var(--surface-border);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.home-template .site-main { display: block; }

.splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    padding: 24px;
    text-align: center;
    gap: clamp(32px, 4vw, 42px);
}

.brand-splash { display: flex; flex-direction: column; align-items: center; }

.icon-wrap {
    width: clamp(176px, 24vw, 216px);
    height: clamp(176px, 24vw, 216px);
    animation: floatIn 1100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.icon-wrap img { width: 100%; height: 100%; }

.lockup { display: flex; flex-direction: column; align-items: center; margin-top: clamp(-28px, -3.4vw, -20px); }

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(88px, 12vw, 108px);
    letter-spacing: -0.075em;
    color: var(--starlight);
    line-height: 1;
    animation: floatIn 1100ms 120ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tagline {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: clamp(17.6px, 2.4vw, 21.6px);
    color: var(--starlight);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1;
    white-space: nowrap;
    margin-top: clamp(-6px, -0.5vw, -3px);
    transform-origin: center top;
    animation: floatIn 1100ms 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.app-store-badge {
    display: inline-block;
    transition: transform 200ms ease, opacity 200ms ease;
    animation: floatIn 1100ms 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.app-store-badge:hover { transform: translateY(-1px); opacity: 0.92; }
.app-store-badge:active { transform: scale(0.98); }
.app-store-badge img { height: 56px; width: auto; }

@keyframes floatIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Page heads (blog index, tag, author)
   ========================================================================== */
.page-head {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(48px, 8vw, 88px) 24px clamp(24px, 4vw, 40px);
    text-align: center;
}
.page-kicker { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--accent-bright); margin-bottom: 12px; }
.page-title { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(40px, 6vw, 64px); line-height: 1.02; }
.page-subtitle { margin-top: 14px; color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); max-width: 38rem; margin-left: auto; margin-right: auto; }
.author-head { display: flex; flex-direction: column; align-items: center; }
.author-avatar { border-radius: 50%; margin-bottom: 16px; }

/* ==========================================================================
   Post feed / cards
   ========================================================================== */
.post-feed {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 8px 24px 64px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}
.empty-feed { text-align: center; color: var(--muted); padding: 32px 24px 96px; }

.post-card {
    border: 1px solid var(--surface-border);
    background: var(--surface-raised);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 220ms cubic-bezier(0.16,1,0.3,1), border-color 220ms ease, background 220ms ease;
}
.post-card:hover { transform: translateY(-3px); border-color: rgba(171, 104, 219, 0.45); background: var(--surface-raised-hover); }
.post-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.post-card-image-wrap { aspect-ratio: 16 / 9; overflow: hidden; background: var(--cosmos-2); }
.post-card-image { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.post-card-kicker { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; color: var(--accent-bright); margin-bottom: 10px; }
.post-card-title { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.01em; font-size: 22px; line-height: 1.2; color: var(--starlight); }
.post-card-excerpt { margin-top: 10px; color: var(--muted); font-size: 15px; flex: 1; }
.post-card-meta { margin-top: 16px; color: var(--faint); font-size: 13px; }

/* Featured pillar — full-width hero card at the top of the feed. */
.featured-wrap { max-width: var(--wrap); margin: 0 auto; padding: 8px 24px 28px; }
.featured-card {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    border: 1px solid var(--surface-border);
    background: var(--surface-raised);
    border-radius: 18px;
    overflow: hidden;
    color: inherit;
    transition: transform 220ms cubic-bezier(0.16,1,0.3,1), border-color 220ms ease, background 220ms ease;
}
.featured-card:hover { transform: translateY(-3px); border-color: rgba(171, 104, 219, 0.45); background: var(--surface-raised-hover); }
.featured-card-image-wrap { overflow: hidden; background: var(--cosmos-2); min-height: 300px; }
.featured-card-image { width: 100%; height: 100%; object-fit: cover; }
.featured-card-body { padding: clamp(28px, 3.4vw, 46px); display: flex; flex-direction: column; justify-content: center; }
.featured-card-title { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.015em; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.08; color: var(--starlight); }
.featured-card-excerpt { margin-top: 14px; color: var(--muted); font-size: clamp(15px, 1.6vw, 17px); line-height: 1.6; }
.featured-card .post-card-meta { margin-top: 20px; }

@media (max-width: 700px) {
    .featured-card { grid-template-columns: 1fr; }
    .featured-card-image-wrap { min-height: 0; aspect-ratio: 16 / 9; }
}

/* ==========================================================================
   Single post / page — reading layout
   ========================================================================== */
.post {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(40px, 7vw, 80px) 24px 64px;
}
.post-header { max-width: var(--measure); margin: 0 auto; text-align: center; }
.post-kicker { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; color: var(--accent-bright); }
.post-title { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(34px, 5.2vw, 56px); line-height: 1.05; margin-top: 14px; }
.post-dek { margin-top: 18px; color: var(--muted); font-size: clamp(17px, 2.4vw, 21px); line-height: 1.5; }
.post-meta { margin-top: 22px; color: var(--faint); font-size: 14px; }
.post-author { color: var(--muted); }

.post-feature-image { margin: clamp(32px, 5vw, 56px) auto 0; max-width: var(--wrap); border-radius: 18px; overflow: hidden; }
.post-feature-image img { width: 100%; }
.post-feature-image figcaption { text-align: center; color: var(--faint); font-size: 13px; padding-top: 10px; }

/* Editor (Koenig) content. card_assets:true supplies the .kg-* card CSS. */
.gh-content {
    max-width: var(--measure);
    margin: clamp(32px, 5vw, 52px) auto 0;
    font-size: 18px;
    line-height: 1.75;
    color: rgba(245, 245, 247, 0.88);
}
.gh-content > * + * { margin-top: 1.5em; }
.gh-content h2, .gh-content h3, .gh-content h4 { font-family: var(--font-accent); font-weight: 700; letter-spacing: -0.01em; color: var(--starlight); line-height: 1.2; }
.gh-content h2 { font-size: 1.65em; margin-top: 2em; }
.gh-content h3 { font-size: 1.3em; margin-top: 1.8em; }
.gh-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(171,104,219,0.5); }
.gh-content a:hover { text-decoration-color: var(--accent-bright); }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li + li { margin-top: 0.5em; }
.gh-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.2em 0 0.2em 1.2em;
    color: var(--starlight);
    font-size: 1.15em;
    font-style: italic;
}
.gh-content img, .gh-content figure { border-radius: 12px; }

/* Koenig wide / full-bleed cards break out of the reading measure. */
.gh-content .kg-width-wide { width: min(var(--wrap), 92vw); margin-left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full img { border-radius: 0; }
.gh-content figcaption { text-align: center; color: var(--faint); font-size: 0.8em; margin-top: 0.6em; }
.gh-content hr { border: none; border-top: 1px solid var(--surface-border); margin: 2.5em 0; }
.gh-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 5px; padding: 0.15em 0.4em; }
.gh-content pre { background: var(--cosmos-1); border: 1px solid var(--surface-border); border-radius: 12px; padding: 18px 20px; overflow-x: auto; }
.gh-content pre code { background: none; border: none; padding: 0; }

.post-footer { max-width: var(--measure); margin: clamp(40px, 6vw, 64px) auto 0; display: flex; flex-direction: column; gap: 28px; align-items: center; text-align: center; }
.post-tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tag-pill { font-family: var(--font-accent); font-size: 13px; color: var(--muted); border: 1px solid var(--surface-border); border-radius: 999px; padding: 6px 14px; }
.tag-pill:hover { color: var(--starlight); border-color: var(--accent); }
.back-link { font-family: var(--font-accent); font-size: 14px; color: var(--faint); }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination { max-width: var(--wrap); margin: 0 auto; padding: 0 24px 80px; display: flex; align-items: center; justify-content: center; gap: 24px; }
.pagination a, .pagination .page-number { font-family: var(--font-accent); font-size: 14px; color: var(--muted); }
.pagination a:hover { color: var(--starlight); }

/* ==========================================================================
   Error page
   ========================================================================== */
.error-content { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 24px; gap: 12px; }
.error-code { font-family: var(--font-accent); font-weight: 700; font-size: clamp(72px, 16vw, 140px); color: var(--accent); line-height: 1; }
.error-title { font-family: var(--font-accent); font-weight: 700; font-size: clamp(24px, 4vw, 34px); }
.error-description { color: var(--muted); }
.error-link { font-family: var(--font-accent); margin-top: 16px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 880px) {
    .site-nav .nav-item--sub { display: none; }
}

@media (max-width: 600px) {
    .post-feed { grid-template-columns: 1fr; }
    .site-nav-menu { gap: 16px; }
    .gh-content { font-size: 17px; }
}

@media (max-width: 380px) {
    .splash { gap: 28px; }
    .icon-wrap { width: 164px; height: 164px; }
    .wordmark { font-size: 82px; }
    .lockup { margin-top: -18px; }
    .tagline { font-size: 16.4px; margin-top: -3px; }
    .app-store-badge img { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .icon-wrap, .wordmark, .tagline, .app-store-badge { animation: none; }
    .post-card { transition: none; }
}

.post-author-bio {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--hairline);
}
.post-author-bio .author-bio-name {
    font-family: var(--font-accent);
    color: var(--starlight);
    font-size: 15px;
    letter-spacing: 0.02em;
    margin: 0 0 6px;
}
.post-author-bio .author-bio-text {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   Home journey — scrollytelling sections below the splash.
   Reveal contract: elements carrying [data-reveal] are hidden ONLY when the
   root <html> has .js (set inline in default.hbs), so no-JS visitors and
   crawlers always see full content. assets/js/home.js adds .in-view.
   Motion: transform/opacity only, 600ms, cubic-bezier(0.16,1,0.3,1).
   ========================================================================== */

html { scroll-behavior: smooth; }

.journey { overflow-x: clip; }

.section {
    position: relative;
    padding: clamp(96px, 14vh, 160px) 24px;
}
.section[id], .movies[id] { scroll-margin-top: 76px; }

.section-inner { max-width: var(--wrap); margin: 0 auto; }
.section-inner--narrow { max-width: 52rem; text-align: center; }

.kicker {
    font-family: var(--font-accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 13px;
    color: var(--accent-bright);
    margin-bottom: 18px;
}

.display {
    font-family: var(--font-accent);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: clamp(38px, 5.6vw, 64px);
    line-height: 1.06;
    color: var(--starlight);
}
.display--sm { font-size: clamp(30px, 4.2vw, 48px); }

.headline {
    font-family: var(--font-accent);
    font-weight: 700;
    letter-spacing: -0.015em;
    font-size: clamp(27px, 3.4vw, 40px);
    line-height: 1.12;
    color: var(--starlight);
}

.lede {
    margin: 22px auto 0;
    color: var(--muted);
    font-size: clamp(16.5px, 2vw, 19px);
    line-height: 1.7;
    max-width: 44rem;
}

.body-copy { margin-top: 18px; color: var(--muted); font-size: 16.5px; line-height: 1.7; max-width: 36rem; }
.body-copy a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(171, 104, 219, 0.5); }
.body-copy a:hover { text-decoration-color: var(--accent-bright); }

/* --- Scroll cue on the hero -------------------------------------------- */
.scroll-cue {
    position: absolute;
    bottom: calc(22px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    margin-inline: auto;
    width: max-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--faint);
    animation: floatIn 1100ms 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.scroll-cue:hover { color: var(--starlight); }
.scroll-cue-label {
    font-family: var(--font-accent);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.scroll-cue-chevron {
    width: 10px;
    height: 10px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    animation: cueBob 2.4s ease-in-out infinite;
}
@keyframes cueBob {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.55; }
    50% { transform: rotate(45deg) translate(4px, 4px); opacity: 1; }
}

/* --- Reveal engine ------------------------------------------------------ */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].in-view { opacity: 1; transform: none; }

/* Line-mask variant: the element stays opaque; its .line children rise
   out of clipped wrappers. */
.js [data-reveal="lines"] { opacity: 1; transform: none; transition: none; }
.line-mask { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.js [data-reveal="lines"] .line {
    display: inline-block;
    transform: translateY(112%);
    transition: transform 850ms cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--l, 0) * 110ms);
}
.js [data-reveal="lines"].in-view .line { transform: none; }

/* Device variant: settle up with a light scale. */
.js [data-reveal="device"] {
    opacity: 0;
    transform: translateY(36px) scale(0.94);
    transition: opacity 900ms cubic-bezier(0.16, 1, 0.3, 1), transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}
.js [data-reveal="device"].in-view { opacity: 1; transform: none; }

/* --- The stance --------------------------------------------------------- */
.stance .display { margin-bottom: 0; }

/* --- Phone frame (layered: bevel, casing, inset screen, island, glare) --- */
.device-col { display: flex; justify-content: center; }
.phone {
    --phone-bezel: clamp(12px, 4vw, 14px);
    position: relative;
    width: min(320px, 76vw);
    /* The outer device is wider than its display. Keeping the screenshot's
       aspect ratio here made the casing unnaturally tall and razor-thin. */
    aspect-ratio: 71.6 / 147.6;
    border-radius: 12%/5.55%;
    padding: var(--phone-bezel);
    background:
        linear-gradient(135deg, #4a4a52 0%, #17171c 30%, #0a0a0e 70%, #3a3a42 100%);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.35),
        0 12px 28px rgba(0, 0, 0, 0.35),
        0 36px 80px rgba(0, 0, 0, 0.45),
        0 0 90px rgba(142, 78, 198, 0.14);
}
.phone::before {
    content: "";
    position: absolute;
    inset: 2.5px;
    border-radius: inherit;
    background: #101014;
    pointer-events: none;
}
.phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10.4%/4.8%;
    overflow: hidden;
    background: #000;
    box-shadow: inset 0 0 4px 1.5px rgba(0, 0, 0, 0.55);
}
.phone-screen img,
.phone-screen video { width: 100%; height: 100%; object-fit: cover; }
.phone-island {
    position: absolute;
    top: calc(var(--phone-bezel) + 1.3%);
    left: 50%;
    transform: translateX(-50%);
    width: 27%;
    height: 2.55%;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 35%, #16161a 0%, #030305 100%);
}
.phone-glare {
    position: absolute;
    inset: var(--phone-bezel);
    border-radius: 10.4%/4.8%;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.015) 34%, rgba(255, 255, 255, 0) 55%);
}
.phone[data-tilt] { transition: transform 200ms ease-out; will-change: transform; }

/* --- The method --------------------------------------------------------- */
.method-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(40px, 6vw, 88px);
    align-items: center;
}
.tab-chips {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 30px;
    max-width: 26rem;
}
.tab-chips > li { min-width: 0; }
.tab-chip {
    appearance: none;
    width: 100%;
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    text-align: left;
    color: var(--starlight);
    border: 1px solid var(--surface-border);
    background: var(--surface-raised);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.tab-chip-num { font-weight: 400; font-size: 12px; color: var(--accent-bright); letter-spacing: 0.08em; }
.tab-chip:hover {
    transform: translateY(-1px);
    background: var(--surface-raised-hover);
    border-color: rgba(171, 104, 219, 0.42);
}
.tab-chip:active { transform: translateY(0); }
.tab-chip:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 3px;
}
.tab-chip.is-active {
    background: rgba(142, 78, 198, 0.22);
    border-color: rgba(171, 104, 219, 0.78);
    box-shadow: inset 0 0 0 1px rgba(171, 104, 219, 0.16), 0 14px 36px rgba(78, 31, 115, 0.22);
}
.tab-chip.is-active .tab-chip-num { color: var(--starlight); }
.method-screen-image,
.method-screen-video {
    position: absolute;
    inset: 0;
    transition: opacity 160ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.method-screen-video {
    opacity: 0;
    pointer-events: none;
}
.feature-loop-video { display: block; }
.phone-screen.has-video .method-screen-image { opacity: 0; }
.phone-screen.has-video .method-screen-video { opacity: 1; }
.phone-screen.is-switching .method-screen-image,
.phone-screen.is-switching .method-screen-video {
    opacity: 0;
    transform: scale(0.985);
}

/* --- Principles --------------------------------------------------------- */
.principle-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(40px, 6vw, 88px);
    align-items: center;
}
.principle--flip .principle-grid { grid-template-columns: 0.85fr 1.15fr; }
.principle--flip .principle-copy { order: 2; }
.principle--flip .device-col { order: 1; }

.phase-num {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: clamp(56px, 7vw, 84px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(171, 104, 219, 0.5);
    margin-bottom: 10px;
}
.principle .kicker { margin-bottom: 14px; }

.evidence { margin-top: 34px; display: flex; flex-direction: column; gap: 14px; max-width: 38rem; }
.evidence-label {
    font-family: var(--font-accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11.5px;
    color: var(--faint);
}
.study {
    border: 1px solid var(--surface-border);
    background: var(--surface);
    border-left: 2px solid rgba(142, 78, 198, 0.65);
    border-radius: 12px;
    padding: 16px 18px;
}
.study-finding { color: rgba(245, 245, 247, 0.86); font-size: 15px; line-height: 1.6; }
.study-source { margin-top: 9px; color: var(--faint); font-size: 12.5px; letter-spacing: 0.015em; }
.study-source a { color: var(--accent-bright); white-space: nowrap; }
.study-source a::after { content: " ↗"; font-size: 11px; }
.study-source a:hover { color: var(--starlight); }

/* --- Mental movies (pinned cinematic) ----------------------------------- */
.movies { position: relative; padding: clamp(96px, 14vh, 160px) 24px 40px; }
.movies-head { margin-bottom: 8vh; }

.pin-track {
    max-width: var(--wrap);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 5vw, 72px);
}
.pin-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: grid;
    place-items: center;
}
.pin-stage .phone { z-index: 1; }

.pin-steps { display: flex; flex-direction: column; }
.step {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    align-content: center;
    max-width: 30rem;
}
.step-num {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 15px;
    color: var(--accent-bright);
    border: 1px solid rgba(171, 104, 219, 0.4);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
}
.step-title {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: clamp(24px, 2.8vw, 32px);
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--starlight);
}
.step-body { margin-top: 14px; color: var(--muted); font-size: 16.5px; line-height: 1.7; }

.movies-cites {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 6vh;
}
.study--chip { border-left-width: 1px; border-left-color: var(--surface-border); border-top: 2px solid rgba(142, 78, 198, 0.65); }

/* --- Also inside --------------------------------------------------------- */
.inside .kicker, .inside .display { text-align: center; }
.inside-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 48px;
}
.inside-card {
    border: 1px solid var(--surface-border);
    background: var(--surface-raised);
    border-radius: 18px;
    padding: 26px;
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms ease, background 220ms ease;
}
.inside-card:hover { transform: translateY(-3px); border-color: rgba(171, 104, 219, 0.45); background: var(--surface-raised-hover); }
.inside-card h3 {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.01em;
    color: var(--starlight);
}
.inside-card p { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.65; }

/* --- The receipts -------------------------------------------------------- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 44px;
}
.stat {
    border: 1px solid var(--surface-border);
    background: var(--surface);
    border-radius: 16px;
    padding: 22px 16px;
}
.stat-value {
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: clamp(30px, 3.6vw, 44px);
    line-height: 1;
    color: var(--starlight);
    font-variant-numeric: tabular-nums;
}
.stat-label { margin-top: 10px; color: var(--faint); font-size: 13px; line-height: 1.5; }
.receipts-blog { margin-left: auto; margin-right: auto; margin-top: 40px; }

.references { margin-top: 44px; text-align: left; }
.references summary {
    font-family: var(--font-accent);
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    padding: 12px;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    list-style: none;
}
.references summary::-webkit-details-marker { display: none; }
.references summary:hover { color: var(--starlight); border-color: var(--accent); }
.references[open] summary { margin-bottom: 20px; }
.references ol { padding-left: 1.3em; color: var(--faint); font-size: 13px; line-height: 1.6; }
.references li + li { margin-top: 10px; }
.references li a { color: var(--accent-bright); }
.references em { color: var(--muted); }

/* --- Finale -------------------------------------------------------------- */
.finale { padding-bottom: clamp(120px, 18vh, 200px); }
.finale .section-inner { display: flex; flex-direction: column; align-items: center; }
.finale-mark { width: 64px; height: 64px; margin-bottom: 26px; }
.finale .lede { margin-bottom: 34px; }
.app-store-badge--static { animation: none; }
.finale::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 70%;
    background: radial-gradient(ellipse at 50% 100%, rgba(142, 78, 198, 0.13) 0%, transparent 65%);
    pointer-events: none;
}

/* --- Scroll-linked enhancement (supporting browsers only) ---------------- */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .principle .device-col .phone, .method .device-col .phone {
            animation: phoneDrift linear both;
            animation-timeline: view();
            animation-range: cover 8% cover 92%;
        }
        .splash .brand-splash {
            animation: heroExit linear both;
            animation-timeline: view();
            animation-range: exit 0% exit 85%;
        }
    }
}
@keyframes phoneDrift {
    from { transform: translateY(34px); }
    to { transform: translateY(-34px); }
}
@keyframes heroExit {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0.1; transform: translateY(-40px); }
}
/* data-tilt writes an inline transform; give it the drift via a wrapper-free
   fallback: skip drift when tilting is active (pointer present). */
@media (hover: hover) {
    .method .device-col .phone[data-tilt] { animation: none; }
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
    .method-grid, .principle-grid, .principle--flip .principle-grid { grid-template-columns: 1fr; }
    .principle--flip .principle-copy { order: 1; }
    .principle--flip .device-col { order: 2; }
    .device-col { margin-top: 44px; }
    .phone { width: min(280px, 74vw); }

    .pin-track { grid-template-columns: 1fr; }
    .pin-stage { position: relative; height: auto; padding: 6vh 0 2vh; }
    .step { min-height: 0; padding: 8vh 0; max-width: none; }

    .movies-cites { grid-template-columns: 1fr; padding-top: 2vh; }
    .inside-grid { grid-template-columns: 1fr 1fr; }
    .stat-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .section { padding: 72px 20px; }
    .inside-grid { grid-template-columns: 1fr; }
    .display { font-size: clamp(32px, 9vw, 44px); }
    .headline { font-size: clamp(24px, 6.6vw, 32px); }
    .tab-chips { grid-template-columns: 1fr 1fr; }
    .stat-row { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* --- Reduced motion: everything visible, nothing moves -------------------- */
@media (prefers-reduced-motion: reduce) {
    .js [data-reveal], .js [data-reveal="device"] { opacity: 1; transform: none; transition: none; }
    .js [data-reveal="lines"] .line { transform: none; transition: none; }
    .scroll-cue, .scroll-cue-chevron { animation: none; }
    .phone[data-tilt] { transition: none; }
    .tab-chip, .method-screen-image, .method-screen-video { transition: none; }
    .method-screen-video { display: none; }
    html { scroll-behavior: auto; }
}
