:root {
  color-scheme: dark;
  --bg: #050608;
  --bg-soft: #0b0d11;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text: #f3eee3;
  --muted: #b0b7c5;
  --muted-strong: #ddd6ca;
  --accent: #b7c8ff;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.34);
  --radius: 30px;
  --radius-lg: 40px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body,
button,
input,
textarea,
select {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top center, rgba(100, 123, 255, 0.14), transparent 32%),
    radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #020304 0%, #050608 40%, #080b10 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 22%);
  pointer-events: none;
}

a,
button {
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

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

section,
aside,
main {
  scroll-margin-top: 88px;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.5;
}

.ambient-one {
  top: 140px;
  right: -40px;
  width: 320px;
  height: 320px;
  background: rgba(116, 144, 255, 0.16);
}

.ambient-two {
  top: 520px;
  left: -80px;
  width: 280px;
  height: 280px;
  background: rgba(255, 255, 255, 0.08);
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 40px), 1280px);
  margin: 0 auto;
  padding: 0 0 36px;
}

.site-header {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 14px 18px 10px;
  margin-bottom: 0;
  background: linear-gradient(180deg, rgba(7, 10, 18, 0.56), rgba(7, 10, 18, 0.34));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.brand {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: flex-end;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 6px 0;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

main {
  display: grid;
  gap: 72px;
}

.hero {
  padding: clamp(4px, 1.8vw, 20px) 0 10px;
}

.eyebrow,
.update-date,
.post-meta,
.project-meta,
.dialog-meta,
.stack-label,
.hero-note-label,
.site-footer {
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 18px;
}

.hero h1,
.section-intro h2,
.profile-copy h2 {
  margin: 0;
  letter-spacing: -0.07em;
  line-height: 0.94;
  font-weight: 800;
}

.hero h1 {
  max-width: 14.5ch;
  font-size: clamp(2.9rem, 7.4vw, 5.3rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  word-spacing: 0.04em;
}

.lede,
.section-copy,
.profile-copy p,
#dialog-body p,
.hero-note p,
.update-copy p,
.post-card p,
.project-card p {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.82;
}

.lede {
  max-width: 54ch;
  margin: 14px 0 0;
  font-size: 1rem;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.hero-note,
.profile-card,
.post-card,
.project-card,
.post-dialog {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-note {
  max-width: 680px;
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 22px;
  backdrop-filter: blur(20px);
}

.hero-note-label {
  display: block;
  margin-bottom: 10px;
}

.hero-note p {
  margin: 0;
  color: var(--muted-strong);
}

.button,
.post-link,
.project-link,
.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.button:focus-visible,
.post-link:hover,
.post-link:focus-visible,
.project-link:hover,
.project-link:focus-visible,
.dialog-close:hover,
.dialog-close:focus-visible {
  transform: translateY(-2px);
}

.button-primary,
.post-link {
  background: #f4f7ff;
  color: #06070a;
}

.button-primary:hover,
.post-link:hover {
  box-shadow: 0 18px 40px rgba(255, 255, 255, 0.12);
}

.button-secondary,
.project-link,
.dialog-close {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
  color: var(--text);
}

.section-block {
  display: grid;
  gap: 22px;
}

.section-intro {
  max-width: 720px;
}

.section-intro h2,
.profile-copy h2 {
  font-size: clamp(2rem, 4.8vw, 3.6rem);
}

.section-copy {
  margin: 18px 0 0;
  max-width: 46ch;
}

.updates-list {
  display: grid;
}

.update-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
}

.update-item:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.update-date {
  padding-top: 4px;
}

.update-copy h3,
.post-card h3,
.project-card h3 {
  margin: 0;
  letter-spacing: -0.028em;
  line-height: 1.12;
  word-spacing: 0.015em;
}

.update-label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.update-copy h3 {
  font-size: clamp(1.45rem, 2.8vw, 2.1rem);
}

.update-copy p {
  max-width: 60ch;
  margin: 10px 0 0;
}

.posts-grid,
.projects-grid {
  display: grid;
  gap: 18px;
}

.posts-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.projects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card,
.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 270px;
  padding: 24px;
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
}

.post-card,
.project-card-link {
  cursor: pointer;
}

.post-card:hover,
.post-card:focus-visible,
.project-card-link:hover,
.project-card-link:focus-visible {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.post-card h3,
.project-card h3 {
  margin-top: 10px;
  font-size: 1.85rem;
}

.post-card p,
.project-card p {
  margin: 14px 0 0;
}

.post-footer,
.project-footer {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.post-tags,
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags span,
.project-tags span {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted-strong);
  font-size: 0.83rem;
}

.profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 32px;
  padding: 28px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(22px);
}

.profile-copy p {
  max-width: 58ch;
  margin: 14px 0 0;
}

.profile-panel {
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}

.profile-stack {
  display: grid;
  gap: 18px;
}

.profile-stack strong {
  display: block;
  margin-top: 8px;
  font-size: 1.12rem;
  line-height: 1.5;
  letter-spacing: -0.03em;
}

.site-footer {
  padding: 28px 0 8px;
  text-align: center;
}

.post-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: min(84vh, 900px);
  padding: 0;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.72);
  overflow: auto;
}

.post-dialog::backdrop {
  background: rgba(3, 4, 7, 0.92);
}

.dialog-close-row {
  display: flex;
  justify-content: flex-end;
  padding: 12px 12px 0;
}

.dialog-article {
  padding: 4px 26px 24px;
}

#dialog-title {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(1.6rem, 3.1vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  font-weight: 750;
}

