/* Jacob Stoner - portfolio
   Warm light editorial: centered content card on a soft grey gradient backdrop.
   Restrained mono voice, teal accent. */

:root {
    --bg: #ececec;
    --bg-raised: #ffffff;
    --bg-sunken: #f4f4f4;
    --text: #2b2f36;
    --text-strong: #101418;
    --text-muted: #565c66;
    --text-faint: #878d97;
    --line: #d8d8d8;
    --line-soft: #e6e6e6;
    --accent: #0b7a86;
    --accent-dim: rgba(11, 122, 134, 0.5);
    --accent-soft: rgba(11, 122, 134, 0.06);
    --warn: #a06a1f;
    --ok: #2e8b62;
    --fail: #b0432f;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    --measure: 44rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

img { max-width: 100%; height: auto; }

html {
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.65;
    font-size: 16.5px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(90deg, #ececec 0%, #d6d6d6 100%);
    background-attachment: fixed;
}

/* The centered content card: header, main, footer read as one lifted sheet */
.card {
    max-width: 58rem;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    filter: drop-shadow(0 0 10px rgba(95, 95, 95, 0.6));
}
.site-header {
    height: 80px;
}
main {
    background: #fff;
}
.site-footer {
    padding: 1.5rem 0 2rem;
    color: var(--text-faint);
    font-size: 0.82rem;
}

.wrap {
    max-width: 58rem;
    margin: 0 auto;
    padding: 0 2.5rem;
}

.wrap-narrow { max-width: 52rem; }

::selection { background: rgba(11,122,134,0.2); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #0e97a6; }

/* ---------- Header ---------- */

.site-header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-strong);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.brand em { color: var(--accent); font-style: normal; }

.site-nav {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.site-nav a { color: var(--text-muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }

/* ---------- Hero (homepage) ---------- */

.hero {
    padding: 3.5rem 0 3.5rem;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgb(238, 238, 238), transparent 70%);
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.1rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
    font-weight: 700;
    color: var(--text-strong);
    max-width: none;
    margin-bottom: 1.5rem;
}

.hero .lede {
    font-size: 1.12rem;
    color: var(--text-muted);
    max-width: var(--measure);
    margin-bottom: 2.25rem;
}

.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.btn {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.7rem 1.35rem;
    border-radius: 3px;
    text-decoration: none;
    border: 1px solid var(--line);
    color: var(--text);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn:hover { border-color: var(--accent-dim); color: var(--text-strong); background: var(--bg-raised); }

.btn-primary { border-color: var(--accent-dim); color: var(--accent); background: var(--accent-soft); }
.btn-primary:hover { background: rgba(11,122,134,0.16); color: var(--accent); }

/* ---------- Proof strip ---------- */

.proof {
    border-bottom: 1px solid var(--line-soft);
    padding: 1.6rem 0;
}

.proof ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.proof li { display: flex; align-items: baseline; gap: 0.55rem; }
.proof li::before { content: "-"; color: var(--accent); font-family: var(--font-mono); }

/* ---------- Sections ---------- */

.section { padding: 4.5rem 0; border-bottom: 1px solid var(--line-soft); }
.section:last-of-type { border-bottom: none; }

.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.6rem;
}

.section-title {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-strong);
    margin-bottom: 1.5rem;
    max-width: 30ch;
}

.section-intro { max-width: var(--measure); color: var(--text-muted); margin-bottom: 2.5rem; }
.section-intro + .section-intro { margin-top: -1.5rem; }

/* ---------- Work cards ---------- */

.work-list { display: grid; gap: 1rem; }

.work-card {
    display: block;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1.5rem 1.75rem;
    transition: border-color 0.15s ease;
}

.work-card:hover { border-color: var(--accent-dim); }

.work-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.work-card h3 {
    color: var(--text-strong);
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.work-card .deck { color: var(--text-muted); font-size: 0.95rem; max-width: var(--measure); }

.work-card .more {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    margin-top: 0.9rem;
    display: inline-block;
}

.tag-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.9rem; }

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-faint);
    border: 1px solid var(--line);
    padding: 0.15rem 0.55rem;
    border-radius: 3px;
}

