/* ========================================
   Frame layout — the live home page on desktop (see frame.js).
   Jasur's Figma frame (1512 × 982) scaled to the window:

     30 | 512 column | 140 | 800 column | 30      = 1512 wide
     30 | text band  ...  object band   | 30      = 982 tall

   - Every size is a frame pixel times --u (one frame pixel in screen pixels,
     at most 1.2), so type, margins and bricks keep the frame's proportions.
   - One 30 margin all round. Text hangs from the top margin; the bricks and
     the piece stand on the bottom margin.
   - Active on body.frame-ui. Below 900 × 560 (phones) frame.js stacks the
     same parts in one column (.is-compact, at the end of this file).
   ======================================== */

.frame-root { display: none; }

body.frame-ui {
  --u: min(100vw / 1512, 100vh / 982, 1.2px);
  --frame-bg: #FFFFFF;
  --frame-fg: #000000;
  --frame-fg-70: rgba(0, 0, 0, 0.7);
  --frame-fg-40: rgba(0, 0, 0, 0.4);
  --frame-surface: #F6F6F6;
  --frame-line: #DDDDDD;
  --frame-brick: #E6E6E6;
  --frame-brick-on: #D0D0D0;
  overflow: hidden;
  background: var(--frame-bg);
}

/* the site's own header, grid, footer and note make way for the frame */
body.frame-ui > .nav,
body.frame-ui > .main,
body.frame-ui > .footer,
body.frame-ui > .bottom-bar,
body.frame-ui > .info-overlay,
body.frame-ui > .info-modal {
  display: none;
}

body.frame-ui::before { display: none; }

body.frame-ui .frame-root {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding: calc(30 * var(--u));
  color: var(--frame-fg);
  background: var(--frame-bg);
  font-family: var(--font-body, "Inter", sans-serif);
  font-feature-settings: "cv11" 1, "ss01" 1;
  letter-spacing: 0;
}

body.frame-ui .frame-root[hidden] { display: none; }

.frame-root button { font: inherit; letter-spacing: inherit; color: inherit; }

/* --- left column: name and note on top, bricks at the bottom --- */
.frame-info {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: calc(512 * var(--u));
  min-width: 0;
  min-height: 0;
}

.frame-name {
  margin: calc(4 * var(--u)) 0 calc(14 * var(--u)); /* name at 34, note at 75 */
  color: var(--frame-fg);
  font-size: max(15px, calc(22 * var(--u)));
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.22;
}

.frame-about {
  color: var(--frame-fg-70);
  font-size: max(12px, calc(16 * var(--u)));
  line-height: 1.5;
  text-wrap: pretty;
}

/* The bricks stand on the bottom margin, level with the foot of the piece.
   When there are more rows than room the list scrolls, coming to rest on whole rows. */
.frame-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: calc(5 * var(--u));
  width: 100%;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.frame-list::-webkit-scrollbar { display: none; }

.frame-row {
  display: flex;
  flex: none;
  gap: calc(5 * var(--u));
  width: 100%;
  scroll-snap-align: end;
}

/* A brick's width says how important its project is. Bricks are grey; the
   one on show takes a soft tint in its project's hue (set from frame.js). */
.frame-brick {
  position: relative;
  flex: none;
  min-width: 0;
  height: calc(36 * var(--u));
  border: 0;
  padding: 0 calc(14 * var(--u));
  background-color: var(--frame-brick);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease-out;
  --accent: var(--accent-light);
  --ink: var(--ink-light);
}

.frame-brick.is-on { background-color: var(--accent, var(--frame-brick-on)); }

.frame-brick:focus-visible { outline: 2px solid var(--frame-fg); outline-offset: 2px; }

.frame-brick-title {
  position: relative;
  display: block;
  overflow: hidden;
  color: var(--frame-fg-40);
  font-size: max(10px, calc(12 * var(--u)));
  line-height: calc(36 * var(--u));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-brick.is-on .frame-brick-title { color: var(--ink, var(--frame-fg)); }

/* the wait before the page moves on, a shade crossing the brick on show */
.frame-brick::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--frame-fg);
  opacity: 0.1;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* --wait: the seconds set for the work in the admin, from frame.js */
