/* ==========================================================================
   tgeddes.dev - shared styles
   Single dark palette.
   ========================================================================== */

/* --- Palette tokens ------------------------------------------------------- */

:root {
  --bg:          #0d0e0c;
  --bg-elev:    #14160f;
  --text:        #ecebe4;
  --heading:     #ffffff;
  --muted:       #b6bac1;
  --accent:      #4ade80;
  --accent-2:    #fbbf24;
  --accent-soft: rgba(74, 222, 128, 0.10);
  --border:      rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --code-bg:     #1a1c18;
  --code-text:   #86efac;
  --shadow:      0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 30px -10px rgba(0, 0, 0, 0.6);

  /* Grain overlay */
  --grain-opacity: 0.05;
}

/* --- Reset and base ------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s ease, color 0.35s ease;
  position: relative;
  overflow-x: hidden;
}

/* Subtle film grain - adds texture without dominating */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--grain-opacity);
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

a { color: inherit; text-decoration: none; }

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* --- Typography ----------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Geist', -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--heading);
  margin: 0;
}

.eyebrow,
.section-label,
.footer-label,
.stack-tag,
.chip,
.brand,
.playground-label {
  font-family: 'Geist Mono', ui-monospace, 'JetBrains Mono', monospace;
  font-feature-settings: "ss01" on, "ss02" on;
}

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

.site-header {
  position: relative;
  z-index: 10;
  padding: 1.5rem 0 0;
}

.site-nav {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  display: inline-flex;
  align-items: baseline;
}

.brand-mark {
  background: var(--text);
  color: var(--bg);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.brand-dot { color: var(--accent); margin: 0 0.05rem; font-weight: 700; }
.brand-tld { color: var(--text); }

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-link:hover { color: var(--accent); }

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding: 6rem 0 2rem;
  position: relative;
}

/* Tighten the gap into the first work section */
.hero + .work-section { padding-top: 2.5rem; }

.hero-name {
  font-family: 'Space Grotesk', 'Geist', -apple-system, sans-serif;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--accent);
  background: linear-gradient(95deg, #6ee7a8 0%, #4ade80 55%, #2dd4bf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 1rem;
}

.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 2rem;
}

.hero-headline {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 875px;
  margin-bottom: 2rem;
}

.hero-headline em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

.hero-sub {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: var(--muted);
  max-width: 875px;
  line-height: 1.5;
  margin: 0 0 2.5rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  color: #0d0e0c;
  font-weight: 600;
  box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
  cursor: default;
}

