/* =====================================================================
   DevHub — page CSS: only what sits inside a visual and the kit lacks,
   plus the app-frame recipe (sections-library.md, app-frame) and the
   breakpoints the system does not carry for this product.
   ===================================================================== */

/* ---------------------------------------------------------------- hero collage */
/* the art stands on the lit ground with one soft light (layout deal, hero collage) */
.hero__art {
  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__proof { font-size: var(--t-small); color: var(--muted); }

/* the window lays itself out for the width and height it gets: fluid inside the art piece,
   so the frame cuts its right and bottom edges at every width (layout.css --ly-cut) and the
   result card lands on the window's own open rows, never half across a row of text */
.hero__art { container: hero-art / size; }
.hero__art > .ly-piece--main { bottom: 0; height: auto; }
.hero__art .ui-win { position: absolute; top: 0; left: 0; right: 0; bottom: -48px; width: auto; height: auto; display: flex; flex-direction: column; }
/* the rows take the window whole: the categories list stood in the way of every row's two reads */
.hero__art .ui-win__side { display: none; }
.hero__art .ui-win__body { flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(0, 1fr); }
.hero__art .ui-logo--sm { width: 24px; height: 24px; border-radius: 6px; }
.hero__art .ui-logo--sm img { width: 16px; height: 16px; }
.hero__art .ui-win__nav em { font-family: var(--font-mono); font-size: 12px; }
/* four columns the page's own (a wide window's rows): resource, one line of detail, its category;
   the content keeps --ly-cut-room clear at the right, so the frame's cut falls in empty margin */
@container ui-win (min-width: 540px) {
  .hero__art .ui-win__cols,
  .hero__art .ui-win__row { grid-template-columns: 24px 132px minmax(0, 1fr) 92px; }
  .hero__art .ui-win__cols span:first-child { grid-column: 1 / 3; }
}
@media (min-width: 1024px) { .hero__art .ui-win__cols, .hero__art .ui-win__row { padding-right: 64px; } }
@media (max-width: 1023px) { .hero__art .ui-win__cols, .hero__art .ui-win__row { padding-right: 56px; } }

/* the result card floats over the window's lower-left corner, inside the window's own box */
.ly-piece--main > .ly-piece--note { position: absolute; left: 24px; bottom: 56px; width: 300px; z-index: 2; }
@media (max-width: 639px) { .ly-piece--main > .ly-piece--note { display: none; } }
.note-card {
  background: #ffffff; color: #16181a; border-radius: 12px; overflow: hidden;
  padding: 14px 16px 16px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .06), 0 14px 32px -18px rgb(0 0 0 / .35);
  font: 400 13px/1.45 var(--font-text);
}
.note-card__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-card__row h5 { margin: 0; font: 500 13px/1.4 var(--font-text); letter-spacing: 0; }
.note-chip {
  font-size: 12px; line-height: 1; padding: 5px 8px; border-radius: 999px;
  background: #eef1f6; color: #31445f; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06);
}
.note-line { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; color: #3d4247; border-top: 1px solid rgb(0 0 0 / .06); }
.note-card__row + .note-line { border-top: 0; padding-top: 8px; }
.note-line i { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #e7f4ec; color: #17673f; font-style: normal; font-size: 12px; font-weight: 700; }
.note-line b { font-weight: 500; color: #16181a; }

/* rows end above the result card's zone whatever the frame's height: the card's top edge never
   crosses a row of text, and below the last row the window's open body runs out through the
   frame's bottom edge. Two tables: the kit's 44px rows in a wide window, its 56px compact rows
   in a narrow one (window/fragment.css), each counted from where its rows start. */
@container hero-art (max-height: 489px) {
  .ly-piece--note { display: none; }
  .ui-win__row:nth-of-type(n+7) { display: none; }
}
@container ui-win (min-width: 540px) {
  @container hero-art (min-height: 490px) and (max-height: 533px) { .ui-win__row:nth-of-type(n+4) { display: none; } }
  @container hero-art (min-height: 534px) and (max-height: 577px) { .ui-win__row:nth-of-type(n+5) { display: none; } }
  @container hero-art (min-height: 578px) and (max-height: 621px) { .ui-win__row:nth-of-type(n+6) { display: none; } }
  @container hero-art (min-height: 622px) and (max-height: 665px) { .ui-win__row:nth-of-type(n+7) { display: none; } }
  @container hero-art (min-height: 666px) and (max-height: 709px) { .ui-win__row:nth-of-type(n+8) { display: none; } }
  @container hero-art (min-height: 710px) { .ui-win__row:nth-of-type(n+9) { display: none; } }
}
@container ui-win (max-width: 539px) {
  @container hero-art (min-height: 494px) and (max-height: 549px) { .ui-win__row:nth-of-type(n+4) { display: none; } }
  @container hero-art (min-height: 550px) and (max-height: 605px) { .ui-win__row:nth-of-type(n+5) { display: none; } }
  @container hero-art (min-height: 606px) and (max-height: 661px) { .ui-win__row:nth-of-type(n+6) { display: none; } }
  @container hero-art (min-height: 662px) and (max-height: 717px) { .ui-win__row:nth-of-type(n+7) { display: none; } }
  @container hero-art (min-height: 718px) and (max-height: 773px) { .ui-win__row:nth-of-type(n+8) { display: none; } }
  @container hero-art (min-height: 774px) { .ui-win__row:nth-of-type(n+9) { display: none; } }
}

/* ---------------------------------------------------------------- nav menu card */
.menu-card .panel { --p-h: 260px; }
.menu-card .t-card { font-family: var(--font-text); }

/* ---------------------------------------------------------------- app-frame (the product) */
.app.ui {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  grid-template-rows: minmax(0, 1fr);
  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);
  overflow: hidden;
  --fx-accent: var(--p-accent);
  --fx-accent-ink: var(--p-accent-ink);
}
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 16px; }
.app > .app__pane + .app__pane { border-left: 1px solid var(--u-line); }
.app > .app__pane::after {
  content: ""; position: absolute; inset: auto 0 16px 0; height: 64px; z-index: 3;
  background: linear-gradient(transparent, var(--u-bg)); pointer-events: none;
}

/* left pane: the category list, the counts beside it */
.lib__cats { display: flex; flex-direction: column; min-height: 0; padding: 14px 10px; gap: 6px; }
.lib__cats__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 8px 6px; }
.lib__cats__head .t-label { color: var(--u-ink); }
.lib__cats__head .lib__total { font-family: var(--font-mono); font-size: 13px; color: var(--u-muted); }
.lib__cats ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.lib__cat {
  background-color: var(--u-bg);
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px;
  border: 0; border-radius: 6px; background: none; cursor: pointer; text-align: left;
  font: 400 14px/1.3 var(--font-text); color: var(--u-muted);
}
.lib__cat span { background-color: inherit; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib__cat em { background-color: inherit; font-style: normal; font-family: var(--font-mono); font-size: 13px; color: var(--u-soft); }
.lib__cat:hover { background: var(--u-fill); color: var(--u-ink); }
.lib__cat.is-on { background: var(--u-fill-2); color: var(--u-ink); font-weight: 500; }
.lib__cat.is-on em { color: var(--u-muted); }
.lib__cat:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }

