/* PartPriced Tools homepage: the workspaces, the "why" strip, the app sections, the status board and the header.
 * Tokens come from style/base.css (colours, Archivo / Instrument Serif / Inter Tight / JetBrains Mono). */

/* ---------- layers, bottom to top. Every page-level layer reads these; the shell's overlays (switcher, drawer,
 * notifications, tour) stay above all of them. --z-mascot matches the layer's z-index from shared/buddy/config.js (15 on
 * the homepage), so the speech bubble, which lives inside that layer, sits above the consent strip. */
:root {
  --z-grain: 1;       /* the film grain (style/base.css) */
  --z-consent: 10;    /* the consent strip (shared/consent/banner.css) */
  --z-mascot: 15;     /* Helper, his speech bubble (shared/buddy) */
  --z-toast: 30;      /* the short toast at the bottom (style/footer.css) */
  --z-header: 40;     /* the sticky header (style/base.css) */
  --consent-h: 0px;   /* the consent strip's measured height, set by shared/consent/banner.js */
}
/* Room for the strip: the page's end clears it, and a control scrolled into view (jump link, focus) lands above it
 * and below the sticky header. Both are 0 while no strip is shown. */
body { padding-bottom: var(--consent-h); }
html { scroll-padding-top: calc(var(--top, 64px) + 8px); scroll-padding-bottom: var(--consent-h); } /* the sticky header and the strip; sections and jump links use this */

.home { padding: calc(var(--top, 64px) + 24px) clamp(16px, 4vw, 56px) 40px; max-width: 1280px; margin: 0 auto; }

/* The hero (headline, app globe) and the capability strip are in home/hero.css and home/globe/globe.css. */
/* ---------- why it's different ---------- */
.why { padding: 56px 0 0; }
.why-title { font: 700 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bone-faint); margin: 0 0 16px; }
.why-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.why-grid li { background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 20px; }
.why-grid h3 { margin: 0 0 6px; font: 600 17px/1.3 var(--sans); }
.why-grid p { margin: 0; color: var(--bone-dim); font-size: 14px; }

/* ---------- shelves: Business apps and Creative apps ---------- */
.shelf { padding: 64px 0 8px; }
.shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; margin-bottom: 22px; }
.shelf-head h2 { font-family: var(--cond); font-weight: 800; font-stretch: 90%; font-size: clamp(30px, 3.6vw, 44px); margin: 0; letter-spacing: -.01em; }
.shelf-head p { margin: 0; max-width: 60ch; color: var(--bone-dim); }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.app-card, .tile { display: flex; color: inherit; text-decoration: none; background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .2s, transform .2s; }
.app-card { min-height: 96px; }
.tile { flex-direction: column; }
.app-card:hover, .tile:hover, .app-card:focus-visible, .tile:focus-visible { border-color: var(--tlbx); transform: translateY(-2px); }

