/* ==========================================================================
   zljones.com — design tokens
   Dark-first (terminal heritage), with a real light scheme for readers who
   need one. Every muted colour below clears WCAG AA (4.5:1) on its backdrop,
   which the previous build did not.
   ========================================================================== */

:root {
  --bg:        #0a0e17;
  --bg-elev:   #0f1521;
  --panel:     #131a28;
  --panel-2:   #182133;
  --line:      #232d42;
  --line-2:    #33415c;

  --txt:       #e9eff9;
  --txt-2:     #b8c4d8;   /* 9.4:1 on --bg */
  --txt-3:     #8b9bb4;   /* 6.4:1 on --bg  (was #64748b = 3.9:1, a fail) */

  --accent:    #5eead4;
  --accent-2:  #7dd3fc;
  --accent-ink:#04231f;
  --good:      #86efac;
  --warn:      #fbbf24;

  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r: 12px;
  --r-sm: 8px;
  --pad: clamp(16px, 4vw, 28px);
  --maxw: 1080px;
  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:      #f6f8fc;
    --bg-elev: #ffffff;
    --panel:   #ffffff;
    --panel-2: #eef3fa;
    --line:    #dfe6f1;
    --line-2:  #c3cee0;

    --txt:     #0c1320;
    --txt-2:   #3c4a63;
    --txt-3:   #56657f;

    --accent:  #0d7f74;
    --accent-2:#0b5f97;
    --accent-ink: #ffffff;
    --good:    #0f7a3d;
    --warn:    #8a5a00;
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent-2); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: var(--accent-ink);
  padding: 14px 22px; font-weight: 600; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
section { padding: clamp(36px, 6vw, 64px) 0; scroll-margin-top: 76px; }
section + section { border-top: 1px solid var(--line); }

.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 10px;
}
h2 { font-size: clamp(22px, 3.4vw, 29px); }
.lede { font-size: 17.5px; color: var(--txt-2); max-width: 68ch; }

/* ---------- top bar ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 62px; flex-wrap: wrap;
}
.brand {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  color: var(--txt); text-decoration: none; letter-spacing: -.01em;
  margin-right: auto;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
}
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  font-size: 14px; color: var(--txt-2); text-decoration: none;
  padding: 10px 12px; border-radius: var(--r-sm); min-height: 44px;
  display: inline-flex; align-items: center;
}
.site-nav a:hover { color: var(--txt); background: var(--panel); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  padding: 12px 20px; min-height: 48px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--txt);
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--txt); }
.btn-primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }

/* ---------- hero ---------- */
.hero { padding-top: clamp(34px, 6vw, 62px); }
.hero-grid {
  display: grid; grid-template-columns: 1fr 200px; gap: clamp(24px, 4vw, 44px);
  align-items: start;
}
.hero h1 { font-size: clamp(30px, 5.6vw, 46px); letter-spacing: -.03em; margin-bottom: 6px; }
.hero .role {
  font-family: var(--mono); font-size: clamp(15px, 2.2vw, 18px);
  color: var(--accent); margin: 0 0 18px; font-weight: 500;
}
.hero .current {
  font-size: 14px; color: var(--txt-3); margin: -10px 0 18px;
}
.hero .current strong { color: var(--txt-2); font-weight: 600; }
.hero .pitch { font-size: clamp(17px, 2.3vw, 19.5px); color: var(--txt-2); max-width: 58ch; }
.hero .pitch strong { color: var(--txt); font-weight: 600; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-meta {
  display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: 22px;
  font-size: 14px; color: var(--txt-3);
}
.hero-meta a { color: var(--txt-2); }
.portrait {
  border-radius: 50%; overflow: hidden; border: 1px solid var(--line-2);
  width: 200px; height: 200px; background: var(--panel);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; margin-top: 8px;
}
.stat { background: var(--panel); padding: 20px 18px; }
.stat .n {
  font-family: var(--mono); font-size: 30px; font-weight: 700;
  color: var(--accent); line-height: 1; letter-spacing: -.02em;
}
.stat .l { font-size: 14px; color: var(--txt); margin-top: 9px; font-weight: 600; }
.stat .w { font-size: 12.5px; color: var(--txt-3); margin-top: 3px; }

/* ---------- cards ---------- */
.cards { display: grid; gap: 16px; margin-top: 26px; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px;
}
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { font-size: 15px; color: var(--txt-2); margin-bottom: 12px; }
.card p:last-child { margin-bottom: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em;
  color: var(--txt-3); border: 1px solid var(--line-2);
  border-radius: 5px; padding: 3px 8px;
}

/* ---------- flagship case study ---------- */
.flagship {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r); overflow: hidden;
}
.flagship-head { padding: var(--pad); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.flagship-head .kicker {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--warn); margin: 0 0 8px;
}
.flagship-head h3 { font-size: clamp(19px, 2.6vw, 23px); margin-bottom: 8px; }
.flagship-head p { margin: 0; color: var(--txt-2); font-size: 15px; }
.flagship-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px; background: var(--line);
}
.flagship-body > div { background: var(--panel); padding: 20px var(--pad); }
.flagship-body h4 {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--txt-3); margin-bottom: 8px;
}
.flagship-body p { font-size: 14.5px; color: var(--txt-2); margin: 0; }
.flagship-foot {
  padding: 18px var(--pad); border-top: 1px solid var(--line);
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  font-size: 14px; color: var(--txt-3); background: var(--panel-2);
}

