/* DIGITHRONEX · The Cut · chrome: the top bar, its edit list and the mobile menu, shared by every page.
   The bar is transparent over a cold open, diffusion glass after it, and solid while a glass object
   passes beneath it. A 1px signal playhead along its bottom edge shows page progress, with a 45° tick
   at each act boundary, and the current act is named in mono. */

.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 56px;
  display: flex; align-items: center; gap: 20px; padding-inline: var(--margin);
  color: var(--d-text);
  transition: background-color calc(8 * var(--f)) var(--ease-snap), color calc(8 * var(--f)) var(--ease-snap), box-shadow calc(8 * var(--f)) var(--ease-snap);
}
.topbar[data-state="open"] { background: transparent; box-shadow: none; }
/* the opening's glass is passing beneath (a phone, scrolled a little): solid, never glass on glass, no blur */
.topbar[data-state="open"][data-covered] { background: var(--d-ground); box-shadow: inset 0 -1px 0 var(--d-line); }
.topbar[data-state="glass"] {
  background: var(--glass-etch), rgba(11, 12, 14, .58); background-size: 160px 160px, auto;
  -webkit-backdrop-filter: blur(26px) saturate(1.2) brightness(1.04); backdrop-filter: blur(26px) saturate(1.2) brightness(1.04);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06);
}
.topbar[data-state="glass"][data-room="studio"] {
  color: var(--s-text);
  background: var(--glass-etch), rgba(241, 242, 244, .78); background-size: 160px 160px, auto;
  box-shadow: inset 0 -1px 0 rgba(11, 12, 14, .08);
}
/* A glass object is passing beneath: the bar drops to solid so glass never sits on glass */
.topbar[data-state="solid"] { background: var(--d-ground); box-shadow: inset 0 -1px 0 var(--d-line); }
.topbar[data-state="solid"][data-room="studio"] { color: var(--s-text); background: var(--s-ground); box-shadow: inset 0 -1px 0 var(--s-line); }

/* The logo. The master file is pending (design/02-logo-check.md); the name is never re-set in the site's type. */
.topbar-logo { display: inline-flex; align-items: center; height: 26px; flex: none; text-decoration: none; color: inherit; }
.topbar-logo svg, .topbar-logo img { height: 100%; width: auto; display: block; }

/* The act label: a button that opens the edit list */
.topbar-act {
  appearance: none; background: none; border: 0; color: inherit; cursor: pointer; padding: 8px 4px; margin-left: 6px;
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--font-mono); font-stretch: 87.5%; font-size: 11.5px; letter-spacing: .02em; white-space: nowrap;
}
.topbar-act-name { opacity: .7; overflow: hidden; text-overflow: ellipsis; }
.topbar-act::after { content: ""; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .5; }
.topbar-act[aria-expanded="true"]::after { transform: rotate(225deg) translate(-1px, -1px); }
.editlist {
  position: absolute; top: 100%; left: var(--margin); width: min(320px, 80vw); padding: 8px 0;
  background: inherit; color: inherit; box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: inherit; backdrop-filter: inherit;
}
.topbar[data-state="open"] .editlist { background: rgba(11, 12, 14, .94); }
.editlist[hidden] { display: none; }
.editlist a { display: grid; grid-template-columns: 28px 1fr; align-items: baseline; padding: 9px 16px; text-decoration: none; color: inherit; font-size: 15px; box-shadow: inset 2px 0 0 transparent; }
.editlist a span { font-family: var(--font-mono); font-stretch: 87.5%; font-size: 11px; opacity: .6; }
.editlist a[aria-current] { box-shadow: inset 2px 0 0 var(--d-signal); }
.editlist a:hover { background: rgba(128, 133, 143, .12); }

.topbar-nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.topbar-nav a:not(.primary) {
  font-stretch: 125%; font-weight: 620; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; color: inherit;
  padding: 8px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size calc(4 * var(--f)) var(--ease-snap);
}
.topbar-nav a:not(.primary):hover, .topbar-nav a[aria-current="page"] { background-size: 100% 1px; }
.topbar-cta { display: inline-flex; min-width: 150px; justify-content: flex-end; }
.topbar .primary { --c: 10px; padding: 12px 20px 12px 16px; font-size: 11.5px; }
.topbar .primary, .topbar[data-room="screen"] .primary { --ground: var(--d-ground); --text: var(--d-text); --signal: var(--d-signal); }
.topbar[data-room="studio"]:not([data-state="open"]) .primary { --ground: var(--s-ground); --text: var(--s-text); --signal: var(--s-signal); }
.topbar-cta.is-empty .primary { visibility: hidden; }

/* The live offer (discounts step 2, 1 November 2026; /assets/js/offers.js): a slim line hanging from the bar's
   bottom edge under Start while an offer runs, and the saving as a tag on Start. A solid fill, never glass over the
   moving film, and only transform and opacity move. It hangs off the bar, so nothing in the page moves when it
   arrives, and it is only drawn while an offer is live. */
