:root {
        color-scheme: dark;
        --transition-theme: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease,
          fill 0.5s ease, stroke 0.5s ease;
      }

      [data-theme="night"] {
        --bg: #020810;
        --accent: #00ff8c;
        --text: #c8f0e0;
        --text-muted: rgba(200, 240, 224, 0.45);
        --nav-bg: rgba(2, 8, 16, 0.88);
        --border: rgba(200, 240, 224, 0.12);
        --card-bg: #070d14; /* opaque: same look, background lines stay behind */
        --card-bg-hover: #0c1219;
        --particle-line: rgba(0, 255, 140, 0.4);
        --particle-dot: rgba(0, 255, 140, 0.35);
        --hero-bg: #020810;
      }

      [data-theme="day"] {
        color-scheme: light;
        --bg: #faf8f4;
        --accent: #e05a10;
        --text: #2a1a08;
        --text-muted: rgba(42, 26, 8, 0.68);
        --nav-bg: rgba(250, 248, 244, 0.92);
        --border: rgba(42, 26, 8, 0.12);
        --card-bg: #f5f3ef;
        --card-bg-hover: #f0eeeb;
        --particle-line: rgba(224, 90, 16, 0.3);
        --particle-dot: rgba(224, 90, 16, 0.45);
        --hero-bg: #faf8f4;
      }

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

      html {
        scroll-behavior: smooth;
      }

      body {
        margin: 0;
        min-height: 100%;
        font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
        font-size: 16px;
        line-height: 1.55;
        background: var(--bg);
        color: var(--text);
        transition: var(--transition-theme);
      }

      h1,
      h2,
      h3,
      .font-display {
        font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
        font-weight: 600;
        letter-spacing: 0.02em;
      }

      a {
        color: inherit;
        text-decoration: none;
      }

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

      #page {
        position: relative;
        z-index: 1;
      }

      .site-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        z-index: 60;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        border-bottom: 1px solid var(--border);
        background: var(--nav-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        transition: var(--transition-theme);
      }

      .brand {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        font-family: "Cormorant Garamond", Georgia, serif;
        font-size: 1.35rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        color: var(--accent);
        transition: color 0.3s ease;
      }

      .brand-mark {
        display: block;
        width: 28px;
        height: 28px;
        flex-shrink: 0;
        background: center / contain no-repeat url("logo-light.png?v=5");
      }

      [data-theme="day"] .brand-mark {
        background-image: url("logo.png?v=5");
      }

      .nav-toggle {
        display: none;
      }

      .nav-burger {
        display: none;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: transparent;
        color: var(--text);
        cursor: pointer;
        padding: 0;
      }

      .nav-burger span {
        display: block;
        width: 18px;
        height: 2px;
        background: currentColor;
        position: relative;
      }

      .nav-burger span::before,
      .nav-burger span::after {
        content: "";
        position: absolute;
        left: 0;
        width: 18px;
        height: 2px;
        background: currentColor;
      }

      .nav-burger span::before {
        top: -6px;
      }

      .nav-burger span::after {
        top: 6px;
      }

      .nav-overlay {
        display: none;
      }

      .nav-center {
        display: flex;
        align-items: center;
        gap: 28px;
        flex: 1;
        justify-content: center;
      }

      .nav-link {
        font-size: 0.75rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: var(--text);
        cursor: pointer;
        border: none;
        background: none;
        padding: 8px 0;
        font-family: inherit;
        font-weight: 600;
        transition: color 0.3s ease, background 0.25s ease;
      }

      .nav-link:hover:not(.nav-link--disabled) {
        color: var(--accent);
      }

      .nav-link--disabled {
        cursor: help;
        color: var(--text-muted);
        font-weight: 500;
        opacity: 1;
      }

      .nav-tools {
        display: flex;
        align-items: center;
        gap: 16px;
      }

      .lang-switch {
        display: flex;
        border: 1px solid var(--border);
        border-radius: 6px;
        overflow: hidden;
      }

      .lang-switch button {
        font-family: inherit;
        font-size: 0.65rem;
        letter-spacing: 0.15em;
        padding: 8px 12px;
        border: none;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        transition: color 0.2s ease, background 0.2s ease;
      }

      .lang-switch button + button {
        border-left: 1px solid var(--border);
      }

      .lang-switch button.is-active {
        color: var(--accent);
        background: rgba(128, 128, 128, 0.08);
      }

      .theme-pill {
        position: relative;
        width: 64px;
        height: 30px;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: rgba(128, 128, 128, 0.12);
        cursor: pointer;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        color: var(--text-muted);
        line-height: 0;
      }

      .theme-pill__knob {
        position: absolute;
        top: 50%;
        left: 3px;
        width: 22px;
        height: 22px;
        margin: 0;
        border-radius: 50%;
        background: var(--accent);
        box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
        transform: translateY(-50%);
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
          transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      }

      /* Mirror night inset: knob aligns with moon (left) / sun (right) icons */
      [data-theme="day"] .theme-pill__knob {
        left: calc(100% - 3px - 22px);
        transform: translateY(-50%);
      }

      .theme-pill svg {
        width: 14px;
        height: 14px;
        display: block;
        flex-shrink: 0;
        pointer-events: none;
        z-index: 1;
      }

      /* Day: sun glyph centered on knob (knob center = 100% − 3px inset − half width) */
      [data-theme="day"] .theme-pill svg:last-of-type {
        position: absolute;
        top: 50%;
        left: calc(100% - 3px - 11px);
        transform: translate(-50%, -50%);
        margin: 0;
      }

      #hero {
        position: relative;
        /* svh = visible viewport (avoids mobile 100vh chrome cropping the tagline) */
        min-height: 100vh;
        min-height: 100svh;
        padding-top: 60px;
        overflow-x: hidden;
        overflow-y: clip;
      }

      #scene {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        display: block;
        outline: none;
        touch-action: pan-y;
        cursor: pointer;
        z-index: 0;
      }

      .hero-overlay {
        position: relative;
        z-index: 2;
        pointer-events: none;
        min-height: calc(100vh - 60px);
        min-height: calc(100svh - 60px);
        display: flex;
        align-items: end;
        box-sizing: border-box;
        padding: 32px clamp(16px, 4vw, 48px) max(56px, calc(24px + env(safe-area-inset-bottom, 0px)));
      }

      .hero-copy {
        max-width: 560px;
      }

      .hero-copy h1 {
        margin: 0 0 12px;
        font-size: clamp(2.2rem, 5vw, 3.6rem);
        line-height: 1.1;
        color: var(--text);
      }

      .hero-copy .line-accent {
        color: var(--accent);
        font-style: italic;
        font-weight: 400;
      }

      .hero-tagline {
        display: inline-block;
        max-width: 100%;
      }

      .hero-sub {
        font-size: 1.05rem;
        line-height: 1.5;
        letter-spacing: 0;
        text-transform: none;
        color: var(--text-muted);
        margin: 0;
      }

      .hero-rule {
        display: block;
        width: 100%;
        height: 2px;
        margin-top: 5px;
        background: var(--accent);
        border-radius: 1px;
      }

      .hero-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 12px;
        margin-top: 22px;
        pointer-events: auto;
      }

      .hero-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        padding: 0.65rem 1.1rem;
        font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
        font-size: 0.68rem;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        text-decoration: none;
        border-radius: 2px;
        transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
      }

      .hero-cta--primary {
        color: #020810;
        background: var(--accent);
        border: 1px solid var(--accent);
      }

      [data-theme="day"] .hero-cta--primary {
        color: #faf8f4;
      }

      .hero-cta--primary:hover {
        filter: brightness(1.08);
      }

      .hero-cta--ghost {
        color: var(--text);
        background: transparent;
        border: 1px solid var(--border);
      }

      .hero-cta--ghost:hover {
        border-color: var(--accent);
        color: var(--accent);
      }

      .home-explore {
        padding-top: 72px;
        padding-bottom: 72px;
      }

      .home-explore-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 1100px;
      }

      @media (min-width: 720px) {
        .home-explore-grid {
          grid-template-columns: 1fr 1fr;
        }
      }

      @media (min-width: 1100px) {
        .home-explore-grid {
          grid-template-columns: 1fr 1fr 1fr;
        }
      }

      .home-explore-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        min-height: 100%;
        padding: 22px 20px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--card-bg);
        text-decoration: none;
        color: inherit;
        transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
      }

      .home-explore-card:hover {
        border-color: var(--accent);
        background: var(--card-bg-hover);
        transform: translateY(-2px);
      }

      .home-explore-card__meta {
        font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
        font-size: 0.62rem;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        color: var(--accent);
      }

      .home-explore-card__title {
        margin: 0;
        font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
        font-size: clamp(1.35rem, 2.4vw, 1.7rem);
        font-weight: 600;
        line-height: 1.15;
        color: var(--text);
      }

      .home-explore-card__hint {
        margin: 0;
        flex: 1;
        font-size: 0.88rem;
        line-height: 1.55;
        color: var(--text-muted);
      }

      .home-explore-card__cta {
        margin-top: 4px;
        font-size: 0.62rem;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: var(--accent);
        font-weight: 600;
      }

      section.content-section {
        max-width: 1200px;
        margin: 0 auto;
        padding: 96px clamp(16px, 4vw, 32px);
        position: relative;
        z-index: 2;
      }

      .tag {
        font-size: 0.62rem;
        letter-spacing: 0.28em;
        text-transform: uppercase;
        color: var(--accent);
        margin-bottom: 16px;
      }

      .section-title {
        font-size: clamp(1.8rem, 3vw, 2.6rem);
        margin: 0 0 20px;
        color: var(--text);
      }

      .section-desc {
        max-width: 720px;
        color: var(--text-muted);
        margin-bottom: 40px;
      }

      #history .section-desc {
        max-width: min(940px, 96vw);
        line-height: 1.72;
      }

      .discoveries-now {
        margin-top: 8px;
        max-width: min(1100px, 100%);
      }

      .discoveries-now__title {
        margin: 0 0 28px;
        font-size: clamp(1.25rem, 2.2vw, 1.65rem);
        color: var(--text);
      }

      .discovery-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 22px;
      }

      @media (min-width: 640px) {
        .discovery-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr));
        }
      }

      @media (min-width: 1024px) {
        .discovery-grid {
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 26px 28px;
        }
      }

      .discovery-card {
        display: flex;
        flex-direction: column;
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: hidden;
        background: var(--card-bg);
        transition: border-color 0.2s ease, transform 0.2s ease;
      }

      .discovery-card:hover {
        border-color: var(--accent);
        transform: translateY(-2px);
      }

      .discovery-card__media {
        display: block;
        aspect-ratio: 4 / 3;
        overflow: hidden;
        background: rgba(0, 0, 0, 0.2);
      }

      [data-theme="day"] .discovery-card__media {
        background: rgba(0, 0, 0, 0.06);
      }

      .discovery-card__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        vertical-align: middle;
      }

      .discovery-card__body {
        padding: 16px 18px 18px;
      }

      .discovery-card__name {
        margin: 0 0 8px;
        font-size: 1.05rem;
        color: var(--text);
      }

      .discovery-card__text {
        margin: 0;
        font-size: 0.82rem;
        line-height: 1.6;
        color: var(--text-muted);
      }

      .research-card {
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 48px clamp(20px, 4vw, 56px);
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        background: var(--card-bg);
      }

      .research-card p {
        margin: 0;
        font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
        font-size: clamp(1.4rem, 2.5vw, 2rem);
        font-style: italic;
        color: var(--text-muted);
      }

      .pill-tag {
        font-size: 0.58rem;
        letter-spacing: 0.22em;
        text-transform: uppercase;
        padding: 10px 16px;
        border: 1px solid var(--border);
        border-radius: 999px;
        color: var(--accent);
      }

      .site-footer {
        border-top: 1px solid var(--border);
        padding: 40px clamp(16px, 4vw, 32px) 96px;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
        gap: 24px 32px;
        max-width: 1200px;
        margin: 0 auto;
      }

      .footer-brand {
        font-family: "Cormorant Garamond", Georgia, serif;
        font-weight: 700;
        letter-spacing: 0.14em;
        color: var(--accent);
        text-decoration: none;
      }

      a.footer-brand:hover {
        text-decoration: underline;
        text-underline-offset: 0.2em;
      }

      .footer-center {
        font-size: 0.75rem;
        color: var(--text-muted);
      }

      .footer-stack {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        min-width: min(100%, 16rem);
      }

      .footer-links {
        display: grid;
        grid-template-columns: auto auto;
        column-gap: 2.5rem;
        row-gap: 0;
        align-items: start;
        width: max-content;
        max-width: 100%;
      }

      .footer-links__col {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
      }

      .footer-links a {
        font-size: 0.78rem;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        text-decoration: none;
      }

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

      /* Hide the link for the page you are already on */
      body[data-page='atlas'] .footer-links a[data-footer-nav='atlas'],
      body[data-page='brain-scans'] .footer-links a[data-footer-nav='brain-scans'],
      body[data-page='articles'] .footer-links a[data-footer-nav='articles'],
      body[data-page='book'] .footer-links a[data-footer-nav='book'],
      body[data-page='publish'] .footer-links a[data-footer-nav='publish'],
      .footer-links a[data-footer-nav][hidden] {
        display: none !important;
      }

      .structures-dialog {
        width: min(960px, calc(100vw - 32px));
        max-height: min(88vh, 900px);
        margin: auto;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--bg);
        color: var(--text);
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
        overflow: hidden;
      }

      .structures-dialog::backdrop {
        background: rgba(2, 8, 16, 0.62);
        backdrop-filter: blur(6px);
      }

      [data-theme="day"] .structures-dialog::backdrop {
        background: rgba(42, 26, 8, 0.35);
      }

      .structures-dialog__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        background: var(--nav-bg);
      }

      .structures-dialog__top h2 {
        margin: 0;
        font-size: clamp(1.25rem, 3vw, 1.6rem);
        font-weight: 600;
        letter-spacing: 0.04em;
      }

      .structures-dialog__close {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: transparent;
        color: var(--text-muted);
        font-size: 1.35rem;
        line-height: 1;
        cursor: pointer;
        transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
      }

      .structures-dialog__close:hover {
        color: var(--accent);
        border-color: rgba(128, 128, 128, 0.35);
        background: rgba(128, 128, 128, 0.06);
      }

      .structures-dialog__body {
        padding: 20px;
        max-height: min(calc(88vh - 88px), 812px);
        overflow: auto;
      }

      .structures-dialog__embed {
        display: block;
        width: 100%;
        min-height: min(68vh, 620px);
        height: min(68vh, 620px);
        border: none;
        border-radius: 8px;
        background: rgba(0, 0, 0, 0.2);
      }

      [data-theme="day"] .structures-dialog__embed {
        background: rgba(0, 0, 0, 0.04);
      }

      .structures-dialog__fallback {
        max-width: 520px;
        margin: 0 auto;
        text-align: center;
        padding: 24px 8px 8px;
      }

      .structures-dialog__fallback p {
        margin: 0 0 20px;
        color: var(--text-muted);
        font-size: 0.9rem;
        line-height: 1.6;
      }

      .structures-dialog__actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
        margin-top: 8px;
      }

      .structures-dialog__btn {
        font-family: inherit;
        font-size: 0.72rem;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        font-weight: 600;
        padding: 12px 20px;
        border-radius: 8px;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--text);
        cursor: pointer;
        transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
      }

      .structures-dialog__btn:hover {
        color: var(--accent);
        border-color: var(--accent);
      }

      .structures-dialog__btn--primary {
        border-color: var(--accent);
        color: var(--accent);
        background: rgba(128, 128, 128, 0.06);
      }

      .io-fade {
        opacity: 0;
        transform: translateY(22px);
        transition: opacity 0.7s ease, transform 0.7s ease;
      }

      .io-fade.io-visible {
        opacity: 1;
        transform: translateY(0);
      }

      @media (max-width: 1180px) {
        /* Nav bar height includes notch / status safe area — overlay starts below it (never crosses the tab strip) */
        .site-nav {
          padding-top: env(safe-area-inset-top, 0px);
          padding-left: max(20px, env(safe-area-inset-left, 0px));
          padding-right: max(20px, env(safe-area-inset-right, 0px));
          min-height: calc(60px + env(safe-area-inset-top, 0px));
          height: auto;
          box-sizing: border-box;
          flex-wrap: nowrap;
          gap: 8px;
        }

        #hero {
          padding-top: calc(60px + env(safe-area-inset-top, 0px));
          min-height: calc(100svh);
        }

        .hero-overlay {
          min-height: calc(100svh - 60px - env(safe-area-inset-top, 0px));
        }

        /* Drawer open: block interaction with page (no visibility:hidden — content stays visible on the right) */
        body.nav-menu-open {
          overflow: hidden;
        }

        body.nav-menu-open #page > :not(.site-nav) {
          pointer-events: none;
        }

        /* Top strip stays a solid readable “tab” — not swallowed by the dimmer */
        body.nav-menu-open .site-nav {
          background: var(--bg);
          backdrop-filter: none;
          -webkit-backdrop-filter: none;
        }

        /* Dim only the main column (right of drawer), same width as .nav-center — left menu + page text stay clear */
        .nav-overlay {
          display: block;
          position: fixed;
          top: calc(60px + env(safe-area-inset-top, 0px));
          left: min(300px, 88vw);
          right: 0;
          bottom: 0;
          padding-bottom: env(safe-area-inset-bottom, 0px);
          z-index: 52;
          background: rgba(2, 8, 16, 0.06);
          backdrop-filter: blur(4px);
          -webkit-backdrop-filter: blur(4px);
          opacity: 0;
          pointer-events: none;
          transition: opacity 0.28s ease;
          cursor: pointer;
        }

        [data-theme="day"] .nav-overlay {
          background: rgba(250, 248, 244, 0.12);
        }

        #nav-toggle:checked ~ .nav-overlay {
          opacity: 1;
          pointer-events: auto;
        }

        .nav-center {
          position: fixed;
          top: 0;
          left: 0;
          bottom: 0;
          width: min(300px, 88vw);
          flex: none;
          flex-direction: column;
          align-items: stretch;
          justify-content: flex-start;
          gap: 0;
          padding: calc(72px + env(safe-area-inset-top, 0px)) 0 calc(24px + env(safe-area-inset-bottom, 0px));
          margin: 0;
          padding-left: env(safe-area-inset-left, 0px);
          background: var(--bg);
          backdrop-filter: blur(20px);
          -webkit-backdrop-filter: blur(20px);
          border-right: 1px solid var(--border);
          /* Outer shadow only while open: when closed the drawer sits off-screen
             and its shadow used to leak onto the page as a grey smudge. */
          box-shadow: inset 3px 0 0 var(--accent);
          z-index: 54;
          transform: translate3d(-100%, 0, 0);
          transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
          display: flex;
          visibility: visible;
        }

        #nav-toggle:checked ~ .nav-center {
          transform: translate3d(0, 0, 0);
          box-shadow: inset 3px 0 0 var(--accent), 12px 0 40px rgba(0, 0, 0, 0.22);
        }

        .nav-center .nav-link {
          padding: 18px 24px;
          text-align: left;
          font-size: 1.05rem;
          letter-spacing: 0.12em;
          font-weight: 700;
          color: var(--text);
          border-bottom: 1px solid var(--border);
          width: 100%;
        }

        .nav-center .nav-link:hover:not(.nav-link--disabled) {
          color: var(--accent);
          background: rgba(128, 128, 128, 0.08);
        }

        .nav-center .nav-link--disabled {
          font-size: 0.95rem;
          font-weight: 600;
          color: var(--text);
          opacity: 0.72;
        }

        [data-theme="night"] .nav-center .nav-link {
          text-shadow: 0 0 20px rgba(0, 255, 140, 0.12);
        }

        .nav-burger {
          display: inline-flex;
          position: relative;
          z-index: 56;
          flex-shrink: 0;
        }

        .brand {
          position: relative;
          z-index: 56;
          min-width: 0;
          flex-shrink: 1;
        }

        .nav-tools {
          margin-left: auto;
          position: relative;
          z-index: 56;
          flex-shrink: 0;
          gap: 10px;
        }
      }

      @media (max-width: 520px) {
        .lang-switch button {
          padding: 6px 8px;
        }
      }

      /* Very narrow phones: keep logo + burger + EN/AZ + theme from colliding */
      @media (max-width: 400px) {
        .site-nav {
          padding-left: max(10px, env(safe-area-inset-left, 0px));
          padding-right: max(10px, env(safe-area-inset-right, 0px));
          gap: 6px;
        }

        .brand {
          font-size: 0.95rem;
          letter-spacing: 0.04em;
          gap: 5px;
        }

        .brand-mark {
          width: 20px;
          height: 20px;
        }

        .nav-burger {
          width: 34px;
          height: 34px;
        }

        .nav-tools {
          gap: 5px;
        }

        .lang-switch button {
          padding: 5px 5px;
          letter-spacing: 0.06em;
          font-size: 0.58rem;
        }

        .theme-pill {
          width: 52px;
          height: 26px;
        }

        .theme-pill__knob {
          width: 18px;
          height: 18px;
        }

        [data-theme="day"] .theme-pill__knob {
          left: calc(100% - 3px - 18px);
        }

        .theme-pill svg {
          width: 11px;
          height: 11px;
        }
      }

      @media (max-width: 340px) {
        /* Icon-only brand if the strip is extremely narrow */
        .brand {
          font-size: 0;
          letter-spacing: 0;
          gap: 0;
        }

        .brand-mark {
          width: 26px;
          height: 26px;
        }
      }

