:root {
  color-scheme: dark;
  --page-bg: radial-gradient(circle at 10% 10%, #031625 0%, #01060c 55%, #000204 100%);
  --page-bg-image: none;
  --page-sheen: rgba(88, 235, 203, 0.15);
  --page-text: #e8fbff;
  --page-muted: rgba(181, 227, 236, 0.76);
  --panel-bg: rgba(6, 22, 33, 0.82);
  --panel-border: rgba(94, 255, 197, 0.25);
  --accent: #6fffd9;
  --accent-strong: #4bd4ff;
  --glow: 0 15px 45px rgba(79, 225, 255, 0.35);
  --cursor-x: 10%;
  --cursor-y: 10%;
  --font-body: 'Space Grotesk', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', 'Share Tech Mono', 'IBM Plex Mono', monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-image: var(--page-bg-image), var(--page-bg);
  background-size: cover, 100% 100%;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
  color: var(--page-text);
  font-family: var(--font-body);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  transition: background 0.8s ease, color 0.8s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at var(--cursor-x, 10%) var(--cursor-y, 10%), var(--page-sheen), transparent 65%);
  pointer-events: none;
  z-index: -2;
  transition: background 0.8s ease, opacity 0.8s ease;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  mix-blend-mode: screen;
  opacity: 0.35;
  pointer-events: none;
  z-index: -2;
  transition: opacity 0.8s ease;
}

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

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

ul {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

.container {
  width: min(1200px, 100% - 1rem);
  margin: 0 auto;
}

p {
  color: var(--page-muted);
  font-size: 1.05rem;
}

h1,
h2,
h3,
h4 {
  line-height: 1.3;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.3rem, 3vw, 1.85rem);
}

.eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
}

section {
  padding: clamp(4rem, 12vw, 6.5rem) 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.95rem 1.8rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--page-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, rgba(14, 34, 44, 0.65), rgba(12, 57, 61, 0.9));
}

.button:hover {
  transform: translateY(-2px) scale(1.01);
}

.button--ghost {
  background: transparent;
  border-color: var(--page-muted);
  color: var(--page-muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(0, 5, 9, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  transition: background 0.65s ease, border-color 0.65s ease, color 0.65s ease;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--page-muted);
  position: relative;
  transition: color 0.6s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0.65);
  transform-origin: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-toggle__line {
  width: 1.6rem;
  height: 2px;
  background: var(--page-text);
  display: block;
}

.hero {
  padding-top: clamp(5rem, 12vw, 8rem);
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

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

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

.about {
  margin-top: clamp(1.75rem, 5vw, 2.75rem);
  padding-top: clamp(4.5rem, 9vw, 6rem);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.about__actions {
  margin-top: 1rem;
}

.about__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding-top: 1rem;
  align-items: start;
}

.stats {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.35rem;
}

.stats span {
  display: block;
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: var(--accent);
  font-family: var(--font-mono);
}

.work {
  background: rgba(0, 8, 12, 0.55);
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.work__grid article {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  background: rgba(3, 14, 20, 0.7);
  box-shadow: var(--glow);
  transition: transform 0.35s ease, border-color 0.4s ease, box-shadow 0.45s ease,
    background 0.45s ease, color 0.35s ease;
}

.work__grid article:hover,
.work__grid article:focus-within {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent);
  background: linear-gradient(140deg, rgba(7, 31, 42, 0.9), rgba(16, 80, 100, 0.75));
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(111, 255, 217, 0.25);
  color: var(--page-text);
}

.work__grid article:hover h3,
.work__grid article:focus-within h3 {
  color: var(--accent);
}

.projects {
  position: relative;
  margin-top: clamp(3rem, 8vw, 5.5rem);
}

.projects__intro {
  margin-top: 1rem;
  max-width: 640px;
}

.project-grid {
  margin-top: 3rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}


.project-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  padding-bottom: 2.75rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(4, 12, 18, 0.78) 0%, rgba(4, 12, 18, 0.38) 100%);
  transition: transform 0.35s ease, border-color 0.6s ease, background 0.6s ease, color 0.6s ease;
  position: relative;
  overflow: hidden;
  color: var(--project-text, var(--page-text));
  isolation: isolate;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 15, 22, 0.78) 0%, rgba(5, 15, 22, 0.35) 55%, rgba(5, 15, 22, 0.06) 100%),
    var(--project-bg, rgba(255, 255, 255, 0.02));
  opacity: 0.85;
  z-index: 0;
  transition: opacity 0.6s ease, background 0.6s ease;
}

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

.project-card:focus-visible {
  outline: 2px solid var(--project-accent, var(--accent));
  outline-offset: 6px;
}

.project-card header,
.project-card p,
.project-card ul {
  position: relative;
  z-index: 1;
}