#dialog-body {
  color: var(--muted-strong);
  margin-top: 14px;
}

#dialog-body p {
  margin: 0.82rem 0 0;
  color: var(--muted-strong);
  font-size: 1rem;
  line-height: 1.72;
}

.dialog-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 20px;
  padding-top: 8px;
}

.dialog-link {
  min-width: 220px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  main {
    gap: 60px;
  }

  .posts-grid,
  .projects-grid,
  .profile-card,
  .update-item {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
    padding-top: 24px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 0;
  }

  .site-header {
    position: relative;
    top: 0;
    display: grid;
    gap: 10px;
    padding: 10px 14px 8px;
    margin-bottom: 12px;
  }

  .brand {
    font-size: 0.96rem;
  }

  .site-nav {
    gap: 10px;
    overflow-x: auto;
    padding: 2px 0 6px;
    scrollbar-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    white-space: nowrap;
    font-size: 0.84rem;
    padding: 8px 0;
  }

  .hero {
    padding: 10px 0 6px;
  }

  .hero h1 {
    max-width: 11.8ch;
    font-size: clamp(2.45rem, 10.4vw, 3.45rem);
    line-height: 1.06;
    word-spacing: 0.02em;
  }

  .eyebrow,
  .update-date,
  .post-meta,
  .project-meta,
  .dialog-meta,
  .stack-label,
  .hero-note-label,
  .site-footer {
    font-size: 0.72rem;
    letter-spacing: 0.07em;
  }

  .lede,
  .section-copy,
  .profile-copy p,
  #dialog-body p,
  .hero-note p,
  .update-copy p,
  .post-card p,
  .project-card p {
    font-size: 0.96rem;
    line-height: 1.72;
  }

  .hero-actions,
  .contact-actions {
    gap: 10px;
  }

  .hero-actions .button,
  .contact-actions .button {
    width: 100%;
  }

  .section-block {
    gap: 18px;
  }

  .section-intro h2,
  .profile-copy h2 {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    line-height: 1.02;
  }

  .update-item {
    gap: 10px;
    padding: 14px 0;
  }

  .update-date {
    padding-top: 0;
  }

  .update-copy h3 {
    font-size: 1.28rem;
    line-height: 1.12;
  }

  .posts-grid,
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .post-card,
  .project-card {
    min-height: auto;
  }

  .post-card,
  .project-card,
  .profile-card,
  .hero-note {
    padding: 18px;
    border-radius: 24px;
  }

  .post-card h3,
  .project-card h3 {
    font-size: 1.5rem;
    line-height: 1.08;
  }

  .post-footer,
  .project-footer {
    gap: 14px;
    margin-top: 20px;
  }

  .post-link,
  .project-link {
    width: 100%;
  }

  .profile-card {
    gap: 22px;
  }

  .profile-stack {
    gap: 16px;
  }

  .profile-stack strong {
    font-size: 1rem;
  }

  .dialog-article {
    padding: 4px 20px 20px;
  }

  .dialog-link {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .site-shell {
    width: min(calc(100% - 16px), var(--max-width));
  }

  .hero h1 {
    font-size: clamp(2.2rem, 10vw, 3rem);
  }

  .button,
  .post-link,
  .project-link,
  .dialog-close {
    padding: 12px 16px;
  }

  .post-tags span,
  .project-tags span {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  .post-dialog {
    width: min(100% - 12px, 720px);
    border-radius: 22px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