.frame-brick.is-timing::after { transform: scaleX(1); transition: transform var(--wait, 7s) linear; }

/* --- right column: what is on show and the links on top, the piece at the bottom --- */
.frame-side {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: calc(30 * var(--u));
  width: calc(800 * var(--u));
  font-size: max(12px, calc(16 * var(--u)));
  line-height: 1.5;
}

.frame-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: calc(20 * var(--u));
}

/* 440 of the 800 column, on the column's left edge */
.frame-note {
  position: relative;
  width: calc(440 * var(--u));
  border: 1px solid transparent; /* the line itself is drawn, with smoothed corners */
  padding: calc(10 * var(--u));
  color: var(--frame-fg-70);
}

.frame-note-edge {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  pointer-events: none;
}

.frame-note-edge path { fill: none; stroke: var(--frame-line); stroke-width: 1; }

.frame-note-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.frame-links { display: flex; flex: none; gap: calc(20 * var(--u)); white-space: nowrap; }

.frame-links a { color: var(--frame-fg); text-decoration: none; }

.frame-links a:hover {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 3px;
}

/* the space under the head; a piece stands on its bottom edge: a landscape
   one on the right edge, a portrait one on the left */
.frame-work {
  position: relative;
  flex: 1;
  min-height: 0;
  container-type: size;
  cursor: pointer;
}

.frame-work .piece {
  --tall: min(calc(648 * var(--u)), 100cqh);
  --w: min(100cqw, var(--tall) * var(--r));
  position: absolute;
  inset: auto auto 0 auto;
  display: block;
  width: var(--w);
  height: calc(var(--w) / var(--r));
  overflow: hidden;
  background: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.frame-work .piece.is-on { opacity: 1; }
.frame-work .piece.is-wide { right: 0; }
.frame-work .piece.is-tall { left: 0; }

.frame-work .piece-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

/* dark: the page black, as in the lab.
   The page follows the screen's own light or dark. The admin's playground
   can ask for one outright, to work on a mode the screen is not in: app.js
   then marks the page (html[data-scheme]). So every dark rule is written
   twice: for a dark screen that has not been told to be light, and for a
   page told to be dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) body.frame-ui {
    color-scheme: dark;
    --frame-bg: #000000;
    --frame-fg: #EDEDED;
    --frame-fg-70: rgba(237, 237, 237, 0.7);
    --frame-fg-40: rgba(237, 237, 237, 0.4);
    --frame-surface: #1B1B1B;
    --frame-line: #333333;
    --frame-brick: #232323;
    --frame-brick-on: #3A3A3A;
  }

  :root:not([data-scheme="light"]) .frame-brick { --accent: var(--accent-dark); --ink: var(--ink-dark); }
}
:root[data-scheme="dark"] body.frame-ui {
  color-scheme: dark;
  --frame-bg: #000000;
  --frame-fg: #EDEDED;
  --frame-fg-70: rgba(237, 237, 237, 0.7);
  --frame-fg-40: rgba(237, 237, 237, 0.4);
  --frame-surface: #1B1B1B;
  --frame-line: #333333;
  --frame-brick: #232323;
  --frame-brick-on: #3A3A3A;
}
:root[data-scheme="dark"] .frame-brick { --accent: var(--accent-dark); --ink: var(--ink-dark); }
:root[data-scheme="light"] body.frame-ui { color-scheme: light; }

/* ========================================
   Phone (and any screen below 900 × 560): one column.
     name ··· Contact  X/Twitter
     note about him
     [ title of what is on show ]
     the piece, edge to edge and uncropped, centred in the room left
     three rows of bricks side by side, scrolling sideways
   ======================================== */
body.frame-ui .frame-root.is-compact {
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.is-compact .frame-top {
  display: flex;
  flex: none;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.is-compact .frame-name { margin: 0; font-size: 18px; }

.is-compact .frame-links { gap: 16px; font-size: 14px; line-height: 1.4; }

/* the note belongs to the name: closer to it than to what follows */
.is-compact .frame-about {
  flex: none;
  margin-top: -8px;
  font-size: 14px;
  line-height: 1.45;
}

.is-compact .frame-note {
  flex: none;
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;
}

/* The piece runs the full width of the screen, edge to edge, uncropped,
   centred between the title box and the bricks. One too tall for the room
   keeps its shape and is as tall as the room. */
.is-compact .frame-work {
  flex: 1 1 0;
  min-height: 0;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left)));
}

