/* ==================================================================================================================
   Home page redesign pilot (w42 taste; docs/HOME_TASTE.md). Loaded ONLY by the platform home (pages.ts overviewPage),
   every rule scoped under html.uw-home, so tool pages, app pages and the apps themselves are unchanged.
   tasteskill 2.5.1 deal: kind software · hero product (a real app screenshot) · palette cool-white-slate · type Funnel
   Display / Funnel Sans (self-hosted, OFL) · radius soft · buttons solid · rhythm space · close close-word.
   One section per screen (--h 1 or 2 screens), equal edges on one 1280px wrap with a 12-column grid.
   The kit's motion layer (public/taste/motion/motion.css, unchanged) does every hover, press and the hero entrance.
   ================================================================================================================== */


/* ---------------------------------------------------------------- tokens (palette as start.mjs printed it; dark derived) */
html.uw-home {
  /* palette and type come from the site system (styles.css :root, light and dark); only page-level rhythm here */
  --uh-card: var(--surface); --uh-line: var(--line); --uh-tint: var(--info-bg);
  --wrap: 1280px; /* the home's one wrap: the shared header, every section and the footer use it (equal edges) */
  --display-weight: 500; --display-tracking: -0.03em; --display-tracking-xl: -0.04em;
  /* rhythm (system.md): section padding, wrap gutter; --uh-hdr = the shared header above the hero */
  --padt: 120px; --padb: 72px; --gut: 80px; --uh-hdr: 65px; --uh-gap: 24px;
  --t-h1: 72px; --t-h2: 48px; --t-h3: 22px; --t-lead: 20px;
  --r-lg: 20px; --r-md: 12px; --r-sm: 8px; --r-btn: 8px; --btn-h: 48px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
}
@media (max-width: 1179px) { html.uw-home { --gut: 48px; --t-h1: 60px; --t-h2: 40px; } }
@media (max-width: 640px) {
  html.uw-home { --uh-hdr: 57px; --gut: 24px; --padt: 96px; --padb: 48px; --t-h1: 40px; --t-h2: 30px; --t-h3: 20px; --t-lead: 18px; --uh-gap: 12px; }
}

/* ---------------------------------------------------------------- page ground, sections, wrap */
html.uw-home body { background: var(--p-bg); }
html.uw-home main#main { background: var(--p-bg); color: var(--p-ink); font-family: var(--font-text); font-size: 16px; line-height: 1.6; }
.uw-home .uh-sec {
  --ink: var(--p-ink); --muted: var(--p-muted); --accent: var(--p-accent); --action: var(--p-action);
  box-sizing: border-box; display: flex; flex-direction: column; min-height: calc(var(--h, 1) * 100svh);
  margin: 0; padding: var(--padt) 0 var(--padb); background: var(--p-bg); color: var(--p-ink);
}
.uw-home .uh-g2 { --h: 2; }
/* one wrap for the shared header, every section and the footer: the header's own lines (styles.css .wrap at 1440px) */
/* The wrap's box IS the content column (no inline padding), so its edges are the page's two lines: max 1280 - 2 x 28. */
.uw-home .uh-wrap, html.uw-home .site-header > .wrap.header-inner, html.uw-home .site-footer > .wrap { box-sizing: border-box; width: calc(100% - 2 * clamp(16px, 4vw, 28px)); max-width: calc(var(--wrap) - 56px); margin-inline: auto; padding-inline: 0; }
.uw-home .uh-sec :is(h1, h2, h3) { font-family: var(--font-display); font-weight: var(--display-weight); color: var(--p-ink); text-wrap: balance; }
.uw-home .uh-sec h2 { margin: 0; font-size: var(--t-h2); line-height: 1.08; letter-spacing: var(--display-tracking); max-width: 20ch; }
.uw-home .uh-sec h3, .uw-home .uh-sec .uw-day-title { margin: 0; font-size: var(--t-h3); line-height: 1.25; letter-spacing: -0.01em; }
.uw-home .uh-sec p { margin: 0; }
.uw-home .uh-sec :where(a:not(.btn, .link)) { color: inherit; }
.uw-home .uh-lead { font-size: var(--t-lead); line-height: 1.5; color: var(--p-ink); max-width: 62ch; }
:lang(ar) .uw-home .uh-sec :is(h1, h2, h3), html.uw-home:lang(ar) .uh-sec :is(h1, h2, h3) { letter-spacing: 0; }

