/* Aside / G3NR8 — shared stylesheet for /specification + /sop/* pages.
   Brand v3: warm paper, clay accent. Same tokens as commitments.html.
   Variables follow the marketing-site naming so it composes cleanly. */

:root {
    --teal:          #A53D24;
    --teal-soft:     rgba(165, 61, 36, 0.35);
    --bg:            #FAF6EE;
    --bg-card:       #FFFCF5;
    --bg-elevated:   #F2EDE0;
    --border:        #ECE5D6;
    --border-strong: rgba(165, 61, 36, 0.25);
    --text:          #2A2018;
    --text-soft:     #3D3128;
    --text-muted:    #75665A;
    --text-dim:      #A89C8E;
    --focus-ring:    #A53D24;
    --green:         #2F6B45;
    --green-bg:      rgba(63, 139, 92, 0.14);
    --hearing:       #1F538B;
    --hearing-bg:    rgba(43, 108, 176, 0.13);
    --motor:         #8A5A1B;
    --motor-bg:      rgba(220, 156, 56, 0.20);
    --cog:           #5C4A3D;
    --cog-bg:        rgba(124, 113, 100, 0.16);
    --situational:   #5C3F8C;
    --situational-bg:rgba(123,  95, 168, 0.16);
    --age:           #A53D24;
    --age-bg:        rgba(165, 61, 36, 0.12);
    --privacy:       #2A2018;
    --privacy-bg:    rgba(42, 32, 24, 0.10);
    --font-body:     'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono:     'JetBrains Mono', ui-monospace, monospace;
    --radius:        14px;
    --radius-sm:     10px;
    --max-w:         900px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 1.0625rem;          /* 17px — bigger than typical for a11y */
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

a {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
}
a:hover { text-decoration-thickness: 2.5px; }

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    top: -40px; left: 8px;
    background: var(--teal); color: var(--bg);
    padding: 10px 14px; border-radius: var(--radius-sm);
    font-weight: 600; text-decoration: none;
    z-index: 100;
}
.skip-link:focus { top: 8px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container.wide { max-width: 1100px; }

/* Site nav (matches commitments.html / privacy.html) */
nav.site {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(250, 246, 238, 0.9);
    border-bottom: 1px solid var(--border);
}
nav.site .container {
    max-width: 1100px;
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 16px; padding-bottom: 16px;
}
nav.site .brand {
    display: flex; align-items: baseline; gap: 12px;
    color: var(--text); text-decoration: none;
}
nav.site .brand:hover { text-decoration: none; }
nav.site .brand img { height: 28px; width: auto; align-self: center; }
nav.site .brand .product { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
nav.site .brand .company {
    font-family: var(--font-mono); font-size: 0.6875rem;
    color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase;
}
nav.site .links a {
    color: var(--text-muted); text-decoration: none;
    font-weight: 500; font-size: 0.9rem;
    margin-left: 22px;
}
nav.site .links a.active { color: var(--text); font-weight: 600; }
nav.site .links a:hover { color: var(--text); text-decoration: underline; }
@media (max-width: 720px) {
    nav.site .brand .company { display: none; }
    nav.site .links a { margin-left: 14px; font-size: 0.85rem; }
}

/* Hamburger button — matches the React app's SiteNav hamburger so the
   surface feels the same wherever you arrive. */
nav.site .nav-hamburger {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    width: 40px; height: 40px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
    margin-left: 16px;
    transition: border-color 0.18s ease, background 0.18s ease;
}
nav.site .nav-hamburger:hover {
    border-color: var(--border-strong);
    background: var(--bg-elevated);
}
nav.site .nav-hamburger svg { display: block; }

/* Slide-out drawer + backdrop — same structure / colors as the React drawer
   so a visitor jumping between marketing page and a SOP page sees an
   identical nav surface. */
.nav-backdrop {
    position: fixed; inset: 0;
    background: rgba(42, 32, 24, 0.45);
    opacity: 0; pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 90;
}
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

.nav-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(420px, 100vw);
    background: var(--bg);
    box-shadow: -12px 0 48px rgba(42, 32, 24, 0.18);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 100;
    overflow-y: auto;
    padding: 24px 36px 48px;
    box-sizing: border-box;
    font-family: var(--font-body);
    color: var(--text);
}
body.nav-open .nav-drawer { transform: translateX(0); }

.nav-drawer .drawer-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 36px;
}
.nav-drawer .drawer-brand {
    display: flex; flex-direction: column; gap: 4px;
    text-decoration: none; color: var(--text);
}
.nav-drawer .drawer-brand .product { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; }
.nav-drawer .drawer-brand .company {
    font-family: var(--font-mono); font-size: 0.625rem;
    color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase;
}
.nav-drawer .drawer-close {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    width: 38px; height: 38px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
}
.nav-drawer .drawer-section + .drawer-section { margin-top: 28px; }
.nav-drawer .drawer-section .heading {
    font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600;
    letter-spacing: 0.16em; color: var(--text-muted);
    text-transform: uppercase; margin-bottom: 12px;
}
.nav-drawer .drawer-section a {
    display: block;
    font-family: var(--font-body); font-size: 1.0625rem;
    color: var(--text); text-decoration: none; font-weight: 500;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}
