/* ============================================================
   Sheet 3 of 4 — system cards, track record, certifications, writing,
   peer testimonials, connect, footer, education, case-study pages,
   splash screen. Load AFTER styles.css.
   ============================================================ */

.pd-engine {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
}
.pd-engine-header { margin-bottom: 0.5rem; }
.pd-engine-desc { font-size: 0.87rem; line-height: 1.6; color: var(--fg-soft); margin-bottom: 0.85rem; }
.pd-engine-desc strong { color: var(--fg); }
.pd-surfaces { display: flex; flex-direction: column; gap: 0.45rem; }
.surface-item { font-size: 0.83rem; color: var(--fg-soft); display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.surface-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; background: var(--chip-bg);
  padding: 0.15em 0.5em; border-radius: 4px;
  color: var(--accent); font-weight: 500;
}
.surface-label { font-weight: 600; color: var(--fg); }

.pd-infra {
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 0.3rem;
  align-items: center; text-align: center;
}
.pd-infra-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-muted);
}
.pd-infra-stack {
  font-size: 0.83rem; color: var(--fg-muted);
}

@media (max-width: 640px) {
  .pd-engines { grid-template-columns: 1fr; }
  .pd-flagship { padding: 1.25rem; }
  .pd-arrow-row { max-width: 100%; }
}

/* ============================================================
   SYSTEM CARDS
   ============================================================ */
.systems-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; margin-bottom: 1.5rem;
}
.system-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s;
  position: relative;
}
.system-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.system-rail {
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.15rem;
}
.system-type {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent);
}
.system-metric {
  font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 600; color: var(--fg); line-height: 1.1;
}
.system-caption { font-size: 0.74rem; color: var(--fg-muted); }
.system-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.system-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 500; color: var(--fg);
}
.system-desc { font-size: 0.89rem; line-height: 1.7; color: var(--fg-soft); }

/* Full-width stack instead of the 3-up grid. Each project card now
   carries four labelled lines, which need reading width rather than a
   narrow column. */
.systems-grid--stack { grid-template-columns: 1fr; gap: 1.25rem; }
.systems-grid--stack .system-name { font-size: 1.35rem; }

/* Problem / Method / Proof / What you can verify. A definition list
   because that is what it is: four fixed questions, answered per card,
   in the same order every time so they can be compared across cards. */
.card-lines {
  display: grid;
  grid-template-columns: 11.5rem 1fr;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
}
.card-lines dt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-muted);
  padding-top: 0.15rem;
}
.card-lines dd {
  margin: 0;
  font-size: 0.9rem; line-height: 1.7; color: var(--fg-soft);
}
.card-lines dd code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86em; color: var(--accent);
}
.card-gt {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.95em;
  color: var(--accent-warm);
  border-bottom: 1px dotted var(--border);
  cursor: help;
}
.system-card--wip { border-style: dashed; box-shadow: none; }
.system-card--wip:hover { transform: none; box-shadow: none; }

@media (max-width: 720px) {
  .card-lines { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .card-lines dd { margin-bottom: 0.75rem; }
}

.tech-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.card-actions {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  align-items: center; margin-top: auto; padding-top: 0.5rem;
}
.expand-btn {
  background: none; border: none; padding: 0;
  font-size: 0.88rem; font-weight: 500; color: var(--fg-muted);
  text-decoration: underline; text-decoration-style: dotted;
  cursor: pointer; transition: color 0.2s;
}
.expand-btn:hover { color: var(--accent); }
.arch-expand { margin-top: 1rem; border-top: 1px solid var(--border-soft); padding-top: 1rem; }
.arch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.arch-box {
  background: var(--bg-alt); border-radius: var(--r);
  padding: 0.9rem; border: 1px solid var(--border-soft);
}
.arch-box h4,
.arch-box h3 {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--accent); margin-bottom: 0.4rem;
}
.arch-box p { font-size: 0.83rem; line-height: 1.6; color: var(--fg-soft); }