/* centred in the room between the title box and the bricks */
.is-compact .frame-work .piece { --tall: 100cqh; inset: 0; margin: auto; }

/* the rows run to the screen's edges and scroll sideways, starting on the margin */
.is-compact .frame-list {
  flex: none;
  gap: 5px;
  width: auto;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left)));
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  scroll-padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: none;
  -webkit-overflow-scrolling: touch;
}

.is-compact .frame-row { gap: 5px; width: max-content; }

.is-compact .frame-brick { flex: none; height: 40px; padding: 0 12px; }

.is-compact .frame-brick-title { font-size: 13px; line-height: 40px; }

/* ========================================
   Ring — Jasur's mockup of 2026-11-18 (see mountRing in frame.js), the
   gallery layout "ring". Sizes are pixels of the 1512 × 982 frame times --u.

     10 | name and note, the links under them | 32 | the work, the ring under it | 10

   - Everything stands in a corner: name and note top-left, the links
     bottom-left, the work top-right, the ring bottom-right, as wide as the
     work's column (frame.js sets its width).
   - Objects keep a 10 margin; the name and note are set in 32 further.
   - The ring frames only the words about the work on show. Its bricks are
     placed by frame.js in whole screen pixels; the brick at a corner turns
     it as an L, cut to that shape with its inside corner curved.
   - The work is as wide as its column and keeps its own shape, standing on
     the ring. A landscape piece keeps to the right edge, a portrait one to
     the left of the column.
   - The page is #FAFAFA; in dark mode pure black.
   ======================================== */
