/* Site chrome shared by every page: header, menus, footer, buttons, Gallery and Dusk surfaces, scroll reveals.
   Product pages load it with product.css; research notes and the sales page load it with styles.css and their own CSS.
   Tokens are scoped to the chrome so they never restyle a page's own content. */

:root { --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.p-header, .p-footer, .r-toc, .site-chrome {
  --paper: #f3f0e7; --paper-2: #ebe7db; --paper-3: #f8f6f0;
  --ink: #1b1a17; --ink-2: #46443e; --muted: #7a776d;
  --rule: rgba(27, 26, 23, 0.13); --rule-2: rgba(27, 26, 23, 0.26);
  --accent: #4c3a91; --night: #181614; --on-night: #efe8dc; --on-night-2: #9b9183; --lilac: #d6ba84;
  --display: "Newsreader", Georgia, serif; --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  font-family: var(--sans);
}
.p-header :where(p, ul, h4), .p-footer :where(p, ul, h4) { margin: 0; }
.p-header :where(ul), .p-footer :where(ul) { padding: 0; list-style: none; }
:where(.p-header, .p-footer, .r-toc) a { color: inherit; }
.p-shell { width: min(1280px, calc(100% - 64px)); margin-inline: auto; }
@media (max-width: 700px) { .p-shell { width: calc(100% - 36px); } }
.label { font: 500 13px/1.3 var(--sans); color: var(--muted); }
.label.dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; background: var(--accent); vertical-align: 1px; }

/* ---------- buttons and links ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 3px;
  font: 500 15px/1 var(--sans);
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.btn .arrow { font-family: var(--sans); font-size: 14px; letter-spacing: 0; transition: transform 180ms ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #33312b; }
.btn-secondary { border-color: var(--rule-2); color: var(--ink); background: transparent; }
.btn-secondary:hover { border-color: var(--ink); }
.btn-light { background: var(--on-night); color: var(--night); }
.btn-light:hover { background: #fff; }
.btn-ghost-dark { border-color: rgba(241, 238, 230, 0.3); color: var(--on-night); }
.btn-ghost-dark:hover { border-color: var(--on-night); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }

.text-link { display: inline-flex; align-items: center; gap: 8px; padding-bottom: 5px; border-bottom: 1px solid var(--rule-2); color: var(--ink); font: 500 13px/1 var(--sans); text-decoration: none; }
.text-link:hover { border-color: var(--ink); }
.night .text-link { color: var(--on-night); border-color: rgba(241, 238, 230, 0.3); }

/* ---------- header ---------- */
.p-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--rule); background: rgba(243, 240, 231, 0.82); -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px); transition: border-color 220ms ease; }
.p-header.scrolled { border-bottom-color: var(--rule); }
.p-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand img { width: 24px; height: 24px; border-radius: 6px; }
.brand-name { font: 600 18px/1 var(--sans); letter-spacing: -0.02em; }
.brand-lab { padding-left: 11px; border-left: 1px solid var(--rule-2); font: 400 14px/1 var(--sans); color: var(--muted); }
.p-nav { display: flex; align-items: center; gap: 30px; font-size: 14.5px; }
.p-nav > a, .p-nav summary { color: var(--ink-2); text-decoration: none; cursor: pointer; list-style: none; transition: color 160ms; }
.p-nav summary::-webkit-details-marker { display: none; }
.p-nav > a:hover, .p-nav summary:hover, .p-nav > a[aria-current="page"] { color: var(--ink); }
.p-nav > a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.p-actions { display: flex; align-items: center; gap: 22px; }
.p-actions .quiet { color: var(--ink-2); font-size: 14.5px; text-decoration: none; }
.p-actions .quiet:hover { color: var(--ink); }
.p-menu { position: relative; }
.p-menu summary::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.p-menu::before { content: ""; position: absolute; top: 100%; left: -32px; width: 700px; height: 24px; } /* hover bridge to the panel */
.p-menu-panel { position: absolute; top: calc(100% + 22px); left: -30px; display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 8px; width: 640px; padding: 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper-3); color: var(--ink); box-shadow: 0 30px 70px -30px rgba(27, 26, 23, 0.35), 0 2px 6px -2px rgba(27, 26, 23, 0.06); }
.p-menu[open] .p-menu-panel { animation: menu-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(0.985); } }
.p-menu-list { display: grid; align-content: start; }
.p-menu-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 14px; border-radius: 4px; text-decoration: none; transition: background 140ms; }
.p-menu-list a:hover, .p-menu-list a:focus-visible { background: var(--paper-2); outline: none; }
.p-menu-list b { font: 400 21px/1.1 var(--display); letter-spacing: -0.015em; color: var(--ink); }
.p-menu-list span { grid-column: 1; font-size: 13px; color: var(--muted); }
.p-menu-list i { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 500 13px/1 var(--sans); font-style: normal; color: var(--muted); }
.p-menu-list .all { display: block; margin-top: 4px; padding-top: 15px; border-top: 1px solid var(--rule); border-radius: 0; font: 500 13px/1 var(--sans); color: var(--ink); }
.p-menu-list .all:hover { background: none; text-decoration: underline; text-underline-offset: 4px; }
.p-menu-feature { display: grid; align-content: space-between; gap: 22px; padding: 18px; text-decoration: none; }
.p-menu-feature b { font: 400 22px/1.15 var(--display); letter-spacing: -0.015em; }
.p-menu-feature b em { color: var(--accent); }
.p-menu-feature .go { font: 500 13px/1 var(--sans); color: var(--ink); }
.p-menu-feature:hover .go { text-decoration: underline; text-underline-offset: 4px; }
.p-burger, .p-mobile { display: none; }
@media (max-width: 960px) {
  .p-nav, .p-actions .hide-sm { display: none; }
  .p-burger { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--rule-2); border-radius: 3px; background: transparent; cursor: pointer; }
  .p-burger span, .p-burger span::before, .p-burger span::after { position: relative; display: block; width: 16px; height: 1px; background: var(--ink); content: ""; }
  .p-burger span::before { position: absolute; top: -5px; }
  .p-burger span::after { position: absolute; top: 5px; }
  .p-mobile[data-open="true"] { display: grid; padding: 4px 0 20px; }
  .p-mobile a { padding: 14px 0; border-bottom: 1px solid var(--rule); color: var(--ink); font: 400 22px/1.2 var(--display); text-decoration: none; }
  .p-mobile .btn { margin-top: 16px; border-bottom: 0; font: 500 13px/1 var(--sans); }
}
@media (max-width: 420px) { .p-header .brand-lab { display: none; } }