.nav-drawer .drawer-section a:hover { color: var(--teal); }
.nav-drawer .drawer-section a.active { color: var(--teal); font-weight: 600; }

main { padding: 56px 0 96px; }

/* Headings */
h1.page-title {
    font-family: var(--font-body); font-weight: 800;
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1.1; letter-spacing: -0.02em;
    margin-bottom: 16px; color: var(--text);
}
h1.page-title .eyebrow {
    display: block;
    font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
    color: var(--teal); letter-spacing: 0.16em; text-transform: uppercase;
    margin-bottom: 12px;
}
.lede {
    font-size: 1.1875rem; color: var(--text-soft);
    line-height: 1.55; margin-bottom: 36px;
    max-width: 760px; font-weight: 400;
}
.lede strong { color: var(--text); font-weight: 600; }
h2 {
    font-family: var(--font-body); font-weight: 700;
    font-size: 1.5rem; line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 48px 0 14px; color: var(--text);
}
h2.section-eyebrow {
    font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--teal);
    margin: 56px 0 4px;
}
h2.section-eyebrow + .section-lead {
    font-family: var(--font-body); font-size: 1.5rem; font-weight: 700;
    letter-spacing: -0.015em; line-height: 1.25;
    margin: 0 0 6px; color: var(--text);
}
h2.section-eyebrow + .section-lead + .section-sub {
    font-size: 1.0625rem; color: var(--text-soft);
    line-height: 1.55; margin: 0 0 24px; max-width: 780px;
}
h3 {
    font-family: var(--font-body); font-weight: 700;
    font-size: 1.1875rem; line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 28px 0 10px; color: var(--text);
}
p { color: var(--text-soft); margin-bottom: 14px; }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 28px; margin-bottom: 14px; color: var(--text-soft); }
ul li, ol li { margin-bottom: 6px; line-height: 1.55; }
strong { color: var(--text); font-weight: 600; }
code, .mono {
    font-family: var(--font-mono); font-size: 0.94em;
    background: var(--bg-elevated); padding: 1px 6px;
    border-radius: 4px; color: var(--text);
}
code.bare { background: transparent; padding: 0; color: var(--teal); }

/* Audience pills (the why-tags) */
.aud-pill {
    display: inline-block; padding: 3px 10px; border-radius: 100px;
    font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    margin: 2px 4px 2px 0; white-space: nowrap;
    border: 1px solid transparent;
}
.aud-pill.vision      { background: var(--green-bg);       color: var(--green); }
.aud-pill.hearing     { background: var(--hearing-bg);     color: var(--hearing); }
.aud-pill.motor       { background: var(--motor-bg);       color: var(--motor); }
.aud-pill.cognitive   { background: var(--cog-bg);         color: var(--cog); }
.aud-pill.situational { background: var(--situational-bg); color: var(--situational); }
.aud-pill.age         { background: var(--age-bg);         color: var(--age); }
.aud-pill.privacy     { background: var(--privacy-bg);     color: var(--privacy); }