.work-card-flagship { border-color: var(--line); }

/* ---------- Pillars ---------- */

.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.pillar {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1.4rem 1.5rem;
    background: var(--bg-sunken);
}

.pillar h3 { font-size: 1.02rem; color: var(--text-strong); margin-bottom: 0.6rem; font-weight: 600; }
.pillar p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.pillar .evidence { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.pillar .evidence b { color: var(--accent); font-weight: 500; }

/* ---------- Principles ---------- */

.principles { counter-reset: principle; display: grid; gap: 1.75rem; max-width: var(--measure); }

.principle { position: relative; padding-left: 3.25rem; }
.principle::before {
    counter-increment: principle;
    content: counter(principle, decimal-leading-zero);
    position: absolute;
    left: 0; top: 0.15rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
}
.principle h3 { font-size: 1.05rem; color: var(--text-strong); margin-bottom: 0.35rem; font-weight: 600; }
.principle p { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Contact ---------- */

.contact-box {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg-sunken);
    padding: 2.5rem;
    max-width: var(--measure);
}

.contact-box h2 { color: var(--text-strong); font-size: 1.5rem; margin-bottom: 0.9rem; letter-spacing: -0.02em; }
.contact-box p { color: var(--text-muted); margin-bottom: 1.75rem; }

.email-line {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--text-strong);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.7rem 1.1rem;
    cursor: pointer;
    background: var(--bg-sunken);
    transition: border-color 0.15s ease;
}

.email-line:hover { border-color: var(--accent-dim); }
.email-line .hint { font-size: 0.7rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Footer ---------- */

.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Case study pages ---------- */

.page-head {
    padding: 4rem 0 2.5rem;
    border-bottom: 1px solid var(--line-soft);
}

.page-head h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-strong);
    max-width: 24ch;
    margin-bottom: 1rem;
}

.page-head .deck { font-size: 1.08rem; color: var(--text-muted); max-width: var(--measure); }

.breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-bottom: 1.25rem;
    color: var(--text-faint);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* Prose body */
.prose { max-width: 100%; padding: 3rem 0 4rem; }
.prose > section { margin-bottom: 3.25rem; }
.prose > section::after { content: ""; display: table; clear: both; }

.prose h2 {
    font-size: 1.35rem;
    color: var(--text-strong);
    letter-spacing: -0.015em;
    margin-bottom: 1rem;
    padding-top: 0.5rem;
}

.prose h2 .anchor {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-faint);
    text-decoration: none;
    margin-left: 0.6rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.prose h2:hover .anchor { opacity: 1; }

.prose h3 { font-size: 1.05rem; color: var(--text-strong); margin: 1.75rem 0 0.6rem; font-weight: 600; }
.prose p { margin-bottom: 1.1rem; color: var(--text); }
.prose p.muted, .prose li.muted { color: var(--text-muted); }
.prose ul, .prose ol { margin: 0 0 1.25rem 1.4rem; color: var(--text); }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text-strong); }
.prose code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-sunken);
    border: 1px solid var(--line-soft);
    border-radius: 3px;
    padding: 0.1em 0.35em;
}

.prose blockquote {
    border-left: 2px solid var(--line);
    padding: 0.25rem 0 0.25rem 1.25rem;
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.98rem;
}

/* Evidence panel */
.panel {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg-raised);
    margin: 1.75rem 0;
    overflow: hidden;
}