/* Each chip a distinct color; lift + colored glow on hover */
.chip:nth-child(1) { background: #4ade80; }
.chip:nth-child(2) { background: #fbbf24; }
.chip:nth-child(3) { background: #60a5fa; }
.chip:nth-child(4) { background: #c084fc; }
.chip:nth-child(5) { background: #f472b6; }
.chip:nth-child(6) { background: #2dd4bf; }

.chip:hover { transform: translateY(-3px); filter: brightness(1.05); }
.chip:nth-child(1):hover { box-shadow: 0 6px 22px -4px rgba(74, 222, 128, 0.6); }
.chip:nth-child(2):hover { box-shadow: 0 6px 22px -4px rgba(251, 191, 36, 0.6); }
.chip:nth-child(3):hover { box-shadow: 0 6px 22px -4px rgba(96, 165, 250, 0.6); }
.chip:nth-child(4):hover { box-shadow: 0 6px 22px -4px rgba(192, 132, 252, 0.6); }
.chip:nth-child(5):hover { box-shadow: 0 6px 22px -4px rgba(244, 114, 182, 0.6); }
.chip:nth-child(6):hover { box-shadow: 0 6px 22px -4px rgba(45, 212, 191, 0.6); }

@media (prefers-reduced-motion: reduce) {
  .chip { transition: box-shadow 0.25s ease; }
  .chip:hover { transform: none; }
}

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

.work-section,
.about,
.playground-cta-section {
  padding: 4rem 0;
  position: relative;
  z-index: 2;
}

.work-section { padding: 5rem 0; }

.section-header {
  max-width: 1240px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.section-heading {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  max-width: 28ch;
}

/* --- Project grid (Tier 1) ------------------------------------------------ */

.project-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0 2rem;
  max-width: 1240px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.project-card {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 4px;
  transition: transform 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-body { flex: 1; min-width: 0; }

.card-title {
  font-family: 'Space Grotesk', 'Geist', sans-serif;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  line-height: 1.1;
}

.card-description {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

/* In-card hero image: sits flush between title and description */
.card-hero {
  margin: 0 0 1.1rem;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Show the full image, scaled to a uniform height; width varies, never cropped. */
.card-hero img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--code-bg);
}

/* Clickable card title + thumbnail -> the project's About page */
.card-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.card-title-link:hover { color: var(--accent); }
/* display:contents lets the wrapped img keep participating in the .card-hero
   flex layout (uniform height), while the whole image stays clickable. */
.card-hero-link { display: contents; }
.card-hero-link img { cursor: pointer; transition: border-color 0.15s; }
.card-hero-link:hover img { border-color: var(--accent); }

.project-card-compact .card-hero {
  margin-bottom: 0.85rem;
}

.card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.stack-tag {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  white-space: nowrap;
}

.card-note {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1rem;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 0.15rem;
  margin-top: 0.5rem;
  transition: color 0.2s, border-color 0.2s, gap 0.2s;
}

.card-cta:hover {
  color: var(--accent);
  border-color: var(--accent);
  gap: 0.7rem;
}

.arrow { transition: transform 0.2s; }
.card-cta:hover .arrow { transform: translateX(2px); }

/* --- Project grid (Tier 2 compact) ---------------------------------------- */

.project-grid-compact {
  list-style: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card-compact {
  padding: 1.5rem;
  display: block;
}

.card-title-sm {
  font-family: 'Space Grotesk', 'Geist', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.card-description-sm {
  font-size: 0.92rem;
  color: var(--text);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.card-cta-sm {
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.1rem;
  display: inline-block;
  margin-top: 0.5rem;
  transition: color 0.2s, border-color 0.2s;
}

.card-cta-sm:hover { color: var(--accent); border-color: var(--accent); }

/* --- Playground CTA ------------------------------------------------------- */

.playground-cta-section { padding: 3rem 0 5rem; }

.playground-cta {
  display: block;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

.playground-cta-inner {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.playground-cta:hover .playground-cta-inner {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* Faux window chrome - a nod to the FakeDesktop playground */
.pg-titlebar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.pg-dots { display: inline-flex; gap: 0.45rem; }

.pg-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  opacity: 0.9;
}

.pg-dots i:nth-child(1) { background: #ff5f57; }
.pg-dots i:nth-child(2) { background: #febc2e; }
.pg-dots i:nth-child(3) { background: #28c840; }

.pg-titlebar-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.pg-window-body {
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem);
}

.playground-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.playground-headline {
  font-family: 'Space Grotesk', 'Geist', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  color: var(--heading);
  max-width: 22ch;
}

.playground-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.playground-action {
  font-family: 'Geist Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.playground-cta:hover .playground-action .arrow { transform: translateX(4px); }

/* --- About --------------------------------------------------------------- */

.about {
  border-top: 1px solid var(--border);
  padding: 5rem 0;
}

.about-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.about-body {
  margin-top: 2rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}

.about-body p { margin: 0 0 1.25rem; max-width: 64ch; }

.about-meta {
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
}

.inline-link {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  transition: opacity 0.2s;
}
.inline-link:hover { opacity: 0.75; }

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

.site-footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 4rem 0 3rem;
  position: relative;
  z-index: 2;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-col { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col-right { text-align: right; align-items: flex-end; }

.footer-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.footer-link {
  font-family: 'Geist Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--text);
  transition: color 0.2s;
}

.footer-link:hover { color: var(--accent); }

.footer-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 768px) {
  .site-nav { flex-wrap: wrap; gap: 1rem; }
  .nav-links { gap: 1rem; }

  .hero { padding: 4rem 0 5rem; }
  .hero-headline { font-size: clamp(1.6rem, 6.5vw, 2.4rem); }

  .project-grid,
  .project-grid-compact { grid-template-columns: 1fr; }

  .project-card { padding: 1.5rem; flex-direction: column; gap: 0.75rem; }
  .card-title { font-size: 1.75rem; }
  .card-hero { height: 200px; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-col-right { text-align: left; align-items: flex-start; }

}

/* === Mobile QA pass (responsive refinements) ============================= */
/*
   Additive-only block. Do not edit rules above - only append here.
   Problems fixed:
     1. Section vertical padding stays desktop-sized on phones, causing
        excessive dead space. Tightened for <= 768px and <= 480px.
     2. Nav links have no tap-target padding - hard to hit on phones.
        Added vertical padding to bring them closer to 44px touch area.
     3. hero padding further reduced at 480px - 4rem top/bottom is still
        generous on a small phone.
     4. project-card-compact had no padding override at 480px; inherited
        1.5rem which is fine, but card-title-sm can go a touch smaller.
*/

@media (max-width: 768px) {
  /* Section vertical padding - bring it in on tablets */
  .work-section              { padding: 3rem 0; }
  .playground-cta-section    { padding: 2rem 0 3.5rem; }
  .about                     { padding: 3rem 0; }

  /* Nav links - add vertical hit area so they're easier to tap */
  .nav-link {
    padding: 0.5rem 0;
    display: inline-block;
  }
}

@media (max-width: 480px) {
  /* Tighten hero further on small phones */
  .hero { padding: 2.5rem 0 3.5rem; }

  /* Section padding - small phones get even less dead space */
  .work-section              { padding: 2.5rem 0; }
  .playground-cta-section    { padding: 1.5rem 0 2.5rem; }
  .about                     { padding: 2.5rem 0; }

  /* Section header bottom margin */
  .section-header { margin-bottom: 1.75rem; }

  /* Compact card title - 1.35rem is fine, leave it; card description
     slightly tighter line-height helps on narrow columns */
  .card-description-sm { line-height: 1.45; }
}

/* === End Mobile QA pass ================================================== */

/* --- Page-load entrance animation ---------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    opacity: 0;
    transform: translateY(8px);
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  .hero-inner > *:nth-child(1) { animation-delay: 0.05s; }
  .hero-inner > *:nth-child(2) { animation-delay: 0.18s; }
  .hero-inner > *:nth-child(3) { animation-delay: 0.30s; }
  .hero-inner > *:nth-child(4) { animation-delay: 0.42s; }

  @keyframes rise {
    to { opacity: 1; transform: translateY(0); }
  }
}

/* === Card actions + "How it works" proof ================================= */
/*
   Quick-actions row + expandable architecture/glossary disclosure.
   Renders inside both full Tier 1 cards and compact Tier 2 cards.
*/

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 1rem;
}

.card-action {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  transition: color 0.18s, background-color 0.18s, border-color 0.18s, transform 0.18s;
}
.card-action:hover { transform: translateY(-1px); }
.card-action .arrow { transition: transform 0.2s; }
.card-action:hover .arrow { transform: translateX(2px); }

/* Per-action color coding (hero-pill palette) */
.card-action.demo            { color: #6ee7a8; border-color: rgba(74, 222, 128, 0.5);  background: rgba(74, 222, 128, 0.10); }
.card-action.demo:hover      { background: #4ade80; color: #0d0e0c; border-color: #4ade80; }
.card-action[download]       { color: #8fc4ff; border-color: rgba(96, 165, 250, 0.5);  background: rgba(96, 165, 250, 0.10); }
.card-action[download]:hover { background: #60a5fa; color: #0d0e0c; border-color: #60a5fa; }
.card-action[href*="github.com"]       { color: #cbabff; border-color: rgba(192, 132, 252, 0.5); background: rgba(192, 132, 252, 0.10); }
.card-action[href*="github.com"]:hover { background: #c084fc; color: #0d0e0c; border-color: #c084fc; }
.card-action.cta             { color: #fbbf24; border-color: rgba(251, 191, 36, 0.5);  background: rgba(251, 191, 36, 0.10); }
.card-action.cta:hover       { background: #fbbf24; color: #0d0e0c; border-color: #fbbf24; }

.card-note-inline {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

/* --- Disclosure ----------------------------------------------------------- */

details.proof {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

details.proof summary {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.2s;
}

details.proof summary::-webkit-details-marker { display: none; }

details.proof summary::before {
  content: "\25be"; /* down triangle */
  display: inline-block;
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  color: var(--accent);
}

details.proof[open] summary::before { transform: rotate(-180deg); }

details.proof summary:hover { color: var(--accent); }

.proof-body {
  padding-top: 1.1rem;
  display: grid;
  gap: 1.25rem;
}

.proof-diagram {
  overflow-x: auto;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.proof-diagram pre.mermaid {
  margin: 0;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre;
}

.proof-diagram svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.proof-glossary h4 {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.proof-glossary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.proof-glossary li {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}

.proof-glossary strong { color: var(--accent); font-weight: 600; }

.proof-glossary code {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.8em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.05em 0.35em;
  border-radius: 3px;
}

.proof-shot { margin: 0 0 0.25rem; }
.proof-shot img {
  width: 100%;
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.proof-shot:not(.is-empty) figcaption { display: none; }
.proof-shot.is-empty {
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  padding: 2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proof-shot figcaption {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: center;
}

/* Stack-tag colors are assigned per-unique-tag via JS (same tag -> same color everywhere) */

/* Two-row card actions: tighten the gap between primary and secondary rows */
.card-actions + .card-actions { margin-top: 0.5rem; }

/* --- Clickable diagram + fullscreen modal --------------------------------- */
.proof-diagram:has(svg) { cursor: zoom-in; position: relative; }

.proof-diagram:has(svg)::after {
  content: "Click to expand";
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.65;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.proof-diagram:has(svg):hover::after { opacity: 1; color: var(--accent); border-color: var(--accent); }

.diagram-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: rgba(5, 6, 5, 0.92);
  backdrop-filter: blur(3px);
}
.diagram-modal[hidden] { display: none; }

.diagram-modal-stage {
  width: min(1200px, 95vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
}
/* Proof content inside the modal */
.diagram-modal-stage .proof-body { padding-top: 0; }

/* Small proof-shot inside the modal; click to expand to full-res */
.diagram-modal-stage .proof-shot img {
  width: auto;
  max-width: 100%;
  max-height: 360px;
  margin: 0 auto;
  object-fit: contain;
  cursor: zoom-in;
}
.diagram-modal-stage .proof-shot:not(.is-empty)::after {
  content: "Click to expand";
  display: block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-top: 0.4rem;
}

/* Full-image view (swapped in when the small shot is clicked) */
.proof-fullview {
  display: grid;
  gap: 1rem;
  justify-items: start;
}
.proof-fullview img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: block;
}
.proof-goback {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background-color 0.18s;
}
.proof-goback:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.diagram-modal-stage .proof-diagram { cursor: default; }
.diagram-modal-stage .proof-diagram::after { display: none; }
.diagram-modal-stage .proof-diagram svg {
  width: 100%;
  height: auto;
  max-height: 68vh;
  display: block;
  margin: 0 auto;
}

/* "How it works" trigger button (opens the proof modal) */
.proof-trigger {
  margin-top: 1.25rem;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.18s, border-color 0.18s, background-color 0.18s;
}
.proof-trigger:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.proof-trigger-icon { font-size: 0.9rem; line-height: 1; }

/* When the trigger sits inline in the secondary actions row, drop the top gap */
.card-actions .proof-trigger { margin-top: 0; }

.diagram-modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.4rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.diagram-modal-close:hover { color: var(--accent); }

/* === End card actions + proof =========================================== */
