/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  /* core palette */
  --ink: #0D1117;
  --surface: #151B23;
  --surface-2: #1B222C;
  --line: #242B36;
  --fg: #E6EDF3;
  --muted: #8A94A6;
  --accent: #FFB454;
  --accent-dim: #8a672f;

  /* semantic (borrowed from real HTTP conventions — grounded in the subject) */
  --status-ok: #3FB950;
  --method-get: #79C0FF;
  --method-post: #FFB454;

  /* type */
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 10px;
  --max-w: 900px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }


body {
  margin: 0;
  /* Keep the solid base color as a fallback */
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;

  /* Required to position the background pseudo-element correctly */
  position: relative;
  /* Prevents the scaled gradient from causing horizontal scrollbars */
  overflow-x: hidden;
}

/* 1. Define the subtle breathing animation for the background */
@keyframes auroraBreathe {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* 2. Create the lag-free gradient layer */
body::before {
  content: "";
  /* Fixed positioning decoupled from the document flow prevents scroll lag */
  position: fixed;
  top: -10%;
  left: -10%;
  width: 120vw;
  height: 120vh;
  z-index: -1; /* Keeps it behind all your content */
  pointer-events: none; /* Ensures it doesn't block clicks */

  /* A dark, mesh-like radial gradient using your theme colors */
  background:
    radial-gradient(circle at 20% 30%, rgba(121, 192, 255, 0.15), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 180, 84, 0.12), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(138, 103, 47, 0.08), transparent 60%);

  /* Hardware-accelerated animation */
  animation: auroraBreathe 15s ease-in-out infinite;
  will-change: transform, opacity;
}

/* 3. Disable the background animation for accessibility if requested */
@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none !important;
    opacity: 0.8;
  }
}

h1, h2, h3 { margin: 0; font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--ink);
  padding: var(--space-1) var(--space-2);
  z-index: 100;
  font-family: var(--font-mono);
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

/* ==========================================================================
   Shared utility
   ========================================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section__inner,
.hero__inner,
.footer__inner,
.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.section { padding: var(--space-6) 0; border-top: 1px solid var(--line); }
.section__title { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: var(--space-2); }
.section__lede { color: var(--muted); max-width: 60ch; margin-bottom: var(--space-4); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.7em 1.1em;
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--ink); border-color: var(--accent); font-weight: 600; }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--fg); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
.nav__logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}
.nav__logo-bracket { color: var(--accent); }
.nav__links {
  display: flex;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.nav__links a:hover { color: var(--fg); }
.nav__github { color: var(--muted); }
.nav__github:hover { color: var(--accent); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: var(--space-6) 0 var(--space-5); }
.hero__title {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.15;
  margin: var(--space-1) 0 var(--space-2);
  max-width: 16ch;
}
.hero__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.hero__lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 58ch;
  margin-bottom: var(--space-4);
}

/* ==========================================================================
   Impact Metrics Grid
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* Load-in keyframes */
@keyframes metricEnter {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric {
  background: rgba(21, 27, 35, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

  /* Entrance animation */
  animation: metricEnter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  will-change: transform, border-color, box-shadow, background-color;

  /* Smooth 1.5s ease transition for both entering and leaving hover */
  transition: transform 0.5s ease,
              border-color 0.5s ease,
              box-shadow 0.5s ease,
              background-color 0.5s ease;
}

/* Stagger load-in */
.metric:nth-child(1) { animation-delay: 0.1s; }
.metric:nth-child(2) { animation-delay: 0.2s; }
.metric:nth-child(3) { animation-delay: 0.3s; }

.metric:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 180, 84, 0.5);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.6),
              0 8px 20px -5px rgba(255, 180, 84, 0.15);
  background-color: rgba(30, 38, 49, 0.8);
}

.metric__number {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
  transition: color 1.5s ease;
}

.metric:hover .metric__number {
  color: #FFC57A;
}

.metric__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

