/* ===== SJ.DEV — Dark dev grid redesign ===== */
:root {
  --bg: #0b0f19;
  --panel: #111827;
  --line: #1f2937;
  --line-strong: #374151;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --dim: #858e9d; /* lightened from #6b7280 so small labels reach 4.5:1 */
  --white: #ffffff;
  --c1: #22d3ee; /* cyan */
  --c2: #f472b6; /* pink */
  --c3: #facc15; /* yellow */
  --green: #4ade80;
  --error: #fca5a5;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; } /* keeps headings clear of the sticky header */
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  background-image:
    linear-gradient(#ffffff08 1px, transparent 1px),
    linear-gradient(90deg, #ffffff08 1px, transparent 1px);
  background-size: 64px 64px;
}
a { color: var(--text); }
a:hover { color: var(--white); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--c1); color: var(--bg); padding: 8px 16px; z-index: 100; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 48px; padding-right: 48px; }
.mono { font-family: var(--mono); }
.section { padding-top: 40px; padding-bottom: 120px; }
.section h2 { font-size: 56px; font-weight: 700; margin: 0 0 40px; color: var(--white); }

/* ----- Buttons and links ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border: 1px solid var(--c1); border-radius: 6px;
  font-family: var(--mono); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.btn-solid { background: var(--c1); color: var(--bg); }
.btn-solid:hover { background: var(--white); border-color: var(--white); color: var(--bg); }
.btn:disabled { opacity: .6; cursor: wait; }
.text-link {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 8px;
  font-family: var(--mono); font-size: 15px; text-underline-offset: 6px; text-decoration-color: var(--c1);
}

/* ----- Header ----- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 20px; padding-bottom: 20px; }
.logo { font-family: var(--mono); font-weight: 700; font-size: 20px; text-decoration: none; }
.nav-links { display: flex; gap: 32px; font-family: var(--mono); font-size: 15px; }
.nav-links a { padding: 4px 0; text-decoration: none; }
.nav-links span { color: var(--c1); }
.menu-toggle {
  display: none; min-height: 44px; min-width: 44px; padding: 0 14px;
  background: transparent; color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 6px; font-family: var(--mono); font-size: 14px; cursor: pointer;
}

/* ----- Hero + terminal background ----- */
.hero { position: relative; overflow: hidden; }
.terminal-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, #000 80%);
  mask-image: radial-gradient(ellipse at center, transparent 30%, #000 80%);
}
.terminal-scroll { font-family: var(--mono); font-size: 14px; line-height: 2; padding: 0 48px; }
.terminal-lines div { white-space: pre; }
.t-g { color: var(--green); } .t-w { color: #d1d5db; } .t-d { color: var(--dim); }
.t-p { color: var(--c2); }   .t-y { color: var(--c3); } .t-b { color: var(--c1); }

/* js/script.js makes 4 copies of the lines, so moving up 25% = exactly one copy. */
@keyframes scrollUp { from { transform: translateY(0); } to { transform: translateY(-25%); } }
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .terminal-scroll.is-looping { animation: scrollUp 40s linear infinite; }
  .caret { animation: blink 1s steps(1) infinite; }
}

.hero-inner { position: relative; text-align: center; padding-top: 96px; padding-bottom: 80px; }
.hero-tag { font-family: var(--mono); color: #d1d5db; margin: 0 0 20px; font-size: 15px; }
.hero h1 { font-size: 120px; line-height: 0.95; font-weight: 700; letter-spacing: -4px; margin: 0; color: var(--white); white-space: nowrap; }
.hero-role { font-family: var(--mono); font-size: 22px; margin: 32px 0 0; color: #d1d5db; text-wrap: balance; }
.hero-role .d1 { color: var(--c1); } .hero-role .d2 { color: var(--c2); }
.hero-intro { font-size: 19px; color: #d1d5db; max-width: 620px; margin: 24px auto 0; line-height: 1.6; }
.hero-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 32px; }
.hero-meta {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 32px;
  font-family: var(--mono); font-size: 14px; color: #d1d5db; margin: 32px 0 0; text-wrap: balance;
}
.pin { color: var(--c1); }
.hero-prompt { font-family: var(--mono); font-size: 15px; color: var(--c1); margin: 20px 0 0; }

/* ----- Stats ----- */
.stats { padding-bottom: 120px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-strong); background: var(--bg); }
.stat { padding: 32px 40px; border-right: 1px solid var(--line-strong); }
.stat:last-child { border-right: 0; }
.stat .num { font-family: var(--mono); font-size: 40px; font-weight: 700; color: var(--white); }
.stat .lbl { font-family: var(--mono); font-size: 14px; color: var(--muted); margin-top: 8px; }

/* ----- About ----- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.about-copy p { margin: 0 0 20px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.about-copy p:last-child { margin-bottom: 0; }
.about-copy strong { color: var(--white); font-weight: 500; }
.facts { margin: 0; padding: 8px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 14px; line-height: 1.5; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--c1); flex: none; }
.facts dd { margin: 0; color: var(--text); text-align: right; }

/* ----- Expertise ----- */
.expertise-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-strong); background: var(--bg); }
.expertise-grid > div { padding: 40px; border-right: 1px solid var(--line-strong); }
.expertise-grid > div:last-child { border-right: 0; }
.bar { height: 4px; width: 48px; margin-bottom: 24px; }
.bar.c1 { background: var(--c1); } .bar.c2 { background: var(--c2); } .bar.c3 { background: var(--c3); }
.expertise-grid h3 { font-size: 26px; margin: 0 0 16px; color: var(--white); }
.expertise-grid p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 17px; }
.code-note { font-family: var(--mono); color: var(--dim); margin: 32px 0 0; font-size: 15px; }