/* text link with the drawn underline (motion.css .link draws it on hover) */
.uw-home .uh-sec .link { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: var(--p-action); font-weight: 500; text-decoration: none; }

/* ---------------------------------------------------------------- buttons (one pair; motion.css steps and presses) */
.uw-home .btn {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--btn-h); padding: 0 24px; border-radius: var(--r-btn); border: 1px solid transparent;
  font: 500 16px/1 var(--font-text); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.uw-home .btn--primary { background: var(--p-action); color: var(--p-action-ink); }
.uw-home .btn--primary:hover { background: color-mix(in srgb, var(--p-action) 88%, var(--p-ink)); color: var(--p-action-ink); }
.uw-home .btn--secondary { background: transparent; color: var(--p-ink); border-color: color-mix(in srgb, var(--p-ink) 35%, transparent); }
.uw-home .btn--secondary:hover { background: var(--p-surface); color: var(--p-ink); }
.uw-home .btn .m-arrow { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .uw-home .btn .m-arrow, html.uw-home[dir="rtl"] .btn .m-arrow { transform: scaleX(-1); }
.uw-home .uh-btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------------------------------------------------------- hero: head row, then the app screenshot to the fold */
.uw-home .uh-hero { min-height: 100svh; padding: calc(var(--uh-hdr) + 48px) 0 40px; background: var(--p-bg); }
/* the platform tagline under the wordmark repeats the hero; on the home the header shows the wordmark alone */
html.uw-home .site-header .brand-tagline { display: none; }
/* The shared header is fixed over the page on the home at every width (sticky elsewhere, static on other phones' pages;
   same look): the hero starts at the top of the screen, every section on a whole screen with the bar over its top padding. */
html.uw-home .site-header { position: fixed; top: 0; inset-inline: 0; }
html.uw-home { scroll-padding-top: var(--uh-hdr); }
@media (max-width: 640px) { .uw-home .uh-hero { padding-top: calc(var(--uh-hdr) + 24px); } }
.uw-home .uh-hero-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--uh-gap); align-items: start; }
.uw-home .uh-hero-title { grid-column: 1 / span 7; }
.uw-home .uh-hero-side { grid-column: 8 / span 5; display: grid; gap: 24px; }
.uw-home .uh-hero h1 { margin: 0; font-size: var(--t-h1); line-height: 1.02; letter-spacing: var(--display-tracking-xl); }
.uw-home .uh-h1-main { display: block; }
.uw-home .uh-h1-main::first-letter { text-transform: uppercase; }
.uw-home .uh-hero .uh-lead { font-size: 18px; color: var(--p-ink); }
/* The screenshot sits on the wrap's lines (equal edges with the text and the header; the seasonal margin art stays
   outside it): a framed window that runs to the fold. */
.uw-home .uh-stage { position: relative; flex: 1 1 auto; box-sizing: border-box; width: min(calc(100% - 2 * clamp(16px, 4vw, 28px)), calc(var(--wrap) - 56px)); min-height: 240px; margin: 40px auto 0; overflow: hidden; border: 1px solid var(--uh-line); border-radius: var(--r-lg); background: var(--p-surface); }
.uw-home .uh-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
html.uw-home[data-theme="dark"] .uh-stage img { filter: brightness(.9); }
@media (prefers-color-scheme: dark) { html.uw-home:not([data-theme="light"]) .uh-stage img { filter: brightness(.9); } }

/* ---------------------------------------------------------------- section heads and the two-screen groups */
.uw-home .uh-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--uh-gap); align-items: end; margin-bottom: 48px; }
.uw-home .uh-head > h2 { grid-column: 1 / span 6; }
.uw-home .uh-head-side { grid-column: 8 / span 5; color: var(--p-ink); font-size: 17px; line-height: 1.55; }
.uw-home .uh-head-side .link { margin-inline-start: 4px; }
.uw-home .uh-g2 > .uh-wrap { display: grid; grid-template-rows: repeat(2, calc(100svh - var(--padt) - var(--padb))); row-gap: calc(var(--padt) + var(--padb)); }
/* the popular apps' second row sits in the middle of its screen, so the gap to #goals matches the page rhythm */
.uw-home #apps > .uh-wrap > .uh-screen:nth-child(2) { align-self: center; }

