:root {
  color-scheme: light;
  --page-bg: #f6f7fb;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --border-subtle: rgba(18, 22, 31, 0.08);
  --text-primary: #111320;
  --text-secondary: rgba(17, 19, 32, 0.72);
  --accent: #3536ff;
  --accent-soft: rgba(53, 54, 255, 0.12);
  --brand-mark: linear-gradient(135deg, #4c51ff, #8436ff);
  --shadow-soft: 0 24px 48px rgba(15, 23, 42, 0.12);
  --shadow-float: 0 24px 60px rgba(17, 19, 32, 0.18);
  --glass-blur: saturate(180%) blur(24px);
  --max-width: 1184px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Playfair Display", "Times New Roman", serif;
  --header-height: 4rem;
  --header-radius: 2rem;
}

body[data-theme='dark'] {
  color-scheme: dark;
  --page-bg: #06070c;
  --surface: rgba(18, 20, 32, 0.6);
  --surface-strong: rgba(14, 16, 26, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text-primary: #f5f6fd;
  --text-secondary: rgba(239, 242, 255, 0.7);
  --accent: #8b8cff;
  --accent-soft: rgba(139, 140, 255, 0.16);
  --brand-mark: linear-gradient(135deg, #5d6bff, #d454ff);
  --shadow-soft: 0 24px 48px rgba(6, 7, 12, 0.45);
  --shadow-float: 0 36px 72px rgba(6, 7, 12, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header-blur-backdrop {
  position: fixed;
  top: 0;
  top: env(safe-area-inset-top, 0);
  left: 2px;
  right: 2px;
  height: var(--header-height, 4rem);
  border-radius: var(--header-radius);
  overflow: hidden;
  pointer-events: none;
  z-index: 99;
}

.blur-layer {
  position: absolute;
  inset: 0;
  opacity: 1;
  background: rgba(246, 247, 251, 0.1);
}

body[data-theme='dark'] .blur-layer {
  background: rgba(6, 7, 12, 0.1);
}

/* Layer 1: Strongest blur at top (3.5px) */
.blur-layer-1 {
  backdrop-filter: blur(3.5px);
  -webkit-backdrop-filter: blur(3.5px);
  mask: linear-gradient(to bottom,
    black 0%,
    black 15%,
    transparent 35%);
  -webkit-mask: linear-gradient(to bottom,
    black 0%,
    black 15%,
    transparent 35%);
}

/* Layer 2: 2.5px blur */
.blur-layer-2 {
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  mask: linear-gradient(to bottom,
    transparent 10%,
    black 25%,
    black 40%,
    transparent 55%);
  -webkit-mask: linear-gradient(to bottom,
    transparent 10%,
    black 25%,
    black 40%,
    transparent 55%);
}

/* Layer 3: 1.0px blur */
.blur-layer-3 {
  backdrop-filter: blur(1.0px);
  -webkit-backdrop-filter: blur(1.0px);
  mask: linear-gradient(to bottom,
    transparent 35%,
    black 50%,
    black 65%,
    transparent 75%);
  -webkit-mask: linear-gradient(to bottom,
    transparent 35%,
    black 50%,
    black 65%,
    transparent 75%);
}

/* Layer 4: 0.5px blur */
.blur-layer-4 {
  backdrop-filter: blur(0.5px);
  -webkit-backdrop-filter: blur(0.5px);
  mask: linear-gradient(to bottom,
    transparent 60%,
    black 75%,
    black 100%);
  -webkit-mask: linear-gradient(to bottom,
    transparent 60%,
    black 75%,
    black 100%);
}

/* Layer 5: 1.0px blur */
.blur-layer-5 {
  backdrop-filter: blur(1.0px);
  -webkit-backdrop-filter: blur(1.0px);
  mask: linear-gradient(to bottom,
    transparent 45%,
    black 55%,
    black 65%,
    transparent 75%);
  -webkit-mask: linear-gradient(to bottom,
    transparent 45%,
    black 55%,
    black 65%,
    transparent 75%);
}

/* Layer 6: 2.5px blur */
.blur-layer-6 {
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  mask: linear-gradient(to bottom,
    transparent 60%,
    black 70%,
    black 80%,
    transparent 90%);
  -webkit-mask: linear-gradient(to bottom,
    transparent 60%,
    black 70%,
    black 80%,
    transparent 90%);
}

/* Layer 7: 3.5px blur */
.blur-layer-7 {
  backdrop-filter: blur(3.5px);
  -webkit-backdrop-filter: blur(3.5px);
  mask: linear-gradient(to bottom,
    transparent 60%,
    black 75%,
    black 100%);
  -webkit-mask: linear-gradient(to bottom,
    transparent 60%,
    black 75%,
    black 100%);
}

.site-header {
  position: sticky;
  top: 0;
  top: env(safe-area-inset-top, 0);
  background: rgba(246, 247, 251, 0.06);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--header-radius);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height, 4rem);
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  padding-left: max(clamp(1.25rem, 5vw, 3rem), env(safe-area-inset-left));
  padding-right: max(clamp(1.25rem, 5vw, 3rem), env(safe-area-inset-right));
  margin: 0 2px;
  box-sizing: border-box;
}

body[data-theme='dark'] .site-header {
  background: rgba(6, 7, 12, 0.06);
}

.header-left {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-left: 0;
  transition: padding-left 0.4s ease-out;
}

.brand.with-back-button {
  padding-left: 2.5rem;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.6rem;
  border-radius: 1.25rem;
  background: var(--brand-mark);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-name {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.4s ease;
  margin-left: auto;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(17, 19, 32, 0.1);
}

.theme-toggle__icon {
  display: none;
}

.theme-toggle__label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 50;
  transition: transform 0.2s ease;
}

.hamburger:hover {
  transform: scale(1.05);
}

.hamburger__line {
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger.active .hamburger__line:nth-child(1) {
  transform: translateY(0.45rem) rotate(45deg);
}

.hamburger.active .hamburger__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active .hamburger__line:nth-child(3) {
  transform: translateY(-0.45rem) rotate(-45deg);
}

.cta {
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.site-main {
  flex: 1;
  width: min(var(--max-width), 94vw);
  margin: 0 auto;
  padding-bottom: 5rem;
}

.hero {
  display: none;
}

.hero.is-active {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  background: var(--surface-strong);
  border-radius: clamp(1.5rem, 4vw, 2.75rem);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.hero-media.is-hidden {
  display: none;
}

.hero-media {
  position: relative;
  min-height: 360px;
}

.hero-media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 7, 12, 0.1) 0%, rgba(6, 7, 12, 0.7) 100%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

body[data-theme='dark'] .hero-media__overlay {
  background: linear-gradient(180deg, rgba(6, 7, 12, 0.35) 0%, rgba(6, 7, 12, 0.85) 100%);
}

.hero-copy {
  padding: clamp(2.5rem, 5vw, 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.92) 100%);
}

body[data-theme='dark'] .hero-copy {
  background: linear-gradient(180deg, rgba(12, 14, 22, 0.75) 0%, rgba(12, 14, 22, 0.95) 100%);
}

.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.6rem);
  line-height: 1.1;
  margin: 0;
}

.hero-meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.hero-excerpt {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.about {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  animation: fadeInUp 0.6s ease-out forwards;
}

.about-content {
  max-width: 48ch;
  margin: 0 auto;
}

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

.about-text p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

.hero-tags {
  display: none;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

body[data-theme='dark'] .ghost:hover {
  background: rgba(255, 255, 255, 0.04);
}

.section-heading {
  margin-top: clamp(3rem, 6vw, 5rem);
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 900px;
  animation: fadeInUp 0.6s ease-out forwards;
}

.section-heading h2 {
  font-family: var(--font-sans);
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.section-heading p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 54ch;
  font-size: 0.85rem;
  font-weight: 400;
}

.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 900px;
}

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 3rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.15s; }
.post-card:nth-child(3) { animation-delay: 0.2s; }
.post-card:nth-child(4) { animation-delay: 0.25s; }
.post-card:nth-child(5) { animation-delay: 0.3s; }
.post-card:nth-child(6) { animation-delay: 0.35s; }
.post-card:nth-child(7) { animation-delay: 0.4s; }
.post-card:nth-child(8) { animation-delay: 0.45s; }
.post-card:nth-child(9) { animation-delay: 0.5s; }
.post-card:nth-child(10) { animation-delay: 0.55s; }

.post-card:hover {
  opacity: 0.7;
}

.post-card:hover .post-card__link {
  color: var(--text-primary);
}

.post-card--active {
  opacity: 0.85;
}

.post-card__date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.post-card__title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.post-card__link {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  white-space: nowrap;
  transition: color 0.2s ease;
  letter-spacing: -0.01em;
  pointer-events: none;
}

.article-view {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  min-height: 100vh;
  padding-top: var(--header-height);
}

.article-view:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

.article-view[data-loading]::after {
  content: 'Loading article...';
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  background: rgba(6, 7, 12, 0.12);
  color: var(--text-primary);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  z-index: 101;
}

body[data-theme='dark'] .article-view[data-loading]::after {
  background: rgba(6, 7, 12, 0.45);
}

.article-shell {
  width: min(var(--max-width), 94vw);
  margin: 0 auto;
  padding-top: clamp(1rem, 3vw, 2rem);
  padding-bottom: 5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.article-header {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fadeInUp 0.6s ease-out forwards;
}

.article-back {
  position: absolute;
  left: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.25rem;
  font-weight: 400;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0.4rem;
  width: 2rem;
  height: 2rem;
  transition: all 0.3s ease;
  border-radius: 0.5rem;
  opacity: 0;
  transform: translateX(-20px);
  z-index: 10;
}

.article-back:not([hidden]) {
  display: inline-flex;
  animation: slideInFromLeft 0.4s ease-out forwards;
}

.article-back:hover {
  color: var(--text-primary);
  background: rgba(53, 54, 255, 0.08);
}

body[data-theme='dark'] .article-back:hover {
  background: rgba(139, 140, 255, 0.12);
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.article-header__meta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-header__tag {
  display: none;
}

.article-header__title {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0;
}

.article-header__details {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
}

.subtle {
  display: none;
}

.article-cover {
  max-height: 600px;
  overflow: hidden;
  border-radius: 1rem;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.article-cover.is-hidden {
  display: none;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content {
  max-width: 720px;
  display: grid;
  gap: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-secondary);
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  color: var(--text-primary);
  font-family: var(--font-serif);
  margin: 2rem 0 0.8rem;
}

.article-content p {
  margin: 0;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}

.article-content blockquote {
  margin: 0;
  padding: 1.2rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: rgba(53, 54, 255, 0.04);
  border-radius: 1rem;
  font-style: italic;
}

.article-content code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  background: rgba(53, 54, 255, 0.12);
  padding: 0.15rem 0.35rem;
  border-radius: 0.45rem;
  font-size: 0.9rem;
}

.article-content pre {
  background: rgba(53, 54, 255, 0.08);
  padding: 1.25rem;
  border-radius: 1.2rem;
  overflow: auto;
}

.article-content img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.article-error,
.posts-error {
  background: rgba(255, 87, 87, 0.08);
  border: 1px solid rgba(255, 87, 87, 0.4);
  color: #e63946;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  font-size: 0.95rem;
}

body[data-theme='dark'] .article-error,
body[data-theme='dark'] .posts-error {
  background: rgba(230, 57, 70, 0.16);
  border-color: rgba(230, 57, 70, 0.38);
  color: #ffb4c2;
}

.newsletter {
  margin-top: clamp(4rem, 8vw, 6rem);
  display: flex;
  justify-content: center;
}

.newsletter-card {
  width: min(640px, 100%);
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: 2rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 1.25rem;
  text-align: center;
}

.newsletter-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.newsletter-form input {
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

body[data-theme='dark'] .newsletter-form input {
  background: rgba(18, 20, 32, 0.8);
  color: var(--text-primary);
}

.newsletter-form button {
  padding: 0.85rem 1.45rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.newsletter-form button:hover {
  transform: translateY(-2px);
}

.newsletter-disclaimer {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

@media (min-width: 1024px) {
  .section-heading,
  .posts-grid,
  .about-content,
  .newsletter-card {
    margin-left: auto;
    margin-right: auto;
  }

  .section-heading,
  .posts-grid {
    width: 100%;
    padding-inline: 1rem;
  }
}

.site-footer {
  width: min(var(--max-width), 94vw);
  margin: 0.5rem auto 2.5rem;
  padding: 3rem 0 1.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  animation: fadeInUp 0.6s ease-out forwards;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.02em;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 480px;
}

.footer-brand-name {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.footer-copy {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

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

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.footer-socials a:visited {
  color: var(--text-secondary);
}

.footer-socials a:focus {
  outline: none;
}

.footer-socials svg {
  width: 20px;
  height: 20px;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-bottom p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(246, 247, 251, 0.98);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: all 0.4s ease;
  border-radius: 2rem;
}

body[data-theme='dark'] .nav-overlay {
  background: rgba(6, 7, 12, 0.9);
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.nav-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 50;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-primary);
  padding: 0;
}

body[data-theme='dark'] .nav-close {
  background: rgba(18, 20, 32, 0.3);
}

.nav-close:hover {
  transform: scale(1.1) rotate(90deg);
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(53, 54, 255, 0.4);
  box-shadow: var(--shadow-soft);
}

body[data-theme='dark'] .nav-close:hover {
  background: rgba(18, 20, 32, 0.5);
}

.nav-overlay__content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem;
}

.nav-link {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.75rem 2rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

body[data-theme='dark'] .nav-link {
  background: rgba(18, 20, 32, 0.4);
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(53, 54, 255, 0.15), rgba(132, 54, 255, 0.15));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.nav-link:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-float);
  border-color: rgba(53, 54, 255, 0.3);
}

.nav-link:hover::before {
  opacity: 1;
}

body.nav-open {
  overflow: hidden;
}

/* Blur text animation */
@keyframes blur-in {
  0% {
    filter: blur(10px);
    opacity: 0;
  }
  100% {
    filter: blur(0px);
    opacity: 1;
  }
}

.brand-name--animating {
  display: inline-block;
}

.brand-name--animating .letter {
  display: inline-block;
  animation: blur-in 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  opacity: 0;
  filter: blur(10px);
}

/* Page fade effect */
.page-fade {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 700ms ease, filter 700ms ease;
  transition-delay: 0ms;
}

.page-fade.loaded {
  opacity: 1;
  filter: blur(0);
}

/* Content animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.cursor-blink {
  animation: blink 1s infinite;
  font-weight: 400;
}

.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.animate-in-delay-1 {
  animation-delay: 0.1s;
}

.animate-in-delay-2 {
  animation-delay: 0.2s;
}

.animate-in-delay-3 {
  animation-delay: 0.3s;
}

@media (max-width: 720px) {
  :root {
    --header-height: 3.6rem;
  }

  .nav-overlay {
    border-radius: 1.5rem;
  }

  .site-header {
    padding: 0.3rem 1rem;
    gap: 0.5rem;
  }

  .header-left {
    gap: 1rem;
  }

  .brand-name {
    font-size: 0.85rem;
  }

  .brand-tagline {
    font-size: 0.7rem;
  }

  .theme-toggle {
    padding: 0.4rem 0.7rem;
  }

  .theme-toggle__label {
    font-size: 0.7rem;
  }

  .hamburger {
    width: 2rem;
    height: 2rem;
    gap: 0.3rem;
  }

  .nav-close {
    width: 2rem;
    height: 2rem;
    font-size: 1.6rem;
    top: 0.8rem;
    right: 0.8rem;
  }

  .nav-link {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
    padding: 0.6rem 1.5rem;
  }

  .post-card {
    grid-template-columns: 110px 1fr auto;
    gap: 1.5rem;
    padding: 1.5rem 0;
  }

  .post-card__title {
    font-size: 0.95rem;
  }

  .post-card__date {
    font-size: 0.8rem;
  }

  .post-card__link {
    font-size: 0.8rem;
  }

  .newsletter-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero.is-active {
    grid-template-columns: 1fr;
    margin-top: clamp(1.5rem, 8vw, 2.5rem);
  }

  .article-cover {
    max-height: none;
    border-radius: 0.75rem;
  }
}

@media (max-width: 640px) {
  .post-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.5rem 0;
    text-align: left;
  }

  .post-card__date {
    font-size: 0.8rem;
    order: 3;
  }

  .post-card__title {
    order: 1;
    font-size: 0.95rem;
  }

  .post-card__link {
    order: 2;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }

  .article-content {
    gap: 1.2rem;
    font-size: 0.95rem;
  }

  .article-content img {
    border-radius: 0.75rem;
  }

  .article-header__title {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
  }

}

@media (max-width: 520px) {
  .site-main {
    width: 94vw;
  }

  .article-content {
    font-size: 0.9rem;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .footer-info {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .post-card,
  .section-heading,
  .about,
  .article-header,
  .article-cover,
  .article-content,
  .site-footer {
    opacity: 1 !important;
    animation: none !important;
  }
}
