:root {
  --bg: #0a0a0a;
  --fg: #e8e6e0;
  --muted: #8a8a85;
  --accent: #7fb069;
  --accent-dim: rgba(127, 176, 105, 0.55);
  --border: rgba(255, 255, 255, 0.08);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Cascadia Code", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Matrix-code background ---------- */
#matrix-face {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  opacity: 0.8; /* master dimmer — keeps the content sections dominant */
}

/* Eye-glow layer: above the scrim (undimmed glow) but below the text. */
#matrix-eyes {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: block;
  pointer-events: none;
}

/* Light scrim just takes the edge off the brightest code behind the column;
   per-glyph text-shadow (below) does the real legibility work. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 46% 64% at 50% 48%,
      rgba(10, 10, 10, 0.4) 0%,
      rgba(10, 10, 10, 0.26) 50%,
      rgba(10, 10, 10, 0) 100%);
}

main {
  position: relative;
  z-index: 3;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(2.25rem, 6vh, 4rem) 1.5rem 2.5rem;
  /* local dark halo so text stays crisp over the moving code */
  text-shadow:
    0 0 5px rgba(10, 10, 10, 0.95),
    0 0 12px rgba(10, 10, 10, 0.85),
    0 1px 2px rgba(10, 10, 10, 0.9);
}

/* ---------- Intro reveal: face first, then content cascades in ---------- */
:root {
  --intro-hold: 1.9s; /* how long the face shows alone before text appears */
}

@keyframes mf-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes mf-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* each top-level block fades+rises in, staggered after the hold */
main > * {
  opacity: 0;
  animation: mf-rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
main > *:nth-child(1) { animation-delay: var(--intro-hold); }
main > *:nth-child(2) { animation-delay: calc(var(--intro-hold) + 0.13s); }
main > *:nth-child(3) { animation-delay: calc(var(--intro-hold) + 0.26s); }
main > *:nth-child(4) { animation-delay: calc(var(--intro-hold) + 0.39s); }
main > *:nth-child(5) { animation-delay: calc(var(--intro-hold) + 0.52s); }

/* scrim stays hidden during the intro so the face is crisp, then fades in */
.scrim {
  animation: mf-fade 0.9s ease var(--intro-hold) both;
}

/* accessibility: opt-out users get everything immediately, no delay */
@media (prefers-reduced-motion: reduce) {
  main > * { opacity: 1; animation: none; }
  .scrim { animation: none; }
}

/* ---------- Hero ---------- */
.hero {
  margin-bottom: 2.75rem;
}

.whoami {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

.whoami .prompt {
  color: var(--accent);
  margin-right: 0.15rem;
}

.bio {
  font-size: 1.25rem;
  color: var(--fg);
  max-width: 28ch;
}

/* ---------- Sections ---------- */
section {
  margin-bottom: 2.5rem;
}

.filename {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--accent-dim);
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

/* ---------- Projects ---------- */
.project {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  padding: 1.1rem 1rem;
  margin: 0 -1rem;
  border-top: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: background-color 0.15s ease, border-left-color 0.15s ease;
}

.project:last-of-type {
  border-bottom: 1px solid var(--border);
}

.project:hover {
  background-color: rgba(127, 176, 105, 0.11);
  border-left-color: var(--accent);
}

.project:hover .project-name {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.project-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.project-name {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.project-name:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
}

.project-desc {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 58ch;
}

/* ---------- also.md ---------- */
.also .filename {
  color: rgba(127, 176, 105, 0.4);
}

.also-card {
  display: block;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.7rem 1rem;
  margin: 0 -1rem;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: background-color 0.15s ease, border-left-color 0.15s ease;
}

.also-card:hover {
  background-color: rgba(127, 176, 105, 0.11);
  border-left-color: var(--accent);
}

.also-link {
  color: var(--fg);
  border-bottom: 1px solid var(--accent-dim);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.also-card:hover .also-link {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Links (social icons) ---------- */
.links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
}

.social {
  display: inline-flex;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.social svg {
  width: 23px;
  height: 23px;
  display: block;
}

.social:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

/* Official brand colors at rest */
.social-x { color: #e8e6e0; }
.social-github { color: #e8e6e0; }
.social-linkedin { color: #0a66c2; }
.social-email { color: var(--accent); }

/* ---------- Footer ---------- */
footer {
  margin-top: 2.75rem;
}

footer p {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(138, 138, 133, 0.55);
  letter-spacing: 0.02em;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .bio {
    font-size: 1.15rem;
  }
  .whoami {
    font-size: 0.82rem;
  }
}