.supporting-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Smaller row-gap stacks the left-column cards (Azure + repo-context-hooks)
     tightly; the column-gap stays generous so the ML card on the right has
     breathing room. */
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}
.support-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm);
  position: relative;
  transition: box-shadow 0.25s, transform 0.25s;
}
.support-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.support-card h3 {
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 500;
  color: var(--fg); margin: 0.35rem 0 0.75rem;
}
.support-card p { font-size: 0.88rem; line-height: 1.65; color: var(--fg-soft); margin-bottom: 0.75rem; }
.support-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.support-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.support-list li { font-size: 0.88rem; line-height: 1.6; color: var(--fg-soft); }
.support-list strong { color: var(--fg); }
.ml-projects { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.5rem; }
.ml-project-entry { border-top: 1px solid var(--border-soft); padding-top: 0.9rem; }
.ml-project-entry h4 {
  font-size: 0.85rem; font-weight: 600; color: var(--fg); margin-bottom: 0.3rem;
}
.ml-project-entry p { font-size: 0.83rem; line-height: 1.6; color: var(--fg-soft); margin-bottom: 0.6rem; }

/* Status tag for work that is not shipped end-to-end. Reads as a state,
   not a decoration - only applied where the repo cannot back a finished
   claim, so a reviewer sees the honest state before the description. */
.wip-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-warm);
  border: 1px solid var(--accent-warm);
  border-radius: 2px;
  padding: 0.08rem 0.34rem;
  margin-left: 0.4rem;
  vertical-align: 0.08em;
}

@media (max-width: 900px) {
  .systems-grid { grid-template-columns: 1fr; }
  .arch-grid { grid-template-columns: 1fr; }
  .supporting-row { grid-template-columns: 1fr; gap: 1rem; }
}

/* ============================================================
   TRACK RECORD
   ============================================================ */
.track { display: flex; flex-direction: column; position: relative; }
.track::before {
  content: ''; position: absolute;
  left: 9.5rem; top: 0; bottom: 0;
  width: 1px; background: var(--border);
}
.track-item {
  display: grid; grid-template-columns: 9.5rem 1fr;
  gap: 2rem; padding-bottom: 2rem; position: relative;
}
.track-item::before {
  content: ''; position: absolute;
  left: 9.5rem; top: 1.5rem;
  width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  transform: translateX(-50%); z-index: 1;
  box-shadow: 0 0 0 3px var(--bg-alt);
}
.track-date {
  font-size: 0.74rem; color: var(--fg-muted);
  font-weight: 500; line-height: 1.5;
  padding-top: 1.35rem; padding-right: 1.25rem; text-align: right;
  white-space: nowrap;
}
.track-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.track-header {
  display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem;
}
.track-logo {
  width: 44px; height: 44px; border-radius: var(--r);
  overflow: hidden; border: 1px solid var(--border-soft);
  flex-shrink: 0; background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
}
.track-logo img { width: 100%; height: 100%; object-fit: contain; }
.track-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 500; color: var(--fg); margin-bottom: 0.2rem;
}
.track-company { font-size: 0.84rem; color: var(--fg-soft); margin-bottom: 0.15rem; }
.track-scope { font-size: 0.77rem; color: var(--accent); font-style: italic; }
/* Case entries inside a role. Each is a titled block with the same four
   labelled lines as a project card, so a reader who learned the pattern
   in Projects does not have to learn a second one here. */
.case {
  border-top: 1px solid var(--border-soft);
  padding-top: 1.1rem;
  margin-top: 1.1rem;
}
.case:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
/* Case bodies run as prose. The earlier version used labelled rows
   (Problem / What changed / Scope / Outcome), which spelled out what the
   sentences already said and read like a template. */
.case-body {
  font-size: 0.9rem; line-height: 1.75; color: var(--fg-soft);
  max-width: 74ch; margin: 0;
}
.case-body code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.86em; color: var(--accent);
}
.case-body em { color: var(--fg); }
.case-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 500; color: var(--fg);
  margin-bottom: 0.85rem;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem;
}
.case-gt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; letter-spacing: 0.06em;
  color: var(--accent-warm);
  border-bottom: 1px dotted var(--border);
  cursor: help;
  /* Deliberately NOT nowrap. A case can cite five ids, and as one
     unbreakable string its min-content width sets the timeline grid
     track, which pushed the whole page 122px wider than a 320px
     viewport. Single-id labels elsewhere may safely use nowrap. */
  overflow-wrap: anywhere;
}
/* Inline evidence-quality marker. Anything the record cannot document
   says so where it is claimed, not in a footnote nobody reaches. */
.claim-status {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.03em;
  color: var(--fg-muted);
  background: var(--chip-bg);
  border-radius: 2px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.25rem;
}
.track-card--edu { background: var(--bg-alt); }
/* The nine-month gap gets its own timeline row rather than being left
   for the reader to spot between two dates. */