/* right pane: search, tags, the count line, the results */
.lib__main { display: flex; flex-direction: column; min-height: 0; padding: 16px 20px 0; gap: 12px; }
.lib__searchrow { display: flex; align-items: center; gap: 12px; }
.lib__searchrow > .t-label { flex: none; color: var(--u-muted); }
.lib__field {
  position: relative; flex: 1; display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 4px 0 12px; border-radius: 8px;
  background: var(--u-fill); box-shadow: inset 0 0 0 1px var(--u-line-2);
}
.lib__field .ui-icon { width: 16px; height: 16px; flex: none; color: var(--u-muted); }
.lib__field input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: 400 15px/1.4 var(--font-text); color: var(--u-ink); }
.lib__field input::placeholder { color: var(--u-soft); }
.lib__field:focus-within { box-shadow: inset 0 0 0 1px var(--action), 0 0 0 3px color-mix(in oklab, var(--action) 22%, transparent); }
.lib__clear {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--u-muted);
}
.lib__clear:hover { background: var(--u-fill-2); color: var(--u-ink); }
.lib__clear svg { width: 14px; height: 14px; }

.lib__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.lib__tag {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border-radius: 6px; border: 1px solid var(--u-line-2); background: var(--u-bg);
  font: 400 13px/1 var(--font-text); color: var(--u-muted); cursor: pointer;
}
.lib__tag em { font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--u-soft); }
.lib__tag:hover { border-color: color-mix(in oklab, var(--u-ink) 30%, transparent); color: var(--u-ink); }
.lib__tag.is-on { background: var(--u-ink); border-color: var(--u-ink); color: var(--u-bg); }
.lib__tag.is-on em { color: color-mix(in oklab, var(--u-bg) 75%, var(--u-ink)); }
.lib__tag:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.lib__tag--more { border-style: dashed; }