/* Audience taxonomy reference card (used on /specification) */
.aud-card {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 24px;
    margin-bottom: 28px;
}
.aud-card .aud-row {
    display: flex; flex-direction: column; gap: 8px;
    padding: 6px 8px;
}
.aud-card .aud-row .desc { font-size: 0.95rem; color: var(--text-soft); line-height: 1.5; }

/* Spec what/why table */
.spec-table-wrap {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: auto;
    margin-bottom: 22px;
}
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th {
    text-align: left; font-family: var(--font-mono);
    font-size: 0.7rem; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--text-muted);
    font-weight: 700; padding: 14px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
}
.spec-table td {
    padding: 16px; border-bottom: 1px solid var(--border);
    vertical-align: top; line-height: 1.55;
    color: var(--text-soft);
}
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table td.cap { width: 26%; }
.spec-table td.cap strong { display: block; color: var(--text); font-weight: 700; }
.spec-table td.cap .mono {
    font-family: var(--font-mono); font-size: 0.85em;
    background: var(--bg-elevated); padding: 1px 6px;
    border-radius: 4px; display: inline-block; margin-top: 4px;
}
.spec-table td.what { width: 38%; color: var(--text-soft); }
.spec-table td.why { width: 36%; }
.spec-table td.why .pills { margin-bottom: 8px; }
.spec-table td.why .reason { color: var(--text-soft); }
@media (max-width: 880px) {
    .spec-table td.cap, .spec-table td.what, .spec-table td.why { display: block; width: 100%; }
    .spec-table td.cap { padding-bottom: 4px; }
    .spec-table td.what { padding-top: 6px; padding-bottom: 6px; color: var(--text); }
    .spec-table td.why { padding-top: 6px; }
}

.spec-meta-line {
    font-family: var(--font-mono); font-size: 0.85rem;
    color: var(--text-muted); margin-top: 10px; line-height: 1.5;
}
.spec-meta-line strong { color: var(--text); font-weight: 600; }

/* Page-section divider for /specification */
.spec-section { margin-top: 48px; }

/* === SOP catalog (sop/index.html) === */
.sop-search {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
    margin: 24px 0 32px;
    display: flex; gap: 12px; align-items: center;
}
.sop-search input {
    flex: 1; font-family: var(--font-body); font-size: 1rem;
    border: 0; outline: none; background: transparent; color: var(--text);
    min-width: 0;
}
.sop-search .label {
    font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--text-muted); font-weight: 700;
}
.sop-group {
    margin-top: 32px; padding-top: 20px;
    border-top: 1px solid var(--border);
}
.sop-group h2 {
    margin: 0 0 6px;
    font-size: 1.375rem; font-weight: 700;
    letter-spacing: -0.015em;
}
.sop-group .desc {
    color: var(--text-muted); margin-bottom: 16px;
    font-size: 1rem; max-width: 720px;
}
.sop-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}
.sop-list li { margin: 0; }
.sop-list a.card {
    display: flex; flex-direction: column; gap: 6px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px 18px;
    color: var(--text); text-decoration: none;
    min-height: 92px;
    transition: border-color .12s, background .12s, transform .12s;
}
.sop-list a.card:hover {
    border-color: var(--border-strong);
    background: var(--bg);
    text-decoration: none;
}
.sop-list a.card .title {
    font-weight: 700; font-size: 1.0625rem; line-height: 1.3;
    color: var(--text);
}
.sop-list a.card .blurb {
    font-size: 0.9375rem; color: var(--text-muted); line-height: 1.45;
}
.sop-list a.card .pills { margin-top: 6px; }
.sop-list a.card.empty {
    opacity: 0.55; pointer-events: none; cursor: not-allowed;
}

/* === Per-feature SOP page === */
.sop-meta {
    display: flex; flex-wrap: wrap; gap: 16px;
    align-items: center;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 18px;
    margin: 0 0 32px;
    font-size: 0.95rem; color: var(--text-soft);
}
.sop-meta .meta-key {
    font-family: var(--font-mono); font-size: 0.7rem;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 700;
    margin-right: 6px;
}
.sop-meta .meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.sop-summary {
    background: var(--bg-card); border-left: 4px solid var(--teal);
    padding: 18px 22px; border-radius: var(--radius-sm);
    margin: 0 0 32px;
    font-size: 1.0625rem; color: var(--text-soft); line-height: 1.55;
}
.sop-summary strong { color: var(--text); }