.topbar-offer {
  position: absolute; top: 100%; right: var(--margin); z-index: 1; max-width: calc(100% - 2 * var(--margin));
  display: flex; align-items: stretch; background: var(--d-select); color: var(--d-signal);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  font-family: var(--font-mono); font-stretch: 87.5%; font-size: 11px; line-height: 1.35; letter-spacing: .06em; text-transform: uppercase;
  opacity: 0; transform: translateY(-6px);
  transition: opacity calc(6 * var(--f)) var(--ease-snap), transform calc(10 * var(--f)) var(--ease-focus);
}
.topbar-offer.is-in { opacity: 1; transform: none; }
.topbar-offer a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; padding: 8px 4px 8px 12px; color: inherit; text-decoration: none; }
.topbar-offer-name { color: var(--d-text); font-weight: 600; }
.topbar-offer-go { transition: transform calc(4 * var(--f)) var(--ease-snap); }
.topbar-offer a:hover .topbar-offer-go { transform: translateX(3px); }
.topbar-offer-close { appearance: none; border: 0; background: none; color: var(--d-text3); cursor: pointer; padding: 0 12px; font: inherit; font-size: 14px; }
.topbar-offer-close:hover, .topbar-offer-close:focus-visible { color: var(--d-text); }
.topbar-offer-tag { margin-left: 8px; font-style: normal; font-family: var(--font-mono); font-stretch: 87.5%; font-size: 10px; letter-spacing: .04em; color: var(--signal, var(--d-signal)); }
@media (prefers-reduced-motion: reduce) { .topbar-offer, .topbar-offer-go { transition: none; } }

.topbar-track { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; display: flex; gap: 4px; pointer-events: none; }
/* the visit's timeline: pages watched before this one, then this page (chrome.js, visit.js) */
.topbar-past { display: flex; gap: 4px; flex: none; }
.topbar-seg { position: relative; flex: none; width: 20px; height: 100%; overflow: hidden; background: rgba(128, 133, 143, .22); }
.topbar-seg b { position: absolute; inset: 0; transform-origin: 0 50%; background: var(--brand-azure); opacity: .5; }
.topbar-now { position: relative; flex: 1 1 auto; min-width: 0; height: 100%; background: rgba(128, 133, 143, .22); }
.topbar-play { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: var(--brand-azure); }
.topbar[data-room="studio"]:not([data-state="open"]) .topbar-play { background: var(--brand-cobalt); }
.topbar-tick { position: absolute; bottom: 0; width: 1px; height: 7px; background: currentColor; opacity: .38; transform-origin: 50% 100%; transform: rotate(var(--angle)); }
.topbar[data-state="open"] .topbar-track { opacity: 0; }

.topbar-menu-btn { display: none; appearance: none; background: none; border: 0; color: inherit; cursor: pointer; padding: 10px 0; font-stretch: 125%; font-weight: 620; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; }

@media (max-width: 900px) {
  .topbar { height: 52px; gap: 14px; }
  .topbar-nav a:not(.primary), .topbar-act { display: none; }
  .topbar-nav { gap: 14px; }
  .topbar-cta { min-width: 0; }
  .topbar .primary { padding: 10px 16px 10px 12px; font-size: 10.5px; letter-spacing: .05em; }
  .topbar-menu-btn { display: inline-flex; }
  /* The offer line spans the phone's width under the bar. */
  .topbar-offer { left: var(--margin); right: var(--margin); }
}

/* Mobile menu: full-screen frosted glass over the page (D8); links roll in at headline size */
.menu {
  position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto; overflow-y: auto;
  padding: 0 var(--margin) calc(28px + env(safe-area-inset-bottom, 0px));
  color: var(--s-text);
  background: var(--glass-etch), linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 2px), rgba(241, 242, 244, .72);
  background-size: 160px 160px, auto, auto;
  -webkit-backdrop-filter: blur(30px) saturate(1.3) brightness(1.08); backdrop-filter: blur(30px) saturate(1.3) brightness(1.08);
  --ground: var(--s-ground); --text: var(--s-text); --text3: var(--s-text3); --signal: var(--s-signal); --line: var(--s-line);
}
.menu[hidden] { display: none; }
.menu-head { height: 52px; display: flex; align-items: center; }
.menu-close { margin-left: auto; appearance: none; background: none; border: 0; color: inherit; cursor: pointer; padding: 10px 0; font-stretch: 125%; font-weight: 620; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; }
.menu-links { align-self: center; display: grid; gap: 4px; padding-block: 24px; }
.menu-links a { font-stretch: 112.5%; font-weight: 560; font-size: clamp(36px, 10vw, 56px); line-height: 1.08; letter-spacing: -.01em; text-decoration: none; color: inherit; display: block; overflow: hidden; }
.menu-links a span { display: block; }
.menu-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding-bottom: 24px; border-top: 1px solid var(--s-line); padding-top: 16px; }
.menu-acts a { font-family: var(--font-mono); font-stretch: 87.5%; font-size: 12px; color: var(--s-text2); text-decoration: none; padding: 6px 0; }
.menu-foot { display: grid; gap: 16px; justify-items: start; }
body.menu-open { overflow: hidden; }
