:root {
  --bg: #0a0c10;
  --bg-alt: #0f1218;
  --surface: #161a22;
  --surface-hover: #1c212b;
  --border: #262b35;
  --text: #eef0f3;
  --text-muted: #99a1ad;
  --text-faint: #5b6472;
  --accent: #e0984a;
  --accent-dim: #8a6636;
  --accent-ink: #241505;
  --status: #5b9bd9;
  --radius: 14px;
  --radius-block: 8px;
  --max-width: 900px;
  --transition: 200ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  margin: 0;
}

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

ul {
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-heading {
  position: relative;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 14px;
}

.section-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transition: width 650ms ease 150ms;
}

.section-heading.is-visible::after {
  width: 56px;
}

/* ---------------------------------- Top bar ---------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms ease;
}

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

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

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

.hero {
  padding: 100px 24px 90px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-wrap {
  position: relative;
  display: flex;
  gap: 16px;
}

.hero-inner {
  max-width: 560px;
  flex: 1 1 auto;
  min-width: 0;
}

.hero-photo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  margin-bottom: 20px;
}

.hero-eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}

.hero-heading {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.hero-buttons {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1.5px solid var(--accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

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

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

.hero-links {
  margin-top: 36px;
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 600;
  transition: color var(--transition);
}

.hero-link svg {
  width: 23px;
  height: 23px;
  flex-shrink: 0;
}

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

/* ---------------------------------- Hero project graph ---------------------------------- */

.graph {
  /* Taken out of the flex flow and centered as an absolute overlay: the
     graph's fixed 460px height is taller than the hero text column, and
     as a flex sibling it forced hero-wrap's box (and everything below it)
     to that full height regardless of alignment. Positioning it this way
     keeps it visually centered beside the text — same look as before —
     without it dictating hero's layout height. */
  position: absolute;
  top: calc(50% + 28px);
  right: 0;
  transform: translateY(-50%);
  width: 480px;
  height: 460px;
  z-index: 1;
}

.graph svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.edge {
  stroke: var(--accent);
  fill: none;
  transition: opacity 220ms ease, stroke-width 220ms ease;
}

.graph.is-active .edge { opacity: 0.08; }
.graph.is-active .edge.is-lit { opacity: 0.75; }

/* Faint background mesh between projects that share no tags -- not a real
   relationship, purely so the graph reads as one connected cluster instead
   of a few lines plus orphaned dots floating with nothing attached. Stays
   faint always; never brightens on hover the way a real edge does. */
.edge-ambient {
  stroke: var(--text-faint);
  fill: none;
  opacity: 0.09;
  transition: opacity 220ms ease;
}

.graph.is-active .edge-ambient { opacity: 0.04; }

/* The node's own box is sized and centered on the dot ONLY -- the label is
   positioned absolutely off to the side, not in-flow next to the dot, so
   it can never pull the centering transform off-center and misalign the
   dot from the coordinate the SVG lines are drawn to. */
.node {
  position: absolute;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  outline: none;
}

.node-dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(224, 152, 74, 0.5);
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
  flex-shrink: 0;
}

/* Continuous, gentle "breathing" glow on its own layer behind the dot --
   kept off .node-dot's own box-shadow so the hover glow (which animates
   box-shadow via transition) never has to fight a running keyframe
   animation for that same property. Animates transform/opacity on a soft
   radial-gradient layer rather than box-shadow: box-shadow isn't
   GPU-composited, so the browser repaints it every frame, which reads as
   stutter at a slow multi-second duration. transform/opacity run on the
   compositor and stay smooth regardless of how slow the animation is. */
.node-pulse {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 152, 74, 0.5) 0%, rgba(224, 152, 74, 0) 72%);
  animation: breathe 3.4s linear infinite;
  animation-delay: var(--pulse-delay, 0s);
  pointer-events: none;
  transition: opacity 180ms ease;
  will-change: transform, opacity;
}

.node:hover .node-pulse,
.node:focus-visible .node-pulse {
  opacity: 0;
}

.node-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: pulseRing 3.6s ease-out infinite;
}

