/* ==========================================================================
   studio.css — the preview bar above a product screen.

   Three controls, one row: the screen it is shown on, the product's own light
   or dark, and the colour vision the visitor wants to check it with. The bar
   carries its own ink so it stays legible whether the page around it is paper
   or the darkened stage.
   ========================================================================== */

/* one row that scrolls sideways on a phone, like the app's own nav: stacking
   three groups costs 150px of screen before the product has even started */
.studio {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px 22px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--dark);
  color: var(--light);
  box-shadow: 0 18px 40px -34px rgba(0, 0, 0, 0.9);
}

.studio::-webkit-scrollbar { display: none; }

.studio__group {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.studio__label {
  font-family: var(--font-small);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--light) 55%, transparent);
  white-space: nowrap;
}

/* the segmented control: one track, one raised choice */
.studio__seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--light) 9%, transparent);
}

.studio__seg button {
  min-height: 32px;
  padding: 6px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in oklab, var(--light) 72%, transparent);
  font-family: var(--font-small);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.studio__seg button:hover { color: var(--light); }

.studio__seg button[aria-pressed="true"] {
  background: var(--light);
  color: var(--dark);
}

.studio__seg button:focus-visible,
.studio__select:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 2px;
}

/* the colour-vision control is a select: five options do not fit as pills */
.studio__select {
  min-height: 36px;
  padding: 6px 30px 6px 12px;
  border: 0;
  border-radius: 999px;
  background-color: color-mix(in oklab, var(--light) 9%, transparent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23f4f1e8' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 7px;
  color: var(--light);
  font-family: var(--font-small);
  font-size: 0.75rem;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}
.studio__select option { color: var(--dark); background: var(--light); }

/* fullscreen sits at the far end of the bar */
.studio__group--end { margin-left: auto; }
.studio__full {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--light) 9%, transparent);
  color: var(--light);
  font-family: var(--font-small);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.studio__full:hover { background: color-mix(in oklab, var(--light) 16%, transparent); }
.studio__full:focus-visible { outline: 2px solid var(--light); outline-offset: 2px; }
.studio__full .icon { width: 16px; height: 16px; }

.studio__note {
  margin-left: auto;
  font-family: var(--font-small);
  font-size: 0.6875rem;
  color: color-mix(in oklab, var(--light) 50%, transparent);
}

@media (min-width: 761px) {
  .studio { gap: 26px; padding: 10px 16px; }
}

/* ---------- the "more" sheet (phones) --------------------------------------
   Her call (Nov 2026): on a phone the bar is two buttons — a kebab on the
   left, Fullscreen on its own on the right. The kebab opens the three
   choices in a sheet drawn like the visitor menu in the header (.you): a
   28px sheet a step above the surface, groups of 4px items on the dark
   ground with 20px outer corners, a check on the chosen one. The controls
   are the same elements as the desktop bar, restyled — one state, one set
   of listeners. From 761px the wrapper is display: contents and the bar is
   the row it always was. */
.studio__more {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in oklab, var(--light) 9%, transparent);
  color: var(--light);
  cursor: pointer;
}
.studio__more:hover,
.studio__more[aria-expanded="true"] { background: color-mix(in oklab, var(--light) 18%, transparent); }
.studio__more:focus-visible { outline: 2px solid var(--light); outline-offset: 2px; }
.studio__more .icon { width: 22px; height: 22px; fill: currentColor; }
.studio__check { display: none; }

