/*
  Clipzebra homepage: page CSS. The page is built on the kit in assets/ (system.css, ui, motion, layout);
  this file holds only what sits inside a visual and the kit does not carry:
    1. the nav menu's picture height (nav-cards)
    2. the hero's art: the tool's own screen and one result card
    3. the Stijlen frame: the sample videos as the pieces of its stage
    4. the app window in "Zo maakt Clipzebra een video" (the app-frame recipe)
    5. the Kosten visual: the result card beside the measured example
    6. the close: the size of the name set across the wrap (close-word)
  Nothing here sets a section's box, the page grid, a type size of the page or a button.
*/

/* ---------------------------------------------------------------- 1. nav-cards: the panel's picture height */
.menu-card .panel { --p-h: 200px; }

/* ---------------------------------------------------------------- 2. the hero's art
   The lit ground with one soft light. On it the tool's own screen and one result card, drawn with the kit's .ui
   tokens in the app's own dark palette (the tool page uses the same palette). */
.hero__art { container: art / size; background:
    radial-gradient(70% 60% at 18% 12%, color-mix(in oklab, var(--ground-surface) 80%, white), transparent 70%),
    radial-gradient(60% 50% at 90% 100%, color-mix(in oklab, var(--ground-bg) 80%, var(--ground-accent)), transparent 70%),
    var(--ground-bg); }
.hero__art > .ui { --fx-bg: var(--p-bg); --fx-surface: var(--p-surface); --fx-ink: var(--p-ink); --fx-muted: var(--p-muted);
  --fx-accent: var(--p-accent); --fx-accent-ink: var(--p-accent-ink); --ui-font: var(--font-text); --ui-radius: 14px; }
/* the window runs 40px past the frame's bottom edge (the frame cuts it there), never past the first screen */
.hero__art > .ly-piece--main { height: calc(100% - var(--s-8) + 40px); }
.hero__art > .ly-piece--note { left: var(--s-6); bottom: var(--s-6); width: 300px; z-index: 2; }

/* the tool: a bar, the shelf of style tiles and the panel of the chosen style. Its content keeps --ly-cut-room clear
   at the right, so the frame cuts empty margin and never a word */
.tool { container: tool / inline-size; display: flex; flex-direction: column; overflow: hidden; }
.tool__bar { flex: none; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-bottom: 1px solid var(--u-line); background: var(--u-fill); white-space: nowrap; }
.tool__name { font-weight: 500; }
.tool__tabs { display: flex; gap: 4px; }
.tool__tabs > span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; color: var(--u-muted); }
.tool__tabs > .is-on { background: var(--u-fill-3); color: var(--u-ink); font-weight: 500; }
.tool__tabs em, .tool__group em { font-style: normal; font-weight: 400; color: var(--u-soft); }
.tool__body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); padding-right: var(--ly-cut-room); }
.tool__shelf { display: grid; align-content: start; gap: 10px; padding: 14px; }
.tool__group { display: flex; gap: 6px; font-weight: 500; }
/* tiles of 119px: small posters with their style's name, as the tool lists them */
.tool__grid { display: grid; grid-template-columns: repeat(var(--cols, 2), 119px); gap: 14px 12px; }
.tool__tile { display: grid; gap: 6px; }
.tool__tile > img { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 1px var(--u-line-2); }
.tool__tile > span { font-size: 12px; line-height: 16px; color: var(--u-text-2); white-space: nowrap; }
/* the chosen tile carries the window's one accent */
.tool__tile.is-on > img { box-shadow: 0 0 0 2px var(--u-bg), 0 0 0 4px var(--u-accent); }
.tool__tile.is-on > span { color: var(--u-ink); font-weight: 500; }
.tool__side { display: grid; align-content: start; gap: 8px; padding: 14px 0 0 16px; border-left: 1px solid var(--u-line); min-width: 0; }
.tool__label { margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--u-muted); }
.tool__label:first-child { margin-top: 0; }
.tool__title { font-size: 15px; line-height: 20px; font-weight: 500; letter-spacing: -0.01em; }
.tool__text { color: var(--u-text-2); }
.tool__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tool__field { min-height: 60px; padding: 8px 10px; border-radius: 8px; background: var(--u-fill); box-shadow: inset 0 0 0 1px var(--u-line-2); }
.tool__go { height: 32px; margin-top: 4px; }
.tool__label.tool__proof { margin-top: 16px; }
/* a narrow window (a 1024 laptop, a phone) keeps one column of tiles; a short frame leaves the proof to the tool */
@container tool (max-width: 560px) { .tool__grid { --cols: 1; } .tool__tile:nth-child(n + 3) { display: none; } }
@container art (max-height: 560px) { .tool__proof { display: none; } }

