/*
 * home.css — homepage only (2026-09-16 redesign).
 *
 * Hero with "order ticket", trust strip, five category sections with a
 * uniform card grid, and the dark-scheme override. Everything is scoped
 * under body.cr-home so tool pages (out of scope, not dark-safe) are
 * untouched.
 */

body.cr-home { font-family: var(--font-sans); font-size: 0.95rem; }
body.cr-home .container { max-width: var(--maxw); padding: 0 var(--gutter); }

/* =====================================================================
   Hero
   ===================================================================== */
.hh {
    display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2.5rem; align-items: start;
    padding: 3.2rem 0 2.4rem;
}
.hh__kicker {
    font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3); margin: 0 0 0.9rem;
}
.hh__kicker .jp { letter-spacing: 0.3em; margin-left: 0.5rem; }
.hh h1 {
    font-family: var(--font-serif); font-weight: 700; font-size: 44px; line-height: 1.08;
    letter-spacing: -0.02em; color: var(--ink); margin: 0 0 1rem; font-variation-settings: 'opsz' 96;
    text-wrap: balance;
}
.hh h1 em { font-style: italic; font-weight: 600; color: var(--accent); }
.hh__lead { font-size: 1.05rem; line-height: 1.6; color: var(--ink-2); max-width: 54ch; margin: 0 0 1.4rem; }
.hh__ctas { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.1rem; }
.hh__btn {
    display: inline-flex; align-items: center; gap: 0.4rem; min-height: 46px; padding: 0 1.2rem;
    border-radius: var(--radius); font-weight: 600; font-size: 0.92rem; text-decoration: none;
    border: 1px solid var(--accent); transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.hh__btn--primary { background: var(--accent); color: var(--on-accent); }
.hh__btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.hh__btn--ghost { color: var(--accent); background: transparent; }
.hh__btn--ghost:hover { background: var(--bg-2); }
.hh__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Smart paste input (homepage v2, 2.3/2.4). Works as a plain /search form without JS. */
.hh__paste { max-width: 560px; margin-bottom: 1rem; }
.hh__paste-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin: 0 0 0.4rem; }
.hh__paste-row { display: flex; gap: 0.5rem; }
.hh__paste-row input[type=search] {
    flex: 1; min-height: 46px; padding: 0 0.9rem; font-family: var(--font-sans); font-size: 0.95rem;
    color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.hh__paste-row input::placeholder { color: var(--ink-3); }
.hh__paste-row button {
    min-height: 46px; padding: 0 1.1rem; font-family: var(--font-sans); font-weight: 600; font-size: 0.9rem;
    background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: var(--radius); cursor: pointer;
}
.hh__paste-row button:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hh__paste-row input[type=search], .hh__paste-row button { min-height: 44px; }
.hh__paste-note { font-size: 0.74rem; color: var(--ink-3); margin: 0.45rem 0 0; }
.hh__detect { margin-top: 0.6rem; font-size: 0.85rem; color: var(--ink-2); }
.hh__detect-type { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink); }
.hh__detect ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.4rem 0 0; }
.hh__detect a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.8rem; border: 1px solid var(--accent); border-radius: var(--radius); color: var(--accent); text-decoration: none; }
.hh__detect a:hover, .hh__detect a:focus-visible { background: var(--accent); color: var(--on-accent); }
.hh__detect small { display: block; color: var(--ink-3); margin-top: 0.3rem; }
.hh__roles { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 1.1rem; }
.hh__chip {
    display: inline-flex; align-items: center; gap: 0.35em; min-height: 44px; padding: 0 0.9rem;
    font-size: 0.85rem; color: var(--ink-2); background: var(--bg-2);
    border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none;
    transition: border-color var(--ease), color var(--ease);
}
.hh__chip:hover { border-color: var(--accent); color: var(--accent); }
.hh__chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Today's set ticket slot (styles in set.css) */
.hh__set { justify-self: end; width: min(100%, 390px); }
.hh__set .set { width: 100%; }

/* =====================================================================
   Category sections + cards
   ===================================================================== */
.cat { margin-bottom: 2.8rem; --cat: var(--accent); }
.cat--house { --cat: var(--cat-house); }
.cat--spicy { --cat: var(--cat-spicy); }
.cat--compliance { --cat: var(--cat-compliance); }
.cat--side { --cat: var(--cat-side); }
.cat--workflow { --cat: var(--cat-workflow); }

.cat__head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
    padding-bottom: 0.7rem; margin-bottom: 1rem; border-bottom: 2px solid var(--cat);
}
.cat__title { display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; }
.cat__icon { font-size: 1.15rem; line-height: 1; }
.cat__head h2 {
    font-family: var(--font-serif); font-weight: 700; font-size: 1.55rem; line-height: 1.1; letter-spacing: -0.01em;
    color: var(--ink); margin: 0; font-variation-settings: 'opsz' 48;
}
.cat__jp { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-3); letter-spacing: 0.08em; }
.cat__desc { flex-basis: 100%; font-size: 0.86rem; color: var(--ink-3); margin: 0.15rem 0 0; }
.cat__all {
    flex-shrink: 0; font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600; color: var(--accent);
    text-decoration: none; white-space: nowrap; padding: 0.3rem 0;
}
.cat__all:hover { text-decoration: underline; }
.cat__all:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cat__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }

.tc {
    display: flex; flex-direction: column; gap: 0.45rem; min-height: 132px;
    padding: 0.95rem 1rem 0.9rem; border: 1px solid var(--line); border-left: 3px solid var(--cat);
    border-radius: var(--radius); background: var(--bg); color: var(--ink); text-decoration: none;
    transition: background var(--ease), border-color var(--ease), transform var(--ease);
}
a.tc:hover { background: var(--bg-2); border-color: var(--cat); transform: translateY(-1px); }
a.tc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tc__top { display: flex; align-items: center; gap: 0.5rem; }
.tc__icon { font-size: 1.05rem; line-height: 1; flex-shrink: 0; }
.tc__name { font-weight: 600; font-size: 0.95rem; line-height: 1.25; color: var(--ink); flex: 1; min-width: 0; }
.tc__badge {
    flex-shrink: 0; font-family: var(--font-mono); font-size: 0.58rem; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; padding: 0.15em 0.45em; border-radius: 3px; border: 1px solid currentColor; color: var(--ink-3);
}
.tc__badge--new { color: var(--accent); }
.tc__badge--soon { color: var(--ink-3); border-style: dashed; }
.tc__desc { font-size: 0.82rem; line-height: 1.5; color: var(--ink-2); margin: 0; }
.tc--soon { opacity: 0.62; border-style: dashed; cursor: default; }
.tc--soon .tc__name { color: var(--ink-2); }
.tc--suggest { border-style: dashed; justify-content: center; align-items: center; text-align: center; color: var(--ink-3); }
.tc--suggest .tc__name { color: var(--accent); flex: 0; }
a.tc--suggest:hover { background: var(--bg-2); }
@media (prefers-reduced-motion: reduce) { a.tc:hover { transform: none; } .tc { transition: none; } }

/* Card badges: FREE/NEW + where the tool runs (wrap on narrow cards) */
.tc__top { flex-wrap: wrap; }
.tc__badges { display: flex; flex-wrap: wrap; gap: 0.25rem; flex-basis: 100%; order: 3; }
.tc__badge--exec { letter-spacing: 0.06em; }
.tc__badge--in-browser { color: var(--sev-good); }
.tc__badge--server-assisted { color: var(--info); }
.tc__badge--server-only { color: var(--sev-medium); }
@media (max-width: 540px) {
    /* One card per row: room for the badges next to the name again. */
    .tc__top { flex-wrap: nowrap; }
    .tc__badges { flex-basis: auto; order: 0; justify-content: flex-end; }
}

/* Legal disclaimer, bottom of the page */
.home-disclaimer { font-family: var(--font-mono); font-size: 0.7rem; line-height: 1.5; color: var(--ink-3); text-align: center; max-width: 70ch; margin: 0.4rem auto 1.4rem; }

/* Remaining catalog categories (chips) */
.more { margin-bottom: 2.6rem; padding: 1.1rem 1.2rem; background: var(--bg-2); border-radius: var(--radius); }
.more__label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.6rem; }
.more__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem; }
.more__cat {
    display: flex; flex-direction: column; gap: 0.15rem; min-height: 44px; padding: 0.55rem 0.75rem;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--ink); text-decoration: none; transition: border-color var(--ease);
}
.more__cat:hover { border-color: var(--accent); }
.more__cat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more__name { font-size: 0.86rem; font-weight: 600; }
.more__added { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-3); }
.more__desc { font-size: 0.76rem; color: var(--ink-2); line-height: 1.35; }

/* Legacy homepage widgets (task finder / recents / new strip) re-skinned
   to the card language so they sit naturally between the sections. */
body.cr-home #cr-task-finder, body.cr-home #cr-recents { margin-bottom: 2.6rem; }
body.cr-home #cr-new-strip .menu-header { border-bottom: 2px solid var(--accent); }
body.cr-home #cr-new-strip .menu-title { font-family: var(--font-serif); font-size: 1.55rem; }
body.cr-home #cr-new-strip .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
body.cr-home #cr-new-strip .menu-item { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--bg); }
body.cr-home #cr-new-strip .menu-item:hover { background: var(--bg-2); }
body.cr-home #cr-new-strip .menu-item-desc { color: var(--ink-2); font-size: 0.82rem; }

.home-browse { text-align: center; padding: 0.5rem 0 1rem; }
.home-browse a { font-family: var(--font-mono); font-size: 0.86rem; font-weight: 600; color: var(--accent); }

/* For network administrators — allow-list guidance + separation from offensiveramen */
.home-admins { max-width: 72ch; margin: 0 auto 1.4rem; padding: 1.1rem 1.3rem; background: var(--bg-2); border-radius: var(--radius); border-left: 3px solid var(--accent); }
.home-admins h2 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.6rem; }
.home-admins p { font-size: 0.9rem; line-height: 1.6; color: var(--ink-2); margin: 0 0 0.55rem; }
.home-admins p:last-child { margin-bottom: 0; }
.home-admins a { color: var(--accent); font-weight: 600; }
.home-admins .proxy-note { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-3); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1000px) {
    .cat__grid, body.cr-home #cr-new-strip .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .hh { grid-template-columns: 1fr; gap: 1.6rem; padding: 2.2rem 0 1.8rem; }
    .hh h1 { font-size: 36px; }
    .hh__set { justify-self: stretch; width: 100%; }
    .cat__grid, body.cr-home #cr-new-strip .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    .hh h1 { font-size: 30px; }
    .hh__lead { font-size: 0.98rem; }
    .cat__grid, body.cr-home #cr-new-strip .menu-grid { grid-template-columns: 1fr; }
    .cat__head { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    .tc { min-height: 0; }
    .hh__paste-row { flex-direction: column; }
}

/* =====================================================================
   Dark scheme — tokens are redefined site-wide in main.css (2026-09-17);
   only homepage component tweaks remain here.
   ===================================================================== */
@media (prefers-color-scheme: dark) {
    body.cr-home .sh__mega { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); }
    body.cr-home .hh__paste-row button { background: var(--ink); color: var(--cream); border-color: var(--ink); }
}