.panel-head {
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.panel-head .kind { color: var(--accent); text-transform: uppercase; letter-spacing: 0.07em; }
.panel-body { padding: 1.25rem; }

.panel-note {
    font-size: 0.78rem;
    color: var(--text-faint);
    font-style: italic;
    padding: 0.6rem 1.25rem;
    border-top: 1px solid var(--line-soft);
}

/* Code */
pre {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    background: var(--bg-sunken);
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    color: #33414f;
}

pre .cm { color: #7d8a99; }
pre .dec { color: #a06a1f; }
pre .kw { color: var(--accent); }
pre .st { color: #2e8b62; }
pre .fn { color: #a06a1f; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; }

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.88rem;
}

th, td {
    text-align: left;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: top;
}

th {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    font-weight: 500;
}

td { color: var(--text-muted); }
td:first-child { color: var(--text); }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-size: 0.82rem; }

/* ---------- Diagrams (SVG shared semantics) ---------- */

.diagram { margin: 1.75rem 0; overflow-x: auto; }
.diagram svg { display: block; width: 100%; height: auto; min-width: 640px; }
.diagram figcaption {
    font-size: 0.8rem;
    color: var(--text-faint);
    margin-top: 0.6rem;
}

/* ---------- Screenshot figures ---------- */

.shot {
    margin: 1.75rem 0;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.6rem 0.6rem 0.4rem;
}
.shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--line);
}
.shot figcaption {
    font-size: 0.8rem;
    color: var(--text-faint);
    margin: 0.6rem 0.15rem 0.2rem;
}
.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; align-items: start; }
.shot-grid .shot { margin: 0; }

.shot-float-right {
    float: right;
    max-width: 280px;
    margin: 0.5rem 0 1.5rem 2rem;
}
.shot-float-left {
    float: left;
    max-width: 280px;
    margin: 0.5rem 2rem 1.5rem 0;
}
@media (max-width: 680px) {
    .shot-float-right, .shot-float-left {
        float: none;
        max-width: 100%;
        margin: 1.75rem 0;
    }
}

.d-box { fill: var(--bg-raised); stroke: var(--line); }
.d-box-external { fill: var(--bg-sunken); stroke: var(--line); stroke-dasharray: 4 3; }
.d-box-agent { fill: var(--bg-raised); stroke: var(--warn); }
.d-box-failure { fill: var(--bg-raised); stroke: var(--fail); }
.d-text { fill: var(--text); font-family: var(--font-sans); }
.d-mono { fill: var(--text-muted); font-family: var(--font-mono); }
.d-label { fill: var(--text-faint); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.d-accent { fill: var(--accent); }
.d-warn { fill: var(--warn); }
.d-ok { fill: var(--ok); }
.d-fail { fill: var(--fail); }
.d-edge { stroke: #7d8a99; }
.d-edge-accent { stroke: var(--accent); }
.d-edge-fail { stroke: var(--fail); }

/* Status chips in diagrams/timelines */
.chip {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    border: 1px solid var(--line);
    color: var(--text-muted);
    white-space: nowrap;
}
.chip-ok { color: var(--ok); border-color: rgba(46,139,98,0.4); }
.chip-warn { color: var(--warn); border-color: rgba(160,106,31,0.45); }
.chip-accent { color: var(--accent); border-color: var(--accent-dim); }

/* Related links at foot of case studies */
/* ---------- Story chapter summary box ---------- */

.story-box {
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1.15rem 1.4rem;
    margin: 2rem 0 2.5rem;
    max-width: var(--measure);
}
.story-box .story-box-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    display: block;
    margin-bottom: 0.5rem;
}
.story-box p { margin: 0; color: var(--text-strong); font-size: 1.02rem; line-height: 1.55; }
.story-box p + p { margin-top: 0.6rem; }

.related { border-top: 1px solid var(--line-soft); padding: 2.5rem 0 3.5rem; }
.related h2 { font-size: 1.05rem; color: var(--text-strong); margin-bottom: 1rem; font-weight: 600; }
.related ul { list-style: none; display: grid; gap: 0.6rem; }
.related a { text-decoration: none; }
.related .rel-deck { color: var(--text-faint); font-size: 0.85rem; }

/* ---------- Case-study transition ---------- */
.case-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 4.25rem 0 3rem;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.case-divider::before,
.case-divider::after {
    content: "";
    height: 1px;
    background: var(--line);
    flex: 1;
}
.case-divider span { white-space: nowrap; }

/* ---------- Trail: full enumeration of the work pages ---------- */

.trail { border-top: 1px solid var(--line-soft); padding: 2.5rem 0 1.75rem; }
.trail h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.trail-list { list-style: none; display: grid; gap: 0.35rem; counter-reset: none; }
.trail-list a {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  color: var(--text-muted);
  min-width: 0;
}
.trail-list a:hover { background: var(--accent-soft); color: var(--text-strong); }
.trail-list a:hover .trail-title { color: var(--accent); }
.trail-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  flex-shrink: 0;
}
.trail-title { font-size: 0.92rem; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.trail-current {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.3rem 0.5rem;
  font-weight: 600;
  color: var(--text-strong);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  min-width: 0;
}
.trail-current .trail-num { color: var(--accent); }

/* ---------- Pager: prev / index / next footer row ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line-soft);
  padding: 1rem 0 3rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.pager a { text-decoration: none; color: var(--accent); }
.pager a:hover { text-decoration: underline; }
.pager-prev { text-align: left; }
.pager-index { color: var(--text-faint); white-space: nowrap; }
.pager-next { text-align: right; }
.pager-disabled { color: var(--text-faint); }
@media (max-width: 640px) {
  .pager { flex-wrap: wrap; gap: 0.75rem 1rem; }
  .pager-prev, .pager-next { flex: 0 0 auto; }
  .pager-index { order: -1; flex: 1 1 100%; text-align: center; }
}

/* Meta line under case-study headers */
.case-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-faint);
}
.case-meta span b { color: var(--text-muted); font-weight: 500; }