/* Compact card: a small thumbnail (screenshot, clip or tile), then name, badge, one line and the link. */
.shot { position: relative; aspect-ratio: 16 / 10; background: color-mix(in srgb, var(--sl-text, #f1ede4) 7%, var(--sl-surface, #17171b)); overflow: hidden; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; pointer-events: none; }
.shot.playing video { opacity: 1; }
.shot-ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--sl-text, var(--bone-faint)); }
.shot.has-img .shot-ph { display: none; }
.shot-ph b { font-family: var(--cond); font-size: 22px; color: color-mix(in srgb, var(--sl-text, #f1ede4) 78%, transparent); }
.shot-icon { width: 48px; height: 48px; fill: none; stroke: var(--tlbx); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.app-card .shot { flex: 0 0 92px; width: 92px; aspect-ratio: auto; align-self: stretch; }
.app-card .shot-ph { padding: 8px; text-align: center; gap: 6px; }
.app-card .shot-ph b { font-size: 13px; line-height: 1.2; color: color-mix(in srgb, var(--sl-text, #f1ede4) 78%, transparent); }
.app-card .shot-icon { width: 30px; height: 30px; }
.app-body, .tile-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.app-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.app-name h3 { margin: 0; font-size: 16px; font-weight: 600; }
.tile .app-name h3 { font-size: 16px; }
.app-tag, .tile-body p { margin: 0; color: var(--bone-dim); font-size: 14px; line-height: 1.4; }
.go { margin-top: auto; padding-top: 4px; font: 600 12px var(--mono); color: var(--tlbx); }
.badge { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 3px 7px; border-radius: 99px; border: 1px solid currentColor; }
.badge.live { color: var(--tlbx); }
.badge.beta { color: #5cc8ff; }
.badge.building { color: #ffa23a; }

/* ---------- status board ---------- */
.status-sum { color: var(--bone-dim); }
.status-board { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.status-row { display: grid; grid-template-columns: 14px minmax(120px, 180px) 100px 130px 1fr; gap: 14px; align-items: center; padding: 12px 18px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); font-size: 14px; }
.status-row:first-child { border-top: 0; }
.status-row:hover { background: var(--ink-2); }
.status-row .kind, .status-row .state { font: 12px var(--mono); color: var(--bone-faint); }
.status-row .tagline { color: var(--bone-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tlbx); box-shadow: 0 0 10px var(--tlbx); }
.dot.beta { background: #5cc8ff; box-shadow: 0 0 10px #5cc8ff; }
.dot.building { background: #ffa23a; box-shadow: 0 0 10px #ffa23a; }

@media (max-width: 760px) {
  .status-row { grid-template-columns: 14px 1fr auto; }
  .status-row .kind, .status-row .tagline { display: none; }
}
@media (max-width: 420px) {
  .app-card .shot { flex-basis: 76px; width: 76px; }
}

/* Choose a workspace: a row of layout presets, each opens its app with ?layout= set. */
.workspaces { padding: 56px 0 0; }
.ws-title { font: 700 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bone-faint); margin: 0 0 8px; }
.ws-lede { margin: 0 0 16px; color: var(--bone-dim); font-size: 15px; max-width: 60ch; }
.ws-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.ws-card { display: grid; gap: 6px; height: 100%; box-sizing: border-box; padding: 16px 18px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; transition: border-color .2s; }
.ws-card:hover, .ws-card:focus-visible { border-color: var(--bone-faint); }
.ws-card b { font: 600 16px/1.3 var(--sans); }
.ws-card span { color: var(--bone-dim); font-size: 14px; }

/* ---------- Guided tours menu: the nav's Tours button opens this modal (markup in shared/tour/mount.js) ---------- */
.stour-menu { inset: 0; margin: auto; box-sizing: border-box; width: min(580px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--ink-2); color: var(--bone); font: 14px/1.45 var(--sans); box-shadow: 0 24px 70px rgba(0, 0, 0, .6); }
.stour-menu[open] { display: flex; flex-direction: column; }
.stour-menu::backdrop { background: rgba(0, 0, 0, .6); }
.stour-menu-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 0; }
.stour-menu-head h2 { flex: 1; min-width: 0; margin: 0; font: 800 26px/1.1 var(--cond); letter-spacing: -.01em; }
.stour-menu-x { width: 36px; height: 36px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--bone-dim); font-size: 20px; line-height: 1; cursor: pointer; }
.stour-menu-x:hover { color: var(--bone); border-color: var(--bone-faint); }
.stour-menu-lede { margin: 8px 20px 14px; color: var(--bone-dim); }
.stour-search { box-sizing: border-box; display: block; width: calc(100% - 40px); min-height: 40px; margin: 0 20px 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ink); color: var(--bone); font: inherit; }
.stour-search::placeholder { color: var(--bone-faint); }
.stour-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0 20px 20px; list-style: none; overflow: auto; }
.stour-grid li { min-width: 0; }
.stour-grid li[hidden], .stour-empty[hidden] { display: none !important; }
.stour-card { display: flex; align-items: flex-start; gap: 12px; height: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink); color: inherit; text-decoration: none; transition: border-color .2s; }
.stour-card:hover, .stour-card:focus-visible { border-color: var(--tlbx); }
.stour-icon { flex: none; width: 40px; height: 40px; }
.stour-card-text { display: grid; gap: 3px; min-width: 0; }
.stour-card-text strong { font: 600 15px/1.25 var(--cond); }
.stour-card-desc { color: var(--bone-dim); font-size: 13px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stour-empty { margin: 0 20px 20px; color: var(--bone-dim); }
.stour-menu-x:focus-visible, .stour-search:focus-visible, .stour-card:focus-visible { outline: 2px solid var(--tlbx); outline-offset: 2px; }
@media (max-width: 600px) {
  .stour-menu { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .stour-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- the finder, right under the hero and the capability strip ---------- */
.finder-top { padding: 4px 0 0; }
.finder-host { min-width: 0; }
.finder-host .fd-big .fd-input { font-size: 18px; }
/* Jump links under the hero: one per section that is showing. */
.jump-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0 0; min-width: 0; }
.jump-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--sl-border); border-radius: 999px;
  color: var(--sl-text); text-decoration: none; font-size: 14px; max-width: 100%; overflow-wrap: anywhere; background: var(--sl-surface); }
.jump-link:hover { border-color: var(--sl-accent); }
.jump-link:focus-visible { outline: 2px solid var(--sl-accent); outline-offset: 2px; }
@media (max-width: 420px) {
  .jump-link { flex: 1 1 auto; justify-content: center; }
}

/* ---------- header: the shell's search and bell keep their contrast in every theme, and the row never overlaps.
 * The shell paints them in a fixed light colour, which is near-invisible on the light and Classic themes; they take the
 * theme's text colour here instead (4.5:1 for the Apps label and 3:1 for the icons, checked in tests/home/layout-overlap). */
.nav > * { flex: none; }
.nav .tabs { flex: none; }   /* never squeezed under the header buttons: they drop their labels instead (shared/ui/hbtn.js) */
.nav { --tlbx-hbtn-h: 36px; }
.nav .tab { color: var(--bone-dim); }
.nav .tab:hover { color: var(--bone); }
/* the room the shell's buttons and the Tour button take, kept in the HTML so the header does not move when they come;
 * like them it narrows when the header is full (their labels give way to icons) */
.nav .sh-hdr-slot { flex: 0 1 207px; min-inline-size: 116px; block-size: 36px; }
.nav .stour-slot { flex: 0 1 75px; min-inline-size: 36px; block-size: 36px; }
/* the app finder is built by script: until then it keeps a screen's height, so what follows it is below the fold and
 * does not move when it comes */
.finder-host:empty { min-block-size: 100svh; }
.nav .sh-hdr {
  --sh-fg: var(--sl-text, #f1ede4);
  --sh-dim: var(--sl-text, #f1ede4);
  --sh-line: color-mix(in srgb, var(--sl-text, #f1ede4) 45%, transparent);
  --sh-sel: color-mix(in srgb, var(--sl-text, #f1ede4) 12%, transparent);
  color: var(--sl-text, #f1ede4);
}
.nav .sh-hbtn { color: var(--sl-text, #f1ede4); }

/* the helper's toggle (shared/buddy/boot.js) is a fixed button at the bottom right, where the strip's buttons are. While the
 * strip shows, lift it by the strip's height (translate leaves its saved position alone). */
.buddy-toggle { translate: 0 calc(var(--consent-h, 0px) * -1); }

/* The switch above the app sections: shows "Tlbx" in the app names. */
.names-switch { display: inline-flex; align-items: center; gap: .5em; margin: 0 0 1.2em; font-size: .92rem; cursor: pointer; }

/* The finder is filled in by script after the first paint: reserve its height so the sections below do not jump. */
.finder-host { min-height: 211px; }

/* The video: a thumbnail kept on this site (assets/video), linking to the video on YouTube. Sized so it never shifts the page. */
.hero-video { display: flex; gap: 12px; align-items: center; margin-top: 22px; max-width: 440px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.hero-video img { width: 170px; max-width: 40%; height: auto; border-radius: 8px; flex: 0 0 auto; }
.hero-video b { color: var(--tlbx); }
.hero-video span { font-size: 15px; }

/* Header: the section tabs and the tools sit at the right, each with its icon (a mask in the text colour, so they follow the theme). */
.nav .tabs { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav .tab { display: inline-flex; align-items: center; gap: 7px; }
.nav .tab::before, .nav .top-btn::before { content: ''; width: 16px; height: 16px; flex: 0 0 auto; background: currentColor; }
.nav .tab[href="#apps"]::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Crect x=%223%22 y=%223%22 width=%227%22 height=%227%22 rx=%221.5%22/%3E%3Crect x=%2214%22 y=%223%22 width=%227%22 height=%227%22 rx=%221.5%22/%3E%3Crect x=%223%22 y=%2214%22 width=%227%22 height=%227%22 rx=%221.5%22/%3E%3Crect x=%2214%22 y=%2214%22 width=%227%22 height=%227%22 rx=%221.5%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Crect x=%223%22 y=%223%22 width=%227%22 height=%227%22 rx=%221.5%22/%3E%3Crect x=%2214%22 y=%223%22 width=%227%22 height=%227%22 rx=%221.5%22/%3E%3Crect x=%223%22 y=%2214%22 width=%227%22 height=%227%22 rx=%221.5%22/%3E%3Crect x=%2214%22 y=%2214%22 width=%227%22 height=%227%22 rx=%221.5%22/%3E%3C/svg%3E") center / contain no-repeat; }
.nav .tab[href="#status"]::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M2 12h4l2.5-6 4.5 12 2.5-6H22%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M2 12h4l2.5-6 4.5 12 2.5-6H22%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") center / contain no-repeat; }
.nav .tab[href^="settings"]::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Ccircle cx=%2212%22 cy=%228%22 r=%224%22 fill=%22%23000%22/%3E%3Cpath d=%22M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7z%22 fill=%22%23000%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Ccircle cx=%2212%22 cy=%228%22 r=%224%22 fill=%22%23000%22/%3E%3Cpath d=%22M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7z%22 fill=%22%23000%22/%3E%3C/svg%3E") center / contain no-repeat; }
.nav .top-btn { display: inline-flex; align-items: center; gap: 7px; }
.nav .top-btn::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M7 4.5v15l13-7.5z%22 fill=%22%23000%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M7 4.5v15l13-7.5z%22 fill=%22%23000%22/%3E%3C/svg%3E") center / contain no-repeat; }

/* Phones: the tabs take a row of their own under the brand, spread across the width. */
@media (max-width: 720px) {
  .nav { flex-wrap: wrap; row-gap: 8px; }
  .nav .tabs { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  /* the install button (shown late, only when the browser offers an install) comes last on the first row, an icon, so
   * nothing before it moves and the row never wraps */
  .nav .pwa-install { order: 2; }
}
/* under 560px the header buttons are icons only (shared/ui/hbtn.css): their slots start at that size, since a wrapping
 * row breaks before it shrinks anything, and a slot too wide would put the row on two lines until they come */
@media (max-width: 560px) {
  .nav .sh-hdr-slot { flex-basis: 116px; }
  .nav .stour-slot { flex-basis: 36px; }
}