.metric__detail {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ==========================================================================
   Responsive Overrides & Fallbacks
   ========================================================================== */
@media (max-width: 720px) {
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .metric {
    animation: none !important;
  }
  .metric:hover {
    transform: translateY(-2px) !important;
    box-shadow: none !important;
  }
}

/* Add this inside your existing @media (max-width: 720px) block at the bottom of the file */
@media (max-width: 720px) {
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
}

.hero__ctas { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ==========================================================================
   Projects — "endpoint" cards
   ========================================================================== */
.endpoints { display: flex; flex-direction: column; gap: var(--space-3); }

.endpoint {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.endpoint.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .endpoint { opacity: 1; transform: none; }
}

.endpoint__route {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.method {
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}
.method--get { color: var(--method-get); background: rgba(121,192,255,0.12); }
.method--post { color: var(--method-post); background: rgba(255,180,84,0.12); }
.endpoint__path { color: var(--fg); }
.status-pill {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--status-ok);
  border: 1px solid rgba(63,185,80,0.35);
  background: rgba(63,185,80,0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.endpoint__name { font-size: 1.3rem; margin-bottom: 0.3rem; }
.endpoint__tagline { color: var(--muted); margin-bottom: var(--space-2); max-width: 65ch; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--space-2); }
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.endpoint__highlights { margin-bottom: var(--space-2); }
.endpoint__highlights li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.4rem;
  color: var(--fg);
}
.endpoint__highlights li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

.endpoint__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--line);
}
.endpoint__date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.endpoint__links { display: flex; gap: var(--space-2); }
.endpoint__links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}
.endpoint__links a:hover { text-decoration: underline; }

/* ==========================================================================
   Skills
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
}

/* Updated skill-card__title for flex layout */
.skill-card__title {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: var(--space-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* New class for the skill icons */
.skill-icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--accent);
}

.skill-card .tag { color: var(--fg); }

/* ==========================================================================
   Experience
   ========================================================================== */
.timeline__item {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}
.timeline__item:first-child { border-top: none; padding-top: 0; }
.timeline__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin-bottom: 0.4rem;
}
.timeline__head h3 { font-size: 1rem; font-weight: 600; }
.timeline__at { color: var(--muted); font-weight: 400; }
.timeline__date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.timeline__item p { color: var(--muted); max-width: 65ch; }

/* ==========================================================================
   About
   ========================================================================== */
.about__text { color: var(--muted); max-width: 68ch; font-size: 1.02rem; }
.about__text strong { color: var(--fg); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--line); padding: var(--space-6) 0 var(--space-4); }
.footer__title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-bottom: var(--space-2); }
.footer__lede { color: var(--muted); margin-bottom: var(--space-4); max-width: 55ch; }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-5); }
.footer__copy { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 720px) {
  .nav__links { gap: var(--space-2); font-size: 0.78rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .endpoint__footer { flex-direction: column; align-items: flex-start; }
  .status-pill { margin-left: 0; }

  .flow { flex-direction: column; overflow-x: visible; }
  .flow__stage { min-width: 0; }
  .flow__arrow { align-self: flex-start; margin-left: var(--space-2); transform: rotate(90deg); }
}

@media (max-width: 480px) {
  .nav__links { gap: 0.6rem; font-size: 0.68rem; }
  .nav__inner { padding-left: var(--space-2); padding-right: var(--space-2); }
}

/* ==========================================================================
   Connect (Terminal UI)
   ========================================================================== */
.terminal-card {
  background: #0D1117;
  border: 1px solid #30363D;
  border-radius: 12px;
  overflow: hidden;
  max-width: 700px;
  margin: var(--space-4) auto 0; /* Centered with top margin */
}

.terminal-header {
  background: #161B22;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #30363D;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #FF5F56; }
.dot.yellow { background: #FFBD2E; }
.dot.green { background: #27C93F; }

.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.terminal-body {
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--fg);
}

.prompt { color: var(--status-ok); margin-right: 0.5rem; }

.json-block {
  color: #79C0FF;
  background: transparent;
  margin: var(--space-2) 0 var(--space-2) 1.5rem;
  line-height: 1.6;
  white-space: pre-wrap;
  font-family: inherit;
}

.terminal-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.terminal-link:hover { color: #fff; }

/* Blinking cursor effect */
.cursor {
  display: inline-block;
  width: 8px;
  background-color: var(--fg);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ==========================================================================
   Terminal Responsive Overrides
   ========================================================================== */
@media (max-width: 768px) {
  .terminal-card { margin: var(--space-2) auto 0; }
  .terminal-body { padding: var(--space-3); font-size: 0.8rem; }
  .json-block { margin-left: 0.5rem; }

  /* Applying the grid updates from your snippet */
  .metrics-grid, .skills-grid { grid-template-columns: 1fr; }
  .split-layout { grid-template-columns: 1fr; gap: var(--space-4); }
  .nav__inner { justify-content: center; gap: var(--space-4); }
  .nav__links { display: flex; gap: var(--space-2); font-size: 0.75rem; }
  .hero__title { font-size: 2rem; }
}