:root {
  --bg: #070b14;
  --bg-elevated: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.88);
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(96, 165, 250, 0.4);
  --text: #e8eef8;
  --text-muted: #9aa8c0;
  --accent: #60a5fa;
  --accent-2: #34d399;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --max: 960px;
  --font: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  pointer-events: none;
  position: fixed;
  inset: -20% auto auto 35%;
  width: 60vw;
  height: 60vw;
  background:
    radial-gradient(circle at 30% 30%, rgba(96, 165, 250, 0.2), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(52, 211, 153, 0.12), transparent 50%);
  filter: blur(14px);
  z-index: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header,
.site-main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.78);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.nav {
  position: relative;
  max-width: calc(var(--max) + 80px);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  align-items: center;
}

.nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav__links a:hover,
.nav__links a:focus-visible {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav__external { color: var(--accent) !important; }

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.nav__toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.site-main--home { max-width: calc(var(--max) + 40px); }

.hero {
  margin: 0.75rem 0 2.25rem;
  padding: 2rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(145deg, rgba(96, 165, 250, 0.12), transparent 42%),
    linear-gradient(325deg, rgba(52, 211, 153, 0.08), transparent 38%),
    var(--bg-card);
  box-shadow: var(--shadow);
  animation: rise 0.7s ease both;
}

.hero__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2.25rem;
}

.hero__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.hero__photo {
  position: relative;
  flex: 0 0 auto;
  width: 200px;
  height: 200px;
}

.hero__photo::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(145deg, #60a5fa, #34d399 55%, #818cf8);
  z-index: 0;
}

.hero__photo::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.28), transparent 68%);
  z-index: 0;
  pointer-events: none;
}

.hero__photo img {
  position: relative;
  z-index: 1;
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid #0b1220;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.hero__eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0 0 0.7rem;
  font-size: clamp(2rem, 4.8vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero__lead {
  margin: 0 0 1.35rem;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Scale each diagram so Lucid blocks match; widest (native 1982) fills the content width. */
.pattern-card {
  --pattern-ref-w: 1982;
  --pattern-native-w: 1982;
  width: min(100%, calc(100% * var(--pattern-native-w) / var(--pattern-ref-w)));
  max-width: 100%;
  margin-inline: 0 auto;
  padding: 12px;
  background: #fff;
}

.pattern-card img {
  display: block;
  width: 100%;
  height: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: #1d4ed8;
  color: #ffffff;
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.btn--ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.prose > h1:first-child {
  margin-top: 0;
  font-size: clamp(1.8rem, 3.5vw, 2.3rem);
  letter-spacing: -0.02em;
}

.prose h1,
.prose h2,
.prose h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.prose h2 {
  margin-top: 2rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  font-size: 1.25rem;
}

.prose h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.1rem;
}

.prose p,
.prose li { color: var(--text-muted); }

.prose strong { color: var(--text); }

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(96, 165, 250, 0.35);
}

.prose a:hover { border-bottom-color: var(--accent); }

.prose ul { padding-left: 1.15rem; }
.prose li + li { margin-top: 0.4rem; }

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-soft);
  color: #bfdbfe;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.prose th,
.prose td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: rgba(96, 165, 250, 0.08);
  color: var(--text);
}

.prose tr:last-child td { border-bottom: 0; }

.prose--home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.prose--home > h1,
.prose--home > p.lead { grid-column: 1 / -1; }

.prose--home > h2 {
  margin: 0;
  padding: 1.1rem 1.1rem 0.35rem;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-card);
  font-size: 1.05rem;
}

.prose--home > h2 + p {
  margin: 0 0 0.2rem;
  padding: 0 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg-card);
  transition: border-color 0.2s ease;
}

.prose--home > h2:has(+ p):hover,
.prose--home > h2:has(+ p):hover + p { border-color: var(--border-strong); }

.prose--home > h2 a {
  border-bottom: 0;
  color: var(--text);
}

.prose--home > h2 a:hover { color: var(--accent); }

