/* ===========================
   Reset & Custom Properties
   =========================== */

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

:root {
  --bg:        #0c0c0e;
  --bg-alt:    #101012;
  --bg-card:   #17171a;
  --border:    #26262c;
  --text:      #e1e1e6;
  --muted:     #85858f;
  --accent:    #6366f1;
  --accent-lo: rgba(99, 102, 241, 0.12);
  --tag-fg:    #a5b4fc;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;

  --w: 900px;

  --s1: 1rem;
  --s2: 2rem;
  --s3: 2rem;
  --s4: 2.75rem;
}

/* ===========================
   Base
   =========================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

/* ===========================
   Layout
   =========================== */

.container {
  width: 100%;
  max-width: var(--w);
  margin-inline: auto;
  padding-inline: var(--s2);
}

/* ===========================
   Navigation
   =========================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 12, 14, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  max-width: var(--w);
  margin-inline: auto;
  padding: 1rem var(--s2);
}

.nav-links {
  display: flex;
  gap: var(--s2);
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  color: var(--text);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: opacity 0.2s;
}

/* ===========================
   Hero
   =========================== */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--s4) var(--s3);
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  top: -140px;
  right: -160px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s1);
}

.hero h1 {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.hero-title {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--muted);
  font-weight: 400;
  margin-bottom: var(--s2);
}

.hero-bio {
  max-width: 540px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: var(--s2);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .hero .eyebrow  { animation: fade-up 0.7s ease both 0.05s; }
  .hero h1        { animation: fade-up 0.7s ease both 0.15s; }
  .hero-title     { animation: fade-up 0.7s ease both 0.25s; }
  .hero-bio       { animation: fade-up 0.7s ease both 0.35s; }
  .hero-links     { animation: fade-up 0.7s ease both 0.45s; }
}

/* ===========================
   Buttons
   =========================== */

.btn {
  display: inline-block;
  padding: 0.55rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: opacity 0.15s, transform 0.1s;
  background: var(--accent);
  color: #fff;
}

.btn:hover {
  opacity: 0.82;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -8px rgba(99, 102, 241, 0.55);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: #45454e;
  opacity: 1;
}

/* ===========================
   Sections
   =========================== */

.section {
  padding-block: var(--s4);
  border-bottom: 1px solid var(--border);
}

.section-alt {
  background: var(--bg-alt);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s2);
}

.section-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: calc(-1 * var(--s1));
  margin-bottom: var(--s2);
}

/* ===========================
   Prose (About)
   =========================== */

.prose {
  max-width: 660px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.prose p {
  color: var(--muted);
  line-height: 1.8;
}

/* ===========================
   Experience logos (About)
   =========================== */

.exp-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.exp-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.exp-logo-mark {
  display: block;
  height: 22px;
  width: 22px;
  flex-shrink: 0;
}

.exp-logo-subly {
  height: 20px;
  width: auto;
}

.exp-logo-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.exp-logo-meta {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.35rem;
}

/* ===========================
   Cards
   =========================== */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s2);
}

@media (min-width: 600px) {
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -18px rgba(99, 102, 241, 0.45);
}

.card-top {
  display: flex;
  justify-content: flex-end;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.card-title {
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card-desc {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.65;
  flex-grow: 1;
}

/* ===========================
   Tags
   =========================== */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin-top: 0.25rem;
}

.tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--tag-fg);
  background: var(--accent-lo);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

/* ===========================
   Footer
   =========================== */

.footer {
  padding-block: var(--s3);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--s3);
}

.footer-heading {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
}

.footer-prompt {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 400px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.5;
  border-top: 1px solid var(--border);
  padding-top: var(--s2);
}

/* ===========================
   Scroll reveal
   =========================== */

.reveal {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .cards .card:nth-child(2) { transition-delay: 0.08s; }
  .cards .card:nth-child(3) { transition-delay: 0.16s; }
}

/* ===========================
   Focus / Selection
   =========================== */

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

::selection {
  background: var(--accent-lo);
  color: var(--text);
}

/* ===========================
   Mobile nav
   =========================== */

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

  .nav-links {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding-block: 0.5rem;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links li a {
    display: block;
    padding: 0.75rem var(--s2);
    font-size: 1rem;
    color: var(--text);
  }
}

/* ===========================
   Reduced motion
   =========================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