/* the result card: the video that is ready, its title and the three steps it went through (layout.js steps them) */
.hero__art > .klaar { --fx-bg: color-mix(in oklab, var(--p-ink) 9%, var(--p-bg)); padding: 14px 14px 6px; }
.klaar__top { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; padding-bottom: 12px; }
.klaar__top > img { width: 40px; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; }
.klaar__title { font-weight: 500; line-height: 18px; }
.klaar__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--u-muted); }
.klaar__step { display: flex; align-items: center; gap: 10px; height: 34px; border-top: 1px solid var(--u-line); color: var(--u-text-2); }
:is(.klaar__step, .take__step) > i { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--u-ink); color: var(--u-bg); }
:is(.klaar__step, .take__step) > i > svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* 1024 to 1279: the frame is about 420 to 560px wide, the window alone (as the kit's split frame does) */
@media (min-width: 1024px) and (max-width: 1279px) { .hero__art > .ly-piece--note { display: none; } }
@media (max-width: 1023px) {
  .hero__art > .ly-piece--main { height: calc(100% - var(--s-6) + 40px); }
  .hero__art > .ly-piece--note { left: var(--s-4); bottom: var(--s-4); width: 284px; }
}
/* a phone: the chosen tile beside its idea and the button; the rest of the shelf waits for a wider screen */
@media (max-width: 639px) {
  .hero__art > .ly-piece--main { height: calc(100% - var(--s-4) + 20px); }
  .tool__mine, .tool__group, .tool__tile:not(.is-on), .tool__tile > span, .tool__side > :is(.tool__text, .tool__meta, .tool__proof) { display: none; }
  .tool__shelf { padding: 14px 0 14px 14px; }
  .tool__grid { grid-template-columns: 96px; }
  .tool__side { border-left: 0; padding: 12px 0 14px 14px; gap: 6px; }
  .tool__label { margin-top: 2px; }
  .tool__field { min-height: 0; }
}

/* ---------------------------------------------------------------- 3. the Stijlen frame
   The page's one data-visual frame, on the dealt effect. Its stage holds the sample videos as pieces (the kit places
   a stage's pieces absolutely): each whole, each 9:16, side by side round the stage's middle. --n pieces a row and
   --rows rows; a piece is as wide as its share of the stage and never taller than the screen leaves (--cap).
   Controls on the lit ground take its ink. */
.reel-frame { --action: var(--ground-ink); --n: 5; --rows: 1; --pad: var(--s-7); --gap: var(--s-5);
  --cap: calc((100svh - 470px) * 9 / 16);
  --iw: min(var(--cap), calc((100% - 2 * var(--pad) - (var(--n) - 1) * var(--gap)) / var(--n))); }
.reel > .reel__item { --i: 0; --j: 0; left: 50%; top: 50%; width: var(--iw); aspect-ratio: 9 / 16;
  translate: calc((var(--i) - (var(--n) - 1) / 2) * (100% + var(--gap)) - 50%) calc((var(--j) - (var(--rows) - 1) / 2) * (100% + var(--gap)) - 50%); }
.reel > .reel__item:nth-child(2) { --i: 1; }
.reel > .reel__item:nth-child(3) { --i: 2; }
.reel > .reel__item:nth-child(4) { --i: 3; }
.reel > .reel__item:nth-child(5) { --i: 4; }
.reel > .reel__item:nth-child(n + 6) { display: none; }
.reel__link { display: block; width: 100%; height: 100%; border-radius: var(--r-md); background: #101010;
  box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 20px 40px -20px rgb(0 0 0 / .5); }
.reel__video { width: 100%; height: 100%; object-fit: cover; }
/* the round button: a 44px target holding the kit's 32px disc, at the tile's lower right */
.reel__play { position: absolute; right: 4px; bottom: 4px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px;
  margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.reel__play > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ground-surface); color: var(--ground-ink); box-shadow: 0 1px 2px rgb(0 0 0 / .2), 0 4px 12px -4px rgb(0 0 0 / .45);
  transition: background-color var(--dur) var(--ease), transform 90ms var(--ease); }
