/* ============================================================
   Leishka Pagan - Portfolio
   Shared stylesheet for all public pages (not investigations).
   Single file. No framework. Easy to maintain.
   ============================================================ */


/* ------------------------------------------------------------
   1. RESET + BASE
   ------------------------------------------------------------ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

::selection {
  background: rgba(59, 130, 246, 0.2);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
}


/* ------------------------------------------------------------
   2. COLOR + DESIGN TOKENS
   ------------------------------------------------------------ */

:root {
  /* backgrounds */
  --bg: #050505;
  --surface: #111111;
  --surface-2: #1a1a1a;

  /* text */
  --text: #f3f4f6;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* accent (interactive, links, focus) */
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-dim: rgba(59, 130, 246, 0.08);
  --accent-border: rgba(59, 130, 246, 0.2);

  /* borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  /* status */
  --success: #10b981;        /* open to work dot, active certs */
  --warning: #f59e0b;        /* in-progress, soft limits */
  --gate: #ef4444;           /* hard enforcement points in diagrams */

  /* transitions — targeted, not 'all'. use the right token per component. */
  --t-color: color 0.2s ease;
  --t-border: border-color 0.2s ease;
  --t-bg: background-color 0.2s ease;
  --t-transform: transform 0.2s ease;
  --t-opacity: opacity 0.2s ease;
}


/* ------------------------------------------------------------
   3. ACCESSIBILITY
   ------------------------------------------------------------ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  left: 0;
}

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

button:focus-visible,
a:focus-visible {
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}


/* ------------------------------------------------------------
   4. NAVIGATION
   ------------------------------------------------------------ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 52px;
}

.nav-logo {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--text);
}

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

.nav-links a {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 450;
}

.nav-links a:hover {
  color: var(--text);
}

/* current-page indicator */
.nav-links a.current {
  color: var(--text);
  position: relative;
}

.nav-links a.current::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -16px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}


/* ------------------------------------------------------------
   5. LAYOUT + CONTAINERS
   ------------------------------------------------------------ */

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

main {
  padding-top: 52px;            /* offset for fixed nav */
}

section {
  padding: 96px 0;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* section label (small caps accent eyebrow above section content) */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 2rem;
}

.section-lead {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 680px;
  line-height: 1.8;
}


/* ------------------------------------------------------------
   6. HERO (home page)
   ------------------------------------------------------------ */

.hero {
  padding: 120px 0 80px;
}

.hero-name {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.hero-title {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 2rem;
}

.hero-tagline {
  max-width: 680px;
  font-size: 1.05rem;
  color: var(--text);
  opacity: 0.92;
  font-weight: 450;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

/* "Open to work" banner */
.hero-availability {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text);
  margin-bottom: 2.5rem;
}

.hero-availability .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* hero action buttons */
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* hero stats strip */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.stat-val {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 500;
  line-height: 1.4;
}


/* ------------------------------------------------------------
   7. BUTTONS
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--t-bg), var(--t-color), var(--t-border);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

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

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}


/* ------------------------------------------------------------
   8. SYSTEM CARD  (Sentinel, ClearStep, AXIOM)
   Structured to front-load Problem / Approach / Proof.
   ------------------------------------------------------------ */

.systems-grid {
  display: grid;
  gap: 1.5rem;
}

.system-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.25rem;
  transition: var(--t-border), var(--t-transform);
}

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

.system-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

/* Problem / Approach / Proof blocks */
.system-block {
  margin-bottom: 1.25rem;
}

.system-block:last-of-type {
  margin-bottom: 1.5rem;
}

.block-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.block-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.block-body strong {
  color: var(--text);
  font-weight: 600;
}

/* Constraints block — the engineering credibility signal */
.constraints {
  background: var(--accent-dim);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.constraints .block-label {
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.constraints ul {
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.constraints ul li {
  padding-left: 1.2rem;
  position: relative;
}

.constraints ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* tech stack chip row */
.system-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.system-stack span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

/* system card links row */
.system-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.system-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0.9rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: var(--t-color), var(--t-border), var(--t-bg);
}

.system-link:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.system-link svg {
  width: 14px;
  height: 14px;
}


/* ------------------------------------------------------------
   9. ARCHITECTURE DIAGRAMS (inline SVG)
   Diagrams show control, not just flow.
   ------------------------------------------------------------ */

.diagram {
  margin: 1.75rem 0 1.25rem;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

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

/* diagram element styles (inline inside SVG via these class hooks) */
.diagram .node-box {
  fill: var(--surface);
  stroke: var(--border-hover);
  stroke-width: 1;
}

.diagram .node-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  fill: var(--text);
}

.diagram .node-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  fill: var(--text-muted);
}

/* Arrow stroke styling. Markers are defined inline per-diagram
   (see index.html <defs>) and referenced directly on each <line>
   via marker-end, so all diagrams stay self-contained and
   arrow direction can differ per-diagram without CSS coupling. */
.diagram .arrow {
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
}

/* enforcement gate marker (the differentiator) */
.diagram .gate-box {
  fill: rgba(239, 68, 68, 0.08);
  stroke: var(--gate);
  stroke-width: 1.5;
}

.diagram .gate-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  fill: var(--gate);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


/* ------------------------------------------------------------
   10. INVESTIGATION CARD (home teaser + index page)
   ------------------------------------------------------------ */

.investigations-grid {
  display: grid;
  gap: 1.25rem;
}

.investigation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 2rem;
  transition: var(--t-border), var(--t-transform);
  display: block;
  color: inherit;
}

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