.track-item--gap { padding-bottom: 2rem; }
.track-item--gap::before { background: var(--border); }
.track-gap {
  font-size: 0.84rem; line-height: 1.7; color: var(--fg-muted);
  padding: 1.1rem 1.25rem;
  border-left: 2px dashed var(--border);
  max-width: 62ch;
}

.track-bullets { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.track-bullets li {
  font-size: 0.87rem; line-height: 1.65; color: var(--fg-soft);
  padding-left: 1.1rem; position: relative;
}
.track-bullets li::before { content: '-'; position: absolute; left: 0; color: var(--accent-warm); }
.track-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

@media (max-width: 640px) {
  .track::before { display: none; }
  .track-item { grid-template-columns: 1fr; gap: 0.4rem; }
  .track-item::before { display: none; }
  .track-date { text-align: left; padding-top: 0; }
}

/* ============================================================
   CERTIFICATIONS
   ============================================================ */
.certs-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem;
}
.cert-item {
  display: flex; gap: 0.75rem; align-items: center;
  padding: 0.85rem 1rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.cert-badge { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.cert-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); border-radius: var(--r);
  color: var(--accent); font-size: 1.15rem;
}
.cert-info { display: flex; flex-direction: column; gap: 0.1rem; }
.cert-name { font-size: 0.81rem; font-weight: 600; color: var(--fg); line-height: 1.3; }
.cert-issuer { font-size: 0.73rem; color: var(--fg-muted); }
@media (max-width: 780px) { .certs-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .certs-grid { grid-template-columns: 1fr; } }

/* ============================================================
   WRITING
   ============================================================ */
.writing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2rem;
}
.writing-thumb {
  margin: 0 0 0.25rem;
  padding: 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  color: var(--fg-soft);
}
.writing-thumb .writing-diagram {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 320 / 120;
  color: var(--fg-soft);
}
.writing-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.65rem;
  transition: box-shadow 0.25s, transform 0.25s;
}
.writing-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.writing-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent-warm);
}
.writing-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 500; color: var(--fg); line-height: 1.4;
}
.writing-desc { font-size: 0.86rem; line-height: 1.65; color: var(--fg-soft); flex: 1; }
.research-card {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.75rem; margin-bottom: 2rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.research-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 500; color: var(--fg); line-height: 1.35;
}
.research-authors { font-size: 0.87rem; color: var(--fg-soft); }
.research-pub { font-size: 0.8rem; color: var(--fg-muted); }
.section-cta { text-align: center; margin: 0; }
/* The Publications section ends in a single Substack CTA; the standard
   5rem section bottom-padding produced visible dead space below the
   button before the next section's own top padding. Trim the bottom
   here so the page reads as a tight close, not a hanging break. */
.section#notes { padding-bottom: 1.5rem; }
@media (max-width: 780px) { .writing-grid { grid-template-columns: 1fr; } }

/* ============================================================
   PEER TESTIMONIALS
   ============================================================ */
.peer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.peer-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 1.25rem;
}
.peer-quote {
  font-family: 'Playfair Display', Georgia, serif; font-style: italic;
  font-size: 0.92rem; line-height: 1.7; color: var(--fg-soft); margin: 0; flex: 1;
}
.peer-author { display: flex; gap: 0.75rem; align-items: center; }
.peer-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
}
.peer-name {
  display: block; font-size: 0.87rem; font-weight: 600; color: var(--fg);
  text-decoration: none; transition: color 0.2s;
}
.peer-name:hover { color: var(--accent); }
.peer-role { display: block; font-size: 0.76rem; color: var(--fg-muted); }
@media (max-width: 780px) { .peer-grid { grid-template-columns: 1fr; } }