.sop-tryit {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 22px;
    margin: 28px 0;
}
.sop-tryit .label {
    font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--teal); margin-bottom: 8px;
}
.sop-tryit p { font-size: 1.0625rem; color: var(--text); margin-bottom: 8px; }
.sop-tryit .quote {
    font-style: italic; font-weight: 500;
    color: var(--text); font-size: 1.125rem;
    padding-left: 14px; border-left: 3px solid var(--teal);
    margin: 6px 0 8px;
}

/* Step blocks */
.sop-steps {
    counter-reset: step;
    list-style: none; padding: 0; margin: 0 0 36px;
}
.sop-step {
    counter-increment: step;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px 26px;
    margin-bottom: 18px;
    position: relative;
}
.sop-step::before {
    content: "Step " counter(step);
    display: inline-block;
    font-family: var(--font-mono); font-size: 0.72rem;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--teal); font-weight: 700;
    margin-bottom: 6px;
}
.sop-step h3 {
    margin: 0 0 10px;
    font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em;
}
.sop-step p { font-size: 1.0625rem; color: var(--text-soft); }
.sop-step .say {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
    margin: 12px 0;
    font-size: 1.0625rem; font-style: italic;
    color: var(--text);
}
.sop-step .say::before {
    content: "Say: ";
    font-family: var(--font-mono); font-style: normal;
    font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--teal); font-weight: 700;
    display: block; margin-bottom: 4px;
}
.sop-step .tap-hint::before {
    content: "Tap: ";
    font-family: var(--font-mono); font-style: normal;
    font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--teal); font-weight: 700;
    display: block; margin-bottom: 4px;
}
.sop-step .tap-hint {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
    margin: 12px 0;
    font-size: 1.0625rem;
    color: var(--text);
}

/* Screenshot — phone aspect, with a tasteful frame */
.sop-shot {
    margin: 18px 0 4px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px;
    text-align: center;
}
.sop-shot img {
    max-width: 100%;
    max-height: 640px;
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    display: inline-block;
}
.sop-shot figcaption {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 0.78rem; color: var(--text-muted);
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.sop-note {
    background: rgba(165, 61, 36, 0.04); border-left: 3px solid var(--teal-soft);
    padding: 14px 18px; border-radius: var(--radius-sm);
    margin: 14px 0;
    font-size: 0.96rem; color: var(--text-soft); line-height: 1.55;
}
.sop-note .label {
    font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--teal); margin-right: 8px;
}
.sop-note.warn { border-left-color: var(--motor); background: rgba(220, 156, 56, 0.06); }
.sop-note.warn .label { color: var(--motor); }

/* Related links */
.sop-related {
    margin-top: 48px; padding-top: 28px;
    border-top: 1px solid var(--border);
}
.sop-related h2 {
    margin: 0 0 14px;
    font-size: 1.125rem; font-weight: 700;
}
.sop-related ul {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}
.sop-related a {
    display: block;
    padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-card);
    text-decoration: none; color: var(--text);
    font-size: 0.95rem; line-height: 1.4;
}
.sop-related a:hover { background: var(--bg); border-color: var(--border-strong); }
.sop-related a code { background: transparent; color: var(--teal); padding: 0; }

.sop-foot-nav {
    margin-top: 36px; display: flex; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
    font-size: 0.95rem;
}
.sop-foot-nav a { color: var(--text-muted); }
.sop-foot-nav a:hover { color: var(--text); }

/* Footer (matches commitments.html) */
footer.site-foot {
    border-top: 1px solid var(--border);
    padding: 36px 0;
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-top: 64px;
}
footer.site-foot .container {
    max-width: 1100px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    flex-wrap: wrap;
}
footer.site-foot .small { font-family: var(--font-mono); font-size: 0.78rem; }
footer.site-foot a { color: var(--text-muted); }
