:root {
  color-scheme: dark;
  --bg: #030407;
  --bg-alt: #0b0f1a;
  --surface: rgba(26, 35, 58, 0.8);
  --surface-strong: rgba(24, 31, 47, 0.95);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f7fb;
  --text-muted: rgba(245, 247, 251, 0.7);
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --gradient: radial-gradient(circle at top left, #0f1b49, #030407 60%);
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --shadow: 0 20px 50px rgba(2, 6, 23, 0.8);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

.background-noise,
.background-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.background-noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.4;
}

.background-grid {
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: -3;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem clamp(1.5rem, 4vw, 4rem);
  background: linear-gradient(90deg, rgba(3, 4, 7, 0.92), rgba(5, 8, 18, 0.88));
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
}

.identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.monogram {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #0891b2, #0284c7);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0;
}

.title {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.site-nav {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  font-size: 0.95rem;
}

.site-nav a {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  transition: background 0.3s ease;
  color: var(--text-muted);
}

.site-nav a.active,
.site-nav a:hover {
  background: rgba(125, 211, 252, 0.15);
  color: var(--text);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: rgba(8, 12, 20, 0.75);
  border-radius: 12px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

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

.contact-chip {
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.contact-chip:hover {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}

main {
  padding: 0 clamp(1.5rem, 4vw, 4rem) 5rem;
}

section {
  scroll-margin-top: 100px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 4rem 0 2rem;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 4vw, 3.6rem);
  line-height: 1.1;
  margin: 0.5rem 0 1rem;
  font-family: var(--font-display);
}

.summary {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.contact-inline {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contact-inline a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.contact-inline a:hover {
  border-color: var(--accent-strong);
  color: var(--accent);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn {
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #021123;
  box-shadow: 0 15px 30px rgba(14, 165, 233, 0.35);
}

.btn.ghost {
  border-color: var(--border);
  color: var(--text);
}

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

.hero-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.hero-meta li {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.meta-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.hero-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-card h2 {
  margin: 0;
  font-family: var(--font-display);
}

.snapshot-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.snapshot-list li + li {
  margin-top: 0.4rem;
}

.card-metric {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.card-metric .label {
  color: var(--text-muted);
}

.link-stack {
  display: flex;
  gap: 1rem;
}

.link-stack a {
  color: var(--accent);
}

.section {
  margin: 3.5rem 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 999px;
}

.section-header {
  max-width: 720px;
  margin: 1.5rem 0 2rem;
}

.section-header h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

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

.skill-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  background: rgba(12, 16, 30, 0.8);
  min-height: 150px;
}

.skill-card h3 {
  margin-top: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.github-section {
  margin-top: 1rem;
}

.github-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
}

.github-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  background: rgba(9, 13, 24, 0.85);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.github-card img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.github-copy h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.contrib-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  background: rgba(8, 12, 22, 0.85);
  box-shadow: var(--shadow);
}

.contrib-card header {
  margin-bottom: 1rem;
}

.contrib-card h3 {
  margin: 0.2rem 0 0;
  font-size: 1.4rem;
  font-family: var(--font-display);
}

.contrib-card p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.contrib-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.contrib-card li + li {
  margin-top: 0.4rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.8rem;
  background: rgba(9, 12, 22, 0.85);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-list span {
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.blog-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.blog-card p {
  margin: 0;
  color: var(--text-muted);
}

.text-link {
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.article-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

.article-shell {
  padding: clamp(1.5rem, 6vw, 5rem);
}

.article-header-simple {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.5rem, 4vw, 4rem);
  background: rgba(3, 4, 7, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.article-content {
  max-width: 840px;
}

.article-content h1 {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  margin: 0.2rem 0 1rem;
  font-family: var(--font-display);
}

.article-summary {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.article-section {
  margin: 2.2rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.article-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.article-section h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
}

.article-section p {
  color: var(--text-muted);
  margin: 0.6rem 0;
}

.article-section ul,
.article-section ol {
  color: var(--text-muted);
  padding-left: 1.2rem;
}

.article-note {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.2rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-footer {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.article-footer a {
  color: var(--accent);
  font-weight: 600;
}

.article-diagram {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 18px;
  background: rgba(10, 14, 24, 0.85);
  box-shadow: var(--shadow);
}

.article-diagram svg {
  width: 100%;
  height: auto;
}

.article-diagram figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.experience-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.8rem;
  background: rgba(8, 12, 24, 0.85);
  box-shadow: var(--shadow);
}

.experience-card header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.experience-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.company {
  margin: 0;
  color: var(--text-muted);
}

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

.role-highlight {
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--accent);
}

.experience-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.experience-card li + li {
  margin-top: 0.6rem;
}

.tech-stack {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
}

.awards-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}

.awards-list li {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  background: rgba(6, 10, 20, 0.8);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 500;
}

.education-stack {
  display: grid;
  gap: 1rem;
}

.education-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 10, 17, 0.85);
}

.contact-section {
  margin-bottom: 4rem;
}

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

.contact-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: rgba(7, 10, 18, 0.85);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.contact-card:hover {
  border-color: var(--accent-strong);
  transform: translateY(-2px);
}

.contact-card strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1.5rem, 4vw, 4rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
  background: rgba(3, 4, 7, 0.95);
}

.to-top {
  color: var(--accent);
  font-weight: 600;
}

.observe {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@media (max-width: 1024px) {
  .site-header {
    flex-wrap: wrap;
  }
  .site-nav {
    flex-basis: 100%;
    justify-content: space-between;
    order: 3;
  }
  .contact-chip {
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: static;
  }
  .nav-toggle {
    display: block;
  }
  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(125, 211, 252, 0.2);
    border-radius: 16px;
    background: rgba(6, 9, 16, 0.95);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.7);
    margin-top: 0.5rem;
  }
  body.nav-open .site-nav {
    display: flex;
  }
  .site-nav a {
    width: 100%;
    text-align: left;
  }
  .hero-cta {
    flex-direction: column;
  }
  .awards-list li {
    flex-direction: column;
  }
  .education-card,
  .experience-card header {
    flex-direction: column;
    align-items: flex-start;
  }
  .contact-inline {
    flex-direction: column;
  }
  .github-grid {
    grid-template-columns: 1fr;
  }
  .article-header-simple {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .article-meta {
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  body {
    font-size: 0.95rem;
  }
  main {
    padding: 0 1rem 3rem;
  }
  .site-header {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .site-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .contact-chip {
    margin: 0;
    width: 100%;
    text-align: center;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 0 1rem;
  }
  .hero-text h1 {
    font-size: 2.1rem;
  }
  .summary {
    font-size: 0.95rem;
  }
  .hero-cta {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .hero-meta {
    grid-template-columns: 1fr;
  }
  .hero-card,
  .experience-card,
  .contrib-card,
  .github-card,
  .blog-card {
    padding: 1.4rem;
  }
  .skills-grid,
  .contact-grid,
  .education-stack,
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .section {
    margin: 2.5rem 0;
  }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .article-shell {
    padding: 1.2rem;
  }
  .article-content h1 {
    font-size: 2rem;
  }
  .article-section h2 {
    font-size: 1.45rem;
  }
}