body.frame-ui:has(.frame-root.is-ring) { --frame-bg: #FAFAFA; }

@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) body.frame-ui:has(.frame-root.is-ring) { --frame-bg: #000000; }
}
:root[data-scheme="dark"] body.frame-ui:has(.frame-root.is-ring) { --frame-bg: #000000; }

body.frame-ui .frame-root.is-ring { display: block; padding: 0; }

/* --- top left: who --- */
.ring-intro {
  position: absolute;
  top: calc(39 * var(--u));
  left: calc(42 * var(--u));
  width: calc(462 * var(--u));
}

.ring-name {
  margin: 0 0 calc(12 * var(--u));
  color: var(--frame-fg);
  font-size: max(15px, calc(20 * var(--u)));
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.22;
}

.ring-about {
  color: var(--frame-fg-70);
  font-size: max(12px, calc(14.5 * var(--u)));
  line-height: 1.5;
  text-wrap: pretty;
}

/* --- top right: the work, standing on the ring below it --- */
.ring-work {
  position: absolute;
  top: calc(10 * var(--u));
  right: calc(10 * var(--u));
  bottom: calc((var(--ring-frame-h, 280) + 34) * var(--u)); /* margin 10 + the ring (RING.h, set by frame.js) + 24 */
  left: calc(662 * var(--u)); /* where the mockup has it: 32 past a ring 620 wide */
  container-type: size;
  cursor: pointer;
}

.ring-work .piece {
  --w: min(100cqw, 100cqh * var(--r));
  position: absolute;
  bottom: 0;
  display: block;
  width: var(--w);
  height: calc(var(--w) / var(--r));
  overflow: hidden;
  background: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ring-work .piece.is-on { opacity: 1; }
.ring-work .piece.is-wide { right: 0; }
.ring-work .piece.is-tall { left: 0; }

/* on desktop every work has a frame of one shape (--ring-shape, 16:9, set by
   frame.js), as wide as the ring under it. A work made at that shape fills
   it; one of another shape is never cropped or stretched: it shows whole at
   its own shape (--r), as large as fits the frame, in the frame's middle,
   standing on its bottom */
.frame-root.is-ring:not(.is-compact) .ring-work .piece {
  --fw: min(100cqw, 100cqh * var(--ring-shape, 1.7778)); /* the frame's width */
  --w: min(var(--fw), var(--fw) / var(--ring-shape, 1.7778) * var(--r));
  right: calc((var(--fw) - var(--w)) / 2);
  left: auto;
}

.ring-work .piece-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

/* --- bottom right, under the work: the ring (its size is set by frame.js) --- */
.ring-ring {
  position: absolute;
  right: calc(10 * var(--u));
  bottom: calc(10 * var(--u));
}

.ring-brick {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  padding: 0 calc(8 * var(--u));
}

/* titles of the works not on show are faint; the one on show is deep in its hue */
.ring-brick .frame-brick-title {
  max-width: 100%;
  line-height: 1.4;
}

/* down the sides a title reads sideways: up the left side, down the right */
.ring-brick.is-left, .ring-brick.is-right { padding: calc(8 * var(--u)) 0; }

.ring-brick.is-left .frame-brick-title, .ring-brick.is-right .frame-brick-title {
  max-width: none;
  max-height: 100%;
  writing-mode: vertical-rl;
}

.ring-brick.is-left .frame-brick-title { transform: rotate(180deg); }

/* a brick's outline is cut away with its shape: the one in focus is the one on show, and its title is underlined */
/* Colours set for a project's brick in the admin, from frame.js: its
   background, its fill and its title, each for light mode and for dark
   (--brick-bg-light, --brick-bg-dark and so on). A fill of its own is drawn
   as given, so the title is lifted over it. */
.ring-brick { --brick-bg: var(--brick-bg-light); --brick-fill: var(--brick-fill-light); --brick-ink: var(--brick-ink-light); }
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) .ring-brick { --brick-bg: var(--brick-bg-dark); --brick-fill: var(--brick-fill-dark); --brick-ink: var(--brick-ink-dark); }
}
:root[data-scheme="dark"] .ring-brick { --brick-bg: var(--brick-bg-dark); --brick-fill: var(--brick-fill-dark); --brick-ink: var(--brick-ink-dark); }
.ring-brick.is-on { background-color: var(--brick-bg, var(--accent, var(--frame-brick-on))); }
.ring-brick.is-on .frame-brick-title { color: var(--brick-ink, var(--ink, var(--frame-fg))); }
.ring-brick.has-fill::after { background: var(--brick-fill); opacity: 1; }
.ring-brick.has-fill .frame-brick-title { position: relative; z-index: 1; }
/* held in the admin's playground, the shade stands halfway across */
.ring-brick.is-halfway::after { transform: scaleX(0.5); }
.ring-brick.is-right.is-halfway::after, .ring-brick.is-left.is-halfway::after { transform: scaleY(0.5); }

.ring-brick:focus-visible { outline: none; }
.ring-brick:focus-visible .frame-brick-title { text-decoration: underline; text-decoration-thickness: from-font; text-underline-offset: 3px; }

/* the wait before the page moves on is the brick's plain shade, crossing it
   the way the ring goes round, clockwise: rightwards along the top, down the
   right side, leftwards along the bottom, up the left side */
.ring-brick.is-bottom::after { transform-origin: 100% 50%; }
.ring-brick.is-right::after { transform: scaleY(0); transform-origin: 50% 0; }
.ring-brick.is-left::after { transform: scaleY(0); transform-origin: 50% 100%; }
.ring-brick.is-right.is-timing::after, .ring-brick.is-left.is-timing::after { transform: scaleY(1); }
/* a video's brick is crossed as the video plays: frame.js sets --played, from 0 to 1 */
.ring-brick.is-following::after { transform: scaleX(var(--played, 0)); }
.ring-brick.is-right.is-following::after, .ring-brick.is-left.is-following::after { transform: scaleY(var(--played, 0)); }