/* Skip link */
.skip {
    position: absolute;
    left: -9999px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-raised);
    color: var(--accent);
    padding: 0.5rem 1rem;
    z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Print ---------- */

@media print {
    html { background: #fff; color: #111; font-size: 11pt; }
    body { background: #fff; padding: 0; }
    .card { filter: none; border: none; max-width: none; border-radius: 0; }
    .site-header, .site-footer, .hero-actions, .skip, .breadcrumb { display: none; }
    .work-card, .pillar, .panel, pre, .contact-box { background: #fff; border-color: #ccc; break-inside: avoid; }
    .prose, .section-intro, .proof ul { max-width: none; }
    h1, h2, h3, .section-title, .work-card h3 { color: #000 !important; }
    p, li, td { color: #222 !important; }
    a { color: #111; }
    .page-head, .section { border-color: #ddd; padding: 1.5rem 0; }
}

/* ---------- About / Operator Profile ---------- */

.about-profile {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}
.about-page-profile > div { flex: 1; }
.about-page-profile .deck { margin-bottom: 0; }

.about-profile .headshot {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(11, 122, 134, 0.08), transparent 70%);
    border: 1px solid var(--line-soft);
}
@media (max-width: 680px) {
    .about-profile {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .about-profile .headshot {
        width: 130px;
        height: 130px;
    }
}

/* ---------- Small screens ---------- */

@media (max-width: 680px) {
    html, body { overflow-x: hidden; }
    body { padding: 0.75rem 0.5rem; }
    .card { border-radius: 8px; }
    .wrap { padding: 0 1.25rem; }
    .site-header { height: auto; padding: 1rem 0; }
    .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .site-nav { gap: 1.25rem; }
    .hero { padding: 2.5rem 0 2rem; }
    .section { padding: 2.5rem 0; }
    .contact-box { padding: 1.5rem; }
    .page-head { padding: 2.5rem 0 1.75rem; }
    .prose { padding: 2rem 0 3rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