/* ---------- footer ---------- */
.p-footer { margin-top: clamp(72px, 8vw, 112px); background: linear-gradient(180deg, #eae5d9, #e6e0d3); }
.p-footer-statement { max-width: 16ch; padding: clamp(56px, 7vw, 96px) 0 clamp(48px, 6vw, 80px); font: 400 clamp(38px, 5vw, 76px)/1.02 var(--display); letter-spacing: -0.035em; font-variation-settings: "opsz" 72; }
.p-footer-statement em { color: var(--accent); }
.p-footer-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; padding-top: 28px; border-top: 1px solid var(--rule-2); }
.p-footer-brand { grid-column: 1 / span 4; display: grid; align-content: start; gap: 16px; }
.p-footer-brand p { max-width: 30ch; font-size: 14px; color: var(--muted); }
.p-footer-col { grid-column: span 2; }
.p-footer h4 { margin: 0 0 16px; font: 500 13px/1 var(--sans); color: var(--muted); }
.p-footer ul { display: grid; gap: 10px; }
.p-footer li a { font-size: 14.5px; color: var(--ink-2); text-decoration: none; }
.p-footer li a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.p-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 64px; padding: 22px 0 36px; border-top: 1px solid var(--rule); font: 500 13px/1.4 var(--sans); color: var(--muted); }
@media (max-width: 860px) { .p-footer-brand { grid-column: 1 / -1; } .p-footer-col { grid-column: span 6; } }

/* ---------- surfaces: Gallery (warm stone) and Dusk (peach-to-lilac haze) ---------- */
.surface-gallery, .surface-dusk { position: relative; isolation: isolate; border-radius: 4px; color: var(--ink); }
.surface-gallery::before, .surface-dusk::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background-image: var(--grain); pointer-events: none; }
.surface-gallery {
  --ink: #2b241d; --ink-2: #51483e; --muted: #877b6b;
  --rule: rgba(58, 46, 34, 0.13); --rule-2: rgba(58, 46, 34, 0.24); --paper-3: #e9e3d8;
  border: 1px solid rgba(58, 46, 34, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 45%), #e9e3d8;
  box-shadow: 0 50px 90px -60px rgba(70, 52, 34, 0.45);
}
.surface-gallery::before { opacity: 0.12; }
.surface-dusk {
  --ink: #2c2231; --ink-2: #4f4153; --muted: #7f6c7b; --accent: #563c9e;
  --rule: rgba(44, 34, 49, 0.12); --rule-2: rgba(44, 34, 49, 0.22); --paper: #f6eee9; --paper-3: #f6eee9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    radial-gradient(60% 85% at 8% 0%, rgba(247, 196, 168, 0.85), transparent 66%),
    radial-gradient(55% 75% at 95% 8%, rgba(200, 182, 242, 0.85), transparent 66%),
    radial-gradient(70% 80% at 55% 115%, rgba(250, 216, 196, 0.72), transparent 70%),
    #f1e8e3;
  box-shadow: 0 60px 110px -60px rgba(130, 84, 110, 0.5);
}
.surface-dusk::before { opacity: 0.16; mix-blend-mode: soft-light; }
.surface-dusk .label.dot::before, .surface-gallery .label.dot::before, .surface-plum .label.dot::before { background: var(--accent); }