/* ---------------------------------------------------------------- popular apps: linked cards with a real screenshot */
.uw-home .uh-apps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--uh-gap); }
.uw-home .uh-app { position: relative; display: flex; flex-direction: column; margin: 0; padding: 0; overflow: hidden; background: var(--uh-card); border: 1px solid var(--uh-line); border-radius: var(--r-lg); box-shadow: none; }
.uw-home .uh-app-shot { aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 1px solid var(--uh-line); background: var(--p-surface); }
.uw-home .uh-app-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.uw-home .uh-app-body { display: grid; gap: 12px; padding: 20px 24px 24px; }
.uw-home .uh-app-head { display: flex; align-items: center; gap: 12px; }
.uw-home .uh-app-head .app-logo { flex: none; border-radius: 10px; }
.uw-home .uh-app-link { text-decoration: none; }
.uw-home .uh-app-link::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.uw-home .uh-app:has(.uh-app-link:focus-visible) { outline: 2px solid var(--p-action); outline-offset: 3px; }
.uw-home .uh-app-kind { font-size: 14px; color: var(--p-muted); }
.uw-home .uh-app-tagline { font-size: 16px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------- apps by goal: real icons and names, 44px rows */
.uw-home .uh-goals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--uh-gap); align-items: stretch; }
.uw-home .uh-goal { margin: 0; padding: 24px; background: var(--uh-card); border: 1px solid var(--uh-line); border-radius: var(--r-lg); }
.uw-home .uh-goal h3 a { text-decoration: none; }
.uw-home .uh-goal h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.uw-home .uh-goal-text { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--p-ink); min-height: 3em; }
.uw-home .uh-goal-apps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 0; }
.uw-home .uh-goal-apps li { margin: 0; }
.uw-home .uh-goal-apps a { display: flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; font-weight: 500; border-radius: var(--r-sm); }
.uw-home .uh-goal-apps a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.uw-home .uh-goal-apps .app-logo { flex: none; border-radius: 7px; }

/* ---------------------------------------------------------------- what runs where: the statement (word-highlight) */
.uw-home .home-local h2 { margin-bottom: 48px; }
.uw-home .uh-statement { font-family: var(--font-display); font-size: clamp(30px, 2.4vw + 20px, 56px); line-height: 1.16; letter-spacing: -0.025em; max-width: 34ch; color: var(--p-ink); }
.uw-home .uh-statement strong { font-weight: inherit; }
.uw-home .uh-local-list { list-style: none; margin: 48px 0 8px; padding: 0; display: grid; gap: 8px; max-width: 62ch; color: var(--p-ink); font-size: 17px; }
.uw-home .uh-local-list li { margin: 0; }

/* ---------------------------------------------------------------- splits: text left, the picture right (tools, method) */
.uw-home .uh-split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--uh-gap); align-items: start; }
.uw-home .uh-split-text { grid-column: 1 / span 6; display: grid; gap: 24px; align-content: start; }
.uw-home .uh-split > :last-child:not(.uh-split-text) { grid-column: 8 / span 5; }
.uw-home .uh-split-text h2 { margin-bottom: 8px; }
.uw-home .uh-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 32px; }
.uw-home .uh-stats li { display: grid; gap: 0; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.uw-home .uh-stats strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 38px; line-height: 1.1; color: var(--p-ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.uw-home .uh-stats span { font-size: 14px; color: var(--p-muted); }
.uw-home .home-tools .tool-search { margin: 0; max-width: none; padding: 0; background: none; border: 0; box-shadow: none; }
.uw-home .home-tools .tool-search label { font-weight: 500; font-size: 14px; color: var(--p-muted); }
.uw-home .home-tools .tool-search input { border-radius: var(--r-sm); }
.uw-home .home-tools .tool-search button { border-radius: var(--r-btn); background: var(--p-action); color: var(--p-action-ink); border: 0; font-weight: 500; }
.uw-home .uh-links { display: flex; flex-wrap: wrap; gap: 4px 24px; }

/* the quick tasks as a window of real tools (live links into the tool pages) */
.uw-home .uh-window { margin: 0; overflow: hidden; background: var(--uh-card); border: 1px solid var(--uh-line); border-radius: var(--r-lg); }
.uw-home .uh-window-bar { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--uh-line); background: var(--p-surface); font-size: 14px; font-weight: 500; color: var(--p-muted); }
.uw-home .uh-dots { display: inline-flex; gap: 6px; }
.uw-home .uh-dots i { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in srgb, var(--p-ink) 22%, transparent); }
.uw-home .uh-quick { list-style: none; margin: 0; padding: 8px; display: grid; }
.uw-home .uh-quick li { margin: 0; }
.uw-home .uh-quick a { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 14px; align-items: baseline; padding: 14px 14px; border-radius: var(--r-md); text-decoration: none; }
.uw-home .uh-quick a:hover { background: var(--p-surface); }
.uw-home .uh-quick-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent, var(--p-accent)); align-self: center; grid-row: 1; }
.uw-home .uh-quick-name { grid-column: 2; font-weight: 500; font-size: 17px; }
.uw-home .uh-quick-line { grid-column: 2; font-size: 16px; color: var(--p-ink); line-height: 1.45; }