.lib__status { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--u-muted); }
.lib__status p { margin: 0; }
.lib__field input[type="search"]::-webkit-search-cancel-button { display: none; }
.lib__status b { font-weight: 500; color: var(--u-ink); font-family: var(--font-mono); }
.lib__status .where { color: var(--u-soft); }
.lib__reset {
  height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--u-line-2);
  background: var(--u-bg); font: 500 13px/1 var(--font-text); color: var(--u-ink); cursor: pointer;
}
.lib__reset:hover { background: var(--u-fill); }
.lib__reset:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

.lib__list { list-style: none; margin: 0; padding: 0 20px 20px; overflow-y: auto; min-height: 0; flex: 1; scrollbar-width: thin; }
.lib__row > a {
  background-color: var(--u-bg);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 13px 0; text-decoration: none; color: inherit;
  border-top: 1px solid var(--u-line);
}
.lib__row:first-child > a { border-top: 0; }
.lib__row > a:hover .lib__name { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--action); }
.lib__row > a:hover { background: color-mix(in oklab, var(--u-ink) 3%, transparent); }
.lib__row > a:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; border-radius: 4px; }
.lib__rowmain { display: block; min-width: 0; background-color: inherit; }
.lib__name { display: block; background-color: inherit; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--u-ink); }
.lib__name b { font-weight: 500; box-shadow: inset 0 -6px 0 color-mix(in oklab, var(--action) 16%, transparent); }
.lib__desc { display: block; background-color: inherit; margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--u-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib__desc b { font-weight: 500; color: var(--u-ink); }
.lib__meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 2px; }
.lib__chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px;
  background: var(--u-fill-2); color: var(--u-ink); font-size: 13px; line-height: 1; white-space: nowrap;
}
.lib__chips { display: flex; gap: 6px; }
.lib__chips .lib__chip { background: var(--u-fill); box-shadow: inset 0 0 0 1px var(--u-line-2); color: var(--u-muted); }
.lib__empty { padding: 40px 0 48px; display: grid; gap: 16px; justify-items: start; }
.lib__empty p { margin: 0; font-size: 16px; color: var(--u-muted); }
.lib__more { margin: 0; background-color: var(--u-bg); padding: 12px 0 4px; font-size: 13px; color: var(--u-soft); }

@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--u-line); }
  .app > .app__pane--list::after { display: none; }
  .lib__cats { padding: 12px 16px; }
  .lib__cats ul { flex-direction: row; flex-wrap: wrap; gap: 8px; overflow: visible; }
  .lib__cat { width: auto; min-height: 40px; padding: 0 12px; border: 1px solid var(--u-line-2); border-radius: 6px; }
  .lib__cat.is-on { background: var(--u-ink); border-color: var(--u-ink); color: var(--u-bg); }
  .lib__cat.is-on em { color: color-mix(in oklab, var(--u-bg) 75%, var(--u-ink)); }
  .lib__main { padding: 16px 16px 0; }
  .lib__list { padding: 0 16px 16px; }
}
@media (max-width: 639px) {
  .lib__searchrow { flex-direction: column; align-items: stretch; gap: 8px; }
  .lib__cat { min-height: 44px; }
  .lib__tag { height: 44px; padding: 0 12px; font-size: 14px; }
  .lib__reset { height: 44px; padding: 0 16px; font-size: 14px; }
  .lib__list { max-height: 46vh; }
  .lib__desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .lib__row > a { flex-direction: column; gap: 8px; }
  .lib__meta { flex-direction: row; align-items: center; }
}