/* the admin's playground (frame.js, options.edit): a brick is pressed to work
   on its project, dragged to another place, and by its far end to another
   length. The brick being dragged is the page's ink. */
.ring-ring.is-editing .ring-brick { touch-action: none; cursor: grab; }
/* A grip at the far end of a brick that has a gap there to drag (.has-gap:
   not the last brick of a side, whose end is the ring's corner): faint while
   the pointer is on the brick, plain when a drag from where the pointer is
   would move that gap. It sits in the brick's arm, which is where the
   brick's box has its far end. */
.ring-ring.is-editing .ring-brick::before {
  content: "";
  position: absolute;
  top: calc(8 * var(--u));
  right: calc(4 * var(--u));
  width: 2px;
  height: calc(14 * var(--u));
  border-radius: 1px;
  background: var(--frame-fg);
  opacity: 0;
  transition: opacity 0.15s ease-out;
}
.ring-ring.is-editing .ring-brick.is-bottom::before { top: auto; right: auto; bottom: calc(8 * var(--u)); left: calc(4 * var(--u)); }
.ring-ring.is-editing .ring-brick.is-right::before { top: auto; right: calc(8 * var(--u)); bottom: calc(4 * var(--u)); width: calc(14 * var(--u)); height: 2px; }
.ring-ring.is-editing .ring-brick.is-left::before { top: calc(4 * var(--u)); right: auto; left: calc(8 * var(--u)); width: calc(14 * var(--u)); height: 2px; }
.is-compact .ring-ring.is-editing .ring-brick::before { display: none; }
@media (hover: hover) { .ring-ring.is-editing .ring-brick.has-gap:hover::before { opacity: 0.25; } }
.ring-ring.is-editing .ring-brick.is-gripped::before { opacity: 0.8; }
.ring-ring.is-editing .ring-brick.is-lifted::before { background: var(--frame-bg); }
.ring-ring[data-drag="x"] .ring-brick.is-lifted.has-gap::before, .ring-ring[data-drag="y"] .ring-brick.is-lifted.has-gap::before { opacity: 0.8; }
.ring-ring.is-editing .ring-brick.is-lifted { background-color: var(--frame-fg); }
.ring-ring.is-editing .ring-brick.is-lifted .frame-brick-title { color: var(--frame-bg); }
.ring-ring[data-drag="move"], .ring-ring[data-drag="move"] .ring-brick { cursor: grabbing !important; }
.ring-ring[data-drag="x"], .ring-ring[data-drag="x"] .ring-brick { cursor: ew-resize !important; }
.ring-ring[data-drag="y"], .ring-ring[data-drag="y"] .ring-brick { cursor: ns-resize !important; }

/* the words about the work on show, in the ring's opening */
.ring-box {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(8 * var(--u));
  padding: calc(22 * var(--u)) calc(20 * var(--u)) calc(16 * var(--u));
  overflow: hidden;
  container-type: size;
}

/* on desktop the opening has a faint inner edge, as round as a brick */
.frame-root.is-ring:not(.is-compact) .ring-box {
  border: 1px solid color-mix(in srgb, var(--frame-line) 70%, transparent);
  border-radius: calc(6 * var(--u));
}

/* on desktop the opening is wide and has room: the words are larger, and
   the line about the work runs most of its width before it wraps */
.frame-root.is-ring:not(.is-compact) .ring-box-title { font-size: max(13px, calc(16 * var(--u))); }
.frame-root.is-ring:not(.is-compact) .ring-box-about {
  max-width: 36em;
  margin-top: calc(4 * var(--u));
  font-size: max(12px, calc(13.5 * var(--u)));
  line-height: 1.45;
  text-wrap: pretty;
}
.frame-root.is-ring:not(.is-compact) .ring-tags { gap: calc(6 * var(--u)); }
.frame-root.is-ring:not(.is-compact) .ring-tags li {
  padding: 0 calc(12 * var(--u));
  font-size: max(11px, calc(12.5 * var(--u)));
  line-height: calc(26 * var(--u) - 2px);
}