/* Dusk is kept for the closing call to action on every page. Plum, a dark aubergine with a rose-gold accent, is the
   featured surface: once per page. Everything else uses Gallery or Noir. */
.surface-plum { position: relative; isolation: isolate; overflow: hidden; border-radius: 4px; color: var(--ink); }
.surface-plum::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background-image: var(--grain); pointer-events: none; }
.surface-plum {
  --ink: #f4e9ee; --ink-2: #d2c1ca; --muted: #a08f9a; --accent: #e7b9a2;
  --rule: rgba(244, 233, 238, 0.12); --rule-2: rgba(244, 233, 238, 0.24); --paper: #241b26; --paper-2: #2e2330; --paper-3: #2e2330;
  border: 1px solid rgba(244, 233, 238, 0.08);
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(132, 78, 118, 0.55), transparent 64%),
    radial-gradient(60% 80% at 0% 100%, rgba(88, 58, 112, 0.55), transparent 70%),
    radial-gradient(40% 50% at 70% 110%, rgba(196, 128, 110, 0.22), transparent 70%),
    #221a24;
  box-shadow: 0 60px 110px -60px rgba(34, 26, 36, 0.75);
}
.surface-plum::before { opacity: 0.08; }
.p-menu-feature.surface-plum, .p-menu-feature.surface-dusk { box-shadow: none; }

/* ---------- reveal on scroll (only once JS marks the page ready) ---------- */
.reveal-ready [data-reveal] { opacity: var(--rv, 1); transform: translate3d(0, calc((1 - var(--rv, 1)) * 34px), 0); transition: opacity 120ms linear, transform 120ms linear; will-change: opacity, transform; }
.sw { transition: opacity 140ms linear; }

/* ---------- research notes: a contents panel pinned in the left margin ----------
   Hidden over the splash and the footer; the accent mark slides to the section being read. Wide screens only. */
.r-toc { display: none; }
html:has(.r-toc) { scroll-padding-top: 104px; }
@media (min-width: 1240px) {
  .r-toc {
    position: fixed; z-index: 30; top: 132px; left: 32px; width: 168px;
    display: grid; gap: 22px; opacity: 0; transform: translateY(10px); pointer-events: none;
    transition: opacity 320ms ease, transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .r-toc.is-on { opacity: 1; transform: none; pointer-events: auto; }
}
@media (min-width: 1240px) and (max-width: 1399px) { .r-toc { left: 24px; width: 148px; } }
.r-toc-title { display: grid; gap: 6px; font: 400 20px/1.1 var(--display); letter-spacing: -0.015em; color: var(--ink); text-decoration: none; }
.r-toc-title span { font: 500 12px/1 var(--sans); letter-spacing: 0; color: var(--muted); }
.r-toc-list { position: relative; margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--rule); }
.r-toc-list a { display: block; padding: 7px 0 7px 16px; font: 400 13.5px/1.35 var(--sans); color: var(--muted); text-decoration: none; transition: color 180ms ease; }
.r-toc-list a:hover, .r-toc-list a.on { color: var(--ink); }
.r-toc-mark { position: absolute; left: -1px; top: 0; width: 1px; height: 0; background: var(--ink); opacity: 0; transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1), height 380ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms; }
.r-toc-more { display: grid; gap: 9px; margin: 0; font: 500 13px/1.3 var(--sans); }
.r-toc-more a { color: var(--ink-2); text-decoration: none; }
.r-toc-more a:hover { color: var(--accent); }
.r-toc-more a span { display: inline-block; margin-left: 4px; transition: transform 180ms; }
.r-toc-more a:hover span { transform: translateX(3px); }
.p-nav summary.on { color: var(--ink); }
.p-menu-feature.surface-gallery { box-shadow: none; }
@media (max-width: 960px) {
  .p-mobile a.sub { padding: 9px 0 9px 16px; border-bottom: 0; font: 400 15px/1.3 var(--sans); color: var(--ink-2); }
  .p-mobile a.sub + a:not(.sub) { border-top: 1px solid var(--rule); }
}
.p-nav summary a { color: inherit; text-decoration: none; }
/* a link that is itself a surface takes the surface's ink, not the page's */
a[class*="surface-"] { color: var(--ink); }

