:root {
  /* Catppuccin Mocha Color Palette */
  --ctp-base: #1e1e2e;
  --ctp-mantle: #181825;
  --ctp-crust: #11111b;
  --ctp-surface0: #313244;
  --ctp-surface1: #45475a;
  --ctp-surface2: #585b70;
  --ctp-overlay0: #6c7086;
  --ctp-overlay1: #7f849c;
  --ctp-subtext0: #a6adc8;
  --ctp-subtext1: #bac2de;
  --ctp-text: #cdd6f4;
  --ctp-lavender: #b4befe;
  --ctp-blue: #89b4fa;
  --ctp-sapphire: #74c7ec;
  --ctp-sky: #89dceb;
  --ctp-teal: #94e2d5;
  --ctp-green: #a6e3a1;
  --ctp-yellow: #f9e2af;
  --ctp-peach: #fab387;
  --ctp-maroon: #eba0ac;
  --ctp-red: #f38ba8;
  --ctp-mauve: #cba6f7;
  --ctp-pink: #f5c2e7;
  --ctp-flamingo: #f2cdcd;
  --ctp-rosewater: #f5e0dc;

  /* Theme Variables */
  --color-bg: var(--ctp-base);
  --color-bg-alt: var(--ctp-mantle);
  --color-surface: var(--ctp-surface0);
  --color-border: var(--ctp-surface1);
  --color-text: var(--ctp-text);
  --color-text-muted: var(--ctp-subtext0);
  --color-accent: var(--ctp-peach);
  --color-accent-hover: var(--ctp-yellow);
  --color-link: var(--ctp-peach);
  --color-link-hover: var(--ctp-yellow);
  --color-code-bg: var(--ctp-crust);
  --color-selection: rgba(250, 179, 135, 0.25);

  /* Component-specific vars */
  --header-bg: rgba(30, 30, 46, 0.85);

/* Font */
--font-sans: "JetBrains Mono", "Fira Code", monospace;
--font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Spacing */
  --header-height: 70px;
  --container-max: 1200px;
  --container-pad: 1.5rem;
}

/* ---- Light theme (warm beige — matches hero accent #fab387) ---- */
[data-theme="light"] {
  /* Warm beige palette built around #fab387 (Catppuccin Mocha peach) */
  --ctp-base: #fab387;       /* main background */
  --ctp-mantle: #f0a070;     /* footer, mobile nav, alt bg */
  --ctp-crust: #e08a58;      /* code bg, deepest alt */
  --ctp-surface0: #ffc9a8;   /* cards, panels — lighter cream */
  --ctp-surface1: #ffd8bc;   /* borders */
  --ctp-surface2: #ffe4cc;   /* subtle hover */
  --ctp-overlay0: #9a7060;
  --ctp-overlay1: #845848;
  --ctp-subtext0: #6a4030;   /* muted text */
  --ctp-subtext1: #553020;
  --ctp-text: #2c1500;       /* main text — dark warm brown */
  --ctp-lavender: #5060d0;
  --ctp-blue: #1050c8;
  --ctp-sapphire: #1080a0;
  --ctp-sky: #0480b8;
  --ctp-teal: #107070;
  --ctp-green: #2a6018;
  --ctp-yellow: #905800;
  --ctp-peach: #a03400;      /* accent — deep orange-brown, pops on warm bg */
  --ctp-maroon: #b02030;
  --ctp-red: #900018;
  --ctp-mauve: #5820b0;
  --ctp-pink: #b04898;
  --ctp-flamingo: #a04848;
  --ctp-rosewater: #985848;

  /* Theme Variables */
  --color-bg: var(--ctp-base);
  --color-bg-alt: var(--ctp-mantle);
  --color-surface: var(--ctp-surface0);
  --color-border: var(--ctp-surface1);
  --color-text: var(--ctp-text);
  --color-text-muted: var(--ctp-subtext0);
  --color-accent: var(--ctp-peach);
  --color-accent-hover: var(--ctp-yellow);
  --color-link: var(--ctp-peach);
  --color-link-hover: var(--ctp-yellow);
  --color-code-bg: var(--ctp-crust);
  --color-selection: rgba(160, 52, 0, 0.2);

  /* Component-specific vars */
  --header-bg: rgba(250, 179, 135, 0.88);
}