/* ---------- loop diagram ---------- */
.loop {
  list-style: none; padding: 0; margin: 26px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; counter-reset: step;
}
.loop li {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 15px 16px; font-size: 14.5px;
  color: var(--txt-2); counter-increment: step;
}
.loop li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-family: var(--mono); font-size: 12px;
  color: var(--accent); margin-bottom: 5px; font-weight: 600;
}
.loop li strong { color: var(--txt); display: block; font-weight: 600; margin-bottom: 2px; }

/* ---------- results table (real table, responsive) ---------- */
.table-wrap { margin-top: 24px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
caption {
  text-align: left; font-size: 13px; color: var(--txt-3);
  padding-bottom: 10px;
}
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--txt-3); font-weight: 600;
}
td { color: var(--txt-2); }
td:last-child { color: var(--txt); font-weight: 600; }

@media (max-width: 640px) {
  table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table, tbody, tr, td { display: block; width: 100%; }
  tr {
    border: 1px solid var(--line); border-radius: var(--r-sm);
    margin-bottom: 12px; padding: 6px 0; background: var(--panel);
  }
  td { border: 0; padding: 7px 16px; }
  td::before {
    content: attr(data-label) ": ";
    font-family: var(--mono); font-size: 11px; letter-spacing: .07em;
    text-transform: uppercase; color: var(--txt-3);
    display: block; margin-bottom: 1px;
  }
}

/* ---------- project list ---------- */
.projects { display: grid; gap: 14px; margin-top: 26px; }
.project {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px 22px;
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
}
.project h3 { font-size: 16.5px; margin-bottom: 4px; }
.project p { font-size: 14.5px; color: var(--txt-2); margin: 0 0 8px; }
.project .link {
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; min-height: 44px;
}
.project .stale { font-size: 13px; color: var(--txt-3); white-space: nowrap; }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px; margin-top: 26px; }
.skills h3 {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--txt-3); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.skills ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.skills li {
  font-size: 14px; color: var(--txt-2); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 11px;
}

/* ---------- gaps / honesty block ---------- */
.honest {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-left: 3px solid var(--warn); border-radius: var(--r);
  padding: 22px var(--pad);
}
.honest h3 { font-size: 16px; margin-bottom: 10px; }
.honest ul { margin: 0; padding-left: 20px; }
.honest li { color: var(--txt-2); font-size: 14.5px; margin-bottom: 7px; }
.honest li strong { color: var(--txt); }

/* ---------- contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; margin-top: 26px;
}
.contact-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px; text-decoration: none; color: inherit;
  display: block;
}
a.contact-card:hover { border-color: var(--accent); }
.contact-card .k {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--txt-3); margin-bottom: 7px;
}
.contact-card .v { font-size: 16px; color: var(--txt); font-weight: 600; word-break: break-word; }
.contact-card .h { font-size: 13px; color: var(--txt-3); margin-top: 5px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 34px 0 46px;
  font-size: 14px; color: var(--txt-3);
}
.site-footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.site-footer nav a { color: var(--txt-2); padding: 8px 10px; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { width: 132px; height: 132px; order: -1; }
  .project { grid-template-columns: 1fr; }
  .project .link, .project .stale { min-height: 44px; white-space: normal; }
  .site-nav { order: 3; width: 100%; border-top: 1px solid var(--line); padding-top: 6px; }
  .site-header .wrap { padding-top: 8px; }

  /* inline links sit in flowing text on desktop, but a thumb needs a real
     target on a phone — give them a 44px row without breaking the line box */
  .hero-meta a,
  .site-footer p a,
  .flagship-foot a {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .site-footer p { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
}
@media (max-width: 420px) {
  .hero-cta .btn { width: 100%; }
}

@media print {
  .site-header, .site-footer nav, .hero-cta { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  section { padding: 12pt 0; page-break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
}