@media (max-width: 760px) {
  .studio { position: relative; overflow: visible; justify-content: space-between; }
  .studio__opts {
    --opt-sheet: color-mix(in oklab, var(--light) 7%, var(--surface));
    --opt-item: var(--dark);
    --opt-hover: color-mix(in oklab, var(--light) 13%, var(--surface));
    position: absolute;
    z-index: 40;
    inset-block-start: calc(100% + 8px);
    inset-inline-start: 0;
    width: min(320px, calc(100vw - 24px));
    max-height: min(70svh, 560px);
    overflow-y: auto;
    padding: 6px 12px 14px;
    border-radius: 28px;
    background: var(--opt-sheet);
    color: var(--light);
    box-shadow: 0 24px 48px -20px rgb(0 0 0 / 0.7), 0 2px 8px -2px rgb(0 0 0 / 0.4);
  }
  .studio__opts:not([data-open]) { display: none; }
  .studio__opts .studio__group { display: block; }
  .studio__opts .studio__group[hidden] { display: none; }
  .studio__opts .studio__label {
    display: block;
    margin: 14px 8px 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--light);
  }
  .studio__opts .studio__seg { display: grid; gap: 2px; padding: 0; border-radius: 0; background: none; }
  .studio__opts .studio__seg button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 10px 18px;
    border-radius: 4px;
    background: var(--opt-item);
    color: var(--light);
    font-size: 0.875rem;
    text-align: start;
  }
  .studio__opts .studio__seg button:first-child { border-start-start-radius: 20px; border-start-end-radius: 20px; }
  .studio__opts .studio__seg button:last-child { border-end-start-radius: 20px; border-end-end-radius: 20px; }
  .studio__opts .studio__seg button:hover { background: var(--opt-hover); }
  .studio__opts .studio__seg button[aria-pressed="true"] { background: color-mix(in oklab, var(--primary) 30%, var(--opt-item)); color: var(--light); }
  .studio__opts .studio__seg button[aria-pressed="true"] .studio__check { display: block; width: 20px; height: 20px; fill: currentColor; }
  .studio__opts .studio__seg button:focus-visible,
  .studio__opts .studio__select:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
  .studio__opts .studio__select {
    width: 100%;
    min-height: 48px;
    padding: 10px 40px 10px 18px;
    border-radius: 20px;
    background-color: var(--opt-item);
    background-position: right 18px center;
    font-size: 0.875rem;
  }
}
@media (min-width: 761px) {
  .studio__more { display: none; }
  .studio__opts { display: contents; }
}

/* ---------- the screen the product is shown on ------------------------- */

/* desktop preview: the window fills the column, as it always did */
[data-device="desktop"] .st-window,
[data-device="desktop"] .th-frame,
[data-device="desktop"] .proto,
[data-device="desktop"] .bu-app {
  max-width: none;
  margin-inline: 0;
}

/* mobile preview: a phone-shaped frame, and the product inside reflows on its
   container rather than the viewport — see the container queries per product */
[data-device="mobile"] .st-window,
[data-device="mobile"] .th-frame,
[data-device="mobile"] .proto,
[data-device="mobile"] .bu-app {
  max-width: 392px;
  margin-inline: auto;
}

[data-device="mobile"] .st-window .st-chrome { display: none; }


/* the frame is the query container: the product responds to the space it is
   actually given, not to the window it happens to be in */
.st-window,
.th-frame,
.proto,
.bu-app {
  container-type: inline-size;
}

@media (prefers-reduced-motion: reduce) {
  .studio__seg button { transition: none; }
}

/* ---------- fullscreen (studio.js) -------------------------------------
   The modal is the page's dark ground; the product sits in it at the size
   the screen allows, and scrolls inside itself. */
html[data-full="open"] { overflow: hidden; }
.studio-full {
  --full-bar: 64px;
  --full-pad: clamp(10px, 2.4vw, 28px);
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--dark);
  color: var(--light);
  overflow: hidden;
}
.studio-full::backdrop { background: rgb(0 0 0 / 0.6); }
.studio-full[open] { display: grid; grid-template-rows: var(--full-bar) minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }   /* the bar scrolls sideways; it never widens the modal */
.studio-full__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-inline: var(--full-pad);
}
.studio-full__title {
  font-family: var(--font-display);   /* Nohemi, so 16px and up; her title case */
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--light);
}
.studio-full__close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--light) 10%, transparent);
  color: var(--light);
  font-family: var(--font-small);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