/* —— Multi-page layout —— */
.nav-link.is-active {
  color: var(--accent);
  cursor: default;
}

.nav-link.is-active:hover {
  color: var(--accent);
}

.landing-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: calc(72px + env(safe-area-inset-top, 0px)) clamp(20px, 5vw, 48px) 120px;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.landing-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 14px 24px;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

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

.page-narrow {
  max-width: 720px;
  margin: 0 auto;
}

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

.section-head-row .section-title {
  margin-bottom: 0;
}

.btn-structures {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(128, 128, 128, 0.06);
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-structures:hover {
  border-color: var(--accent);
  background: rgba(128, 128, 128, 0.1);
}

/* Atlas hub — pick a structure (atlas.html) */
.atlas-hub-section {
  padding-bottom: 72px;
}

.atlas-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 720px;
}

@media (min-width: 720px) {
  .atlas-choice-grid {
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
  }
}

.atlas-choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.atlas-choice-card:not(.atlas-choice-card--soon):hover {
  border-color: var(--accent);
  background: var(--card-bg-hover);
  transform: translateY(-2px);
}

.atlas-choice-card--soon {
  pointer-events: none;
  opacity: 0.72;
}

.atlas-choice-card__title {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: 0.02em;
}

.atlas-choice-card__hint {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: min(100%, 68ch);
}

