/* ==========================================================================
   Responsive layout.
   ========================================================================== */

/* Large monitors */
@media (min-width: 1600px) {
  :root { --container: 1360px; }
}

/* Laptops and below: collapse the navigation into the menu */
@media (max-width: 1120px) {
  .primary-nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* Tablets */
@media (max-width: 960px) {
  :root { --header-h: 72px; }

  .hero { padding-bottom: 64px; }
  .hero__grid { grid-template-columns: 1fr; text-align: center; gap: 32px; }
  .hero__copy { order: 2; }
  .hero__book { order: 1; }
  .hero__eyebrow { justify-content: center; }
  .hero__rule { margin-inline: auto; transform-origin: center; background: linear-gradient(90deg, transparent, var(--c-gold), transparent); }
  .hero__subtitle, .hero__lede { margin-inline: auto; }
  .hero__actions, .hero__meta { justify-content: center; }
  .hero__vignette { background: linear-gradient(180deg, transparent 70%, var(--c-void) 100%); }
  .book3d { --bw: clamp(190px, 42vw, 300px); }
  .book3d--small { --bw: clamp(150px, 34vw, 220px); }

  .split, .split--reverse, .author-intro, .overview, .contact-grid, .buy-hero__grid { grid-template-columns: 1fr; }
  .split--reverse > :first-child { order: 0; }
  .overview__aside, .contact-aside { position: static; }

  .part { grid-template-columns: minmax(0, 1fr); gap: 0; padding-left: 40px; }
  .part__card, .part:nth-child(odd of .part) .part__card { grid-column: 1; grid-row: 2; }
  .part__visual, .part:nth-child(odd of .part) .part__visual { grid-column: 1; grid-row: 1; aspect-ratio: 16 / 8; border-bottom: 0; }
  .part__card { position: relative; z-index: 1; }
  .journey__line, .part__node { left: 12px; }
  .part__node { top: 40px; }

  .glimpses__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glimpse { aspect-ratio: 4 / 4.4; }
  .argument { grid-template-columns: minmax(0, 1fr); }
  .spiral { max-width: 480px; margin-inline: auto; width: 100%; }
  .orbits { width: 165%; }

  .why__head { grid-template-columns: 1fr; }
  .why__list { grid-template-columns: 1fr; }

  .showcase { grid-template-columns: 1fr; text-align: center; }
  .showcase__text { margin-inline: auto; }
  .showcase .notice-panel { justify-items: center; text-align: center; }
  .showcase .actions { justify-content: center; }
  .showcase .editions { text-align: left; }

  .expect, .perspective, .contents { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .benefits { grid-template-columns: 1fr; }
  .benefit + .benefit { border-left: 0; border-top: 1px solid var(--c-line-soft); }

  .buy-hero__copy { text-align: center; }
  .buy-hero__list { justify-items: center; }
  .buy-hero__copy .actions { justify-content: center; }
  .buy-hero__desc, .buy-hero__safe { margin-inline: auto; }

  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; }

  .timeline::before { left: 4px; }
  .chapter-of-life { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-left: 32px; }
  .chapter-of-life::before { left: 4px; top: 8px; }
  .chapter-of-life__label { text-align: left; padding: 0; grid-auto-flow: column; justify-content: start; align-items: center; justify-items: start; }
  .chapter-of-life::before { display: none; }
  .timeline::before { left: 22px; }
  .chapter-of-life { padding-left: 0; }
  .chapter-of-life__body { padding-left: 62px; }

  .admin__row { grid-template-columns: 1fr 1fr; }
}

/* Phones */
@media (max-width: 640px) {
  :root { --section: 48px; }

  .site-header__cta { display: none; }
  .brand__divider, .brand__name { display: none; }

  .hero { padding-top: calc(var(--header-h) + 24px); }
  .hero__grid { gap: 24px; }
  .hero__subtitle { letter-spacing: 0.24em; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .hero__meta { font-size: 0.62rem; letter-spacing: 0.2em; gap: 8px 20px; }
  .hero__meta li { gap: 10px; }
  .scroll-cue { display: none; }

  .btn { padding: 0 26px; letter-spacing: 0.2em; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; }
  .actions .text-link { align-self: center; }
  .btn--soon { max-width: 100%; }

  .question__not span { display: block; }
  .question__not span + span::before { content: none; }

  .why__item { grid-template-columns: 44px 1fr; gap: 4px 16px; }
  .why__item > .icon-badge { width: 44px; height: 44px; }
  .why__item > .icon-badge .icon { width: 20px; height: 20px; }

  .glimpses__grid { grid-template-columns: minmax(0, 1fr); }
  .glimpse { aspect-ratio: 16 / 13; }
  .part__visual, .part:nth-child(odd of .part) .part__visual { aspect-ratio: 16 / 9; }
  .part { padding-left: 30px; }
  .journey__line, .part__node { left: 8px; }
  .orbits { width: 150%; }
  .split-art { margin-top: 18px; }
  .legend { gap: 6px 12px; }

  .statement { min-height: 80vh; }

  .questions li { grid-template-columns: 44px 1fr; gap: 12px; }
  .overview__stat { gap: 0 24px; }

  .contents__part summary { padding: 22px 18px; gap: 14px; }
  .contents__roman { width: 32px; font-size: 1.2rem; }
  .contents__list { padding: 0 18px 22px 18px; }

  .form__grid { grid-template-columns: 1fr; }
  .faq__answer { padding-right: 0; }

  .excerpt__body p:first-child::first-letter { font-size: 3.8em; }

  .site-footer { padding-bottom: 88px; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .site-footer__base { flex-direction: column; }

  .portrait__offset { inset: 14px -14px -14px 14px; }

  .admin__row, .admin__retailer { grid-template-columns: 1fr; }

  /* Legal tables become labelled cards */
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; }
  .legal thead { display: none; }
  .legal tr { margin-bottom: 12px; border: 1px solid var(--c-line-soft); background: rgba(13, 13, 17, 0.5); }
  .legal td { border: 0; padding: 10px 14px; }
  .legal td + td { border-top: 1px solid var(--c-line-soft); }
  .legal td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-family: var(--f-sans); font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--c-gold); }

  /* Discreet purchase bar */
  .buy-bar {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 8px 10px;
    border: 1px solid var(--c-line);
    background: rgba(10, 10, 13, 0.88);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
    transform: translateY(140%);
    visibility: hidden;
    transition: transform 0.6s var(--ease-out), visibility 0s linear 0.6s;
  }
  .buy-bar.is-visible { transform: none; visibility: visible; transition: transform 0.6s var(--ease-out); }
  .buy-bar img { width: 34px; height: auto; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); }
  .buy-bar__text { display: grid; line-height: 1.1; margin-right: auto; }
  .buy-bar__title { font-family: var(--f-display); font-size: 1rem; letter-spacing: 0.1em; color: var(--c-champagne); }
  .buy-bar__author { font-family: var(--f-sans); font-size: 0.58rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--c-muted); }
  .buy-bar .btn { --btn-h: 44px; }
  .buy-bar .btn--soon { padding-inline: 16px; }
}

@media (max-width: 380px) {
  .hero__subtitle { font-size: 0.82rem; letter-spacing: 0.18em; }
  .btn { letter-spacing: 0.14em; font-size: 0.74rem; }
  .buy-bar .btn--soon { padding-inline: 10px; letter-spacing: 0.1em; }
  .buy-bar .btn--soon .btn__badge { letter-spacing: 0.16em; }
  .buy-bar .btn { flex-shrink: 0; }
  .buy-bar__author { display: none; }
}

/* Touch devices: no hover lift on cards */
@media (hover: none) {
  .card-light:hover { transform: none; }
}