.node-label {
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
  background: rgba(10, 12, 16, 0.85);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.node:hover .node-dot,
.node:focus-visible .node-dot {
  transform: scale(1.7);
  box-shadow: 0 0 18px 2px rgba(224, 152, 74, 0.55);
}

.node:hover .node-label,
.node:focus-visible .node-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.graph.is-active .node { opacity: 0.35; transition: opacity 220ms ease; }
.graph.is-active .node.is-lit { opacity: 1; }

@keyframes pulseRing {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Sampled from a sine curve at 8 steps with linear interpolation between
   them, rather than 2 keyframes with ease-in-out. ease-in-out on just a
   start/mid/end triplet decelerates almost to a stop at each peak and
   trough before reversing -- technically smooth, but that "hang" at the
   top/bottom of the cycle is what reads as a stutter or hitch. Sampling
   more points along the real curve and interpolating linearly between
   them keeps velocity continuous through the whole cycle, so there's no
   perceptible pause anywhere in it. */
@keyframes breathe {
  0%   { transform: scale(0.750); opacity: 0.400; }
  12.5% { transform: scale(0.873); opacity: 0.522; }
  25%  { transform: scale(1.075); opacity: 0.700; }
  37.5% { transform: scale(1.277); opacity: 0.878; }
  50%  { transform: scale(1.400); opacity: 1.000; }
  62.5% { transform: scale(1.277); opacity: 0.878; }
  75%  { transform: scale(1.075); opacity: 0.700; }
  87.5% { transform: scale(0.873); opacity: 0.522; }
  100% { transform: scale(0.750); opacity: 0.400; }
}

/* Below this width there isn't room for a 480px graph beside the text
   column without the two colliding -- hide it rather than let it overlap
   the heading/buttons. Hover-driven UI doesn't translate well to touch
   anyway, so this also naturally hands off to mobile. */
@media (max-width: 1040px) {
  .graph { display: none; }
  .hero-inner { max-width: none; }
}

/* ---------------------------------- Sections (general) ---------------------------------- */

.about,
.skills,
.projects,
.resume {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.resume {
  border-bottom: none;
}

.about-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
}

/* ---------------------------------- Reveal animation ---------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------- Skills ---------------------------------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.skill-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-block);
  padding: 20px;
  transition: border-color var(--transition);
}

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

.skill-label {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.skill-items {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ---------------------------------- Projects ---------------------------------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.projects-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.project-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-block);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

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

.project-card-image {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  border-bottom: 2px solid var(--border);
  transition: border-color var(--transition);
}

.project-card:hover .project-card-image {
  border-color: var(--accent);
}

.project-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}

.project-card:hover .project-tag {
  border-color: var(--accent);
}

/* Status tag ("In Progress") -- a different color from skill/tech tags so
   it reads as project state, not another capability being claimed. */
.project-tag--status {
  background: rgba(91, 155, 217, 0.12);
  border-color: var(--status);
  color: var(--status);
  font-weight: 700;
}

.project-card:hover .project-tag--status {
  border-color: var(--status);
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 16px;
}

.project-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.project-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 18px;
  bottom: -3px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 250ms ease;
}

.project-link:hover::after {
  transform: scaleX(1);
}

.card-arrow {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform var(--transition);
}

/* ---------------------------------- Resume ---------------------------------- */

.resume-download-row {
  margin-bottom: 28px;
}

.resume-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.resume-block + .resume-block {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.resume-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.resume-entry + .resume-entry {
  margin-top: 16px;
}

.resume-entry-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.resume-entry-meta {
  color: var(--text-faint);
  font-size: 0.88rem;
  margin-top: 2px;
}

.resume-entry-detail {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 6px 0 0;
}

.resume-bullets {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.resume-bullets li + li {
  margin-top: 4px;
}

.resume-skill-line {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.resume-skill-line strong {
  color: var(--text);
}

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

.footer {
  padding: 32px 24px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.footer-inner span {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------------------------------- Mobile ---------------------------------- */

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }

  .nav.is-open {
    max-height: 320px;
  }

  .nav-link {
    padding: 10px 0;
    width: 100%;
  }

  .hero {
    padding: 72px 20px 48px;
  }

  .hero-links {
    gap: 22px;
  }

  .hero-link {
    font-size: 1rem;
  }

  .resume-text {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .section-heading::after {
    transition: none;
  }

  .node-pulse,
  .node-ring {
    animation: none;
  }
}

/* ---------------------------------- Project detail pages ---------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: color var(--transition);
}

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

.project-detail-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 40px;
}

.project-detail-eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 24px 0 10px;
}

.project-detail-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.project-detail-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 16px 0 0;
  line-height: 1.7;
}

.project-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.project-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.project-detail-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 72px;
}

.detail-section {
  margin-top: 48px;
}

.detail-section:first-child {
  margin-top: 0;
}

.detail-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.detail-section p {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.75;
  margin: 0 0 16px;
}

.detail-section p:last-child {
  margin-bottom: 0;
}

.detail-list {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.detail-list li + li {
  margin-top: 8px;
}

.detail-list:last-child {
  margin-bottom: 0;
}

.detail-figure {
  margin: 28px 0;
}

.detail-figure img,
.detail-figure video {
  width: 100%;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.detail-figure figcaption {
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 0.85rem;
  text-align: center;
}

/* Phone screenshots are much lower resolution than the content column is
   wide, so stretching them to 100% makes them look soft -- cap their
   width and center them instead. */
.detail-figure--phone img {
  width: auto;
  max-width: 260px;
  margin: 0 auto;
}

.code-block {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 20px 0;
}

.code-block code {
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre;
}
