:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --line: #242424;
  --text: #f5f5f5;
  --muted: #888;
  --dim: #444;
  --accent: #16a34a;

  --display: "Space Grotesk", sans-serif;
  --body: "Inter", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; /* keeps section titles clear of the sticky navbar */ }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .35;
  mask-image: radial-gradient(ellipse at top, #000 30%, transparent 80%);
}

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.section { padding-block: 56px; }
.mono { font-family: var(--mono); }
.small { font-size: 12px; letter-spacing: .08em; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.btn {
  display: inline-block;
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .08em;
  background: var(--accent); color: #000;
  padding: 10px 18px; border-radius: 999px;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 24px rgba(22,163,74,.45); }

.eyebrow, .section-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .15em; color: var(--muted);
}
.section-label { margin-bottom: 40px; }
.section-label span { color: var(--text); }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  /* three columns so the links stay centered even with nothing on the right */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 16px max(16px, calc((100% - 1200px) / 2));
  background: rgba(10,10,10,.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { justify-self: start; font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 20px; }
.nav-links { display: flex; gap: 32px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; }
.nav-links a { color: var(--muted); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* ---------- HERO ---------- */
#home { scroll-margin-top: 200px; } /* Home and the logo go all the way to the top of the page */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start;
  padding-block: 48px 8px;
}
.hero-title {
  font-family: var(--display); font-weight: 700;
  font-size: min(88px, 6.6vw); line-height: .95; letter-spacing: -.02em;
  margin: -0.12em 0 32px; /* trims the line-height gap so text aligns with the photo top */
}
.nowrap { white-space: nowrap; }
.hero-sub { color: var(--muted); max-width: 480px; font-size: 17px; }

.hero-side { display: flex; flex-direction: column; gap: 24px; align-items: flex-end; }
.portrait { position: relative; width: 100%; max-width: 360px; }
.portrait img {
  aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%;
  width: 100%;
  transform: scaleX(-1); /* mirrored so the gaze points toward the text */
}

/* Cyan-tint effect (disabled). To turn it back on, add class="tinted"
   to the <figure id="portrait"> in index.html. Hover or tap shows real color. */
.portrait.tinted { cursor: pointer; }
.portrait.tinted img { filter: grayscale(1) contrast(1.1); transition: filter .5s; }
.portrait.tinted::after {
  content: ""; position: absolute; inset: 0; bottom: auto; aspect-ratio: 4 / 5;
  background: #19c3c8; mix-blend-mode: multiply; transition: opacity .5s;
}
.portrait.tinted:hover img, .portrait.tinted.color img { filter: none; }
.portrait.tinted:hover::after, .portrait.tinted.color::after { opacity: 0; }
.status { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.badge {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--accent);
  border: 1px solid var(--accent); padding: 4px 10px;
}

/* ---------- STATS ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.stat { padding: 32px 24px 32px 0; border-right: 1px solid var(--line); }
.stat + .stat { padding-left: 24px; }
.stat:last-child { border-right: 0; }
.stat strong { font-family: var(--display); font-size: clamp(56px, 8vw, 104px); line-height: 1; }
.stat .plus { font-family: var(--display); font-size: clamp(40px, 5vw, 64px); line-height: 1; color: var(--accent); }
.stat p { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: var(--muted); margin-top: 12px; }

.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; }
.marquee-track { display: flex; width: max-content; animation: scroll 55s linear infinite; }
.marquee-track span {
  font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--dim);
  padding-inline: 32px; transition: color .2s;
}
.marquee-track span:hover { color: var(--accent); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- SERVICES ---------- */
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px; transition: border-color .3s;
}
.card:hover { border-color: var(--accent); }
.services > * { min-width: 0; }
.service h3 { font-family: var(--mono); font-size: 20px; margin: 16px 0 12px; overflow-wrap: anywhere; }
.service p { color: var(--muted); }
.service-wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: center; }
.service { display: flex; flex-direction: column; }
.service-wide { display: grid; }
.card-head { display: flex; justify-content: space-between; font-size: 12px; }
.dot-active { font-family: var(--mono); font-size: 11px; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.dot-active::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent); animation: blink 1.6s infinite;
}
.code {
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 20px; overflow-x: auto; color: #ccc;
}
.code .k { color: var(--accent); }
.code .s { color: #7dd3fc; }
.code .f { color: #f0abfc; }
.code .muted { color: var(--muted); }

/* ---------- WORK ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.project { display: flex; flex-direction: column; }
.project h3 { font-family: var(--display); font-size: clamp(24px, 3vw, 34px); line-height: 1.1; margin: 28px 0 10px; }
.project > p { color: var(--muted); }
.project .tags { margin-top: 20px; }
.project-link {
  margin-top: auto; padding-top: 28px;
  font-size: 12px; letter-spacing: .08em; color: var(--accent);
}
a.project-link:hover { text-decoration: underline; }


/* ---------- EXPERIENCE ---------- */
.timeline { border-top: 1px solid var(--line); }
.job {
  display: grid; grid-template-columns: 200px 1fr; gap: 24px;
  padding: 36px 0; border-bottom: 1px solid var(--line);
}
.job h3 { font-family: var(--mono); font-size: 18px; margin: 6px 0 12px; overflow-wrap: anywhere; }
.job p { color: var(--text); }
.job p.muted { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; color: var(--muted);
}

/* ---------- CONTACT ---------- */
.contact-title { font-family: var(--display); font-size: clamp(36px, 5vw, 56px); line-height: 1.1; }
.contact-intro { color: var(--muted); font-size: 17px; max-width: 520px; margin: 12px 0 32px; }
.contact-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.contact-card { display: flex; flex-direction: column; gap: 10px; }
.contact-value { font-family: var(--display); font-size: clamp(18px, 2.4vw, 28px); overflow-wrap: break-word; }
.contact-value:hover { color: var(--accent); }
.contact-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; font-size: 12px; letter-spacing: .08em; }
.contact-actions a { color: var(--accent); }
.contact-actions a:hover { text-decoration: underline; }
.copy-btn {
  font: inherit; font-size: 11px; letter-spacing: .08em; cursor: pointer;
  background: none; color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.copy-btn:hover { border-color: var(--accent); }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); overflow: hidden; }
.footer-name {
  font-family: var(--display); font-weight: 700; text-align: center;
  font-size: clamp(56px, 16vw, 240px); line-height: .85; color: var(--surface);
  -webkit-text-stroke: 1px var(--line);
}
.footer-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-block: 32px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: var(--accent); }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s, transform .8s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-title { font-size: 10.5vw; margin-top: 0; }
  .hero-side { align-items: stretch; }
  .portrait { max-width: none; }
  .status { align-items: flex-start; }
  .services, .service-wide, .projects, .contact-cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat { padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .job { grid-template-columns: 1fr; gap: 8px; }
  .section { padding-block: 40px; }
  .code { white-space: pre-wrap; font-size: 12px; padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