.stack { margin-top: 72px; }
.stack h3 { font-size: 26px; margin: 0 0 24px; color: var(--white); }
.stack-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.chip { padding: 10px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 14px; color: var(--text); }

/* ----- Work ----- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; font-family: var(--mono); font-size: 14px; }
.filters button {
  min-height: 44px; padding: 0 20px; background: transparent; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--c1); color: var(--bg); border-color: var(--c1); font-weight: 700; }

.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.card:hover, .card:focus-within { transform: translateY(-4px); border-color: #4b5563; }
.card--static:hover, .card--static:focus-within { transform: none; border-color: var(--line); }
.card[hidden] { display: none; }
.thumb { aspect-ratio: 16 / 10; width: 100%; height: auto; object-fit: cover; background: var(--line); }
.thumb--contain { object-fit: contain; background: #f5f5f5; } /* matches the workflow screenshot's own background */
.thumb-btn {
  position: relative; z-index: 1; /* sits above the stretched card link */
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
}
.thumb-btn:focus-visible { outline-offset: -4px; }
.zoom-hint {
  position: absolute; right: 10px; bottom: 10px; padding: 4px 8px;
  background: var(--bg); color: var(--c1); border-radius: 4px;
  font-family: var(--mono); font-size: 12px; opacity: 0; transition: opacity .2s;
}
.card:hover .zoom-hint, .thumb-btn:focus-visible .zoom-hint { opacity: 1; }
@media (hover: none) { .zoom-hint { opacity: 1; } }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 26px; }
.cat { font-family: var(--mono); font-size: 12px; color: var(--c2); }
.card h3 { font-size: 22px; margin: 8px 0 10px; color: var(--white); }
.card p { flex: 1; margin: 0 0 16px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag { padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 4px; font-family: var(--mono); font-size: 12px; color: #d1d5db; }
.card-link { font-size: 15px; color: var(--muted); text-decoration: none; }
a.card-link::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */
.card:hover a.card-link { color: var(--white); }

/* ----- Experience ----- */
.roles { display: flex; flex-direction: column; gap: 20px; }
.role {
  display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding: 32px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.role .when { font-family: var(--mono); font-size: 14px; color: var(--c1); }
.role .where { font-size: 15px; color: var(--muted); margin-top: 6px; }
.role h3 { font-size: 24px; margin: 0 0 10px; color: var(--white); }
.role p { margin: 0 0 14px; color: var(--muted); line-height: 1.6; }
.role p:last-child { margin-bottom: 0; }
.role .tags-line { font-family: var(--mono); font-size: 13px; color: #d1d5db; }

/* ----- Contact ----- */
.contact { text-align: center; padding-top: 80px; padding-bottom: 120px; }
.contact .label { font-family: var(--mono); color: var(--muted); margin: 0 0 16px; }
.contact h2 { font-size: 56px; font-weight: 700; margin: 0; color: var(--white); }
.contact .sub { color: var(--muted); margin: 24px auto 48px; max-width: 620px; font-size: 18px; line-height: 1.6; }
.contact .email {
  font-size: 64px; font-weight: 700; color: var(--white); overflow-wrap: anywhere;
  text-decoration: underline; text-decoration-color: var(--c1); text-underline-offset: 10px;
}
.socials { display: flex; justify-content: center; gap: 28px; margin-top: 32px; font-family: var(--mono); }
.socials a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }

.contact-form { display: flex; flex-direction: column; gap: 24px; max-width: 560px; margin: 0 auto 72px; text-align: left; }
.contact-form[hidden], .form-thanks[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--mono); font-size: 14px; color: var(--c1); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 16px;
  background: var(--panel); color: var(--text);
  border: 1px solid #6b7280; border-radius: 6px; /* 3:1 against the field, so the box edge is visible */
  font-family: var(--mono); font-size: 16px; /* 16px stops iOS zooming in on focus */
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--error); }
.contact-form .btn { align-self: flex-start; }
.form-status { min-height: 20px; margin: -8px 0 0; font-family: var(--mono); font-size: 14px; }
.form-status.ok { color: var(--c1); }
.form-status.err { color: var(--error); }
.form-thanks { max-width: 560px; margin: 0 auto 72px; padding: 40px 24px; background: var(--panel); border: 1px solid var(--c1); border-radius: 12px; outline: none; }
.form-thanks .sent { font-family: var(--mono); font-size: 14px; color: var(--c1); }
.form-thanks h3 { margin: 12px 0 8px; font-size: 26px; color: var(--white); }
.form-thanks p { margin: 0; color: var(--muted); }

.site-footer { text-align: center; padding: 32px; color: var(--dim); font-size: 14px; border-top: 1px solid var(--line); }

/* ----- Lightbox ----- */
.lightbox {
  width: min(96vw, 1500px); max-height: 92vh; margin: auto; padding: 56px 16px 16px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }
.lightbox-scroll { overflow: auto; max-height: calc(92vh - 90px); background: #f5f5f5; }
.lightbox-scroll img { width: 100%; min-width: 900px; height: auto; }
.lightbox-close {
  position: absolute; top: 8px; right: 12px; min-height: 40px; padding: 0 14px;
  background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px;
  font-family: var(--mono); font-size: 14px; cursor: pointer;
}

/* ----- Responsive ----- */
@media (max-width: 960px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 88px; }
  .nav-links { gap: 18px; font-size: 14px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .stat { padding: 28px 24px; }
  .contact .email { font-size: 44px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 80px; }
  .wrap { padding-left: 24px; padding-right: 24px; }
  .site-header .wrap { padding-top: 12px; padding-bottom: 12px; }
  .section { padding-top: 24px; padding-bottom: 72px; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line);
    font-size: 15px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; border-top: 1px solid var(--line); }
  .hero-inner { padding-top: 72px; padding-bottom: 72px; }
  .hero h1 { font-size: clamp(44px, 14vw, 64px); letter-spacing: -2px; }
  .hero-role { font-size: 15px; margin-top: 24px; }
  .hero-intro { font-size: 17px; }
  .hero-meta { font-size: clamp(12px, 3.3vw, 14px); }
  .section h2, .contact h2 { font-size: 40px; }
  .stats { padding-bottom: 72px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 24px 20px; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line-strong); }
  .stat .num { font-size: 32px; }
  .stat .lbl { font-size: 13px; }
  .expertise-grid, .project-grid, .role { grid-template-columns: 1fr; }
  .expertise-grid > div { padding: 28px 24px; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .expertise-grid > div:last-child { border-bottom: 0; }
  .stack { margin-top: 48px; }
  .role { gap: 16px; padding: 24px; }
  .contact { padding-top: 48px; padding-bottom: 72px; }
  .contact .sub { font-size: 17px; margin-bottom: 40px; }
  .contact-form, .form-thanks { margin-bottom: 56px; }
  .contact-form .btn { align-self: stretch; }
  .contact .email { font-size: clamp(20px, 6vw, 44px); text-underline-offset: 6px; }
  .terminal-bg {
    opacity: 0.2; /* the text fills the screen on a phone, so the lines sit further back */
    -webkit-mask-image: radial-gradient(ellipse at center, transparent 40%, #000 90%);
    mask-image: radial-gradient(ellipse at center, transparent 40%, #000 90%);
  }
  .terminal-scroll { padding: 0 16px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn, .zoom-hint { transition: none; }
  .card:hover, .card:focus-within { transform: none; }
}