/* ---------- pointer effects (pointer.js; mouse and trackpad only; the cursor stays native): light on cards, magnetic buttons, tilt ---------- */
/* light: a soft glow follows the cursor across cards and panels */
.fx-light .plan { isolation: isolate; }
.fx-light :is([class*="surface-"], .night, .plan)::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 450ms ease;
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.55), transparent 62%);
}
.fx-light :is(.night, .surface-plum)::after { background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(232, 200, 150, 0.13), transparent 62%); }
.fx-light :is([class*="surface-"], .night, .plan).fx-lit::after { opacity: 1; }

/* magnet and tilt */
.fx-magnet .btn { transition: background 180ms ease, border-color 180ms ease, color 180ms ease, translate 260ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.fx-tilt :is(.m-art, .r-cover, .m-related a, .r-open a) { transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1); transform-style: preserve-3d; }

/* ======================================================================
   Phones and tablets. Everything below sits inside max-width queries, so wide screens are untouched.
   ====================================================================== */

/* Menu: a full-screen sheet under the header, solid paper, page scroll locked (product.js adds .menu-open).
   Models and Research head their groups, with the four pages of each in two columns; the two calls to action
   sit side by side at the end. The burger turns into a close mark. */
@media (max-width: 960px) {
  html.menu-open { overflow: hidden; }
  html.menu-open .p-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--paper); }
  .p-burger span, .p-burger span::before, .p-burger span::after { transition: transform 220ms ease, top 220ms ease, background 160ms ease; }
  .p-burger[aria-expanded="true"] span { background: transparent; }
  .p-burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
  .p-burger[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }
  .p-mobile[data-open="true"] {
    position: fixed; top: 73px; left: 0; right: 0; bottom: 0; z-index: 49;
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; align-content: start;
    width: auto; margin: 0; padding: 8px max(18px, calc((100vw - 1280px) / 2)) calc(28px + env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain; background: var(--paper);
    animation: menu-sheet 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  @keyframes menu-sheet { from { opacity: 0; transform: translateY(-8px); } }
  .p-mobile a { grid-column: 1 / -1; display: flex; align-items: center; min-height: 54px; padding: 10px 0; font-size: 24px; letter-spacing: -0.01em; }
  .p-mobile a.sub { grid-column: auto; min-height: 42px; padding: 8px 0; border-bottom: 0; font: 400 15.5px/1.3 var(--sans); color: var(--ink-2); }
  .p-mobile a.sub + a:not(.sub) { margin-top: 6px; }
  .p-mobile > a:nth-last-child(2), .p-mobile > a.btn {
    grid-column: auto; justify-content: center; min-height: 48px; margin-top: 28px; padding: 0 16px;
    border: 1px solid var(--rule-2); border-radius: 3px; font: 500 15px/1 var(--sans); letter-spacing: 0;
  }
  .p-mobile > a:nth-last-child(2) { color: var(--ink); }
  .p-mobile a.btn-primary { border-color: transparent; background: var(--ink); color: var(--paper); }
  /* the two feature cards from the desktop menus, Dusk and Plum, side by side */
  .p-mobile-feats { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
  .p-mobile .p-mobile-feats a { grid-column: auto; display: grid; align-content: space-between; gap: 18px; min-height: 132px; padding: 14px; border-bottom: 0; border-radius: 4px; font: inherit; color: var(--ink); }
  .p-mobile-feats .label { font-size: 12px; }
  .p-mobile-feats b { font: 400 18px/1.18 var(--display); letter-spacing: -0.01em; }
  .p-mobile-feats b em { color: var(--accent); }
  .p-mobile .p-mobile-feats ~ a { margin-top: 12px; }
}

/* Cards: the same lifted depth as desktop, a little shorter so stacked cards don't blur into each other. */
@media (max-width: 760px) {
  .surface-gallery { box-shadow: 0 40px 70px -46px rgba(70, 52, 34, 0.45); }
  .surface-dusk { box-shadow: 0 46px 80px -46px rgba(130, 84, 110, 0.5); }
  .surface-plum { box-shadow: 0 46px 84px -44px rgba(34, 26, 36, 0.72); }
}

/* Swipe hints (product.js marks sideways scrollers with data-more): fade the edge that has more to show. */
@media (max-width: 900px) {
  [data-more="end"] { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
  [data-more="start"] { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
  [data-more="both"] { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
}
.swipe-hint { margin: 10px 0 0; font: 500 12.5px/1.3 "DM Sans", sans-serif; letter-spacing: 0; text-transform: none; color: #7a776d; }
