:root {
  color-scheme: dark light;
  --font-sans: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --background: #040b1d;
  --background-alt: #0a1530;
  --surface: rgba(10, 19, 38, 0.72);
  --surface-elevated: rgba(14, 24, 45, 0.82);
  --surface-strong: rgba(17, 29, 54, 0.94);
  --surface-highlight: rgba(52, 211, 153, 0.18);
  --text-primary: rgba(244, 247, 255, 0.98);
  --text-secondary: rgba(207, 219, 236, 0.78);
  --text-muted: rgba(148, 163, 184, 0.68);
  --border: rgba(100, 116, 139, 0.28);
  --border-strong: rgba(148, 163, 184, 0.42);
  --accent: #34d399;
  --accent-strong: #10b981;
  --accent-border: rgba(52, 211, 153, 0.45);
  --accent-soft: rgba(52, 211, 153, 0.2);
  --shadow-sm: 0 12px 30px rgba(2, 6, 23, 0.32);
  --shadow-md: 0 22px 48px rgba(2, 6, 23, 0.42);
  --shadow-lg: 0 36px 68px rgba(2, 6, 23, 0.52);
  --max-width: 1160px;
  --header-height: 72px;
  --container-padding: clamp(1rem, 4vw, 2.75rem);
  --section-spacing: clamp(2.5rem, 8vw, 6.75rem);
  --font-size-base: clamp(0.95rem, 0.92rem + 0.3vw, 1.05rem);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 36px;
  --transition-fast: 140ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 320ms cubic-bezier(0.22, 1, 0.36, 1);
  --outline: 0 0 0 3px rgba(52, 211, 153, 0.35);
  --safe-bottom: max(env(safe-area-inset-bottom), 18px);
}

:root.light {
  --background: #f6f9ff;
  --background-alt: #e8f0ff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-highlight: rgba(52, 211, 153, 0.16);
  --text-primary: #0f172a;
  --text-secondary: rgba(71, 85, 105, 0.86);
  --text-muted: rgba(100, 116, 139, 0.7);
  --border: rgba(148, 163, 184, 0.38);
  --border-strong: rgba(100, 116, 139, 0.48);
  --shadow-sm: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 22px 44px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 40px 60px rgba(15, 23, 42, 0.14);
  --accent: #22c55e;
  --accent-strong: #16a34a;
  --accent-border: rgba(34, 197, 94, 0.42);
  --accent-soft: rgba(34, 197, 94, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.65;
  background-color: var(--background);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px circle at 18% 12%, rgba(52, 211, 153, 0.18), transparent 55%),
    radial-gradient(1000px circle at 82% 8%, rgba(45, 212, 191, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(4, 11, 29, 0.92), rgba(4, 11, 29, 0.98));
}

:root.light body::before {
  background:
    radial-gradient(1200px circle at 18% 12%, rgba(52, 211, 153, 0.18), transparent 55%),
    radial-gradient(900px circle at 85% 5%, rgba(74, 222, 128, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(237, 248, 244, 0.92), rgba(240, 253, 244, 0.98));
}

::selection {
  background-color: rgba(52, 211, 153, 0.22);
  color: #0f172a;
}

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

svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base), opacity var(--transition-base);
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
.button:focus-visible {
  outline: none;
  box-shadow: var(--outline);
}

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

p {
  margin: 0;
  color: var(--text-secondary);
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.25rem);
  line-height: 1.18;
}

h3 {
  font-size: clamp(1.2rem, 2.8vw, 1.4rem);
  line-height: 1.25;
}

main {
  min-height: calc(100vh - var(--header-height));
}

section {
  padding: var(--section-spacing) 0;
}

.page-section {
  padding: var(--section-spacing) 0;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

@media (min-width: 1200px) {
  .container {
    padding: 0 clamp(2.25rem, 4vw, 3.25rem);
  }
}

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

.text-muted {
  color: var(--text-muted);
  font-size: 0.93rem;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
  transition: opacity var(--transition-base);
}

.text-link:hover {
  opacity: 0.75;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

.pill--accent {
  background: var(--surface-highlight);
  border-color: var(--accent-border);
  color: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.78rem 1.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #02131c;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
  box-shadow: 0 12px 28px rgba(52, 211, 153, 0.28);
}

.button:hover,
.button:focus-visible,
.button:active {
  color: #02131c;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(52, 211, 153, 0.35);
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent-border);
  box-shadow: none;
}

.button.secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-strong);
}

.button.button--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: none;
}

.button.button--ghost:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--surface-highlight);
}

