/*
 * 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: center;
    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; }
.hh__disclaimer { font-family: var(--font-mono); font-size: 0.74rem; line-height: 1.55; color: var(--accent); margin: 0 0 1.2rem; max-width: 60ch; }
.hh__search { display: flex; gap: 0.5rem; max-width: 560px; }
.hh__search 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__search input::placeholder { color: var(--ink-3); }
.hh__search 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__search button:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Order ticket */
.ticket {
    justify-self: end; width: min(100%, 340px);
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.2rem 1.3rem 1.1rem; font-family: var(--font-mono); position: relative;
}
.ticket::before, .ticket::after {
    content: ""; position: absolute; left: 0; right: 0; height: 6px;
    background: radial-gradient(circle, var(--bg) 3px, transparent 3.5px) 0 0 / 12px 6px repeat-x;
}
.ticket::before { top: -1px; }
.ticket::after { bottom: -1px; transform: rotate(180deg); }
.ticket__head {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
    padding-bottom: 0.6rem; margin-bottom: 0.4rem; border-bottom: 1px dashed var(--line-strong);
}
.ticket dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; align-items: baseline; }
.ticket dt { font-size: 0.78rem; color: var(--ink-2); }
.ticket dd { margin: 0; text-align: right; font-family: var(--font-serif); font-weight: 700; font-size: 1.6rem; line-height: 1.1; color: var(--ink); font-variation-settings: 'opsz' 40; }
.ticket dd small { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; color: var(--ink-3); margin-left: 0.25rem; }
.ticket__foot {
    margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px dashed var(--line-strong);
    display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--ink-3);
}
.ticket__foot strong { color: var(--accent); font-weight: 600; }

/* =====================================================================
   Trust strip
   ===================================================================== */
.trust {
    list-style: none; margin: 0 0 2.6rem; padding: 0.8rem 0;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.35rem 0;
    font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; color: var(--ink-3); /* uppercase is in the source text */
}
.trust li { display: inline-flex; align-items: center; }
.trust li + li::before { content: "·"; margin: 0 0.9rem; color: var(--line-strong); }
.trust li a { color: inherit; text-decoration: none; }
.trust li a:hover { color: var(--accent); }
.trust li a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =====================================================================
   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; } }

/* 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: flex; flex-wrap: wrap; gap: 0.45rem; }
.more__row .sh__chip { background: var(--bg); font-size: 0.82rem; min-height: 36px; }

/* 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); }

/* =====================================================================
   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; }
    .ticket { justify-self: stretch; width: 100%; }
    .cat__grid, body.cr-home #cr-new-strip .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trust { justify-content: flex-start; }
}
@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; }
    .trust { gap: 0.4rem 1rem; }
    .trust li + li::before { display: none; }
    .tc { min-height: 0; }
    .hh__search { flex-direction: column; }
}

/* =====================================================================
   Dark scheme — HOMEPAGE ONLY. Tool pages carry hard-coded light colours
   and are out of scope; extend the selector once they are dark-safe.
   Only tokens are redefined; every component above reads tokens.
   ===================================================================== */
@media (prefers-color-scheme: dark) {
    body.cr-home {
        /* legacy palette (main.css + features.css widgets) */
        --cream: #1a1210; --cream-dark: #26201c; --cream-darker: #3a312b;
        --ink: #f2ebe0; --ink-light: #d9d0c2; --ink-muted: #b3a89b; --ink-faint: #b3a89b;
        --ink-faint-decorative: #7a6f65;
        --red: #ef6e5c; --red-hover: #ff8a78; --red-dim: rgba(239, 110, 92, 0.14);
        --border-control: rgba(242, 235, 224, 0.45);
        /* shell tokens — restated (not just the legacy palette) because a
           custom property is computed where it is DECLARED: the :root
           aliases in shell.css (--bg: var(--cream)) were resolved against the
           light palette and would not follow the overrides above. */
        --bg: #1a1210; --bg-2: #26201c; --bg-3: #3a312b;
        --ink-2: #d9d0c2; --ink-3: #b3a89b;
        --line: #3a312b; --line-strong: rgba(242, 235, 224, 0.45);
        --accent: #ef6e5c; --accent-hover: #ff8a78;
        --on-accent: #1a1210;
        --cat-house: #ef6e5c; --cat-spicy: #f39a63; --cat-compliance: #dcb15a;
        --cat-side: #7fc784; --cat-workflow: #8fb6f0;
        background: var(--cream); color: var(--ink);
    }
    body.cr-home .sh__mega { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); }
    body.cr-home .hh__search button { background: var(--ink); color: var(--cream); border-color: var(--ink); }
}