/* ---------------------------------------------------------------- features (one --p-h per group) */
#features .panel { --p-h: 336px; }
#features .stage > .dg { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (min-width: 640px) and (max-width: 1023px) {
  #features { --h: 1; }
  #features.g2 > .wrap { display: flex; flex-direction: column; row-gap: var(--s-6); }
  #features.g2 > .wrap > * { align-self: stretch; }
  #features .panel { --p-h: 240px; }
}
@media (max-width: 639px) {
  #features .panel { --p-h: 190px; }
  #features .stage { --fade-h: 24px; }
  #features .ui-toggles__list .ui-tg:nth-of-type(n+4) { display: none; }
}
/* the search mock ends whole above its panel's fade at every width: two result rows, no foot
   line, and the mock starts 16px under its panel's top (the fragment's own --ay is inline) */
@media (max-width: 1023px) {
  #features .ui-search__list .ui-search__row:nth-of-type(n+3) { display: none; }
  #features .ui-search__foot { display: none; }
  #features .panel:has(.ui-search) { --p-h: 260px; }
  #features .stage > .at-rise { top: 16px; }
}
/* the phone's first screen group holds head + two cards (SR-2): the search panel keeps its rows
   whole above the fade and still fits the group's screen */
@media (max-width: 639px) { #features .panel:has(.ui-search) { --p-h: 210px; } }
/* the search mock's cycle keeps every line at running-text strength: the old results step aside
   at a softer ink (still 5:1) and the new ones take their place at once, so no line is ever
   half-drawn while it fades (text-contrast, fade-cut) */
#features .ui-search__row.is-hidden { opacity: 1; transform: none; }
#features .ui-search__row.is-stale { opacity: 1; }
#features .ui-search__row.is-stale .ui-search__t,
#features .ui-search__row.is-stale .ui-search__m { color: var(--u-soft); }
/* one cadence per card loop (motion.md, 2.5-4 s): the search caret blinks three times on the loop's
   cycle --m-cycle instead of its own 1 s timer (kit: ui/search/fragment.css), which reads as blinking */
[data-ui-loop] .ui-search__caret { animation: caret-on-cycle var(--m-cycle, 3.2s) steps(1) infinite; }
@keyframes caret-on-cycle {
  0%, 15% { opacity: 1; } 16.66%, 31.66% { opacity: 0; }
  33.33%, 48.33% { opacity: 1; } 50%, 65% { opacity: 0; }
  66.66%, 81.66% { opacity: 1; } 83.33%, 100% { opacity: 0; }
}
.ui-search__ico { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--u-tile); box-shadow: var(--u-tile-edge); }
.ui-search__ico img { width: 14px; height: 14px; }
.ui-search__m { flex: none; margin-left: 8px; color: var(--u-soft); white-space: nowrap; }
.ui-search__foot { font-size: 12px; }

/* ---------------------------------------------------------------- statement moments */
#ripples .section-head { max-width: none; gap: var(--s-6); }
.statement .mo-la__type, .statement .mo-lt__type { margin-top: 0; }
/* the moment keeps space-separated words together; CJK breaks between its letters instead */
html body .mo-la.is-live .mo-w { white-space: normal; }

/* both diagrams are held still (data-dg-still + motion.pulse none): their node colours settle at once */
#categories .dg-node, #categories .dg-line, #categories .dg-e,
#features .dg-node, #features .dg-line, #features .dg-e { transition: none; }