.ring-box-text { min-height: 0; }

.ring-box-title {
  overflow: hidden;
  color: var(--frame-fg);
  font-size: max(11px, calc(12 * var(--u)));
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ring-box-about {
  max-width: 18em;
  margin-top: calc(2 * var(--u));
  color: var(--frame-fg-70);
  font-size: max(10px, calc(10.5 * var(--u)));
  line-height: 1.4;
  text-wrap: balance;
}

.ring-tags { display: flex; flex: none; gap: calc(5 * var(--u)); margin: 0; padding: 0; list-style: none; overflow: hidden; }

.ring-tags li {
  flex: none;
  border: 1px dashed var(--frame-line);
  border-radius: calc(5 * var(--u));
  corner-shape: squircle;
  padding: 0 calc(10 * var(--u));
  color: var(--frame-fg);
  font-size: max(10px, calc(10 * var(--u)));
  line-height: calc(20 * var(--u) - 2px);
  white-space: nowrap;
}

/* --- bottom left: the links, one shape, sized like the ring's bricks, on the name's left edge --- */
.ring-links {
  position: absolute;
  bottom: calc(10 * var(--u));
  left: calc(42 * var(--u)); /* where .ring-intro starts */
}

.ring-links svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-links path { fill: var(--frame-brick); }

.ring-links a {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--frame-fg);
  font-size: max(11px, calc(14 * var(--u))); /* a little larger than a brick's title */
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease-out;
}

@media (hover: hover) {
  .ring-links a:hover { background-color: var(--frame-brick-on); }
}

.ring-links a:focus-visible { outline: none; text-decoration: underline; text-decoration-thickness: from-font; text-underline-offset: 3px; }

/* ========================================
   Ring on a phone (and any screen below 900 × 560): one column.
     name ··· Contact—X/Twitter
     the piece, edge to edge and uncropped, in the middle of the room left
     the ring, standing on the bottom, as wide as the screen
   There is no note on a phone.
   Sizes are plain pixels here (--u is not used): frame.js lays the ring for
   the screen's width and gives it the height its bricks need.
   ======================================== */
body.frame-ui .frame-root.is-ring.is-compact {
  --u: 1px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.is-compact .ring-top {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.is-compact .ring-name { margin: 0; font-size: 18px; }

.is-compact .ring-links { position: relative; right: auto; bottom: auto; left: auto; flex: none; }
.is-compact .ring-links a { font-size: 12px; }

/* The piece runs the full width of the screen, edge to edge, uncropped,
   in the middle between the name's row and the ring. One too tall for the
   room keeps its shape and is as tall as the room. */
.is-compact .ring-work {
  position: relative;
  inset: auto;
  flex: 1 1 0;
  min-height: 0;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left)));
}

.is-compact .ring-work .piece { inset: 0; margin: auto; }

.is-compact .ring-ring { position: relative; inset: auto; flex: none; }

/* frame.js picks the labels' size and room to suit the screen's height */
.is-compact .ring-brick { padding: 0 var(--ring-pad, 6px); }
.is-compact .ring-brick.is-left, .is-compact .ring-brick.is-right { padding: var(--ring-pad, 6px) 0; }
.is-compact .ring-brick .frame-brick-title { font-size: var(--ring-type, 12px); }

.is-compact .ring-box { gap: 6px; padding: 14px 14px 12px; }
.is-compact .ring-box-title { font-size: 13px; }
.is-compact .ring-box-about { font-size: 12px; }
.is-compact .ring-tags li { font-size: 11px; line-height: 20px; }

/* a low opening has room for the title and its line only */
@container (max-height: 96px) {
  .ring-tags { display: none; }
}

/* Held sideways: the name, the links and the ring on the left, the piece on
   the right. */
body.frame-ui .frame-root.is-ring.is-compact.is-sideways {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 16px;
}

.is-sideways .ring-top { grid-column: 1; grid-row: 1; }
.is-sideways .ring-ring { grid-column: 1; grid-row: 2; align-self: end; }
.is-sideways .ring-work { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
