:root {
  color-scheme: dark;

  --bg: #0d1420;
  --bg-gradient:
    radial-gradient(ellipse 800px 700px at 100% 100%, rgba(0, 41, 102, 0.85) 0%, transparent 70%),
    radial-gradient(ellipse 800px 700px at 0% 0%, rgba(0, 41, 102, 0.85) 0%, transparent 70%),
    radial-gradient(ellipse 560px 340px at 50% 0%, rgba(71, 169, 202, 0.10) 0%, transparent 70%);
  --text: #b4bfcd;
  --text-strong: #eef3f9;
  --text-muted: #8491a3;
  --accent: #47a9ca;
  --accent-hover: #8ad8f0;
  --accent-soft: rgba(71, 169, 202, 0.14);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(71, 169, 202, 0.50);
  --shadow: 0 16px 40px rgba(0, 8, 24, 0.45);
  --selection: rgba(71, 169, 202, 0.35);
  --name-glow: 0 0 36px rgba(71, 169, 202, 0.35);

  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-pill: 999px;

  --ctl-size: clamp(42px, 8vw, 48px);
  --ctl-top: max(20px, env(safe-area-inset-top));
  --ctl-edge: max(20px, env(safe-area-inset-right));
  --ctl-gap: 12px;

  --enter-duration: 750ms;
  --enter-stagger: 70ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f7fb;
  --bg-gradient:
    radial-gradient(ellipse 800px 700px at 100% 100%, #dce8ff 0%, transparent 70%),
    radial-gradient(ellipse 800px 700px at 0% 0%, #dce8ff 0%, transparent 70%),
    radial-gradient(ellipse 560px 340px at 50% 0%, rgba(14, 116, 144, 0.07) 0%, transparent 70%);
  --text: #3a4556;
  --text-strong: #0f1e33;
  --text-muted: #5d6a7e;
  --accent: #0e7490;
  --accent-hover: #0a5670;
  --accent-soft: rgba(14, 116, 144, 0.10);
  --surface: rgba(255, 255, 255, 0.70);
  --surface-hover: rgba(255, 255, 255, 0.96);
  --border: rgba(15, 30, 51, 0.12);
  --border-strong: rgba(14, 116, 144, 0.45);
  --shadow: 0 16px 36px rgba(0, 30, 80, 0.12);
  --selection: rgba(14, 116, 144, 0.25);
  --name-glow: none;
}


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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
  color: var(--text-strong);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.25;
  color: var(--text-strong);
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease, transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.main-stuff {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100dvh;
  padding: clamp(5.5rem, 14vh, 8rem) 1.25rem 3rem;
}


.theme-toggle,
#bell-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ctl-size);
  height: var(--ctl-size);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-strong);
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.25s ease, border-color 0.3s ease, background-color 0.3s ease;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .theme-toggle,
  #bell-btn,
  .nav-link {
    background: var(--bg);
  }
}

@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover,
  #bell-btn:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
  }
}

.theme-toggle:active,
#bell-btn:active {
  transform: scale(0.92);
}

.theme-toggle {
  position: fixed;
  top: var(--ctl-top);
  right: var(--ctl-edge);
  z-index: 9999;
}

.theme-toggle svg,
#bell-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.theme-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-link {
  position: fixed;
  top: var(--ctl-top);
  left: var(--ctl-edge);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  height: var(--ctl-size);
  padding: 0 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
}

.nav-link:hover {
  transform: translateX(-3px);
  border-color: var(--border-strong);
  color: var(--accent-hover);
}


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

.footer-meta-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.8;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-meta-link:hover,
.footer-meta-link:focus-visible {
  opacity: 1;
  color: var(--accent-hover);
}


@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.animate-in {
  animation: pageEnter var(--enter-duration) var(--ease-out) backwards;
}

.stagger > :not(.bell-page) {
  animation: pageEnter var(--enter-duration) var(--ease-out) backwards;
}

.stagger > :nth-child(2) { animation-delay: 70ms; }
.stagger > :nth-child(3) { animation-delay: 140ms; }
.stagger > :nth-child(4) { animation-delay: 210ms; }
.stagger > :nth-child(5) { animation-delay: 280ms; }
.stagger > :nth-child(6) { animation-delay: 350ms; }
.stagger > :nth-child(7) { animation-delay: 420ms; }
.stagger > :nth-child(8) { animation-delay: 490ms; }

.stagger-auto > * {
  animation: pageEnter var(--enter-duration) var(--ease-out) backwards;
  animation-delay: calc(var(--enter-stagger) * var(--i, 0));
}

@media (prefers-reduced-motion: reduce) {
  .animate-in,
  .stagger > *,
  .stagger-auto > * {
    animation: none !important;
  }

  .theme-toggle,
  #bell-btn,
  .nav-link {
    transition: none !important;
  }
}


@media (max-width: 480px) {
  :root {
    --ctl-edge: max(14px, env(safe-area-inset-right));
    --ctl-top: max(14px, env(safe-area-inset-top));
    --ctl-gap: 10px;
  }

  .nav-link {
    padding: 0 0.95rem;
    font-size: 0.82rem;
  }
}


.blog {
  width: 100%;
  max-width: 42rem;
}


.blog__header {
  margin: 0 0 2rem;
  padding: 0 0 1.5rem;
  background: linear-gradient(90deg, var(--border-strong), transparent) 0 100% / 100% 1px no-repeat;
}

.blog__title {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.blog__meta {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
}


.blog__content {
  font-size: 1.04rem;
  line-height: 1.85;
  color: var(--text);
  overflow-wrap: break-word;
}

.blog__content > :last-child {
  margin-bottom: 0;
}

.blog__content p {
  margin-bottom: 1.25em;
}

.blog__content h2 {
  margin: 2.4em 0 0.8em;
  font-size: 1.5rem;
  font-weight: 600;
}

.blog__content h3 {
  margin: 2em 0 0.6em;
  font-size: 1.2rem;
  font-weight: 600;
}

.blog__content strong {
  font-weight: 600;
  color: var(--text-strong);
}

.blog__content a:not(.source) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.blog__content a:not(.source):hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

.blog__content img {
  display: block;
  height: auto;
  margin: 2rem auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.blog__content blockquote {
  margin: 2rem 0;
  padding: 1rem 1.4rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-soft);
  color: var(--text-strong);
}

.blog__content blockquote p:last-child {
  margin-bottom: 0;
}

.blog__content code {
  padding: 0.15em 0.45em;
  border-radius: 6px;
  background: var(--surface-hover);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.blog__content pre {
  margin: 2rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 1.6;
  overflow-x: auto;
}

.blog__content pre code {
  padding: 0;
  background: none;
}

.blog__content hr {
  margin: 2.5rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

.blog__list,
.blog__content ul,
.blog__content ol {
  margin: 1.75rem 0;
  padding-left: 1.5em;
}

.blog__list li,
.blog__content li {
  margin-bottom: 0.7em;
  line-height: 1.8;
}

.blog__list li::marker,
.blog__content li::marker {
  color: var(--accent);
}

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


.blog__footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 1100px) {
  .blog__footer {
    position: fixed;
    bottom: 16px;
    left: 20px;
    z-index: 50;
    margin: 0;
    padding: 0;
    border: 0;
  }
}


@media (max-width: 480px) {
  .blog__content {
    font-size: 1rem;
    line-height: 1.8;
  }

  .blog__content h2 {
    font-size: 1.3rem;
  }
}