.atlas-choice-card__cta {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.atlas-choice-card__soon-title {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.35rem;
  color: var(--text-muted);
}

/* Full-page neuron embed (atlas-neuron.html) */
.atlas-embed-page {
  position: relative;
  z-index: 1;
  padding-top: calc(60px + env(safe-area-inset-top, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: 16px;
}

.atlas-embed-note {
  margin: 0 auto 10px;
  max-width: 1200px;
  padding: 0 clamp(16px, 4vw, 32px);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.atlas-embed-frame {
  margin: 0 auto;
  width: 100%;
  max-width: 1400px;
  height: calc(100svh - 60px - 48px - env(safe-area-inset-top, 0px));
  min-height: 420px;
  padding: 0 clamp(8px, 2vw, 24px);
  box-sizing: border-box;
}

#atlas-full-embed {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="day"] #atlas-full-embed {
  background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 900px) {
  .atlas-embed-frame {
    height: calc(100svh - 60px - 40px - env(safe-area-inset-top, 0px));
    min-height: 360px;
  }
}

/* Synapse: full-bleed under nav (match meninges / neuronatlas) */
body.synapse-atlas-page {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

body.synapse-atlas-page #page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  height: 100%;
  position: relative;
  z-index: 1;
}

body.synapse-atlas-page .atlas-embed-page {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: calc(60px + env(safe-area-inset-top, 0px)) 0 0;
  width: 100%;
  box-sizing: border-box;
}

body.synapse-atlas-page .atlas-embed-note {
  display: none !important;
}

body.synapse-atlas-page .atlas-embed-frame.synapse-embed-wrap {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 0;
}

/* Synapse WebGL fills the atlas structure viewport (synapse.html) */
.synapse-embed-wrap {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: #020810;
}

[data-theme="day"] .synapse-embed-wrap {
  background: #faf8f4;
}

/* Books library (book.html) */
.books-main {
  max-width: 52rem;
}

.books-section {
  margin: 2.25rem 0 0;
}

.books-section__title {
  margin: 0 0 0.75rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
}

.books-section__note {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.books-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.book-card {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}

.book-card--author {
  border-color: var(--accent);
}

.book-card--placeholder {
  border-style: dashed;
}

.book-card__meta {
  margin: 0 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.book-card__title {
  margin: 0 0 0.55rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.book-card__desc {
  margin: 0 0 0.75rem;
  color: var(--text-body, var(--text-muted));
  line-height: 1.55;
  font-size: 0.92rem;
}

.book-card__licence {
  margin: 0 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.book-card__attribution {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  font-style: italic;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.book-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.book-card__btn {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.book-card__btn:hover {
  background: var(--accent-soft, rgba(0, 255, 140, 0.1));
}

.book-card--placeholder .book-card__btn {
  opacity: 0.5;
  cursor: not-allowed;
}

.book-card__chapters {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.book-card__chapters-heading {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.book-card__chapters ul {
  margin: 0;
  padding-left: 1.1rem;
}

.book-card__chapter-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.book-card__chapter-link:hover {
  color: var(--accent);
}

.books-legal {
  margin: 2.75rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.books-attributions {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.books-attributions li {
  margin-bottom: 0.45rem;
}

.books-legal__site {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Articles research library — atlas-style rectangles */
.articles-hub {
  padding-top: 96px;
}

.articles-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin: 1.25rem 0 1rem;
  max-width: 960px;
}

.articles-search {
  flex: 1 1 14rem;
}

.articles-search input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}

.articles-search input:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.articles-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.articles-toolbar__label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.articles-sort__btn,
.articles-topic {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.articles-sort__btn:hover,
.articles-topic:hover {
  color: var(--text);
}

.articles-sort__btn.is-active,
.articles-topic.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft, rgba(0, 255, 140, 0.1));
}

.articles-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  max-width: 960px;
}

.bb-anatomy-viewers {
  margin-bottom: 0.55rem;
}

.articles-count {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.articles-choice-grid {
  margin-top: 0.25rem;
}

.article-choice-card {
  height: 100%;
}

.article-choice-card:hover {
  border-color: var(--accent);
  background: var(--card-bg-hover);
  transform: translateY(-2px);
}

.article-choice-card__meta {
  margin: -6px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.article-choice-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.article-choice-card__tag,
.article-choice-card__licence {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  text-transform: lowercase;
}

.article-choice-card__licence {
  border-color: var(--accent);
  color: var(--accent);
  text-transform: none;
}

.article-choice-card__version {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.article-choice-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  margin-top: auto;
  padding-top: 4px;
}

.article-choice-card__link,
.article-choice-card__copy {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.article-choice-card__link:hover,
.article-choice-card__copy:hover {
  color: var(--accent);
}

.articles-empty {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  max-width: 960px;
}

.articles-empty[hidden] {
  display: none !important;
}

.articles-legal {
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.55;
  max-width: 960px;
}

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

/* Publish — registration-style multi-step wizard */
.publish-page #page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.publish-shell {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: calc(88px + env(safe-area-inset-top, 0px)) 0 3rem;
  flex: 1;
}

.publish-reg-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.publish-reg-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.publish-reg-title {
  margin: 0 0 0.55rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

.publish-reg-lead {
  margin: 0;
  max-width: 36rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.publish-progress {
  margin-bottom: 1.5rem;
}

.publish-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#publish-step-name {
  color: var(--text);
  letter-spacing: 0.04em;
}

.publish-progress__bar {
  height: 2px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.publish-progress__fill {
  height: 100%;
  width: 20%;
  background: var(--accent);
  transition: width 0.35s ease;
}

.publish-panel {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, #808080 12%);
  padding: clamp(1.25rem, 3vw, 2rem);
}

[data-theme='day'] .publish-panel {
  background: #fff;
  box-shadow: 0 1px 0 rgba(42, 26, 8, 0.04);
}

.publish-step[hidden] {
  display: none !important;
}

.publish-step__title {
  margin: 0 0 0.4rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text);
}

.publish-step__help {
  margin: 0 0 1.75rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.publish-q {
  margin-bottom: 1.35rem;
}

.publish-q--third {
  max-width: 8.5rem;
}

.publish-q__label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 600;
}

.publish-req {
  color: var(--accent);
  margin-left: 4px;
  font-weight: 700;
}

.publish-opt {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-left: 6px;
}

.publish-q__hint {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.publish-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 2.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

[data-theme='day'] .publish-input {
  background: #faf8f4;
}

.publish-input--area {
  min-height: 10rem;
  resize: vertical;
  line-height: 1.5;
}

.publish-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.publish-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

@media (max-width: 560px) {
  .publish-row {
    grid-template-columns: 1fr;
  }
}

.publish-choice {
  display: grid;
  gap: 0.65rem;
}

.publish-choice__item {
  display: block;
  cursor: pointer;
}

.publish-choice__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.publish-choice__box {
  display: block;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.publish-choice__item input:focus-visible + .publish-choice__box {
  box-shadow: 0 0 0 1px var(--accent);
}

.publish-choice__item input:checked + .publish-choice__box {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.publish-choice__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.publish-choice__hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.publish-review {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(7rem, 28%) 1fr;
  gap: 0.65rem 1rem;
  font-size: 0.86rem;
}

.publish-review dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.publish-review dd {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.publish-q--checks {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.publish-check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}

.publish-check input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
  accent-color: var(--accent);
  width: 1.05rem;
  height: 1.05rem;
}

.publish-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.publish-status {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.45;
}

.publish-status[hidden] {
  display: none !important;
}

.publish-status--ok {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 255, 140, 0.08);
}

[data-theme='day'] .publish-status--ok {
  background: rgba(224, 90, 16, 0.08);
}

.publish-status--err {
  border-color: #e05858;
  color: #e05858;
}

.publish-status--pending {
  color: var(--text-muted);
}

.publish-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.publish-nav__spacer {
  flex: 1;
}

.publish-btn {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 2.75rem;
  padding: 0.7rem 1.35rem;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
}

.publish-btn[hidden] {
  display: none !important;
}

.publish-btn--primary {
  background: var(--accent);
  color: #020810;
  border-color: var(--accent);
}

[data-theme='day'] .publish-btn--primary {
  color: #fff;
}

.publish-btn--primary:hover {
  filter: brightness(1.05);
}

.publish-btn--primary:disabled {
  opacity: 0.55;
  cursor: wait;
  filter: none;
}

.publish-btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

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

/* About page */
.about-main {
  padding-bottom: 80px;
}

.about-title {
  margin-bottom: 12px;
}

.about-lead {
  margin-bottom: 40px;
}

.about-block {
  margin-bottom: 36px;
}

.about-block__title {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 12px;
}

.about-block p,
.about-list {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.92;
}

.about-list {
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-list li::marker {
  color: var(--accent);
}

.about-list a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-contact,
.about-domain {
  margin-top: 10px;
}

.about-contact a,
.about-domain a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-domain {
  opacity: 0.85;
  font-size: 0.88rem;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 8px;
  padding-top: 8px;
}

.about-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #020810;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

[data-theme='day'] .about-action {
  color: #faf8f4;
}

.about-action:hover {
  opacity: 0.92;
}

.about-action--ghost,
[data-theme='day'] .about-action--ghost {
  background: transparent;
  color: var(--accent);
}

.about-action--ghost:hover {
  background: var(--accent-soft);
}

/* Phone / narrow screens — keep content usable without horizontal scroll */
@media (max-width: 640px) {
  html,
  body {
    overflow-x: hidden;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px; /* avoid iOS auto-zoom on focus */
  }

  .content-section {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .page-narrow {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .atlas-choice-card {
    padding: 22px 18px;
    min-height: 44px;
  }

  .atlas-choice-card__cta {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .book-card,
  .articles-choice-grid .atlas-choice-card {
    padding: 1.1rem 1rem;
  }

  .publish-nav {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .publish-review {
    grid-template-columns: 1fr;
  }

  .about-actions {
    flex-direction: column;
  }

  .about-action {
    width: 100%;
    min-height: 44px;
  }

  .site-footer {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }

  .synapse-structure-main,
  .meninges-structure-main,
  body.synapse-atlas-page #page,
  body.synapse-atlas-page {
    min-height: 100dvh;
  }

  #hero {
    min-height: 100dvh;
  }

  .hero-overlay {
    min-height: calc(100dvh - 60px);
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
    padding-bottom: max(64px, calc(28px + env(safe-area-inset-bottom, 0px)));
  }

  .hero-copy h1 {
    font-size: clamp(1.85rem, 8vw, 2.6rem);
  }

  #creator-credit.copyright {
    right: max(0.65rem, env(safe-area-inset-right, 0px)) !important;
    bottom: max(0.5rem, env(safe-area-inset-bottom, 0px)) !important;
    left: auto !important;
    font-size: 0.5rem !important;
  }
}

/* —— Neuron dynamics (LIF teaching sim) —— */
.neuron-dynamics-page .ndyn-main {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.ndyn-lead {
  max-width: 46rem;
}

.ndyn-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin-top: 1.75rem;
  align-items: start;
}

.ndyn-stage {
  min-width: 0;
}

.ndyn-stage__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  margin-bottom: 0.85rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ndyn-readout strong {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0.2rem;
  font-size: 1.05rem;
}

.ndyn-unit {
  opacity: 0.75;
  font-size: 0.75rem;
}

.ndyn-status {
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.ndyn-status[data-state="spike"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

#ndyn-plot {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: color-mix(in srgb, var(--bg) 70%, #000 30%);
}

[data-theme="day"] #ndyn-plot {
  background: #fffef4;
}

.ndyn-axis {
  display: flex;
  justify-content: space-between;
  margin: 0.45rem 0 1.1rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.ndyn-controls {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.ndyn-slider {
  display: block;
}

.ndyn-slider__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--text);
}

.ndyn-slider__label strong {
  color: var(--accent);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
}

.ndyn-slider input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.ndyn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.ndyn-btn {
  min-height: 2.5rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ndyn-btn:hover {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.ndyn-btn--ghost {
  border-color: var(--border);
  background: transparent;
}

.ndyn-btn--ghost:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.ndyn-teach__title {
  margin: 0 0 0.65rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
}

.ndyn-teach__body {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.ndyn-more {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ndyn-more:hover {
  opacity: 0.85;
}

.ndyn-detail-wrap {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.ndyn-credit {
  margin: 1.25rem 0 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.8;
}

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

  .ndyn-status {
    margin-left: 0;
  }
}

/* —— Hodgkin–Huxley dedicated site page —— */
body.hh-page {
  min-height: 100dvh;
}

body.hh-page #page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.hh-app {
  flex: 1 1 auto;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(1.1rem, 3vw, 2rem) max(16px, env(safe-area-inset-left, 0px))
    clamp(2rem, 5vw, 3.5rem) max(16px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.hh-app__head {
  margin-bottom: 1.25rem;
}

.hh-app__title {
  margin: 0.35rem 0 0.45rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--text);
}

.hh-app__lead {
  margin: 0;
  max-width: 40rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.hh-related,
.ndyn-related {
  margin: 0.75rem 0 0;
  max-width: 40rem;
}

.hh-related a,
.ndyn-related a {
  color: var(--accent);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hh-related a:hover,
.ndyn-related a:hover {
  opacity: 0.85;
}

.hh-page .hh-main {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.hh-lead {
  max-width: 48rem;
}

.hh-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin-top: 1.75rem;
  align-items: start;
}

.hh-stage {
  min-width: 0;
}

.hh-stage__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  align-items: baseline;
  margin-bottom: 0.85rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hh-readout strong {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0.15rem 0 0.25rem;
  font-size: 1.02rem;
}

.hh-unit {
  opacity: 0.75;
  font-size: 0.72rem;
}

.hh-status {
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.hh-status[data-state="rising"],
.hh-status[data-state="stim"] {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

#hh-plot {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: color-mix(in srgb, var(--bg) 70%, #000 30%);
}

[data-theme="day"] #hh-plot {
  background: #fffef4;
}

.hh-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0.55rem 0 0.35rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hh-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hh-legend__item.is-hidden,
.hh-legend__item[hidden] {
  display: none !important;
}

.hh-legend__item i {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 1px;
}

.hh-legend__item--v i { background: #00ff8c; }
.hh-legend__item--m i { background: #5ec8ff; }
.hh-legend__item--h i { background: #ff6b7a; }
.hh-legend__item--n i { background: #c9a0ff; }
.hh-legend__item--ina i { background: #5ec8ff; }
.hh-legend__item--ik i { background: #c9a0ff; }

[data-theme="day"] .hh-legend__item--v i { background: #e05a10; }
[data-theme="day"] .hh-legend__item--m i,
[data-theme="day"] .hh-legend__item--ina i { background: #1a6fd4; }
[data-theme="day"] .hh-legend__item--h i { background: #c93840; }
[data-theme="day"] .hh-legend__item--n i,
[data-theme="day"] .hh-legend__item--ik i { background: #7a3fd4; }

.hh-legend__item[hidden] {
  display: none !important;
}

.hh-caption {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.hh-controls__title {
  margin: 0 0 0.75rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.hh-controls__title--gap {
  margin-top: 1.35rem;
}

.hh-slider {
  display: block;
  margin-bottom: 0.85rem;
}

.hh-slider__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  color: var(--text);
}

.hh-slider__label strong {
  color: var(--accent);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
}

.hh-phi {
  margin-left: auto;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hh-slider input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.hh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.15rem 0 0.75rem;
}

.hh-actions--foot {
  margin-top: 1rem;
  margin-bottom: 0;
}

.hh-btn {
  min-height: 2.45rem;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hh-btn:hover {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.hh-btn--ghost {
  border-color: var(--border);
  background: transparent;
}

.hh-btn--ghost:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.hh-btn--toggle.is-active,
.hh-btn.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
}

.hh-btn--toggle[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
}

.hh-drug-hint {
  margin: -0.25rem 0 0.7rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.hh-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.35rem 0 0.65rem;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
}

.hh-check input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.hh-speed {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.hh-model {
  margin-bottom: 0.35rem;
}

.hh-slider[hidden],
.hh-drug-hint[hidden] {
  display: none !important;
}

.hh-prose {
  margin-top: 1.5rem;
}

.hh-prose__title {
  margin: 0 0 0.75rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--text);
}

.hh-prose p {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 52rem;
}

.hh-prose__note {
  font-size: 0.85rem !important;
  opacity: 0.92;
}

.hh-credit {
  margin: 1rem 0 0 !important;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.68rem !important;
  color: var(--text-muted);
  opacity: 0.8;
}

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

  .hh-status {
    margin-left: 0;
  }

  .hh-controls {
    order: 2;
  }

  .hh-stage {
    order: 1;
  }
}

/* Brain Bee prep (scoped .bb- so tokens stay on AXON night/day) */
.bb-levels {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.bb-levels__item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  background: rgba(128, 128, 128, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bb-levels__n {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.bb-section-grid {
  margin-bottom: 2.5rem;
}

.atlas-choice-card--feature {
  grid-column: 1 / -1;
}

.atlas-choice-card.is-lesson-match {
  border-color: var(--accent);
}

.bb-disclaimer-inline {
  margin: 2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.bb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.bb-habit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0 0 2rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.bb-habit--compact {
  margin-bottom: 1.25rem;
  padding: 0.85rem;
}
@media (min-width: 720px) {
  .bb-habit { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
.bb-habit__cell {
  min-width: 0;
  padding: 0.35rem 0.25rem;
}
.bb-habit__cell--link {
  display: block;
  border-radius: 10px;
  color: inherit;
  padding: 0.5rem 0.55rem;
}
.bb-habit__cell--link:hover {
  color: var(--accent);
  background: var(--card-bg-hover);
}
.bb-habit__icon {
  width: 18px;
  height: 18px;
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
}
.bb-habit__kicker {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bb-habit__value {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text);
}
.bb-habit__value--muted {
  color: var(--text-muted);
}
.bb-habit__meta {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.bb-habit__bar {
  margin-top: 0.55rem;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.bb-habit__bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.bb-habit-nudge {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.atlas-choice-card.is-lesson-done {
  opacity: 0.72;
  background: var(--card-bg);
}
.atlas-choice-card.is-lesson-done:hover {
  transform: none;
}
.atlas-choice-card.is-lesson-next {
  border-color: var(--accent);
}
.bb-lesson-card__extras {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
}
.bb-lesson-card__badge,
.bb-lesson-card__pill,
.bb-lesson-card__miss {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bb-lesson-card__badge { color: var(--accent); }
.bb-lesson-card__badge .bb-habit__icon {
  width: 12px;
  height: 12px;
  margin: 0;
}
.bb-lesson-card__pill {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.bb-lesson-card__mini {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.bb-lesson-card__mini span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.bb-lesson-card__miss {
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.bb-lesson-card__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.bb-score {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.bb-score__n {
  color: var(--accent);
  font-weight: 600;
}

.bb-panel {
  padding: 1.1rem 1rem;
  margin-bottom: 1rem;
  background: rgba(128, 128, 128, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bb-panel__label {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.bb-panel__text {
  margin: 0;
}

.bb-test-group {
  margin-bottom: 1rem;
}

.bb-test-group__title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
}

.bb-test-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.bb-test-row--single {
  grid-template-columns: 1fr;
}

.bb-chip {
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: rgba(128, 128, 128, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.bb-chip:hover:not(:disabled) {
  border-color: var(--accent);
}

.bb-chip.is-on {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft, rgba(0, 255, 140, 0.1));
}

.bb-chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bb-hint {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.bb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.5rem 0 1.25rem;
}

.bb-lesson-body p + p {
  margin-top: 1.75em;
}

.bb-lesson-video {
  margin: 0.5rem 0 1.25rem;
  padding: 0.9rem 1rem;
  background: rgba(128, 128, 128, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.bb-lesson-video + .bb-lesson-video {
  margin-top: -0.4rem;
}
.bb-lesson-video summary {
  cursor: pointer;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.bb-lesson-video summary::-webkit-details-marker { color: var(--accent); }
.bb-lesson-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 0.85rem;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}
.bb-lesson-video__frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

.bb-result {
  margin-bottom: 0.85rem;
}

.bb-result__name {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: var(--accent);
}

.bb-result__body {
  margin: 0;
  color: var(--text-muted);
}

.bb-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.bb-field__label {
  font-size: 0.85rem;
}

.bb-input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.bb-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.bb-feedback.is-ok .bb-panel__label {
  color: var(--accent);
}

.bb-feedback.is-no .bb-panel__label {
  color: #e24b4b;
}

[data-theme="day"] .bb-feedback.is-no .bb-panel__label {
  color: #b42318;
}

.bb-back {
  margin: 1.5rem 0 0;
}

.bb-home-strip {
  padding-top: 48px;
  padding-bottom: 48px;
}

.bb-home-strip .section-title {
  margin-bottom: 12px;
}

.bb-home-strip .section-desc {
  margin-bottom: 24px;
}

.bb-quiz-q {
  margin: 0 0 1rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
}

.bb-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.bb-choice {
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(128, 128, 128, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.bb-choice:hover:not(:disabled) {
  border-color: var(--accent);
}

.bb-choice.is-on {
  border-color: var(--accent);
  color: var(--accent);
}

.bb-choice.is-right {
  border-color: var(--accent);
  color: var(--accent);
}

.bb-choice.is-wrong {
  border-color: #e24b4b;
  color: #e24b4b;
}

[data-theme="day"] .bb-choice.is-wrong {
  border-color: #b42318;
  color: #b42318;
}

.bb-see {
  margin: 0.85rem 0 0;
}

.bb-see .bb-link,
.bb-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bb-score--muted .bb-score__n {
  color: var(--text-muted);
}

.bb-clock .bb-score__n {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.bb-panel__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--accent);
}

.bb-panel__text--dim {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.bb-reset {
  margin: 1.25rem 0 2.5rem;
}

.bb-linkbtn {
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.bb-linkbtn:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.bb-breakdown {
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bb-breakdown__row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(3rem, 6rem) auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.bb-breakdown__name {
  color: var(--text-muted);
}

.bb-breakdown__bar {
  height: 6px;
  background: rgba(128, 128, 128, 0.18);
  border-radius: 999px;
  overflow: hidden;
}

.bb-breakdown__bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.bb-breakdown__n {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--accent);
  text-align: right;
}

.bb-missed {
  padding-top: 0.9rem;
  margin-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.bb-missed:first-of-type {
  padding-top: 0;
  margin-top: 0.6rem;
  border-top: 0;
}

.bb-missed__q {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.bb-missed__line {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.bb-missed__line--dim {
  color: var(--text-muted);
}

.bb-missed__tag {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.bb-missed__line--dim .bb-missed__tag {
  color: var(--text-muted);
}

.bb-missed__why {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.bb-strikes {
  display: inline-flex;
  gap: 0.35rem;
  vertical-align: middle;
}

.bb-strike {
  width: 10px;
  height: 10px;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.bb-strike.is-on {
  background: #e24b4b;
  border-color: #e24b4b;
}

[data-theme="day"] .bb-strike.is-on {
  background: #b42318;
  border-color: #b42318;
}

.bb-stage {
  position: relative;
  height: clamp(320px, 54vh, 540px);
  margin-bottom: 1.25rem;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bb-stage[hidden] {
  display: none;
}

.bb-stage__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.bb-stage__note {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
  pointer-events: none;
}

.bb-hotspot-map {
  position: relative;
  margin-bottom: 1rem;
}

.bb-hotspot-map img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bb-hotspot-map .bb-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  min-height: 0;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
}

@media (min-width: 640px) {
  .bb-levels {
    flex-direction: row;
  }

  .bb-levels__item {
    flex: 1;
  }
}

/* Typography split: readable sans for running text (body, above); the mono
   face is kept for short labels, tags, buttons and readouts. */
.hero-sub,
.tag,
.pill-tag,
.nav-center .nav-link,
.lang-switch button,
.landing-kicker,
.home-explore-card__cta,
.atlas-choice-card__cta,
.atlas-embed-note,
.publish-reg-kicker,
.publish-progress__meta,
.publish-q__label,
.publish-review dt,
.ndyn-status,
.hh-status,
.bb-levels__n,
.bb-habit__kicker,
.bb-lesson-card__badge,
.bb-lesson-card__pill,
.bb-lesson-card__miss,
.bb-panel__label,
.bb-missed__tag,
.bb-score {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.bb-topic-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Accent restraint: the accent colour is kept for the brand, the headline
   accent word, buttons, links, active states and scores. Headings use the
   text colour; small kicker labels use the muted colour. */
.about-block__title,
.bb-panel__title,
.bb-result__name {
  color: var(--text);
}

.tag,
.pill-tag,
.home-explore-card__meta,
.bb-panel__label,
.bb-lesson-card__badge,
.bb-lesson-card__pill,
.bb-missed__tag,
.bb-levels__n {
  color: var(--text-muted);
}

/* ===== Homepage intro video (right under the hero) ===== */
.home-video {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 20px 48px;
}
.home-video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #020810;
  box-shadow: 0 0 60px rgba(0, 255, 140, 0.08);
}
.home-video__player {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #020810;
}
.home-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: #00ff8c; /* always the video's own green: the button sits on the dark film in both themes */
  color: #020810;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 10px rgba(0, 255, 140, 0.15), 0 0 40px rgba(0, 255, 140, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-video__play svg {
  width: 36px;
  height: 36px;
  margin-left: 4px;
  fill: currentColor;
}
.home-video__play:hover,
.home-video__play:focus-visible {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 0 0 14px rgba(0, 255, 140, 0.2), 0 0 56px rgba(0, 255, 140, 0.6);
}
.home-video__play[hidden] {
  display: none;
}
.home-video__note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .home-video { padding: 0 16px 32px; }
  .home-video__frame { border-radius: 10px; }
  .home-video__play { width: 68px; height: 68px; }
  .home-video__play svg { width: 28px; height: 28px; }
}

[data-theme="day"] .home-video__frame {
  border-color: rgba(42, 26, 8, 0.18);
  box-shadow: 0 12px 40px rgba(42, 26, 8, 0.18);
}

/* ===== Homepage: numbers ===== */
.home-stats {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 20px 40px;
}
.home-stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.home-stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  text-align: center;
}
.home-stats__n {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.home-stats__label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .home-stats { padding: 0 16px 28px; }
  .home-stats__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ===== Homepage: question of the day ===== */
.qotd {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 56px;
}
.qotd__card {
  padding: 24px 24px 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
}
.qotd__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.qotd__tag {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.qotd__streak {
  font-size: 0.85rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.qotd__streak[hidden] { display: none; }
.qotd__q {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.45;
}
.qotd__choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qotd__choice {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.qotd__choice:hover:not(:disabled),
.qotd__choice:focus-visible { border-color: var(--accent); }
.qotd__choice:disabled { cursor: default; opacity: 0.6; }
.qotd__choice.is-right { opacity: 1; border-color: var(--accent); background: rgba(0, 255, 140, 0.12); }
[data-theme="day"] .qotd__choice.is-right { background: rgba(224, 90, 16, 0.1); }
.qotd__choice.is-wrong { opacity: 1; border-color: #e0475a; background: rgba(224, 71, 90, 0.1); }
.qotd__why {
  margin: 14px 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.qotd__why[hidden], .qotd__more[hidden] { display: none; }
.qotd__more {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
}
@media (max-width: 640px) {
  .qotd { padding: 0 16px 40px; }
  .qotd__card { padding: 20px 16px 18px; }
  .qotd__choices { grid-template-columns: 1fr; }
}

/* ===== Homepage: live previews on the explore cards ===== */
.home-explore-grid--live { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .home-explore-grid--live { grid-template-columns: 1fr 1fr; }
}
.home-explore-grid--compact { margin-top: 16px; }
@media (min-width: 720px) {
  .home-explore-grid--compact { grid-template-columns: 1fr 1fr; }
}
.hx-prev {
  position: relative;
  width: 100%;
  aspect-ratio: 14 / 9;
  margin-bottom: 6px;
  border-radius: 10px;
  overflow: hidden;
  background: #020810;
  border: 1px solid rgba(200, 240, 224, 0.1);
}
.hx-prev video,
.hx-prev canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hx-prev--quiz {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 18px;
  color: #c8f0e0;
}
.hx-prev--quiz.is-in .hx-quiz__q,
.hx-prev--quiz.is-in .hx-quiz__opts { animation: hxIn 0.45s ease both; }
.hx-prev--quiz.is-in .hx-quiz__opts { animation-delay: 0.08s; }
@keyframes hxIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hx-quiz__q { margin: 0; font-weight: 600; font-size: 1rem; line-height: 1.4; }
.hx-quiz__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hx-quiz__opt {
  padding: 8px 10px;
  border: 1px solid rgba(200, 240, 224, 0.18);
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.3;
  transition: border-color 0.4s ease, background-color 0.4s ease, color 0.4s ease;
}
.hx-quiz__opt.is-right { border-color: #00ff8c; background: rgba(0, 255, 140, 0.14); color: #00ff8c; }
@media (prefers-reduced-motion: reduce) {
  .hx-prev--quiz.is-in .hx-quiz__q, .hx-prev--quiz.is-in .hx-quiz__opts { animation: none; }
}

/* ===== Crayon title above the intro video ===== */
.crayon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.home-video__crayon {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 10px;
  padding: 0 8px;
}
.home-video__title {
  margin: 0;
  font-family: "Mansalva", "Comic Sans MS", cursive;
  font-weight: 400;
  font-size: clamp(1.7rem, 4.6vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-align: center;
  text-wrap: balance;
  color: var(--accent);
  transform: rotate(-2deg);
  filter: url(#crayon);
  text-shadow: 0 0 18px rgba(0, 255, 140, 0.35);
}
[data-theme="day"] .home-video__title { text-shadow: none; }
.home-video__arrow {
  flex: 0 0 auto;
  width: clamp(54px, 7vw, 84px);
  height: auto;
  margin-bottom: -18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#crayon);
}
@media (max-width: 640px) {
  .home-video__crayon { flex-direction: column; align-items: center; gap: 0; }
  .home-video__arrow { width: 52px; margin: 2px 0 -6px; transform: rotate(20deg); }
}

/* ===== About: who's behind AXON ===== */
.about-founder__card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
}
.about-founder__mark {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: #020810 center / 62% no-repeat url("logo-light.png?v=5");
  box-shadow: 0 0 22px rgba(0, 255, 140, 0.25);
}
[data-theme="day"] .about-founder__mark {
  background: #faf8f4 center / 62% no-repeat url("logo.png?v=5");
  box-shadow: 0 0 18px rgba(224, 90, 16, 0.18);
}
.about-founder__id { min-width: 0; }
.about-founder .about-founder__name {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}
.about-founder .about-founder__role {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.about-founder > p + p { margin-top: 10px; }

/* ===== Shorter hero: let the video title peek in on the first screen ===== */
#hero { min-height: 84vh; min-height: 84svh; }
.hero-overlay { min-height: calc(84vh - 60px); min-height: calc(84svh - 60px); padding-bottom: 28px; }
@media (max-width: 760px) {
  #hero { min-height: 78svh; }
  .hero-overlay { min-height: calc(78svh - 60px - env(safe-area-inset-top, 0px)); padding-bottom: 20px; }
}
.home-video { padding-top: 0; }
@media (max-width: 760px) and (max-height: 780px) {
  #hero { min-height: 88svh; }
  .hero-overlay { min-height: calc(88svh - 60px - env(safe-area-inset-top, 0px)); }
}

/* ===== Day mode: live card previews switch to cream + orange ===== */
[data-theme="day"] .hx-prev {
  background: #f5f3ef;
  border-color: rgba(42, 26, 8, 0.12);
}
[data-theme="day"] .hx-prev--quiz { color: #2a1a08; }
[data-theme="day"] .hx-quiz__opt { border-color: rgba(42, 26, 8, 0.16); background: #faf8f4; }
[data-theme="day"] .hx-quiz__opt.is-right { border-color: #e05a10; background: rgba(224, 90, 16, 0.12); color: #b8460a; }

/* ===== Atlases page: every card spins its own 3D model ===== */
.atlas-hub-section .atlas-choice-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.atlas-choice-card--live {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.atlas-choice-card--live .hx-prev {
  aspect-ratio: 16 / 10;
  margin-bottom: 4px;
}
@media (max-width: 560px) {
  .atlas-hub-section .atlas-choice-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .atlas-choice-card--live { padding: 10px; }
  .atlas-choice-card--live .atlas-choice-card__hint,
  .atlas-choice-card--live .atlas-choice-card__cta { display: none; }
  .atlas-choice-card--live .atlas-choice-card__title { font-size: 1.05rem; margin: 2px 0 0; }
}
.atlas-hub-section.page-narrow { max-width: 1120px; }

/* ===== Books: designed covers + shelf layout ===== */
.book-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.book-card--author { grid-template-columns: 170px minmax(0, 1fr); padding: 1.5rem; }
.book-card__body { min-width: 0; }
.book-card__cover-link { display: block; text-decoration: none; }
#library-books.books-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
#library-books .book-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#library-books .book-card__title { font-size: 1.2rem; }

.book-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 3px 6px 6px 3px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.book-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.book-cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(255,255,255,.10) 3%, rgba(0,0,0,.06) 6%, transparent 9%);
  pointer-events: none;
}
.book-card__cover-link:hover .book-cover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4); }

@media (max-width: 900px) {
  #library-books.books-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .book-card, .book-card--author { grid-template-columns: 92px minmax(0, 1fr); gap: .95rem; }
  .book-card--author { grid-template-columns: 112px minmax(0, 1fr); }
  .book-card__desc { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ===== Brain Bee hub: shorter, clearer ===== */
.bb-hub .about-lead { max-width: 52ch; }
.bb-path {
  display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 1.6rem; padding: 0; list-style: none;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.72rem; letter-spacing: 0.06em;
}
.bb-path li { display: flex; align-items: baseline; gap: 0.45rem; padding: 0.45rem 0.9rem; border: 1px solid var(--border); background: var(--card-bg); }
.bb-path li:first-child { border-radius: 999px 0 0 999px; }
.bb-path li:last-child { border-radius: 0 999px 999px 0; }
.bb-path li + li { border-left: 0; }
.bb-path b { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; }
.bb-path span { color: var(--text-muted); }
.bb-hub__h {
  margin: 2.6rem 0 1rem; font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 600;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem); color: var(--text);
}
.bb-grid { display: grid; gap: 14px; max-width: none; }
.bb-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bb-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bb-card { position: relative; gap: 10px; padding: 22px 20px 20px; }
.bb-card .atlas-choice-card__title { font-size: clamp(1.25rem, 2vw, 1.5rem); }
.bb-card .atlas-choice-card__hint { font-size: 0.86rem; line-height: 1.5; }
.bb-card .atlas-choice-card__cta { margin-top: auto; }
.bb-card__n {
  position: absolute; top: 16px; right: 18px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 2.4rem; line-height: 1; font-weight: 600;
  color: var(--accent); opacity: 0.35;
}
.bb-extra { margin: 2.6rem 0 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); }
.bb-extra > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 16px 20px; cursor: pointer; list-style: none;
}
.bb-extra > summary::-webkit-details-marker { display: none; }
.bb-extra__t { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 1.3rem; font-weight: 600; color: var(--text); }
.bb-extra__m { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.bb-extra__m::after { content: " ▾"; }
.bb-extra[open] .bb-extra__m::after { content: " ▴"; }
.bb-extra #bb-quiz { padding: 0 20px 20px; }
.bb-res { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem; margin: 2.2rem 0 0; font-size: 0.9rem; }
.bb-res__k { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.bb-res a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.bb-res a:hover { border-bottom-color: var(--accent); }
.bb-hub .bb-disclaimer-inline { font-size: 0.76rem; margin-top: 1.2rem; }
@media (max-width: 900px) {
  .bb-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .bb-grid--3 { grid-template-columns: 1fr; }
  .bb-grid--3 .bb-card { padding: 16px 18px; }
  .bb-grid--4 { gap: 10px; }
  .bb-grid--4 .bb-card { padding: 16px 14px; }
  .bb-grid--4 .atlas-choice-card__title { font-size: 1.12rem; }
  .bb-grid--4 .atlas-choice-card__hint { font-size: 0.8rem; }
  .bb-path { font-size: 0.64rem; }
  .bb-path li { padding: 0.4rem 0.6rem; }
}

/* ===== Practice: one panel, quiet links ===== */
.bb-session { margin-top: 1.4rem; border: 1px solid var(--border); border-radius: 14px; background: var(--card-bg); overflow: hidden; }
.bb-session > .bb-toolbar { padding: 12px 20px; border-bottom: 1px solid var(--border); margin: 0; }
.bb-session > .bb-toolbar .bb-score { margin: 0; }
.bb-session > #bb-habit-nudge:not(:empty) { padding: 12px 20px 0; }
.bb-session > #bb-app { padding: 20px; }
.bb-back--links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 1.4rem; }
.bb-back--links .about-action {
  border: 0; padding: 0; min-height: 0; background: none; font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted);
}
.bb-back--links .about-action:hover { color: var(--accent); background: none; }
@media (max-width: 640px) {
  .bb-session > .bb-toolbar { padding: 10px 14px; }
  .bb-session > #bb-app { padding: 14px; }
}

/* ===== Articles: two-column shelf, compact cards ===== */
#articles-list.articles-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: none;
}
#articles-list .article-choice-card { padding: 20px 20px 18px; gap: 10px; margin: 0; }
#articles-list .atlas-choice-card__title { font-size: clamp(1.08rem, 1.6vw, 1.22rem); line-height: 1.25; }
#articles-list .atlas-choice-card__hint {
  font-size: 0.86rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#articles-list .article-choice-card__tags { display: none; }
#articles-list .article-choice-card__actions { margin-top: auto; }
.articles-main .articles-topics { gap: 6px; }
.articles-main .articles-legal p { font-size: 0.76rem; }
@media (max-width: 760px) {
  #articles-list.articles-list { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 640px) {
  .bb-path { flex-wrap: nowrap; }
  .bb-path li { flex: 1 1 auto; justify-content: center; padding: 0.45rem 0.4rem; }
  .bb-path span { display: none; }
  .bb-path li + li::before { content: "→"; color: var(--text-muted); margin-right: 0.35rem; }
}

/* ===== Articles on phones: articles visible on first screen ===== */
@media (max-width: 760px) {
  .articles-main.content-section { padding-top: 76px !important; }
  .articles-main .section-title { margin-bottom: 0.4rem; }
  .articles-main .section-desc { margin-bottom: 0.9rem; font-size: 0.92rem; }
  .articles-main .articles-toolbar { flex-wrap: nowrap; gap: 0.5rem; margin-bottom: 0.6rem; align-items: center; }
  .articles-main .articles-search { flex: 1 1 auto; min-width: 0; }
  .articles-main .articles-toolbar__label { display: none; }
  .articles-main .articles-sort { flex: 0 0 auto; gap: 0.3rem; }
  .articles-main .articles-sort__btn { padding: 0.35rem 0.6rem; }
  .articles-main .articles-topics {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    margin: 0 -16px 0.7rem; padding: 2px 16px 6px; gap: 0.35rem;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
  }
  .articles-main .articles-topics::-webkit-scrollbar { display: none; }
  .articles-main .articles-topic { flex: 0 0 auto; white-space: nowrap; }
  .articles-main .articles-count { margin-bottom: 0.6rem; }
}