.prose--skills h3 {
  margin: 1.5rem 0 0;
  padding: 1.15rem 1.2rem 0.35rem;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.08), transparent), var(--bg-card);
}

.prose--skills h3 + p,
.prose--skills h3 + p + p,
.prose--skills h3 + p + p + p {
  margin: 0;
  padding: 0 1.2rem;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg-card);
}

.prose--skills h3 + p {
  padding-top: 0.15rem;
  color: var(--text);
  font-weight: 600;
}

.prose--skills h3 + p + p + p {
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 0.5rem;
}

.prose--skills h3 a { border-bottom: 0; }

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.site-footer a { color: var(--accent); text-decoration: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 0.5rem;
}

.activity {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.activity__photo {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center;
  background: #0b1220;
}

.activity__body {
  padding: 0.85rem 0.95rem 1rem;
}

.activity__body h2 {
  margin: 0 0 0.35rem !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 1.02rem !important;
  color: var(--text);
}

.activity__body p {
  margin: 0 !important;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.skills-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1.5rem;
  align-items: start;
  margin-top: 0.5rem;
}

.skills-layout__main > h2 {
  margin-top: 0.5rem;
}

.skills-invite {
  position: sticky;
  top: 5.5rem;
  padding: 1.25rem 1.2rem 1.35rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(96, 165, 250, 0.14), transparent 55%),
    var(--bg-card);
  box-shadow: var(--shadow);
}

.skills-invite__eyebrow {
  margin: 0 0 0.4rem !important;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-2) !important;
}

.skills-invite h2 {
  margin: 0 0 0.65rem !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 1.15rem !important;
  color: var(--text);
}

.skills-invite p {
  margin: 0 0 1.1rem !important;
  font-size: 0.95rem;
  color: var(--text-muted);
}


.skills-layout__main ul {
  margin: 0.75rem 0 1rem;
  padding-left: 1.2rem;
}

.skills-layout__main li + li {
  margin-top: 0.45rem;
}

.skills-invite .btn--primary {
  display: inline-flex;
  width: auto;
  min-width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  border-bottom: 0 !important;
  font-weight: 600;
}


.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.video-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.video-card__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-card__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-card__body {
  padding: 0.95rem 1.1rem 1.1rem;
}

.video-card__body h2 {
  margin: 0 0 0.4rem !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 1.05rem !important;
  color: var(--text);
}

.video-card__body p {
  margin: 0 !important;
  font-size: 0.92rem;
}

.prose--stack h2 {
  margin-top: 2rem;
  padding-top: 0.85rem;
}

.prose--stack ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.35rem 1rem;
  list-style: none;
  padding-left: 0;
  margin: 0.6rem 0 0.25rem;
}

.prose--stack li {
  margin: 0 !important;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-muted);
  font-size: 0.92rem;
}
@media (max-width: 820px) {
  .skills-layout {
    grid-template-columns: 1fr;
  }
  .skills-invite {
    position: static;
    order: -1;
  }
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.video-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.video-card__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-card__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-card__body {
  padding: 0.95rem 1.1rem 1.1rem;
}

.video-card__body h2 {
  margin: 0 0 0.4rem !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 1.05rem !important;
  color: var(--text);
}

.video-card__body p {
  margin: 0 !important;
  font-size: 0.92rem;
}

.prose--stack h2 {
  margin-top: 2rem;
  padding-top: 0.85rem;
}

.prose--stack ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.35rem 1rem;
  list-style: none;
  padding-left: 0;
  margin: 0.6rem 0 0.25rem;
}

.prose--stack li {
  margin: 0 !important;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-muted);
  font-size: 0.92rem;
}
@media (max-width: 820px) {
  .hero__inner {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .hero__photo,
  .hero__photo img {
    width: 148px;
    height: 148px;
  }

  .nav__toggle { display: flex; }

  .nav__links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: rgba(7, 11, 20, 0.96);
    border-bottom: 1px solid var(--border);
  }

  .nav__links.is-open { display: flex; }

  .nav__links a {
    padding: 0.7rem 0.2rem;
    border-bottom: 1px solid var(--border);
  }
}