.project-card header .eyebrow {
  color: var(--project-accent, var(--accent));
}

.project-card h3 {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

.project-card__meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.project-card__role {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--project-text, var(--page-text));
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.2);
}

.project-card__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.project-card__tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.18);
  color: var(--project-text, var(--page-text));
}

.project-card ul {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.project-card ul li {
  position: relative;
  padding-left: 1.1rem;
}

.project-card ul li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--project-accent, var(--accent));
  opacity: 0.85;
}

.project-card__actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-start;
}

.project-card__more {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: var(--project-text, var(--page-text));
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
}

.project-card__more:hover,
.project-card__more:focus-visible {
  border-color: var(--project-accent, var(--accent));
  color: var(--project-accent, var(--accent));
  background: rgba(0, 0, 0, 0.35);
}

.project-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1.25rem;
  background: rgba(3, 12, 20, 0.95);
  color: var(--page-text);
  padding: 0;
  width: min(900px, 94vw);
  max-height: min(90vh, 900px);
  overflow: hidden;
  box-shadow: 0 35px 75px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
}

.project-dialog[open] {
  display: flex;
  flex-direction: column;
}

.project-dialog::backdrop {
  background: rgba(2, 6, 10, 0.65);
  backdrop-filter: blur(5px);
}

.project-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 10, 0.65);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 40;
}

.project-dialog-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

body.dialog-open {
  overflow: hidden;
}

.project-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  position: sticky;
  top: 0;
  background: rgba(3, 12, 20, 0.95);
  z-index: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.project-dialog__title {
  font-size: 1.3rem;
}

.project-dialog__close {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: inherit;
}

.project-dialog__body {
  padding: 1rem 1.5rem 1.5rem;
  display: grid;
  gap: 1rem;
  overflow-y: auto;
  flex: 1;
}

.project-dialog__section {
  display: grid;
  gap: 0.55rem;
  padding: 0.5rem 0 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.project-dialog__section:last-child {
  border-bottom: none;
}

.project-dialog__links .tech-pill-list a {
  color: inherit;
  border-color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
}

.project-dialog__links .tech-pill-list a:hover,
.project-dialog__links .tech-pill-list a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.tech-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
}

.tech-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--page-text);
}

.project-dialog__list {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  padding-left: 1.1rem;
}

.project-dialog__list li {
  position: relative;
  line-height: 1.5;
}

.project-dialog__list li::before {
  content: '▹';
  position: absolute;
  left: -1.05rem;
  top: 0.15rem;
  color: var(--project-accent, var(--accent));
  opacity: 0.9;
}

.contact {
  background: rgba(2, 10, 18, 0.9);
}

.contact__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.contact__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .site-nav {
    position: absolute;
    right: 1rem;
    top: 100%;
    flex-direction: column;
    background: rgba(0, 5, 9, 0.95);
    padding: 1rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .site-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-toggle {
    display: flex;
  }
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer__blog-link {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.blog-hero {
  padding-bottom: 2rem;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.blog-sidebar,
.blog-content,
.blog-post-card,
.blog-post-view {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(3, 12, 20, 0.84);
}

.blog-sidebar {
  padding: 1rem;
  position: sticky;
  top: 5.6rem;
  display: grid;
  gap: 1rem;
  max-height: calc(100vh - 6.6rem);
  overflow: auto;
}

.blog-filter input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.3);
  color: var(--page-text);
}

.blog-category-group + .blog-category-group {
  margin-top: 1rem;
}

.blog-category-group h3,
.blog-all-posts h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.blog-category-group ul,
.blog-all-posts ul {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.blog-category-group a,
.blog-all-posts a {
  color: var(--page-muted);
  line-height: 1.4;
}

.blog-all-posts li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.blog-all-posts li span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  white-space: nowrap;
}

.blog-content {
  padding: 1rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.blog-post-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  align-content: start;
}

.blog-post-card {
  padding: 1rem;
}

.blog-post-card__date {
  margin-top: 0.6rem;
  font-size: 0.9rem;
}

.blog-post-view {
  padding: 1.2rem;
  margin-top: 1.2rem;
}

.markdown-body {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.2rem;
}

.markdown-body ul {
  list-style: disc;
}

.markdown-body ol {
  list-style: decimal;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-word;
}

.markdown-body code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.35rem;
  padding: 0.1rem 0.35rem;
  word-break: break-word;
}

.markdown-body pre {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.5rem;
  padding: 0.8rem;
  overflow-x: auto;
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 0.8rem;
  color: var(--page-muted);
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .site-footer__inner {
    justify-content: center;
  }

  .blog-content,
  .blog-sidebar,
  .blog-post-card,
  .blog-post-view {
    border-radius: 0.75rem;
  }

  .blog-all-posts li {
    flex-direction: column;
  }
}