.button.button--compact {
  padding: 0.6rem 1.1rem;
  font-size: 0.88rem;
}

.button.button--cv {
  box-shadow: 0 16px 32px rgba(52, 211, 153, 0.28);
}

.cta-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .cta-group {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chip-list--compact .chip {
  font-size: 0.68rem;
  padding: 0.28rem 0.6rem;
}

.chip-list--dense {
  gap: 0.4rem;
}

.chip-list--dense .chip {
  font-size: 0.7rem;
  padding: 0.3rem 0.65rem;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: clamp(2.5rem, 5vw, 3.2rem);
}

.section-heading > div:first-child {
  display: grid;
  gap: 0.65rem;
  max-width: min(620px, 70%);
}

.section-heading p {
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .section-heading {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }

  .section-heading > div:first-child {
    max-width: min(640px, 68%);
  }
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(5rem, 10vw, 7.25rem) 0 clamp(3.2rem, 6vw, 4.75rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(900px circle at 15% 10%, rgba(52, 211, 153, 0.24), transparent 55%),
              radial-gradient(840px circle at 85% 20%, rgba(16, 185, 129, 0.16), transparent 55%);
  opacity: 0.65;
  pointer-events: none;
  z-index: -1;
}

.hero__grid {
  display: grid;
  gap: clamp(2rem, 6vw, 3.5rem);
  align-items: stretch;
}

@media (min-width: 980px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
}

.hero__content {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2rem);
  align-content: flex-start;
}

.hero__lead {
  max-width: 620px;
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.7;
  color: var(--text-secondary);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-meta .pill {
  background: var(--surface-highlight);
  border-color: var(--border);
}

.hero__aside {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.3rem);
  align-content: flex-start;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  padding: clamp(1.25rem, 3vw, 2.4rem);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 1rem;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.18), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}

.hero-card h2 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
}