.investigation-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.investigation-card .inv-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.investigation-card .inv-outcome {
  font-size: 0.82rem;
  line-height: 1.6;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.investigation-card .inv-outcome strong {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.25rem;
}

.investigation-card .inv-outcome span {
  color: var(--text-secondary);
}

.investigation-card .inv-view {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  margin-top: 0.9rem;
  font-weight: 500;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.investigation-card:hover .inv-view {
  opacity: 1;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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


/* ------------------------------------------------------------
   11. TEASER BLOCK (experience teaser on home)
   ------------------------------------------------------------ */

.teaser {
  max-width: 720px;
}

.teaser p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.teaser p:last-of-type {
  margin-bottom: 1.5rem;
}


/* ------------------------------------------------------------
   12. PROOF STRIP (compact home) + PROOF PAGE
   ------------------------------------------------------------ */

.proof-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.proof-strip-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: var(--t-border);
}

.proof-strip-item:hover {
  border-color: var(--accent-border);
}

.proof-strip-item .proof-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.proof-strip-item .proof-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* full proof cards on proof.html */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.proof-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--t-border), var(--t-transform);
}

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

.proof-card img {
  width: 100%;
  display: block;
  opacity: 0.92;
  transition: opacity 0.2s;
}

.proof-card:hover img {
  opacity: 1;
}

.proof-info {
  padding: 0.9rem 1.1rem;
}

.proof-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.proof-issuer {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.proof-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.proof-verify {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--accent);
  margin-top: 0.5rem;
  font-weight: 500;
  opacity: 0.7;
  transition: var(--t-opacity);
}

.proof-verify:hover {
  opacity: 1;
}

/* text-only proof card (for MS AI Challenge, no image) */
.proof-card-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--t-border);
}

.proof-card-text:hover {
  border-color: var(--accent-border);
}


/* ------------------------------------------------------------
   13. CONTACT CARDS
   ------------------------------------------------------------ */

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

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: var(--t-border);
  color: inherit;
}

.contact-card:hover {
  border-color: var(--accent-border);
  color: inherit;
}

.contact-card:hover svg {
  color: var(--accent);
}

.contact-card svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: color 0.2s;
  flex-shrink: 0;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}

.contact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.contact-value {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 450;
  margin-top: 0.1rem;
}


/* ------------------------------------------------------------
   14. EXPERIENCE PAGE BLOCKS
   ------------------------------------------------------------ */

.exp-block {
  max-width: 760px;
  margin-bottom: 3.5rem;
}

.exp-block:last-of-type {
  margin-bottom: 0;
}

.exp-header {
  margin-bottom: 1rem;
}

.exp-block h3 {
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.exp-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.exp-body p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.exp-body ul {
  list-style: none;
  margin-bottom: 1rem;
}

.exp-body ul li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  padding: 0.4rem 0 0.4rem 1.25rem;
  position: relative;
}

.exp-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1rem;
  width: 6px;
  height: 1px;
  background: var(--text-muted);
}


/* ------------------------------------------------------------
   15. FOOTER
   ------------------------------------------------------------ */

footer {
  padding: 2.5rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

footer p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
}


/* ------------------------------------------------------------
   16. LIGHTBOX (for cert images)
   ------------------------------------------------------------ */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 250;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 92%;
  max-height: 92%;
  border-radius: 6px;
}


/* ------------------------------------------------------------
   17. FADE-IN ON SCROLL
   ------------------------------------------------------------ */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* fallback for no-JS: show everything immediately */
html:not(.js) .fade-in {
  opacity: 1;
  transform: none;
}


/* ------------------------------------------------------------
   18. RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 768px) {
  section {
    padding: 72px 0;
  }

  .container {
    padding: 0 1.25rem;
  }

  .hero {
    padding: 90px 0 60px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .nav-inner {
    padding: 0 1.25rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.8rem 1.25rem;
    font-size: 0.88rem;
  }

  .nav-links a.current::after {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .system-card {
    padding: 1.5rem;
  }

  .system-card h3 {
    font-size: 1.2rem;
  }

  .investigation-card {
    padding: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    justify-content: center;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: 2.25rem;
  }

  .proof-grid {
    grid-template-columns: 1fr;
  }
}