/* ============================================================
   CONNECT
   ============================================================ */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 3rem; align-items: start;
}
.contact-photo {
  width: 100%; border-radius: var(--r-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); object-fit: cover;
  aspect-ratio: 4/5; max-height: 300px;
}
.contact-intro { font-size: 0.9rem; line-height: 1.7; color: var(--fg-soft); margin-top: 1rem; }
.contact-links { display: flex; flex-direction: column; gap: 0.75rem; }
.contact-link {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.9rem 1.1rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r);
  text-decoration: none; color: var(--fg-soft); font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.contact-link:hover {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 2px 12px rgba(23,107,82,0.12);
}
.contact-link i { width: 18px; text-align: center; color: var(--accent); }
@media (max-width: 720px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-photo { max-height: 200px; max-width: 200px; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--fg); color: rgba(255,255,255,0.65); padding: 2.5rem 0; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  align-items: center; justify-content: space-between;
}
.footer-left { display: flex; flex-direction: column; gap: 0.2rem; }
.footer-name { font-family: 'Playfair Display', serif; font-size: 1rem; color: #fff; }
.footer-tagline { font-size: 0.76rem; color: rgba(255,255,255,0.45); }
.footer-nav { display: flex; gap: 1.25rem; }
.footer-nav a {
  color: rgba(255,255,255,0.6); text-decoration: none;
  font-size: 0.84rem; transition: color 0.2s;
}
.footer-nav a:hover { color: #fff; }
.footer-social { display: flex; gap: 1rem; }
.footer-social a { color: rgba(255,255,255,0.5); font-size: 1rem; transition: color 0.2s; }
.footer-social a:hover { color: #fff; }
.footer-copy { font-size: 0.76rem; color: rgba(255,255,255,0.35); width: 100%; text-align: center; margin-top: 0.5rem; }
/* Colophon: one quiet line of craft signal, in the site's annotation voice */
.footer-colophon {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem; color: rgba(255,255,255,0.28);
  width: 100%; text-align: center; margin-top: 0.15rem;
}
@media (max-width: 580px) { .footer-nav { display: none; } }

/* ============================================================
   EDUCATION
   ============================================================ */
.edu-card-row { margin-bottom: 1rem; }
.edu-card {
  display: flex; gap: 1.25rem; align-items: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow-sm);
  max-width: 560px;
}
.edu-logo-wrap {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: var(--r); border: 1px solid var(--border-soft);
  background: var(--bg-alt); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.edu-logo { width: 100%; height: 100%; object-fit: contain; }
.edu-degree {
  font-family: 'Playfair Display', serif; font-size: 1.05rem;
  font-weight: 500; color: var(--fg); margin-bottom: 0.2rem;
}
.edu-school { font-size: 0.83rem; color: var(--fg-soft); margin-bottom: 0.5rem; }
.edu-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ============================================================
   PLATFORM DIAGRAM LINKS
   ============================================================ */
.pd-link {
  color: inherit; text-decoration: none;
  transition: color 0.2s;
}
.pd-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   CONTACT - PLATFORM BRAND HOVER COLORS
   ============================================================ */
.contact-linkedin i { color: #0077b5; }
.contact-linkedin:hover { border-color: #0077b5; color: #0077b5; box-shadow: 0 2px 12px rgba(0,119,181,0.12); }
.contact-linkedin:hover i { color: #0077b5; }

.contact-github i { color: var(--fg); }
.contact-github:hover { border-color: #333; color: #333; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.contact-github:hover i { color: #333; }

.contact-substack i { color: #ff6719; }
.contact-substack:hover { border-color: #ff6719; color: #ff6719; box-shadow: 0 2px 12px rgba(255,103,25,0.12); }
.contact-substack:hover i { color: #ff6719; }

/* ============================================================
   ANIMATED CASE STUDY / ESSAY BUTTON
   ============================================================ */
.cs-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.8rem; font-weight: 600; text-decoration: none;
  color: var(--accent); border: 1.5px solid var(--accent);
  padding: 0.38rem 0.85rem 0.38rem 0.75rem;
  border-radius: 50px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.cs-btn-arrow {
  width: 14px; height: 14px; flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.cs-btn:hover { background: var(--accent); color: #fff; }
.cs-btn:hover .cs-btn-arrow { transform: translateX(3px); }

.cs-btn--substack {
  color: #ff6719; border-color: #ff6719;
}
.cs-btn--substack:hover { background: #ff6719; color: #fff; }

/* ============================================================
   WRITING - SUBSTACK CTA BUTTON
   ============================================================ */
.btn-substack {
  background: #ff6719; color: #fff;
  border: none; font-size: 0.9rem; font-weight: 500;
  padding: 0.65rem 1.35rem;
  border-radius: var(--r); text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-substack .substack-logo { width: 15px; height: 15px; flex-shrink: 0; }
.btn-substack:hover { background: #e05510; box-shadow: 0 2px 14px rgba(255,103,25,0.3); }

/* ============================================================
   WRITING CARD - STRETCHED LINK (whole card clickable)
   ============================================================ */
.writing-card { position: relative; }
.writing-card .writing-cta { position: static; }
.writing-card .writing-cta::after {
  content: ''; position: absolute; inset: 0;
  border-radius: var(--r-lg); z-index: 1;
}
.writing-card .writing-cta:hover::after { background: transparent; }

/* ============================================================
   REFERENCES - LINKEDIN RECOMMENDATION STYLING
   ============================================================ */
.peer-linkedin-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; font-weight: 600; color: #0077b5;
  background: rgba(0,119,181,0.07); border: 1px solid rgba(0,119,181,0.18);
  padding: 0.25rem 0.65rem; border-radius: 50px; margin-bottom: 0.5rem;
}
.peer-linkedin-badge i { font-size: 0.75rem; }

.peer-cta {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1rem; margin-top: 2rem;
}
.peer-cta-btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.88rem; font-weight: 600; text-decoration: none;
  padding: 0.65rem 1.4rem; border-radius: 50px;
  border: 2px solid; transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.peer-cta-btn--linkedin {
  color: #0077b5; border-color: #0077b5;
}
.peer-cta-btn--linkedin:hover {
  background: #0077b5; color: #fff;
  box-shadow: 0 2px 14px rgba(0,119,181,0.25);
}
.peer-cta-btn--substack {
  color: #ff6719; border-color: #ff6719;
}
.peer-cta-btn--substack:hover {
  background: #ff6719; color: #fff;
  box-shadow: 0 2px 14px rgba(255,103,25,0.25);
}

/* ============================================================
   ML PIPELINE ACCORDION
   ============================================================ */
.support-card--accordion { padding: 0; overflow: hidden; }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem; background: none; border: none; cursor: pointer;
  text-align: left; gap: 1rem;
}
.accordion-trigger .section-label { display: block; margin-bottom: 0.25rem; }
.accordion-trigger h3 { margin: 0; }
.accordion-trigger:hover { background: var(--bg-alt); }
.accordion-chevron {
  width: 20px; height: 20px; flex-shrink: 0; color: var(--fg-muted);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.accordion-trigger[aria-expanded="true"] .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0;
}
.accordion-project {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.accordion-project:last-child { border-bottom: none; }
.accordion-project strong { font-size: 0.9rem; color: var(--fg); display: block; margin-bottom: 0.3rem; }
.accordion-project p { font-size: 0.85rem; color: var(--fg-soft); line-height: 1.6; margin-bottom: 0.75rem; }
.accordion-body[hidden] { display: none; }

/* ============================================================
   CASE STUDY PAGES
   ============================================================ */
.page-shell { min-height: 100vh; }
.cs-nav {
  padding: 1rem 2rem; background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
}
.cs-nav__back {
  color: var(--accent); text-decoration: none;
  font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: color 0.2s;
}
.cs-nav__back:hover { color: var(--accent-lt); text-decoration: underline; }
.cs-nav__name { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--fg-muted); }
.cs-hero { padding: 4rem 0 2.5rem; }
.cs-hero__kicker {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent-warm); margin-bottom: 0.75rem;
}
.cs-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  font-weight: 600; line-height: 1.15; color: var(--fg);
  margin: 0 0 1.25rem; max-width: 780px;
}
.cs-hero__summary {
  font-size: 1.05rem; color: var(--fg-soft); max-width: 680px;
  line-height: 1.75; margin-bottom: 2rem;
}
/* Build-status callout for a case study whose repo cannot back a finished
   claim. Sits above the proof strip so the honest state is read before any
   architecture detail, not discovered afterwards. */
.cs-status-note {
  border-left: 3px solid var(--accent-warm);
  background: var(--chip-bg);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.75rem;
  max-width: 680px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--fg-soft);
}
.cs-status-note strong { color: var(--fg); }
.cs-proof-strip {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; margin-bottom: 1.5rem;
}
.cs-proof-strip span {
  display: inline-block; font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; color: var(--accent);
  background: var(--chip-bg); border: 1px solid var(--border-soft);
  border-radius: 4px; padding: 0.3rem 0.75rem;
}
.cs-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.65rem; background: var(--chip-bg);
  border-radius: 20px; font-size: 0.78rem; font-weight: 500;
  color: var(--accent); border: 1px solid var(--border-soft);
}
.cs-section {
  padding: 2.5rem 0; border-top: 1px solid var(--border);
}
.cs-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 500; margin: 0 0 1rem; color: var(--fg);
}
.cs-section p {
  color: var(--fg-soft); line-height: 1.75; max-width: 720px; margin-bottom: 1rem;
}
.cs-section p:last-child { margin-bottom: 0; }
.cs-section ul, .cs-section ol {
  color: var(--fg-soft); line-height: 1.75; max-width: 720px;
  padding-left: 1.25rem; margin-bottom: 1rem;
}
.cs-section li { margin-bottom: 0.4rem; }
.cs-section strong { color: var(--fg); font-weight: 600; }

/* Architecture flow diagram for case studies */
.cs-arch {
  display: flex; flex-direction: column; gap: 0;
  align-items: center; margin: 2rem 0;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 2rem;
}
.cs-arch-row { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.cs-arch-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0.75rem 1.25rem;
  font-size: 0.84rem; font-weight: 500; color: var(--fg);
  text-align: center; min-width: 140px;
}
.cs-arch-box.accent { border-color: var(--accent); color: var(--accent); }
.cs-arch-arrow {
  font-size: 1.1rem; color: var(--fg-muted);
  margin: 0.4rem 0; text-align: center;
}
.cs-arch-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--fg-muted); margin-bottom: 0.5rem;
  text-align: center; width: 100%;
}

/* Metrics grid for case studies */
.cs-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; margin: 1.5rem 0;
}
.cs-metric {
  background: var(--bg); padding: 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.cs-metric-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem; font-weight: 600; color: var(--accent); line-height: 1;
}
.cs-metric-lbl { font-size: 0.74rem; color: var(--fg-muted); font-weight: 500; }

/* Image/screenshot placeholder */
.cs-media-placeholder {
  background: var(--bg-alt); border: 1px dashed var(--border);
  border-radius: var(--r-lg); padding: 3rem 2rem;
  text-align: center; margin: 1.5rem 0; color: var(--fg-muted);
  font-size: 0.88rem; line-height: 1.6;
}
.cs-media-placeholder i { font-size: 2rem; display: block; margin-bottom: 0.75rem; opacity: 0.4; }

/* Lessons card */
.cs-lessons {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem;
}
.cs-lesson {
  padding: 1.25rem; border-radius: var(--r);
  font-size: 0.88rem; line-height: 1.65;
}
.cs-lesson.worked { background: rgba(23,107,82,0.06); border: 1px solid rgba(23,107,82,0.2); }
.cs-lesson.failed { background: rgba(181,117,42,0.06); border: 1px solid rgba(181,117,42,0.2); }
.cs-lesson h4,
.cs-lesson h3 {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 0.5rem;
}
.cs-lesson.worked h4 { color: var(--accent); }
.cs-lesson.failed h4 { color: var(--accent-warm); }
.cs-lesson p { color: var(--fg-soft); font-size: 0.86rem; }

/* Inline <code> in case-study prose can hold long shell snippets like
   "tailor-resume --artifact PATH:FORMAT --jd JD_PATH" (42 chars). On
   narrow viewports those overflow the column and trigger horizontal
   scroll. overflow-wrap: anywhere lets the browser break inside the
   code text only when it would otherwise overflow — desktop is
   unaffected. */
.cs-section code, .cs-hero code, .cs-section p code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 780px) {
  .cs-nav { padding: 0.875rem 1rem; }
  .cs-hero { padding: 2.5rem 0 2rem; }
  .cs-hero__summary { font-size: 0.97rem; line-height: 1.7; }
  .cs-proof-strip { gap: 0.4rem 0.55rem; }
  .cs-proof-strip span { font-size: 0.72rem; padding: 0.25rem 0.6rem; }
  .cs-section { padding: 1.75rem 0; }
  .cs-section p { font-size: 0.95rem; line-height: 1.7; }
  .cs-lessons { grid-template-columns: 1fr; }
}

/* Very narrow phones: hide the right-side site-name in the back nav
   so the back-link has the row to itself. The site-name reads as
   chrome, not content — no information lost when it's gone. */
@media (max-width: 480px) {
  .cs-nav__name { display: none; }
  .cs-nav { justify-content: flex-start; }
  .cs-hero h1 { font-size: 1.65rem; line-height: 1.2; }
}

/* inline code in system-desc */
.system-desc code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em; background: var(--chip-bg);
  padding: 0.1em 0.4em; border-radius: 3px;
  color: var(--accent);
}

/* ============================================================
   SPLASH SCREEN — SVG self-drawing brackets
   ============================================================ */
#splash-screen {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#splash-screen.splash-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