.hero-card p {
  position: relative;
  z-index: 1;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-card__tags {
  position: relative;
  z-index: 1;
}

.hero-card__tags .chip {
  background: rgba(52, 211, 153, 0.12);
  border-color: var(--accent-border);
  color: var(--accent);
}

.hero-card--primary {
  border: 1px solid var(--accent-border);
}

.hero-stats {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: clamp(1.2rem, 3vw, 1.6rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-stats__item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero-stats__item dt,
.hero-stats__item dd {
  margin: 0;
}

.hero-stats__label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-stats__value {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.hero-stats__value span {
  font: inherit;
}

.hero-stats--compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding: clamp(1rem, 2.4vw, 1.35rem);
  gap: clamp(0.75rem, 2vw, 1rem);
  border-radius: var(--radius-md);
}

.hero-stats--compact .hero-stats__label {
  font-size: 0.72rem;
}

.hero-stats--compact .hero-stats__value {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
}

.about-layout {
  display: grid;
  gap: clamp(1.6rem, 3vw, 2.5rem);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.4rem);
  box-shadow: var(--shadow-sm);
}

.about-layout__main {
  display: grid;
  gap: 1.25rem;
}

.about-copy {
  display: grid;
  gap: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.about-layout__meta {
  display: grid;
  gap: 1.25rem;
}

.about-highlight h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.about-highlight p {
  color: var(--text-muted);
}

@media (min-width: 960px) {
  .about-layout {
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1.05fr);
  }

  .about-layout__meta {
    padding-left: clamp(0.25rem, 1.2vw, 1rem);
    border-left: 1px solid rgba(148, 163, 184, 0.18);
  }
}

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

.list-bullets li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.list-bullets li::before {
  content: ">";
  color: var(--accent);
  font-weight: 700;
  line-height: 1.2;
}

.list-bullets--compact {
  gap: 0.4rem;
}

.list-bullets--compact li {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.feature-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.feature-card {
  position: relative;
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.25rem, 3vw, 2.1rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  background: var(--surface-strong);
}

.feature-card:hover::after {
  opacity: 0.75;
}

.feature-card__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: var(--surface-highlight);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
  color: var(--accent);
  z-index: 1;
}

.feature-card__icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

.feature-card__content {
  display: grid;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.feature-card__content p {
  line-height: 1.65;
  color: var(--text-secondary);
}

.feature-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.feature-card__list li {
  display: flex;
  gap: 0.4rem;
}

.feature-card__list li::before {
  content: ">";
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.1rem;
}

.grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  position: relative;
  display: grid;
  gap: 1.2rem;
  padding: clamp(1.25rem, 3vw, 2.4rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  background: var(--surface-strong);
}

.card h3 {
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
}

.card p {
  line-height: 1.65;
  color: var(--text-secondary);
}

.card__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-highlight);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card__summary {
  color: var(--text-primary);
  font-weight: 600;
}

.card__description {
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.card--project .cta-group {
  margin-top: 0.5rem;
}

.card--project .cta-group .button {
  min-width: 0;
}

.surface {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  padding: clamp(1.75rem, 3vw, 2.4rem);
  box-shadow: var(--shadow-sm);
}

.surface--callout {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  align-items: flex-start;
}

.surface--callout__content h2 {
  margin-bottom: 0.4rem;
}

.surface--callout__actions {
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .surface--callout {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .surface--callout__content {
    max-width: min(520px, 60%);
  }

  .surface--callout__actions {
    justify-content: flex-end;
  }
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.5rem;
  padding-left: 1.65rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-border), transparent 70%);
  opacity: 0.6;
}

.timeline-item {
  position: relative;
  padding: 1.35rem 1.35rem 1.35rem 1.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 0.55rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.04rem;
  top: 1.45rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.timeline-item span {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-item h3 {
  font-size: clamp(1rem, 2.3vw, 1.2rem);
}

.timeline__summary {
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-item .chip-list {
  gap: 0.4rem;
}

.blog-list {
  display: grid;
  gap: clamp(1.35rem, 3vw, 2rem);
}

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

.blog-card {
  display: grid;
  gap: 0.95rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.blog-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.blog-card h3 {
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
}

.blog-card p {
  color: var(--text-secondary);
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}

.page-hero {
  position: relative;
  padding: clamp(4rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem);
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(1000px circle at 100% 0%, rgba(52, 211, 153, 0.22), transparent 50%),
    radial-gradient(800px circle at 0% 10%, rgba(16, 185, 129, 0.14), transparent 50%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.65;
  filter: blur(40px);
}

:root.light .page-hero::before {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), transparent 90%);
}

.page-hero__inner {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

.page-hero__content {
  display: grid;
  gap: 1.25rem;
  align-content: flex-start;
}

.page-hero__content h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-hero__content p {
  max-width: min(680px, 85%);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.7;
  color: var(--text-secondary);
}

@media (min-width: 900px) {
  .page-hero__inner {
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
    align-items: flex-end;
  }
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: inherit;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.article-layout {
  display: grid;
  gap: clamp(2rem, 5vw, 3.25rem);
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: minmax(0, 2.75fr) minmax(0, 1.1fr);
    align-items: start;
  }
}

.article-main {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  padding: clamp(2.1rem, 4vw, 3.2rem);
  box-shadow: var(--shadow-sm);
}

.article-sidebar {
  display: grid;
  gap: 1.4rem;
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
}

@media (max-width: 1023px) {
  .article-sidebar {
    position: static;
  }
}

.meta-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2rem);
  display: grid;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-base);
}

.meta-card:hover {
  border-color: var(--accent-border);
}

.meta-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
}

.meta-card .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.meta-card .meta-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-content {
  display: grid;
  gap: 1.8rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1.05rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.3;
  font-weight: 700;
  scroll-margin-top: calc(var(--header-height) + 2rem);
}

.article-content h1 {
  font-size: 2.25rem;
}

.article-content h2 {
  font-size: 1.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.article-content h3 {
  font-size: 1.4rem;
}

.article-content p {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 1.5rem 1.8rem;
  border-left: 4px solid var(--accent);
  background: var(--surface-highlight);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-primary);
  font-style: italic;
  font-size: 1.1rem;
}

.article-content pre {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.95rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.article-content code {
  font-family: "Fira Code", "JetBrains Mono", Consolas, monospace;
  background: var(--surface-highlight);
  padding: 0.2em 0.45em;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--accent-strong);
  border: 1px solid transparent;
}

.article-content pre code {
  background: transparent;
  padding: 0;
  color: var(--text-secondary);
  border: none;
  font-size: inherit;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.article-content li {
  color: var(--text-secondary);
  padding-left: 0.5rem;
}

.article-content li::marker {
  color: var(--accent);
}

.contact-card {
  display: grid;
  gap: clamp(1.75rem, 3vw, 2.5rem);
  align-items: start;
}

.contact-card__column {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2rem);
}

.contact-card__body {
  display: grid;
  gap: 0.9rem;
}

.contact-card__email {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--accent);
  word-break: break-word;
}

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

.contact-card__note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-card__actions {
  gap: 0.75rem;
}

.contact-card__aside {
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: var(--surface);
  padding: clamp(1.35rem, 3vw, 1.8rem);
  display: grid;
  gap: 0.9rem;
}

.contact-card__aside h3 {
  font-size: 1rem;
}

@media (min-width: 880px) {
  .contact-card {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr);
  }

  .contact-card__actions {
    justify-content: flex-start;
  }
}

