/* ============================================================
   Project pages only. Loaded after style.css on every
   projects/<slug>/index.html. Uses style.css's variables only.
   ============================================================ */

/* ------------------------------------------------------------
   Page transitions (progressive enhancement)
   Browsers that support cross-document view transitions fade
   between pages that both opt in; others navigate as before.
   ------------------------------------------------------------ */

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.2s;
  animation-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ------------------------------------------------------------
   Hidden by tabs.js / project-nav.js
   .tab-bar and .meta set their own display, which would beat the
   browser's default [hidden] rule, so restate it.
   ------------------------------------------------------------ */

.tab-bar[hidden],
.tab-bar button[hidden],
.meta[hidden],
.meta-item[hidden] { display: none !important; }

/* ------------------------------------------------------------
   First screen: compact header + the 3D viewer
   Every project page shares this skeleton (see the README and
   scripts/project_template.html):

     section.project-top
       header.project-head      .project-title (category + name)
                                .project-summary (sentence + meta row)
       .tab-bar                 3D Model / Final Product (hidden while
                                only one tab has content)
       [data-tab-panel=model]   .project-viewer (the page's own viewer
                                markup and its controls) + .model-notes
       [data-tab-panel=final]
     section.project-section ×3 (case study, reference pictures, files)

   The viewer's height is worked out from the screen height so the model,
   the header and (usually) the controls under it fit in the first screen.
   It is a fixed CSS height, so nothing moves when the model arrives.
   ------------------------------------------------------------ */

.project-top { padding: 20px 0 8px; }

.project-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 8px 48px;
  align-items: end;
  margin-bottom: 20px;
  /* Room for the category + a two-line name, so the header's height (and
     so the viewer's position) doesn't change when the web font replaces
     the fallback font and a name goes from two lines to one. */
  min-height: calc(19px + 6px + 2 * 1.05 * 44px);
}

.project-head .eyebrow { margin-bottom: 6px; }

.project-head h1 {
  font-size: 44px;
  line-height: 1.05;
  margin: 0;
}

.project-summary p.desc {
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  max-width: 68ch;
}

/* Software / Material / Year: one slim row of label + value pairs. */
.project-head .meta {
  gap: 4px 24px;
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.project-head .meta-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.project-head .meta-item .label { margin: 0; }
.project-head .meta-item .value { font-size: 13px; }

/* Main tab bar: tabs.js adds .is-ready once it has decided whether the bar
   is needed (it isn't while "Final Product" only has placeholders). Until
   then it takes no space, so the viewer never jumps down or up. */
.project-top > .wrap > .tab-bar {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 16px;
}

.project-top > .wrap > .tab-bar:not(.is-ready) { display: none; }

/* --- The viewer --------------------------------------------------------
   --viewer-h: at least 60% of the screen height, more when there is room
   (screen minus ~nav + arrows row + header + a row of controls), never silly-tall. */
.project-viewer {
  --viewer-h: clamp(320px, max(60vh, 100vh - 338px), 860px);
  --viewer-h: clamp(320px, max(60svh, 100svh - 338px), 860px);
}

/* model-loading.js draws its own progress bar over the stage, so drop
   model-viewer's thin built-in one (it otherwise lingers as a grey line
   across the top of the now much wider stage). */
.project-viewer model-viewer::part(default-progress-bar) { display: none; }

.project-viewer .model-stage {
  max-width: none;
  aspect-ratio: auto;
  height: var(--viewer-h);
}

/* Less padding around the glow box than the old, smaller layout. */
.project-viewer .visual { padding: 8px 0; }

.project-viewer .model-compare { gap: 32px; }

.project-viewer .model-caption { margin-top: 8px; }
.project-viewer .segmented-toggle-wrap { margin-top: 12px; }
.project-viewer .carousel-nav { margin-top: 10px; }
.project-viewer .remote-debug { margin-top: 16px; }

/* A row of buttons + switches under a viewer (Toga: Exploded View /
   Sharpen Pencil + Clear Parts), kept on one line where it fits. */
.model-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 16px;
  margin-top: 12px;
}