/* Global Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Site wrapper */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===============================
   NAVIGATION - Seamless Top Bar
   =============================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-height);
  background-color: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: none;
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo - Initials only */
.nav-logo {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.25s ease;
}

.nav-logo:hover {
  color: var(--color-accent);
}

.nav-logo {
  position: relative;
}

.nav-logo::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 0%;
  background-color: var(--color-accent);
  transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-logo:hover::after,
.nav-logo--active::after {
  width: 100% !important;
}

.nav-logo--active {
  color: var(--color-text) !important;
}

.nav-logo--active::after {
  width: 100%;
}

/* Nav links - Moved to right */
.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
  margin-right: 2rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ctp-subtext0);
  text-decoration: none;
  transition: color 0.25s ease;
  padding: 0.5rem 0;
  background: transparent !important;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1px;
  width: 0%;
  background-color: var(--color-accent);
  transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-text);
  background: transparent !important;
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  width: 100%;
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Remove search button */
#search-open {
  display: none !important;
}

/* Nav buttons */
.nav-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--color-text);
  transition: color 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  color: var(--color-accent);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}

/* Theme toggle icons — show icon matching current theme */
.icon-sun,
.icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

/* Language toggle */
.lang-switcher {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md, 4px);
  transition: color 0.25s ease, background-color 0.25s ease;
}

.lang-switcher:hover {
  color: var(--color-accent);
  background: var(--color-surface);
}

/* Mobile nav */
.nav-hamburger {
  display: flex;
}

@media (min-width: 768px) {
  .nav-hamburger {
    display: none;
  }
}

.nav-mobile {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background-color: var(--ctp-mantle);
  padding: 1.5rem;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 199;
}

.nav-mobile.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.nav-mobile a {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
  text-decoration: none;
  padding: 1rem 0;
  border-bottom: 1px solid var(--ctp-surface0);
  transition: color 0.25s ease;
}

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

/* ===============================
   HERO SECTION
   =============================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  position: relative;
  overflow: hidden;
}

.hero-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem 3rem;
}

@media (min-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 1rem 4rem;
  }

  .hero-content     { grid-column: 1; grid-row: 1; }
  .hero-illustration{ grid-column: 2; grid-row: 1; }
  .hero-actions     { grid-column: 1; grid-row: 2; align-self: center; }
  .hero-subtitle    { grid-column: 2; grid-row: 2; align-self: center; }
}

/* Hero content - Left side */
.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 10;
  align-items: center;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero-titles {
  width: 100%;
  max-width: 480px;
}

.hero-title {
  display: block;
  text-align: left;
  font-style: italic;
  font-family: var(--font-sans);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--color-text);
  margin: 0;
}

.hero-title-accent {
  text-align: right;
  font-weight: 300;
  color: var(--color-accent);
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 300;
  font-style: italic;
  color: var(--ctp-subtext0);
  margin: 0;
  text-align: center;
  width: 100%;
}

.hero-description {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  font-style: italic;
  color: var(--ctp-subtext0);
  line-height: 1.75;
  max-width: 480px;
  margin: 0;
  text-align: justify;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.hero-actions .hero-cta,
.hero-actions .hero-cta.hero-cta--secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  background-color: transparent !important;
  color: var(--color-text) !important;
  text-decoration: none !important;
  transition: color 0.25s ease !important;
  cursor: pointer !important;
  outline: none !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
  font-weight: normal !important;
  font-size: inherit !important;
  gap: 0 !important;
}

.hero-actions .hero-cta:hover,
.hero-actions .hero-cta:focus,
.hero-actions .hero-cta.hero-cta--secondary:hover {
  color: var(--color-accent) !important;
  border: none !important;
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
}