/* how results are checked: posts and the feedback invitation beside the text */
.uw-home .uh-side { display: grid; gap: var(--uh-gap); align-content: start; }
.uw-home .uh-posts { padding: 24px; background: var(--uh-card); border: 1px solid var(--uh-line); border-radius: var(--r-lg); box-shadow: none; display: grid; gap: 12px; }
.uw-home .uh-posts .start-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.uw-home .uh-posts .start-posts li { margin: 0; border-bottom: 1px solid var(--uh-line); }
.uw-home .uh-posts .start-posts a { display: flex; align-items: center; min-height: 48px; padding-block: 6px; text-decoration: none; font-weight: 500; }
.uw-home .uh-posts .start-posts a:hover { text-decoration: underline; text-underline-offset: 3px; }
.uw-home .home-intro .fb-callout { margin: 0; padding: 24px; background: var(--uh-card); border: 1px solid var(--uh-line); border-radius: var(--r-lg); box-shadow: none; }
.uw-home .home-intro .fb-callout .fb-callout-btn { min-height: 44px; display: inline-flex; align-items: center; padding: 0 20px; border-radius: var(--r-btn); background: transparent; color: var(--p-ink); border: 1px solid color-mix(in srgb, var(--p-ink) 35%, transparent); font-weight: 500; }
.uw-home .home-intro .fb-callout .fb-callout-btn:hover { background: var(--p-surface); color: var(--p-ink); text-decoration: none; filter: none; }
.uw-home .home-intro .fb-callout-icon { color: var(--p-action); }
.uw-home .uh-sec .card::before { content: none; }
.uw-home .uh-sec .card:hover { border-color: var(--uh-line); box-shadow: none; }

/* on this day in science: the day's picture large beside its text */
.uw-home .uh-day .uw-day { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--uh-gap); margin: 0; background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.uw-home .uh-day .uw-day-h { grid-column: 1 / -1; padding: 0 0 48px; font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--t-h2); line-height: 1.08; letter-spacing: var(--display-tracking); text-transform: none; color: var(--p-ink); }
.uw-home .uh-day .uw-day-img { grid-column: 1 / span 7; height: auto; aspect-ratio: 1024 / 683; border-radius: var(--r-lg); }
.uw-home .uh-day .uw-day-body { grid-column: 8 / span 5; padding: 0; display: grid; gap: 12px; align-content: start; }
.uw-home .uh-day .uw-day-summary { font-size: 17px; line-height: 1.6; color: var(--p-ink); }
.uw-home .uh-day .uw-day-meta { font-size: 14px; }
.uw-home .uh-day .uw-day a { color: var(--p-action); font-weight: 500; }
.uw-home .uh-day :is(.uw-day-links, .uw-day-all) a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------------------------------------------------------------- close-word: the h2 and the button, the name set wide */
.uw-home .uh-close > .uh-wrap { display: flex; flex-direction: column; flex: 1 1 auto; }
.uw-home .uh-close-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--uh-gap); align-items: end; }
.uw-home .uh-close-row > div { grid-column: 1 / span 7; display: grid; gap: 16px; }
.uw-home .uh-close-row > .uh-btns { grid-column: 8 / span 5; justify-content: flex-start; }
.uw-home .uh-close .uw-ad { margin-top: 48px; }
.uw-home .uh-word { margin-top: auto; padding-top: 24px; }
.uw-home .uh-word .mo-lt__type { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(56px, 11vw, 160px); line-height: .95; letter-spacing: -0.045em; color: var(--p-ink); max-width: none; white-space: nowrap; }