/* the page's bar, moved in: centre of the top row, the modal's own Close on
   the right replaces its Fullscreen button */
.studio-full__tools { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.studio-full__tools .studio { margin: 0; max-width: 100%; box-shadow: none; padding-block: 6px; }
.studio-full__tools .studio__group--end { display: none; }
.studio-full__title { flex: none; }
.studio-full__close { flex: none; }
/* a phone has no room for the title beside the bar; the bar names itself */
@media (max-width: 760px) {
  .studio-full__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  /* kebab on the left, Close on the right: the sheet opens from the edge */
  .studio-full__tools { justify-content: flex-start; }
  .studio-full__tools .studio { padding-inline: 0; }
}
.studio-full__close:hover { background: color-mix(in oklab, var(--light) 18%, transparent); }
.studio-full__close:focus-visible { outline: 2px solid var(--light); outline-offset: 2px; }
.studio-full__close .icon { width: 18px; height: 18px; }
.studio-full__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* never wider than the modal: Desktop on a phone was 829px */
  align-items: start;
  justify-items: center;
  min-height: 0;
  padding: 0 var(--full-pad) var(--full-pad);
  overflow: auto;
  overscroll-behavior: contain;
}
/* the space a product may fill */
.studio-full { --full-h: calc(100dvh - var(--full-bar) - var(--full-pad)); }
[data-full] { width: 100%; margin: 0; }
[data-full][data-device="desktop"] { max-width: 1600px; }

/* ---------- one mockup style for the three prototypes ------------------
   Her call (Nov 2026): every product screen is drawn the way Steady's was —
   a fine white border, a large radius (a touch smaller than Steady had:
   16px for a window, 28px for a phone) and a soft shadow; no device bezel,
   no notch. The windows: .st-window, .th-window, and TweetSpot's #twApp. */
:root {
  --mock-border: 1px solid rgba(255, 255, 255, 0.7);
  --mock-radius: 16px;
  --mock-radius-phone: 28px;
  --mock-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 30px 60px -34px rgba(20, 22, 28, 0.45), 0 2px 10px -4px rgba(20, 22, 28, 0.14);
}
.st-window,
.th-window,
#twApp.phone {
  border: var(--mock-border);
  border-radius: var(--mock-radius);
  box-shadow: var(--mock-shadow);
  overflow: hidden;
}
[data-device="mobile"] .st-window,
.th-frame[data-device="mobile"] .th-window,
#twApp.phone[data-device="mobile"] { border-radius: var(--mock-radius-phone); }

/* ---------- the scrollbars inside them ----------------------------------
   Narrow, no track, a rounded thumb in the product's own ink. WebKit and
   Blink take the pseudo-elements (setting scrollbar-width/-color there would
   switch them off); Firefox gets the standard thin bar. */
.st-main,
.th-viewport,
.tw-view { --mock-thumb: rgba(16, 17, 18, 0.26); }
.th-viewport { --mock-thumb: color-mix(in oklab, var(--th-ink) 28%, transparent); }
.tw-view { --mock-thumb: color-mix(in oklab, var(--tw-ink) 28%, transparent); }
.st-frame[data-product-theme="dark"] .st-main { --mock-thumb: rgba(255, 255, 255, 0.28); }
:is(.st-main, .th-viewport, .tw-view)::-webkit-scrollbar { display: block; width: 6px; height: 6px; }
:is(.st-main, .th-viewport, .tw-view)::-webkit-scrollbar-track { background: transparent; }
:is(.st-main, .th-viewport, .tw-view)::-webkit-scrollbar-thumb { background: var(--mock-thumb); border-radius: 999px; }
:is(.st-main, .th-viewport, .tw-view)::-webkit-scrollbar-thumb:hover { background: color-mix(in oklab, var(--mock-thumb), currentColor 30%); }
:is(.st-main, .th-viewport, .tw-view)::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) {
  .st-main, .th-viewport, .tw-view { scrollbar-width: thin; scrollbar-color: var(--mock-thumb) transparent; }
}