.language-toggle {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.language-toggle button {
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
}

.language-toggle button:hover {
  color: var(--accent);
}

.language-toggle button.is-active {
  background: var(--accent);
  color: #02131c;
  box-shadow: var(--shadow-sm);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(18px);
  background: rgba(7, 14, 31, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.45);
}

:root.light .site-header {
  background: rgba(245, 249, 255, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  min-height: var(--header-height);
  padding: 0.95rem 0;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color var(--transition-base);
}

.site-header__brand:hover {
  color: var(--accent);
}

.site-header__mark {
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
}

.site-header__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-header__title {
  font-size: 1.05rem;
}

.site-nav {
  display: none;
}

@media (min-width: 980px) {
  .site-nav {
    display: block;
  }
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__list a {
  position: relative;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  transition: color var(--transition-base);
}

.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45rem;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-base);
}

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

.site-nav__list a.is-active {
  color: var(--accent);
}

.site-nav__list a.is-active::after {
  transform: scaleX(1);
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: transform var(--transition-fast), border-color var(--transition-base), background var(--transition-base), color var(--transition-base);
}

.dark .theme-toggle {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text-primary);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  color: var(--accent);
}

.theme-toggle__image {
  width: 1.6rem;
  height: 1.6rem;
  object-fit: contain;
  pointer-events: none;
}

.theme-toggle__image[data-mode="dark"] {
  filter: invert(1) saturate(0) brightness(1.4);
}

.site-header__controls .theme-toggle:focus-visible,
.site-header__controls .site-header__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-header__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: transform var(--transition-fast), border-color var(--transition-base), background var(--transition-base);
}

.site-header__toggle:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.site-header__toggle-icon {
  position: relative;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.site-header__toggle-icon::before,
.site-header__toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform var(--transition-fast), top var(--transition-fast);
}

.site-header__toggle-icon::before {
  top: -6px;
}

.site-header__toggle-icon::after {
  top: 6px;
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-icon {
  background: transparent;
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-icon::after {
  transform: rotate(-45deg);
  top: 0;
}

@media (min-width: 980px) {
  .site-header__toggle {
    display: none;
  }
}

.mobile-drawer {
  display: none;
  padding: 1.5rem var(--container-padding) calc(1.65rem + var(--safe-bottom));
  border-bottom: 1px solid var(--border);
  background: rgba(7, 14, 31, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: 0 24px 46px rgba(2, 6, 23, 0.5);
}

:root.light .mobile-drawer {
  background: rgba(245, 249, 255, 0.95);
}

@media (min-width: 980px) {
  .mobile-drawer {
    display: none !important;
  }
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer.is-open {
  display: block;
  animation: slideDown var(--transition-slow);
}

body.mobile-drawer--overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  pointer-events: none;
  z-index: 40;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-drawer__list {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.mobile-drawer__list a {
  display: block;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
  transition: border-color var(--transition-base), background var(--transition-base), color var(--transition-base), transform var(--transition-fast);
}

.mobile-drawer__list a:hover {
  border-color: var(--accent-border);
  background: var(--surface-highlight);
  color: var(--accent);
  transform: translateY(-2px);
}

.mobile-drawer__list a.is-active {
  border-color: var(--accent-border);
  background: var(--surface-highlight);
  color: var(--accent);
}

.mobile-drawer__cta {
  width: 100%;
  justify-content: center;
}

.mobile-drawer__cta + .mobile-drawer__cta {
  margin-top: 0.75rem;
}

.mobile-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 1.5rem), 560px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.35rem;
  padding: 0.6rem 0.7rem calc(0.75rem + var(--safe-bottom));
  background: rgba(7, 14, 31, 0.95);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: 0 -20px 32px rgba(2, 6, 23, 0.45);
  z-index: 85;
  backdrop-filter: blur(18px);
}

:root.light .mobile-tabbar {
  background: rgba(245, 249, 255, 0.95);
  box-shadow: 0 -18px 28px rgba(15, 23, 42, 0.12);
}

.mobile-tabbar__link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color var(--transition-base), border-color var(--transition-base), background var(--transition-base), transform var(--transition-fast);
}

.mobile-tabbar__link svg {
  width: 1.4rem;
  height: 1.4rem;
}

.mobile-tabbar__link:hover,
.mobile-tabbar__link:focus-visible,
.mobile-tabbar__link.is-active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--surface-highlight);
  transform: translateY(-1px);
}