/* latest posts with their cover pictures */
.uw-home .uh-posts .start-posts a { gap: 16px; }
.uw-home .uh-post-cover { flex: none; width: 96px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-sm); background: var(--p-surface); }
.uw-home .uh-post-cover:empty { display: none; }
.uw-home .uh-post-cover img, .uw-home .uh-post-cover picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.uw-home .uh-post-cover .blog-card-cover { display: block; width: 100%; height: 100%; }

/* ---------------------------------------------------------------- 1024 to 1179: tighter, same order */
@media (max-width: 1179px) {
  .uw-home .uh-hero-title { grid-column: 1 / span 7; }
  .uw-home .uh-hero-side { grid-column: 8 / span 5; }
  .uw-home .uh-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uw-home .uh-goal-apps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
  .uw-home .uh-goal-text { min-height: 0; }
}
/* ---------------------------------------------------------------- tablet (640 to 1023): stack text first */
@media (max-width: 1023px) {
  .uw-home .uh-hero-head, .uw-home .uh-head, .uw-home .uh-split, .uw-home .uh-close-row { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .uw-home :is(.uh-hero-title, .uh-hero-side, .uh-head > h2, .uh-head-side, .uh-split-text, .uh-close-row > div, .uh-close-row > .uh-btns) { grid-column: 1 / -1; }
  .uw-home .uh-split > :last-child:not(.uh-split-text) { grid-column: 1 / -1; margin-top: 24px; }
  .uw-home .uh-close-row > .uh-btns { justify-content: flex-start; }
  .uw-home .uh-hero-side { gap: 20px; }
  .uw-home .uh-apps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .uw-home .uh-app-body { padding: 16px; }
  .uw-home .uh-app-tagline { display: none; }
  .uw-home .uh-day .uw-day-img, .uw-home .uh-day .uw-day-body { grid-column: 1 / -1; }
  .uw-home .uh-day .uw-day-body { margin-top: 24px; }
}
/* ---------------------------------------------------------------- phone */
@media (max-width: 640px) {
  .uw-home .uh-hero .uh-lead { font-size: 17px; }
  .uw-home .uh-btns .btn { flex: 1 1 100%; }
  .uw-home .uh-stage { margin-top: 24px; }
  .uw-home .uh-head { margin-bottom: 32px; }
  .uw-home .uh-apps { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .uw-home .uh-app { flex-direction: row; align-items: stretch; }
  .uw-home .uh-app-shot { flex: 0 0 132px; aspect-ratio: auto; border-bottom: 0; border-inline-end: 1px solid var(--uh-line); }
  .uw-home .uh-app-body { padding: 14px 16px; gap: 6px; align-content: center; }
  .uw-home .uh-app-head .app-logo { width: 32px; height: 32px; }
  .uw-home .uh-goals { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .uw-home .uh-goal { padding: 16px; }
  .uw-home .uh-goal-text { display: none; }
  .uw-home .uh-goal-apps { grid-template-columns: repeat(auto-fill, 44px); gap: 8px; margin-top: 12px; }
  .uw-home .uh-goal-apps a { justify-content: center; width: 44px; min-height: 44px; }
  .uw-home .uh-goal-apps .app-logo { width: 36px; height: 36px; }
  .uw-home .uh-goal-apps a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .uw-home :is(#tools, #method) { --h: 2; }
  .uw-home .uh-g2 > .uh-wrap { grid-template-rows: none; row-gap: 48px; }
  .uw-home .uh-statement { font-size: 26px; }
  .uw-home .uh-stats strong { font-size: 28px; }
  .uw-home .uh-word .mo-lt__type { font-size: 13.4vw; }
}

/* ---------------------------------------------------------------- forced colours, reduced motion, print */
@media (forced-colors: active) {
  .uw-home :is(.uh-app, .uh-goal, .uh-window, .uh-posts, .fb-callout) { border: 1px solid CanvasText; }
  .uw-home .btn { border: 1px solid ButtonText; }
}
@media print {
  .uw-home .uh-sec { min-height: 0; padding: 24px 0; break-inside: avoid; }
  .uw-home .uh-stage, .uw-home .uh-word { display: none; }
}