/* ---------- one height for every screen ---------------------------------
   Her brief (Nov 2026): desktop and mobile are the same height on all three
   prototypes, measured off TweetSpot's desktop window — the viewport under
   the header, less a little air above and below. Each window is a flex
   column of exactly --mock-h; its scroller takes what the chrome leaves.
   In the fullscreen modal the height is the modal's. */
:root {
  --mock-air: clamp(16px, 3svh, 32px);
  --mock-h: clamp(520px, calc(100svh - var(--topbar-h, 80px) - 2 * var(--mock-air)), 800px);
}
.studio-full { --mock-h: var(--full-h); }

/* ---------- Desktop ⇄ Mobile: the window morphs ---------------------------
   studio.js runs the switch as a view transition with the window named
   "mock". Her order (Nov 2026), in three beats that never overlap:
     1. the old layout fades out to the window's own ground   0 – 200ms
     2. the empty window glides to the new width               200 – 660ms
     3. the new layout fades in                                660 – 920ms
   The ground is the image pair: the product's background (--mock-ground,
   read off the window by studio.js) inside the mockup's border, radius and
   shadow, so the frame stays drawn while it is empty. Snapshots keep their
   own size and are cropped by the box, never scaled. */
:root {
  --morph-out: 200ms;
  --morph-move: 460ms;
  --morph-in: 260ms;
}
::view-transition-group(mock) {
  animation-delay: var(--morph-out);
  animation-duration: var(--morph-move);
  animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}
::view-transition-image-pair(mock) {
  overflow: hidden;
  border: var(--mock-border);
  border-radius: var(--mock-radius);
  background: var(--mock-ground, transparent);
  box-shadow: var(--mock-shadow);
  box-sizing: border-box;
}
::view-transition-old(mock),
::view-transition-new(mock) {
  width: 100%;
  height: 100%;
  object-fit: none;          /* natural size, centred: a layout is never scaled to the other's width */
  object-position: 50% 0;
  mix-blend-mode: normal;    /* a plain fade, not the default plus-lighter cross-fade */
}
::view-transition-old(mock) {
  animation: morph-out var(--morph-out) ease-in both;
}
::view-transition-new(mock) {
  animation: morph-in var(--morph-in) ease-out calc(var(--morph-out) + var(--morph-move)) both;
}
@keyframes morph-out { to { opacity: 0; } }
@keyframes morph-in { from { opacity: 0; } }
/* the rest of the page (the bar's pressed button) changes without a fade */
::view-transition-old(root),
::view-transition-new(root) { animation: none; }

/* ---------- the desktop window in miniature ------------------------------
   studio.js lays the window out at 1200px and scales it to the column when
   Desktop is picked on a narrow screen (data-mini; inline transform and
   negative margins so the page holds only the scaled size). Look-only:
   the caption under it offers the mobile version. */
[data-mini] { pointer-events: none; }
.studio-mini {
  margin: 14px auto 0;
  max-width: 44ch;
  font-family: var(--font-small);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
  color: var(--ink-soft);
}
.studio-mini[hidden] { display: none; }
.studio-mini__go {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.studio-mini__go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ---------- no browser chrome (her call, Nov 2026) ----------------------
   The mockups are the product, not a browser: no window controls, no
   address bar. Steady and TweetSpot lose the strip; Thursdays keeps its
   Site / Portal switch (the only way between its two surfaces) on a bare
   row, without the lights and the URL. */
.st-window .st-chrome,
#twApp.phone[data-device] .tw-chrome,   /* beats tweetspot.css, which loads later */
.th-chrome .th-lights,
.th-chrome .th-url { display: none; }