/* ---------------------------------------------------------------- categories diagram
   the section's one visual: it takes what the screen leaves under the head row, at every width */
#categories .cat-panel { flex: 1 1 0; min-height: 440px; --p-h: 440px; }
#categories .cat-panel > .dg { width: 100%; height: 100%; }
@media (min-width: 640px) and (max-width: 1023px) { #categories .cat-panel { min-height: 640px; } }
@media (min-width: 640px) and (max-width: 1023px) and (min-height: 1100px) { #categories .cat-panel { min-height: 800px; } }
@media (max-width: 639px) { #categories .cat-panel { min-height: 460px; } }

/* ---------------------------------------------------------------- faq */
@media (max-width: 639px) { .faq > .faq__item { padding: var(--s-2) 0; } }
.faq { padding-top: 4px; }
/* the six questions sit in their one screen at every width: the list fills its column and its rows
   take the screen's rest between them, so the section's air is even above and below (SR-3) */
#faq .grid { flex: 1 1 auto; align-items: stretch; grid-template-rows: auto 1fr; }
@media (min-width: 1024px) { #faq .grid { grid-template-rows: 1fr; } }
#faq .span-6 { min-height: 0; }
#faq .faq { height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.faq-ico { width: 24px; height: 24px; margin-right: 8px; vertical-align: -0.3em; color: var(--action); }

/* ---------------------------------------------------------------- the mocks' own palette
   the kit mixes its muted text from --fx-muted; on the lit sand ground and over the mocks' own
   panels it must clear 4.5:1 like any running text (text-contrast), so the page darkens two steps */
.ui, :where(.ui) { --fx-muted: #4f4a3c; --u-muted: #4f4a3c; --u-soft: #514b3b; }

/* the nav at phone and tablet: the menu button's icon ends on the content's right edge
   (its 44px hit area stays inside the wrap), so the bar starts and ends on the two edges */
@media (max-width: 1023px) { .nav__toggle { justify-items: end; padding-right: 0; } }

/* the hero's seam matches every other seam on a phone (SR-3): its content ends --hpadb above
   the fold, and the fold's room below counts like any section's padb + bar (the kit zeroes --bar
   on the hero; the seam rule wants the phone's uniform gap) */
@media (max-width: 639px) {
  .hero { --hpadb: 96px; --hgap: 24px; }
  /* the fold must hold the longest headline the stress writes (48 characters): the art is the
     part that gives, and only then -- its real height on a phone stays well above this */
  .hero__art { min-height: 120px; }
}

/* the nav marks the section on screen: a line of the action colour under its link */
.nav__link.is-current { color: var(--ink); box-shadow: inset 0 -2px 0 var(--action); }

/* the close block keeps 44px over the columns on a phone: the footer is one screen exactly (SR-2) */
@media (max-width: 639px) { #contact > .wrap { row-gap: 44px; } }

/* ---------------------------------------------------------------- footer tags */
.footer__tags { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 8px; margin: 0; }
.footer__tags a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font: 400 14px/1 var(--font-text); color: var(--muted); text-decoration: none;
}
.footer__tags a:hover { color: var(--ink); border-color: var(--line-strong); }
@media (max-width: 639px) {
  .footer__tags { display: none; }
  .footer__col li:nth-child(2) { display: none; }
}

/* ---------------------------------------------------------------- grounds keep the page's section box
   backgrounds.css gives a ground its own min-height, padding and vertical centring;
   the page's section box (layout-v4.md: --padt at the top, one or two screens) wins, the ground stays */
@media (min-width: 640px) {
  #categories.bg-mist {
    min-height: calc(var(--h, 1) * 100svh);
    padding-block: var(--padt) calc(var(--padb) + var(--bar));
    align-content: stretch;   /* the wrap fills the screen so the one visual fills it too */
  }
}
@media (max-width: 639px) {
  #categories.bg-mist {
    min-height: calc(var(--hm, var(--h, 1)) * 100lvh);
    padding-block: var(--padt) calc(var(--padb) + var(--bar));
    align-content: stretch;
  }
}