.hero-actions .hero-cta svg,
.hero-actions .hero-cta.hero-cta--secondary svg {
  width: 36px !important;
  height: 36px !important;
  display: block !important;
  fill: currentColor !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Make email icon larger to match visual height of GitHub/LinkedIn */
.hero-actions .hero-cta.hero-cta--email svg {
  width: 44px !important;
  height: 44px !important;
}

.hero-actions .hero-cta:hover svg {
  color: var(--color-accent) !important;
}

/* Hero illustration - Right side */
.hero-illustration {
  position: relative;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.hero-xray-container {
  position: relative;
  display: inline-block;
  cursor: crosshair;
}

.hero-profile-original,
.hero-profile-stylized {
  display: block;
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
  user-select: none;
}

.hero-profile-stylized {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mask: url(#brush-mask);
}

/* ===============================
   MAIN CONTENT
   =============================== */
.site-main {
  flex: 1;
}

.content-panel {
  background-color: transparent;
  border: none;
  box-shadow: none;
}

/* ===============================
   FOOTER
   =============================== */
.site-footer {
  background-color: var(--ctp-mantle);
  border-top: 1px solid var(--ctp-surface0);
  padding: 1.5rem 0;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-logo {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  /* font-style: italic; */
  letter-spacing: 0;
  color: var(--color-text);
  text-decoration: none;
}

.footer-logo:hover {
  color: var(--color-accent);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-footer .footer-social a {
  font-family: var(--font-mono);
  font-size: 11px;
  /* font-style: italic; */
  text-transform: uppercase;
  /* letter-spacing: 0.08em; */
  color: var(--ctp-subtext0);
  text-decoration: none;
  transition: color 0.25s ease;
}

.site-footer .footer-social a:hover {
  color: var(--color-accent);
}

/* ===============================
   UTILITY CLASSES
   =============================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* Remove old background panels */
.site-background,
.hero-overlay::before,
.hero-overlay::after {
  display: none !important;
}

/* Override any remaining panel styles */
.panel,
.card,
.content-panel,
.content-panel.post-panel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;
}

/* ===============================
   MOBILE OVERRIDES (max-width: 767px)
   =============================== */

/* ---- Nav ---- */
.nav-mobile-actions {
  display: none; /* hidden by default; shown on mobile below */
}

.nav-mobile-actions__label {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
}

@media (max-width: 767px) {
  /* Hide lang dropdown and theme toggle from the header bar */
  .nav-desktop-only {
    display: none !important;
  }

  /* Show controls inside the mobile drawer */
  .nav-mobile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--ctp-surface0);
  }

  .nav-mobile-actions .nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    height: auto;
    padding: 0.5rem;
  }

  .nav-mobile-actions__label {
    display: none;
  }

  .nav-mobile-actions #theme-toggle-mobile {
    padding: 0.4rem 0.5rem;
  }

  /* ---- Hero: reorder to image → title → subtitle → description → socials ---- */
  .hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  /* Unwrap hero-content so its children become direct flex items */
  .hero-content {
    display: contents;
  }

  .hero-badge   { order: 0; display: none; }
  .hero-illustration { order: 1; min-height: 260px; width: 100%; }
  .hero-titles  { order: 2; text-align: center; width: 100%; }
  .hero-subtitle { order: 3; text-align: center; }
  .hero-description { order: 4; max-width: 100%; text-align: left; }
  .hero-actions { order: 5; }

  .hero-title {
    text-align: center;
  }

  .hero-title-accent {
    text-align: center;
  }

  /* ---- Markdown post: reduce horizontal padding ---- */
  .content-panel.post-panel,
  .content-panel.notes-panel {
    padding-inline: 1rem !important;
  }

  /* ---- Notes filter: hide buttons, show select ---- */
  .tag-filter--desktop {
    display: none;
  }

  .tag-filter--mobile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

  .tag-filter-select {
    background: var(--ctp-surface0);
    color: var(--color-text);
    border: 1px solid var(--ctp-surface1);
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 13px;
    cursor: pointer;
  }

  /* ---- Post card: image above text ---- */
  .post-card {
    flex-direction: column;
    gap: 0.75rem;
  }

  .post-card__cover {
    width: 100%;
    height: 180px;
  }

  /* ---- Hero: breathing room before footer ---- */
  .hero {
    padding-bottom: 3rem;
  }

  /* ---- Notes / post prose: left-align instead of justify ---- */
  .post-content,
  .post-content p,
  .post-content li,
  .content-panel.post-panel .prose {
    text-align: left !important;
  }
}

/* Desktop: hide the mobile dropdown, show the button row */
@media (min-width: 768px) {
  .tag-filter--mobile {
    display: none;
  }

  .tag-filter--desktop {
    display: flex;
  }
}