.project-viewer .model-actions .tab-bar,
.project-viewer .model-actions .segmented-toggle-wrap { margin: 0; }

/* The still image (thumb.webp) shown until the model is drawn: fit it to
   the stage whatever its shape, instead of 80% of its width. */
.project-viewer .model-placeholder.has-still {
  padding: 6%;
  background-origin: content-box;
  background-size: contain;
}

/* Notes about the model, under the viewer and its controls. */
.model-notes {
  max-width: 680px;
  margin: 48px auto 0;
  text-align: center;
}

.model-notes .eyebrow { justify-content: center; }
.model-notes h2 { font-size: 28px; margin-bottom: 12px; }
.model-notes p.desc { font-size: 17px; margin: 0 auto; }

/* ------------------------------------------------------------
   Content sections under the viewer: case study, reference pictures,
   files. Each one is hidden while its [data-fill] box is empty (only
   comments inside), so unfinished pages never show an empty box.
   project-nav.js does the same check for browsers without :has().
   ------------------------------------------------------------ */

.project-section { padding: 80px 0 0; }

.project-section[hidden],
.project-section:not(:has([data-fill] > *)),
.model-notes:not(:has(> *)) { display: none !important; }

.project-section-title { font-size: 32px; margin-bottom: 28px; }

.project-story {
  max-width: 720px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
}

.project-story > :first-child { margin-top: 0; }
.project-story p { margin: 0 0 1.1em; }
.project-story h3 { font-size: 22px; margin: 1.6em 0 0.5em; }
.project-story ul,
.project-story ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.project-story img { border-radius: 18px; margin: 1.6em 0; }
.project-story a { color: var(--accent); }
.project-story a:hover { color: var(--accent-hover); }

/* Reference pictures reuse .gallery; a link around an image opens it full size. */
.project-section .gallery a { display: block; }
.project-section .gallery img { transition: opacity 0.15s ease; }
.project-section .gallery a:hover img { opacity: 0.9; }

/* Files: one row per download. project-nav.js adds the STEP / STL / PDF
   badge from the file's extension. */
.project-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 12px;
}

.project-files a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-alt);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: box-shadow 0.2s ease, color 0.15s ease;
}

.project-files a:hover { box-shadow: var(--card-shadow); color: var(--accent); }

.project-files .file-type {
  flex: none;
  min-width: 48px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--text-secondary);
}

.project-files .file-note {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

/* --- Previous / next project arrows (project-nav.js) ---------------------
   A slim row above the title. Its space is reserved in .project-top's
   padding, so nothing moves when the script adds it, and it sits above the
   header, well clear of the viewer and its controls. Deliberately quiet: a
   small chevron and the project name in the secondary text colour; the touch
   target is larger than it looks (see ::after). */
.project-top { padding-top: 50px; }
.project-top > .wrap { position: relative; }
.project-arrows {
  position: absolute;
  top: -38px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}
.project-arrow {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  max-width: calc(50% - 8px);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
}
.project-arrow::after { content: ''; position: absolute; inset: -8px -10px; }   /* 44px touch target */
.project-arrow-next { text-align: right; }
.project-arrow-icon {
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}
.project-arrow svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.project-arrow:focus-visible { outline-offset: 2px; }
.project-arrow-thumb {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
}
.project-arrow-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.project-arrow-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.project-arrow-dir {
  display: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-secondary);
}
.project-arrow-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-arrow:hover { color: var(--text); }

/* Pager style "pills" (default; see PAGER in project-nav.js): two bordered buttons
   with the project's picture, "Previous"/"Next" and its name. */