.reel__play svg { width: 14px; height: 14px; fill: currentColor; }
.reel__stop, .reel__play[aria-pressed="true"] .reel__go { display: none; }
.reel__play[aria-pressed="true"] .reel__stop { display: block; }
@media (hover: hover) and (pointer: fine) { .reel__play:hover > span { background: #fff; } }
.reel__play:active > span { transform: scale(.94); }
/* under 1280 a section grows with what it holds, so the frame carries its own height (--ratio: its height over its
   width, from the pieces it holds) and never shrinks under it */
@media (max-width: 1279px) { .reel-frame { --ratio: 39%; } .reel-frame.fill { flex: 1 0 auto; } }
@media (max-width: 1023px) {
  .reel-frame { --n: 4; --rows: 2; --pad: var(--s-6); --gap: var(--s-3); --cap: 100%; --ratio: 87%; }
  .reel > .reel__item:nth-child(n + 6) { display: block; }
  .reel > .reel__item:nth-child(n + 5) { --j: 1; }
  .reel > .reel__item:nth-child(5) { --i: 0; }
  .reel > .reel__item:nth-child(6) { --i: 1; }
  .reel > .reel__item:nth-child(7) { --i: 2; }
  .reel > .reel__item:nth-child(8) { --i: 3; }
}
@media (max-width: 639px) {
  .reel-frame { --n: 2; --rows: 1; --pad: var(--s-4); }
  .reel > .reel__item:nth-child(n + 3) { display: none; }
}

/* ---------------------------------------------------------------- 4. the app window (app-frame, sections-library.md)
   One window across the wrap: the list beside the open item. The recipe's own rules first. */
.app.ui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: var(--s-7); background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); }
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.app > .app__pane + .app__pane { border-left: 1px solid var(--u-line); }
.app > .app__pane > .ui-panel { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
.app > .app__pane::after { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(transparent, var(--u-bg)); pointer-events: none; }
@media (min-width: 1024px) and (max-width: 1279px) { .app.ui { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app > .app__pane--list { max-height: 252px; }
  .app > .app__pane--list::after { display: none; }
  .app .ui-win__side { display: none; }
  .app .ui-win__body { grid-template-columns: minmax(0, 1fr); }
  .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--u-line); }
}
@media (max-width: 639px) {
  .app.ui { grid-template-rows: minmax(0, 1fr); }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0; }
}
/* what this window adds: the window is one step lighter than the dark page and clips its panes to its corners; a
   style's poster stands where the kit's row has an avatar; the open item (the kit's doc) fills its pane as the
   window's own page, with its note in the margin beside it */
