/* guide.css - The guide page, on top of landing.css (same tokens, fonts, keys and bird). */

.guide-layout { max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); display: grid; gap: 40px; }
@media (min-width: 1040px) { .guide-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 56px; } }
.guide-main > section { padding: 56px 0; }
.guide-main > section + section { border-top: 2px dashed var(--line); }

/* Table of contents: sticky on wide screens, the tile grid does the job on phones */
.toc { display: none; }
@media (min-width: 1040px) {
    .toc { display: grid; gap: 2px; align-self: start; position: sticky; top: calc(var(--top-h) + 32px); padding-top: 56px; font-family: var(--mono); font-size: 12px; }
    .toc p { margin: 0 0 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--on-text); }
    .toc a { text-decoration: none; color: var(--muted); padding: 5px 10px; border-radius: 8px; border-left: 3px solid transparent; }
    .toc a b { color: var(--tc, var(--c0)); font-weight: 700; margin-right: 6px; }
    .toc a:hover { color: var(--ink); background: var(--panel); }
    .toc a.is-here { color: var(--ink); background: var(--panel); border-left-color: var(--tc, var(--c0)); }
}

/* Intro */
.guide-hero { display: grid; gap: 18px; padding-top: 48px !important; }
.guide-hero h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 8vw, 78px); line-height: 1; letter-spacing: .5px; text-wrap: balance; }
.guide-hero h1 em { font-style: normal; color: var(--c0); text-shadow: .05em .05em 0 var(--on); }
.guide-hero .lead { max-width: 60ch; }
.checked { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .5px; }

/* The basic loop: four chunky keys with arrows */
.loop { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .loop { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }
.loop li { position: relative; display: grid; gap: 8px; padding: 16px; background: var(--panel); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--c); }
.loop li:nth-child(odd) { transform: rotate(-1deg); }
.loop li:nth-child(even) { transform: rotate(1deg); }
.loop b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--c); }
.loop span { font-size: 14px; color: var(--muted); line-height: 1.4; }
@media (min-width: 720px) {
    .loop li:not(:last-child)::after { content: '→'; position: absolute; right: -20px; top: 50%; transform: translateY(-50%); font-family: var(--display); color: var(--c0); z-index: 1; }
}

/* Pick a workflow */
.picker { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.picker a {
    display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; min-height: 64px;
    padding: 12px 14px; text-decoration: none; background: var(--panel);
    border: 2px solid var(--line); border-radius: 14px;
    transition: transform 90ms ease-out, border-color 90ms, box-shadow 90ms;
}
.picker a:hover { transform: translate(-2px, -2px); border-color: var(--ink); box-shadow: 5px 5px 0 var(--tc); }
.picker b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--tc); line-height: 1; min-width: 1.6em; }
.picker span { font-size: 15px; font-weight: 600; line-height: 1.3; }
.picker small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; letter-spacing: .5px; }

/* The screen at a glance */
.glance { display: grid; gap: 24px; }
@media (min-width: 860px) { .glance { grid-template-columns: 1fr 1fr; } }
.glance-box { padding: 22px; background: var(--panel); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 7px 7px 0 var(--c); }
.glance-box h3 { font-family: var(--display); font-weight: 400; font-size: 22px; margin-bottom: 14px; color: var(--c); }
.glance-box dl { margin: 0; display: grid; gap: 12px; }
.glance-box dt { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.glance-box dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.basics { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.basics li { padding: 18px 20px; border: 2px solid var(--line); border-radius: 14px; background: rgba(31, 26, 39, .7); display: grid; gap: 6px; }
.basics h3 { font-size: 16px; color: var(--run); }
.basics p { color: var(--muted); font-size: 15px; }
.subhead { margin: 40px 0 18px; font-family: var(--display); font-weight: 400; font-size: 24px; }

/* A workflow */
.wf-head { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: start; margin-bottom: 22px; }
.wf-num {
    grid-row: span 3; display: grid; place-items: center; width: 64px; height: 64px;
    font-family: var(--display); font-size: 28px; color: var(--ground);
    background: var(--tc); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink);
    transform: rotate(-4deg);
}
@media (max-width: 600px) { .wf-num { width: 48px; height: 48px; font-size: 21px; border-radius: 12px; } }
.wf-head .eyebrow { margin: 0; color: var(--tc); }
.wf-head h2 { font-size: clamp(24px, 4.2vw, 38px); }
.wf-goal { color: var(--muted); max-width: 64ch; }
.wf-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 22px; padding: 0; list-style: none; }
.wf-meta li { font-family: var(--mono); font-size: 12px; padding: 5px 12px; border-radius: 999px; background: var(--panel); border: 2px solid var(--line); }
.wf-meta li b { color: var(--tc); margin-right: 6px; letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; max-width: 72ch; }
.steps > li { counter-increment: s; position: relative; padding-left: 50px; line-height: 1.65; }
.steps > li::before {
    content: counter(s); position: absolute; left: 0; top: -1px;
    display: grid; place-items: center; width: 34px; height: 34px;
    font-family: var(--display); font-size: 15px; color: var(--ground);
    background: var(--tc); border: 2px solid var(--ink); border-radius: 10px;
}
.steps > li:nth-child(even)::before { transform: rotate(4deg); }
.steps > li:nth-child(odd)::before { transform: rotate(-3deg); }

