/* Shared styles for packingli.st inner pages (templates, support, legal, 404).
   The home page uses home.css; both share the same tokens. Fonts come from /fonts/fonts.css. */
:root {
    --green: #34d27b;
    --teal: #18b3c9;
    --blue: #1f7bf0;
    --check-green: #34c759;
    --ink: #3e4c6d;
    --ink-soft: #71809f;
    --ground: #ececf6;
    --card: #ffffff;
    --hairline: #e3e3ee;
    --chip: #f4f4fa;
}
@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e8eaf2;
        --ink-soft: #9aa3b8;
        --ground: #101018;
        --card: #1c1c26;
        --hairline: #2c2c3a;
        --chip: #242432;
    }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--ground);
}
img { max-width: 100%; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #000; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }

/* ---------- top bar + small hero (gradient continues from bar into hero) ---------- */
.topbar, .hero-sm {
    color: #fff;
    background: linear-gradient(150deg, #34d27b 0%, #18b3c9 45%, #1f7bf0 100%);
    background-attachment: scroll;
}
.topbar { padding: 16px 0 0; }
.hero-sm { padding: 10px 0 44px; }
.hero-sm + main { position: relative; }
/* make bar+hero one continuous gradient */
.topbar { background: linear-gradient(150deg, #34d27b 0%, #18b3c9 45%, #1f7bf0 100%) fixed; }
.hero-sm { background: linear-gradient(150deg, #34d27b 0%, #18b3c9 45%, #1f7bf0 100%) fixed; }
@media (prefers-reduced-motion: reduce), (max-width: 600px) {
    .topbar, .hero-sm { background-attachment: scroll; }
}

.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand-row { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.brand-icon { border-radius: 9px; box-shadow: 0 2px 8px rgba(0,20,60,.25); }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; padding: 6px 12px; border-radius: 999px; }
.site-nav a:hover { background: rgba(255,255,255,.15); }
.site-nav .nav-store { background: rgba(0,0,0,.28); }
.crumbs { font-size: .85rem; margin: 18px 0 0; opacity: .92; }
.crumbs a { color: #fff; }
.crumbs span { color: #fff; }

h1 {
    font-family: 'Amatic SC', 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 8vw, 4.6rem);
    line-height: 1;
    margin: 10px 0 12px;
    letter-spacing: .01em;
    text-shadow: 0 2px 14px rgba(0, 30, 80, .18);
}
.lede { font-size: 1.1rem; max-width: 42em; margin: 0 0 22px; color: rgba(255,255,255,.95); }
.hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.store-badge {
    display: inline-flex; align-items: center; gap: 10px;
    background: #111; color: #fff; text-decoration: none;
    padding: 9px 16px 9px 12px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,.3);
    transition: transform .15s ease;
}
.store-badge:hover { transform: scale(1.03); }
.store-badge svg { width: 24px; height: 32px; flex: none; }
.store-badge small { display: block; font-size: .64rem; font-weight: 400; letter-spacing: .02em; opacity: .85; }
.store-badge span { font-size: 1.2rem; font-weight: 600; line-height: 1.1; }
.cta-note { font-size: .9rem; color: rgba(255,255,255,.9); }
a.cta-note { color: #fff; font-weight: 600; }

/* ---------- summary chips + table of contents ---------- */
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin: -22px 0 0; position: relative; }
.summary span {
    background: var(--card); border: 1px solid var(--hairline); border-radius: 999px;
    padding: 6px 14px; font-size: .88rem; font-weight: 600;
    box-shadow: 0 2px 10px rgba(30,40,80,.08);
}
.toc { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 6px; }
.toc a { font-size: .86rem; font-weight: 600; text-decoration: none; background: var(--chip); color: var(--ink); border-radius: 8px; padding: 5px 10px; }

main h2 {
    font-family: 'Amatic SC', 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 3rem);
    line-height: 1;
    margin: 44px 0 8px;
    letter-spacing: .015em;
}
.sub { color: var(--ink-soft); margin: 0 0 18px; }
.sub.small { font-size: .9rem; }

/* ---------- checklist cards ---------- */
.list-card {
    background: var(--card); border-radius: 18px;
    box-shadow: 0 10px 30px rgba(30,40,80,.08);
    padding: 6px 0 4px; margin: 0 0 16px; overflow: hidden;
    scroll-margin-top: 16px;
}
.cat-header {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center;
    gap: 8px 10px; padding: 12px 18px 10px; border-bottom: 1px solid var(--hairline);
}
.cat-emoji { font-size: 1.3rem; }
.cat-name { font-weight: 800; font-size: 1.15rem; margin: 0; font-family: inherit; }
.cat-pending { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.cat-progress { grid-column: 1 / -1; height: 4px; background: var(--hairline); border-radius: 2px; overflow: hidden; }
.cat-progress-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--teal)); transition: width .25s; }
.demo-items { list-style: none; margin: 0; padding: 4px 0; columns: 2; column-gap: 0; }
@media (max-width: 560px) { .demo-items { columns: 1; } }
.demo-items li { break-inside: avoid; }
.demo-item {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    background: none; border: 0; font: inherit; color: inherit;
    padding: 9px 18px; cursor: pointer; min-height: 44px;
}
.demo-item:hover { background: var(--chip); }
.check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c5c9d6; position: relative; transition: all .15s; }
.demo-item.done .check { background: var(--check-green); border-color: var(--check-green); }
.demo-item.done .check::after {
    content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 11px;
    border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.item-label { transition: opacity .15s ease; }
.demo-item.done .item-label { text-decoration: line-through; opacity: .45; }

/* ---------- open-in-app card ---------- */
.open-card {
    margin: 28px 0; padding: 22px 20px;
    background: linear-gradient(135deg, rgba(52,210,123,.15), rgba(31,123,240,.15));
    border: 1px solid var(--hairline); border-radius: 18px;
    display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
}
.open-card p { margin: 0; }
.open-card strong { display: block; font-size: 1.15rem; }
@media (max-width: 560px) { .open-card { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { background: var(--card); border-radius: 14px; padding: 4px 18px; margin: 0 0 10px; border: 1px solid var(--hairline); }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--ink-soft); font-weight: 400; flex: none; }
.faq[open] summary::after { content: '–'; }
.faq p { margin: 0 0 14px; }

/* ---------- related + template grid ---------- */
.rels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 0 0 40px; }
.rel { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--hairline); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); font-weight: 600; }
.rel span { font-size: 1.3rem; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 28px 0 10px; }
.tcard {
    display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start;
    background: var(--card); border: 1px solid var(--hairline); border-radius: 16px;
    padding: 18px; text-decoration: none; color: var(--ink);
    box-shadow: 0 6px 20px rgba(30,40,80,.06); transition: transform .15s ease;
}
.tcard:hover { transform: translateY(-2px); }
.tcard-emoji { font-size: 2rem; line-height: 1; }
.tcard-body { display: grid; gap: 4px; }
.tcard-body strong { font-size: 1.1rem; line-height: 1.25; }
.tcard-meta { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.tcard-desc { font-size: .92rem; color: var(--ink-soft); }
.tcard-cta { grid-column: 2; color: var(--blue); font-weight: 700; font-size: .95rem; }

/* ---------- legal ---------- */
.legal { padding-bottom: 40px; }
.legal h2 { font-family: 'Nunito Sans', sans-serif; font-size: 1.5rem; margin: 36px 0 10px; }
.legal h3 { font-size: 1.15rem; margin: 26px 0 6px; }
.legal h4 { font-size: 1rem; margin: 20px 0 4px; }
.legal p, .legal li { font-size: .98rem; }
.legal ul { padding-left: 22px; }
.legal table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.legal td, .legal th { border: 1px solid var(--hairline); padding: 6px 8px; text-align: left; vertical-align: top; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); padding: 26px 0 40px; margin-top: 40px; font-size: .95rem; color: var(--ink-soft); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); }
.foot-brand img { border-radius: 7px; }
.foot-links { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.foot-links a { color: var(--ink-soft); text-decoration: none; }
.foot-links a:hover { color: var(--blue); }
.foot-langs { margin: 18px 0 0; font-size: .88rem; }
.foot-langs a { color: var(--ink-soft); }
.foot-langs span[aria-current] { color: var(--ink); font-weight: 700; }
.foot-langs-label { margin-right: 4px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .store-badge, .cat-progress-fill, .item-label, .check, .tcard { transition: none; }
    .store-badge:hover, .tcard:hover { transform: none; }
}