.app.ui { --fx-bg: var(--p-surface); overflow: clip; }
.app .app__thumb { width: 24px; height: 36px; border-radius: 5px; object-fit: cover; box-shadow: 0 0 0 1px var(--u-line-2); }
@container ui-win (max-width: 539px) { .app .app__thumb { grid-row: 1 / 3; height: 40px; } }
/* a wide list (the tablet's): a style's name is longer than the 92px the kit's row keeps for a person's */
@container ui-win (min-width: 540px) { .app :is(.ui-win__cols, .ui-win__row) { grid-template-columns: 24px minmax(0, 220px) minmax(0, 1fr) 96px 28px; } }
.app .ui-doc { width: 100%; }
.app .ui-doc__page { padding: 24px 28px 32px; border: 0; border-radius: 0; box-shadow: none; background: none; }
.app .app__sub { margin-top: 20px; margin-bottom: 6px; }
@media (min-width: 640px) {
  .app .ui-doc { padding-right: 236px; }
  .app .ui-doc__note { right: 20px; width: 200px; }
}
/* a phone has no margin for the note: it stands above the page, on no line of it */
@media (max-width: 639px) {
  .app .ui-doc { padding-right: 0; }
  .app .ui-doc__note { position: static; order: -1; width: auto; margin: 16px 16px 0; }
  .app .ui-doc__page { padding: 16px 20px 32px; }
}

/* ---------------------------------------------------------------- 5. the Kosten visual
   The tool's result card for the measured example beside the example itself, both one height. The card stands on
   the band's own card colour; the video keeps its own controls and is never taller than the screen leaves. */
.take { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-5); align-items: stretch; }
.take__video { width: min(350px, calc((100svh - 220px) * 9 / 16)); height: auto; aspect-ratio: 9 / 16; border-radius: var(--r-md); background: #101010;
  box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 20px 40px -20px rgb(0 0 0 / .5); }
.take__card { --fx-bg: var(--card); --fx-surface: var(--surface); --fx-ink: var(--ink); --fx-muted: var(--muted); --fx-accent: var(--accent); --fx-accent-ink: var(--accent-ink);
  --ui-font: var(--font-text); display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 16px 16px 6px; }
.take__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.take__title { font-size: 15px; line-height: 20px; font-weight: 500; letter-spacing: -0.01em; }
.take__post { display: grid; gap: 6px; }
.take__label { font-size: 12px; line-height: 16px; color: var(--u-muted); }
.take__text { color: var(--u-text-2); }
.take__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.take__step { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 52px; border-top: 1px solid var(--u-line); }
.take__name { font-weight: 500; }
/* a narrow column (a 1024 laptop): the card keeps its title and its steps */
@media (min-width: 1024px) and (max-width: 1279px) { .take__video { width: 190px; } .take__post { display: none; } }
/* stacked under the words (a tablet): the pair stands clear of the link above it, the video as tall as the screen leaves */
@media (max-width: 1023px) {
  .take { margin-top: var(--s-6); }
  .take__video { width: clamp(180px, calc((100svh - 670px) * 9 / 16), 290px); }
}
/* a phone: one surface on a screen of its own. The card takes the row and keeps room at its top for the video,
   which stands on it, centred */
@media (max-width: 639px) {
  .take { --vw: 190px; position: relative; grid-template-columns: minmax(0, 1fr); margin-top: 0; align-self: start; }
  .take__video { position: absolute; left: 50%; top: 16px; z-index: 1; width: var(--vw); translate: -50% 0; }
  .take__card { padding-top: calc(var(--vw) * 16 / 9 + 32px); justify-content: start; }
  .take__title { font-size: 16px; line-height: 22px; }
  .take__post { display: none; }
}

/* ---------------------------------------------------------------- 6. close-word: the name from line to line
   Its size is hand-set from the width of the close itself (the recipe: one line across the wrap, never scaled by
   transform): eleven letters. The kit clips the name's line box, which is shorter than this face's letters are
   tall, so the clip is lifted; the name cannot run past the wrap at this size. */
.close--word { container-type: inline-size; }
.close--word > .close__word { font-size: 21.4cqw; overflow: visible; }