.project-top:has(.project-arrows[data-style="pills"]) { padding-top: 92px; }
.project-arrows[data-style="pills"] { top: -76px; }
.project-arrows[data-style="pills"] .project-arrow {
  gap: 10px; min-height: 56px; padding: 6px 14px 6px 6px; border-radius: 16px;
  background: var(--bg-alt); border: 1px solid var(--divider); color: var(--text);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.project-arrows[data-style="pills"] .project-arrow-next { padding: 6px 6px 6px 14px; }
.project-arrows[data-style="pills"] .project-arrow::after { inset: -4px; }
.project-arrows[data-style="pills"] .project-arrow:hover { background: #fff; box-shadow: var(--card-shadow); transform: translateY(-1px); }
.project-arrows[data-style="pills"] .project-arrow-thumb { flex-basis: 44px; width: 44px; height: 44px; border-radius: 11px; }
.project-arrows[data-style="pills"] .project-arrow-icon { flex-basis: 20px; width: 20px; height: 20px; color: var(--text-secondary); }
.project-arrows[data-style="pills"] .project-arrow-dir { display: block; font-size: 11px; letter-spacing: 0.02em; text-transform: none; color: var(--text-secondary); }
.project-arrows[data-style="pills"] .project-arrow-title { font-size: 14px; font-weight: 600; }
@media (max-width: 600px) {
  .project-top:has(.project-arrows[data-style="pills"]) { padding-top: 84px; }
  .project-arrows[data-style="pills"] { top: -68px; }
  .project-arrows[data-style="pills"] .project-arrow { gap: 8px; padding-right: 10px; min-height: 52px; }
  .project-arrows[data-style="pills"] .project-arrow-next { padding-left: 10px; padding-right: 6px; }
  .project-arrows[data-style="pills"] .project-arrow-thumb { flex-basis: 38px; width: 38px; height: 38px; }
}

/* Pager style "cards": two larger cards at the bottom of the page. */
.pager-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.pager-card {
  display: flex; align-items: center; gap: 16px; padding: 12px; min-width: 0;
  background: var(--bg-alt); border-radius: 18px; text-decoration: none; color: var(--text);
  transition: box-shadow 0.2s ease;
}
.pager-card:hover { box-shadow: var(--card-shadow); }
.pager-card-next { flex-direction: row-reverse; text-align: right; }
.pager-card-thumb { flex: 0 0 96px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; }
.pager-card-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pager-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.pager-card-dir { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.pager-card-title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
@media (max-width: 600px) {
  .pager-cards { grid-template-columns: 1fr; }
  .pager-card-thumb { flex-basis: 72px; }
  .pager-card-title { font-size: 17px; }
}

/* --- Tablet ------------------------------------------------------------ */
@media (max-width: 960px) {
  .project-head { grid-template-columns: 1fr; gap: 10px; min-height: 0; }
  .project-head h1 { font-size: 38px; }
}

/* --- Phone ---------------------------------------------------------------
   Title first, then the viewer straight away; the sentence and meta row
   move under the viewer. The viewer goes back to a square (still capped at
   75% of the screen height by style.css). */
@media (max-width: 600px) {
  .project-top { padding-top: 46px; }
  .project-arrows { top: -36px; left: 20px; right: 20px; }
  .project-top > .wrap { display: flex; flex-direction: column; }
  .project-head { display: contents; }
  .project-title { order: 0; margin-bottom: 14px; }
  .project-top > .wrap > .tab-bar { order: 1; margin-bottom: 12px; }
  .project-top > .wrap > .tab-panel { order: 2; }
  .project-summary { order: 3; margin-top: 20px; text-align: center; }
  .project-summary p.desc { font-size: 16px; }
  .project-head .meta { justify-content: center; margin-top: 12px; }
  .project-head h1 { font-size: 32px; }

  .project-viewer .model-stage {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  /* Miu Miu Sign: the sign and its remote share one screen, so a press on
     the remote and the sign's reaction are both in view without scrolling.
     Each stage gets half of what is left of the screen after everything else. */
  .project-viewer .model-compare:has(model-viewer[data-role="remote"]) { gap: 8px; }
  .project-viewer .model-compare:has(model-viewer[data-role="remote"]) .visual { padding: 4px 0; }
  .project-viewer .model-compare:has(model-viewer[data-role="remote"]) .model-stage {
    aspect-ratio: auto;
    max-height: none;
    /* 288px = everything else above, between and under the two stages
       (nav, Prev/Next row, title, both toggles, gaps), measured at 390px wide. */
    height: max(150px, calc((100vh - 288px) / 2));
    height: max(150px, calc((100svh - 288px) / 2));
  }
  .project-viewer .model-compare:has(model-viewer[data-role="remote"]) .segmented-toggle-wrap { margin-top: 6px; }

  .model-notes { margin-top: 36px; }
  .model-notes h2 { font-size: 24px; }
  .project-section { padding-top: 56px; }
  .project-section-title { font-size: 26px; margin-bottom: 20px; }
  .project-story { font-size: 17px; }
}

/* ------------------------------------------------------------
   Next project card + All projects link
   ------------------------------------------------------------ */

.next-project {
  margin-bottom: 72px;   /* the page footer was removed: room under the link */
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.next-card {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: center;
  width: 100%;
  background: var(--bg-alt);
  border-radius: 18px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.next-card:hover { box-shadow: var(--card-shadow); }

.next-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
}

.next-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.next-card:hover .next-thumb img { transform: scale(1.03); }

.next-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 32px 40px;
}

.next-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.next-label svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.next-card:hover .next-label svg { transform: translateX(3px); }

.next-title {
  font-size: 36px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  transition: color 0.15s ease;
}

.next-card:hover .next-title { color: var(--accent); }

.next-category {
  font-size: 15px;
  color: var(--text-secondary);
}

/* No thumbnail yet: text-only card. */
.next-card.no-thumb { grid-template-columns: 1fr; text-align: center; }
.next-card.no-thumb .next-thumb { display: none; }
.next-card.no-thumb .next-body { align-items: center; padding: 48px 32px; }

.next-project .all-projects {
  /* comfortable tap target without changing the visible text size */
  padding: 10px 12px;
}

@media (max-width: 860px) {
  .next-project { margin-top: 64px; }
  .next-title { font-size: 32px; }
}

@media (max-width: 600px) {
  .next-project { margin-top: 48px; padding-top: 24px; gap: 16px; }
  .next-card { grid-template-columns: 1fr; }
  .next-body { padding: 24px; }
  .next-card.no-thumb .next-body { padding: 32px 24px; }
  .next-title { font-size: 28px; }
}

@media (max-width: 380px) {
  .next-title { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .next-thumb img,
  .next-label svg { transition: none; }
  .next-card:hover .next-thumb img,
  .next-card:hover .next-label svg { transform: none; }
}

/* --- Full screen (viewer-fullscreen.js) ------------------------------------
   A button on each viewer expands the viewer, with its controls, over the whole
   window on the project's colour. */
.project-viewer .model-stage { position: relative; }
.fs-btn {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  color: #15151b; background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.fs-btn:hover { background: #fff; transform: scale(1.06); }
.fs-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fs-btn .fs-collapse { display: none; }
.is-fullscreen .fs-btn .fs-expand { display: none; }
.is-fullscreen .fs-btn .fs-collapse { display: block; }
html.fs-open { overflow: hidden; }
.fs-view.is-fullscreen {
  position: fixed; inset: 0; z-index: 9000;
  box-sizing: border-box;
  width: 100% !important; max-width: none !important;
  height: 100vh; height: 100dvh;
  margin: 0 !important; padding: 0 !important;
  background: var(--fs-bg, #f2f2f2); color: var(--fs-ink, #15151b);
  overflow: auto;
}
/* The usual viewer: the model stage fills the screen, its controls sit under it. */
.fs-view.is-fullscreen:has(> .model-stage) { display: flex; flex-direction: column; align-items: stretch; }
.fs-view.is-fullscreen > .model-stage {
  flex: 1 1 auto; min-height: 0;
  width: 100% !important; height: auto !important; max-height: none !important;
  aspect-ratio: auto !important; border-radius: 0 !important; background: transparent !important;
}
.fs-view.is-fullscreen:has(> .model-stage) > :not(.model-stage):not(.fs-btn) {
  flex: 0 0 auto; position: relative; z-index: 2;
  padding-left: 16px; padding-right: 16px;
}
.fs-view.is-fullscreen:has(> .model-stage) > :last-child { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
/* Viewers with their own layout (Nightstand's tabs + kiosk + photo strip, the
   Miu Miu remote): keep that layout, centred, with a bigger stage. */
.fs-view.is-fullscreen:not(:has(> .model-stage)) {
  align-items: center !important; justify-content: center !important; align-content: center;
  padding: 16px !important;
}
.fs-view.is-fullscreen:not(:has(> .model-stage)) .model-stage {
  width: min(92vw, 820px) !important; height: min(68vh, 68dvh, 640px) !important;
  aspect-ratio: auto !important; max-height: none !important; background: transparent !important;
}
/* Text that sat on the page's white now sits on the project colour. */
.fs-view.is-fullscreen p,
.fs-view.is-fullscreen .model-caption { color: var(--fs-ink, #15151b) !important; }
.fs-btn:focus-visible { outline: 3px solid #2f6df6; outline-offset: 2px; }

/* Miu Miu: sign + remote full screen together, side by side (stacked on narrow screens). */
.model-compare.is-fullscreen {
  position: fixed; inset: 0; z-index: 9000; box-sizing: border-box;
  display: grid !important; grid-template-columns: 1fr 1fr; align-content: center; gap: 0 !important;
  width: 100% !important; max-width: none !important; height: 100vh; height: 100dvh;
  margin: 0 !important; padding: 0 !important; overflow: auto;
  background: var(--fs-bg, #f2f2f2); color: var(--fs-ink, #15151b);
}
.model-compare.is-fullscreen .visual { padding: 0 !important; }
/* One Exit button for the pair: the one that was pressed moves to the corner; the other stays hidden. */
.model-compare.is-fullscreen .model-stage .fs-btn { display: none; }
.model-compare.is-fullscreen .model-stage {
  width: 100% !important; height: calc(100vh - 130px) !important; height: calc(100dvh - 130px) !important;
  max-height: none !important; aspect-ratio: auto !important; border-radius: 0 !important; background: transparent !important;
}
.model-compare.is-fullscreen .segmented-toggle-wrap { margin: 8px 0 0 !important; }
@media (max-width: 700px) {
  .model-compare.is-fullscreen { grid-template-columns: 1fr; }
  .model-compare.is-fullscreen .model-stage { height: calc((100vh - 250px) / 2) !important; height: calc((100dvh - 250px) / 2) !important; }
}
/* In full screen the button sits in the screen's top-right corner. */
.is-fullscreen .fs-btn { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 9100; }
/* Open: the button becomes a clear "X Exit full screen" pill (Esc works too). */
.fs-btn .fs-label { display: none; font: 600 14px/1 inherit; font-family: inherit; white-space: nowrap; }
.is-fullscreen .fs-btn {
  width: auto; height: 44px; padding: 0 18px 0 14px; gap: 8px; border-radius: 999px;
  grid-auto-flow: column; place-items: center; align-items: center;
  background: #fff; color: #15151b; border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.is-fullscreen .fs-btn .fs-label { display: inline; }
.is-fullscreen .fs-btn svg { width: 16px; height: 16px; stroke-width: 2.4; }
.is-fullscreen > .fs-btn { cursor: pointer; }

/* Small tag in a viewer's top-left corner: which program this version comes from. */
.stage-tag {
  position: absolute; top: 14px; left: 14px; z-index: 5;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.2; letter-spacing: 0.01em;
  color: #4a4a52; background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.1);
  pointer-events: none;
}
/* Full screen of a lamp or sign whose light is on: black room, white text. */
.fs-view.is-fullscreen.is-on { background: #0b0b0d; --fs-ink: #ffffff; }

/* --- Nightstand Unit in full screen ----------------------------------------
   Desktop: the photo collection sits at the top of its column, level with the
   model, exactly as on the page (centred, it hung low beside the model). */
.fs-view.is-fullscreen [data-kiosk-collected-wrap] { align-self: flex-start; }

/* Phone: a fixed one-screen layout. The panel tabs sit under the Exit button
   (not behind it), the model takes the middle, and the photo collection is a
   narrow strip beside the model, always on screen where a printed photo lands,
   instead of far below it. */
@media (max-width: 600px) {
  .fs-view.is-fullscreen:has([data-kiosk-nav]) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 72px;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px 8px !important;
    align-items: stretch !important; align-content: stretch !important; justify-content: stretch !important;
    padding: calc(64px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom)) !important;
    overflow: hidden;
  }
  .fs-view.is-fullscreen > div:has(> [data-kiosk-nav]) { grid-column: 1 / -1; grid-row: 1; align-self: start !important; }
  .fs-view.is-fullscreen > div:has(.model-stage) {
    grid-column: 1; grid-row: 2; min-height: 0; max-width: none !important;
    display: flex; flex-direction: column; flex: none !important;
  }
  .fs-view.is-fullscreen > div:has(.model-stage) .model-stage {
    flex: 1 1 auto; width: 100% !important; height: auto !important; min-height: 0;
  }
  .fs-view.is-fullscreen > div:has(.model-stage) .desc { margin-top: 8px !important; font-size: 12px !important; line-height: 1.35; }
  .fs-view.is-fullscreen > div:has(.model-stage) .segmented-toggle-wrap { margin-top: 8px !important; }
  .fs-view.is-fullscreen [data-kiosk-collected-wrap] {
    grid-column: 2; grid-row: 2; width: 72px !important; max-width: 72px !important; flex: none !important;
    min-height: 0; overflow-y: auto; align-self: stretch;
  }
  .fs-view.is-fullscreen [data-kiosk-collected-wrap] .label { font-size: 11px !important; line-height: 1.2; text-align: center; }
  .fs-view.is-fullscreen [data-kiosk-collected] { flex-direction: column !important; flex-wrap: nowrap; align-items: center; gap: 8px; }
  .fs-view.is-fullscreen [data-kiosk-collected] .kiosk-collected-item { width: 60px; }
}

/* While the browser is still entering full screen (before the layout above is
   applied), it already shows the project colour rather than black. */
.fs-view:fullscreen, .model-compare:fullscreen { background: var(--fs-bg, #f2f2f2); }
.fs-view:-webkit-full-screen, .model-compare:-webkit-full-screen { background: var(--fs-bg, #f2f2f2); }

/* Pager style "minimal" (default), all screen sizes: chevron, a small "Previous project" /
   "Next project" line and the project name; no picture, no box. */
.project-arrows[data-style="minimal"] .project-arrow-thumb { display: none; }
.project-top:has(.project-arrows[data-style="minimal"]) { padding-top: 66px; }
.project-arrows[data-style="minimal"] { top: -54px; }
.project-arrows[data-style="minimal"] .project-arrow { gap: 8px; min-height: 44px; color: var(--text); }
.project-arrows[data-style="minimal"] .project-arrow-dir { display: block; font-size: 11px; letter-spacing: 0.02em; text-transform: none; }
.project-arrows[data-style="minimal"] .project-arrow-title { font-size: 14px; font-weight: 600; }
.project-arrows[data-style="minimal"] .project-arrow-icon { color: var(--text-secondary); }
@media (max-width: 600px) {
  .project-top:has(.project-arrows[data-style="minimal"]) { padding-top: 62px; }
  .project-arrows[data-style="minimal"] { top: -50px; }
  .project-arrows[data-style="minimal"] .project-arrow-title { font-size: 13px; }
}

/* Full screen: square corners (the page's rounded boxes showed white corners). */
.fs-view.is-fullscreen, .model-compare.is-fullscreen,
.fs-view:fullscreen, .model-compare:fullscreen { border-radius: 0 !important; }
.fs-view.is-fullscreen::before, .fs-view.is-fullscreen::after { border-radius: 0 !important; }
.fs-view.is-fullscreen .model-stage, .model-compare.is-fullscreen .model-stage { border-radius: 0 !important; }

/* Short rights note under the "All projects" link (project-nav.js). */
.site-disclaimer {
  max-width: 640px;
  margin: 28px auto 0;
  padding-bottom: 8px;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-secondary);
}

/* A project that isn't finished yet (Laser Cutter Z Axis): a badge above
   its category and name, matching the "In Progress" badge on its tile. */
.status-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