@media (min-width: 980px) {
  .mobile-tabbar {
    display: none;
  }
}

@media (max-width: 979px) {
  body {
    padding-bottom: calc(4.5rem + var(--safe-bottom));
  }
}

.site-footer {
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: clamp(3rem, 6vw, 5rem) 1rem 6rem; /* Added bottom padding for mobile tabbar space */
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, var(--background) 100%);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  text-align: center;
}

@media (min-width: 980px) {
  .site-footer {
    padding-bottom: 2rem; /* Reset bottom padding on desktop */
  }
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

.site-footer::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  opacity: 0.2;
  pointer-events: none;
  filter: blur(40px);
}

.site-footer__content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.5rem;
  position: relative;
  z-index: 1;
}

.site-footer__identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.site-footer__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.site-footer__logo img {
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.site-footer__bio {
  max-width: 500px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1.05rem;
  margin: 0;
}

.site-footer__socials {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.site-footer__socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition-base);
}

.site-footer__socials a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px var(--accent-soft);
}

.site-footer__nav-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}

@media (min-width: 640px) {
  .site-footer__nav-wrapper {
    gap: 4rem;
    padding: 2.5rem 0;
  }
}

.site-footer__nav-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 160px;
}

.site-footer__nav-col h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  margin: 0 0 1.5rem;
  font-weight: 700;
  opacity: 0.9;
}

.site-footer__nav-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
}

.site-footer__nav-col a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  display: inline-block;
}

.site-footer__nav-col a:hover {
  color: var(--accent);
  transform: scale(1.05);
}

.site-footer__copyright {
  color: var(--text-muted);
  font-size: 0.9rem;
  opacity: 0.8;
}

.social {
  display: inline-flex;
  gap: 0.75rem;
}

.social a {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--surface);
  transition: border-color var(--transition-base), color var(--transition-base), transform var(--transition-fast), background var(--transition-base);
}

.social a:hover {
  border-color: var(--accent-border);
  background: var(--surface-highlight);
  color: var(--accent);
  transform: translateY(-2px);
}

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

.list-inline li {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.error {
  color: #f87171;
  font-weight: 600;
}

@media (max-width: 768px) {
  .site-header__bar {
    flex-wrap: wrap;
    gap: 0.85rem;
  }

  .site-header__controls {
    width: auto;
    margin-left: auto;
    padding: 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(226, 241, 255, 0.72);
    backdrop-filter: blur(14px);
    justify-content: flex-end;
    align-self: stretch;
    gap: 0.4rem;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
  }

  .site-header__controls .button--cv {
    display: none;
  }

  .dark .site-header__controls {
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.45);
  }

  .site-header__controls .theme-toggle,
  .site-header__controls .site-header__toggle {
    width: 2.4rem;
    height: 2.4rem;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .site-header__controls .theme-toggle:hover,
  .site-header__controls .site-header__toggle:hover {
    background: rgba(59, 130, 246, 0.14);
    border-radius: 0.75rem;
  }

  .hero {
    padding-top: clamp(4.5rem, 10vw, 6rem);
  }

  .hero__content h1 {
    font-size: clamp(2.2rem, 8vw, 2.8rem);
  }

  .page-hero__content p {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .button {
    width: 100%;
  }

  .hero-stats {
    padding: 1rem;
  }

  .site-header__controls {
    padding: 0.28rem;
    gap: 0.3rem;
  }

  .site-header__controls .theme-toggle,
  .site-header__controls .site-header__toggle {
    width: 2.2rem;
    height: 2.2rem;
  }
}

@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;
  }
}

/* TOC Styles */
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.toc-item a {
  display: block;
  font-size: 0.92rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  line-height: 1.4;
}

.toc-item a:hover {
  color: var(--accent);
}

.toc-item--h3 {
  padding-left: 1rem;
  font-size: 0.88rem;
  border-left: 1px solid var(--border);
}

/* Article Navigation Styles */
.article-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0 2rem;
}

.article-nav {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .article-nav {
    grid-template-columns: 1fr 1fr;
  }
}

.nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition-base);
}

.nav-link:hover {
  border-color: var(--accent-border);
  background: var(--surface-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.nav-link--next {
  text-align: right;
  align-items: flex-end;
}

.nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.nav-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