/* App buttons in running text */
.k {
    display: inline-block; padding: 0 7px; margin: 0 1px;
    font-family: var(--mono); font-size: .78em; font-weight: 700; letter-spacing: .06em; line-height: 1.7; white-space: nowrap;
    color: var(--ink); background: var(--panel-2); border: 2px solid var(--ink); border-radius: 7px;
    box-shadow: 2px 2px 0 var(--line); vertical-align: .08em;
}
.k-rec { background: var(--rec); box-shadow: 2px 2px 0 #7a1712; }
.k-on { background: var(--on); box-shadow: 2px 2px 0 var(--c0); }
.k-run { background: var(--run); color: var(--ground); box-shadow: 2px 2px 0 #00a866; }

/* Callouts */
.note, .warn, .phone-note { margin-top: 20px; max-width: 72ch; padding: 16px 18px 16px 20px; border-radius: 14px; font-size: 15px; line-height: 1.65; }
.note { background: rgba(31, 181, 173, .1); border: 2px solid var(--c1); }
.warn { background: rgba(232, 50, 43, .1); border: 2px solid var(--rec); }
.note > b:first-child, .warn > b:first-child, .phone-note > b:first-child { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 4px; }
.note > b:first-child { color: var(--c1); }
.warn > b:first-child { color: #ff6b63; }
.phone-note { position: relative; background: var(--panel); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--on); padding-left: 64px; }
.phone-note > b:first-child { color: var(--on-text); }
.phone-note::before {
    content: ''; position: absolute; left: 20px; top: 18px; width: 24px; height: 40px;
    border: 3px solid var(--ink); border-radius: 6px; background: var(--on);
    box-shadow: inset 0 -5px 0 -3px var(--ink);
}
.next { margin-top: 24px; font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.next a { color: var(--tc); text-decoration: none; border-bottom: 2px solid currentColor; }

/* Demo list */
.demo-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.demo-list li { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 12px 14px; background: var(--panel); border: 2px solid var(--line); border-left: 6px solid var(--tc); border-radius: 12px; }
.demo-list canvas { grid-row: span 2; width: 36px; height: 36px; image-rendering: pixelated; }
.demo-list b { font-size: 15px; }
.demo-list b small { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--muted); margin-left: 6px; letter-spacing: .5px; }
.demo-list a { font-size: 14px; color: var(--muted); text-decoration: none; line-height: 1.4; }
.demo-list a:hover { color: var(--ink); }

/* Reference */
.ref { display: grid; gap: 32px; }
@media (min-width: 860px) { .ref { grid-template-columns: 1fr auto; align-items: start; } }
.padkeys { display: grid; grid-template-columns: repeat(4, 58px); gap: 8px; }
.padkeys div { display: grid; place-items: center; height: 58px; border-radius: 10px; background: var(--panel); border: 2px solid var(--line); font-family: var(--mono); line-height: 1.1; }
.padkeys div b { font-size: 17px; }
.padkeys div small { font-size: 9px; color: var(--muted); }
.padkeys div.drum { border-color: var(--pc); box-shadow: 3px 3px 0 var(--pc); }
.padkeys-caption { margin-top: 12px; max-width: 260px; font-size: 13px; color: var(--muted); }

.guide-main .table-wrap td:first-child { white-space: nowrap; }
.guide-main .faq-list { max-width: 820px; }

.phone-view { display: grid; gap: 14px; }
@media (min-width: 720px) { .phone-view { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
    .loop li:nth-child(n), .wf-num, .steps > li::before { transform: none !important; }
}
