:root {
  /* === Color Palette === */
  --bg-start: #11042a;
  --bg-mid: #071133;
  --bg-end: var(--bg-start);
  --bg-secondary: rgba(15, 24, 52, 0.82);
  --panel1: #07102a;
  --panel2: #05061a;

  --heading: #fff;
  --text: #eaf6ff;
  --muted: #9fb0d6;
  --black: #000;
  --white: #fff;

  /* === Accent Colors === */
  --accent-primary: #d23d3d;
  --accent-secondary: #7a3fff;
  --accent-highlight: #2fc0e8;

  /* === Glows & Effects === */
  --glow-brand: rgba(255, 63, 63, 0.5);
  --glow-brand-strong: rgba(122, 63, 255, 0.7);
  --glow-brand-soft: rgba(122, 63, 255, 0.18);
  --glow-panel-soft: rgba(255, 51, 0, 0.18);
  --glow-panel-mid: rgba(255, 94, 0, 0.28);
  --glow-panel-light: rgba(255, 106, 0, 0.14);
  --glow-panel-start: rgba(255, 60, 0, 0.08);
  --glow-panel-end: rgba(255, 58, 58, 0.06);
  --glow-panel-weak: rgba(255, 106, 0, 0.08);

  /* === Shadows === */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-2: 0 6px 16px rgba(0, 0, 0, 0.45);
  --shadow-dark-1: rgba(0, 0, 0, 0.4);
  --shadow-dark-2: rgba(0, 0, 0, 0.55);
  --shadow-dark-3: 0 8px 22px rgba(0, 0, 0, 0.38);
  --shadow-dark-4: 0 6px 18px rgba(0, 0, 0, 0.34);
  --shadow-ink-35: rgba(2, 6, 23, 0.35);
  --shadow-ink-25: rgba(2, 6, 23, 0.25);
  --shadow-black-25: rgba(0, 0, 0, 0.25);

  /* === Overlays === */
  --overlay-white-02: rgba(255, 255, 255, 0.02);
  --overlay-white-04: rgba(255, 255, 255, 0.04);
  --overlay-white-06: rgba(255, 255, 255, 0.06);
  --overlay-white-09: rgba(255, 255, 255, 0.09);

  /* === Controls === */
  --control-bg: #0b1126;
  --control-border: #28324f;
  --control-bg-header: #0f1628;
  --control-border-header: #26314f;
  --btn-outline-border: rgba(255, 255, 255, 0.2);

  /* === Layout & Sizing === */
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1100px;
  --container-pad: 20px;
  --card-pad: 18px;
  --edge-offset: 12px;
  --wrap-pad-h: 12px;
  --wrap-pad-bottom: 8px;
  --site-header-gap: 22px;
  --site-header-height: 96px;
  --sidebar-width: 360px;

  /* === Safe Areas === */
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);

  /* === Header & Logo === */
  --header-inner-pad-vertical: 18px;
  --header-inner-pad-horizontal: 24px;
  --logo-height: 48px;
  --logo-width: 48px;
  --logo-radius: 10px;

  /* === Spacing === */
  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 18px;
  --space-xs: 6px;
  --space-s: 8px;
  --space-m: 12px;
  --space-lg: 18px;
  --space-xl: 24px;

  /* === Buttons === */
  --btn-pad-vertical: 10px;
  --btn-pad-horizontal: 14px;
  --btn-radius: 10px;
  --btn-primary-hover-shadow: 0 0 20px rgba(255, 0, 225, 0.75);
  --btn-outline-hover-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), 0 0 8px rgba(122, 63, 255, 0.1);

  /* === Panels === */
  --panel-dense-pad: 8px;
  --panel-spacious-pad: 28px;
  --panel-compact-pad: 12px;

  /* === Typography === */
  --font-sans:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --text-small-size: 12px;
  --hero-title-size: 28px;
  --text-eyebrow-size: 13px;

  /* === Accessibility === */
  --focus: 3px solid rgba(124, 58, 237, 0.9);

  /* === Motion === */
  --hover-lift: -2px;
  --hover-lift-small: -1px;
  --hover-duration: 180ms;
  --hover-ease: cubic-bezier(0.2, 0.9, 0.2, 1);

  /* === Background === */
  --bg-image: none;

  /* === Scrollbar (defaults - themes can override) === */
  --scrollbar-track: transparent;
  --scrollbar-thumb: var(--overlay-white-06);
  --scrollbar-thumb-hover: var(--overlay-white-09);
}

* {
  box-sizing: border-box;
}

/* Match the body gradient on the root so overscroll shows a continuous gradient (fixes Safari) */
html {
  /* Set a solid background color matching the top of your gradient */
  /* Draw optional image atop the gradient on the root element so it is
     visible behind browser chrome (some browsers paint chrome from the
     root/html layer). The image variable defaults to `none` in :root. */
  background-image:
    var(--bg-image), linear-gradient(180deg, var(--bg-start), var(--bg-mid) 60%, var(--bg-start));
  background-repeat: no-repeat, no-repeat;
  background-position:
    center center,
    center center;
  -webkit-background-size: cover, cover;
  background-size: cover, cover;
  background-color: var(--bg-start);
  /* Ensure html fills the dynamic viewport (helps mobile WebKit) */
  height: 100dvh;
  min-height: -webkit-fill-available;
  min-height: 100vh;
  /* Prevent horizontal scroll in RTL mode (scrollbar-gutter + RTL can cause overflow) */
  overflow-x: hidden;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  letter-spacing: 0.2px;
  display: block;
  /* allow full-bleed header */
  font-size: 16px;
  /* Keep body transparent so the html background shows behind browser chrome.
    This prevents a white strip when the address bar collapses on mobile. */
  background-color: transparent;
  height: 100dvh;
  min-height: -webkit-fill-available;
  min-height: 100vh;
  /* Prevent horizontal scroll in RTL mode (scrollbar-gutter + RTL can cause overflow) */
  overflow-x: hidden;
}

/* WebKit / Safari overscroll fixes */
html::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    var(--bg-image), linear-gradient(180deg, var(--bg-start), var(--bg-mid) 60%, var(--bg-start));
  background-repeat: no-repeat, no-repeat;
  background-position:
    center center,
    center center;
  -webkit-background-size: cover, cover;
  background-size: cover, cover;
  background-attachment: fixed, scroll;
  /* Force a GPU layer and avoid transforms that can create a new stacking context */
  transform: translateZ(0);
}

/* Smooth scrolling and anchor offset to account for sticky header */
html {
  /* Disable smooth scrolling initially to prevent premature hash scrolling */
  scroll-behavior: auto;
  /* Add scroll padding to the scroll container to account for fixed header */
  scroll-padding-top: calc(var(--site-header-height, 96px) + 20px);
}

/* Enable smooth scrolling after page loads (JS will add this class) */
html.loaded {
  scroll-behavior: smooth;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {

  html,
  html.loaded {
    scroll-behavior: auto;
  }
}

/* Ensure anchors near top aren't hidden under the sticky header. Use the header height variable. */
#top,
#projects,
#news,
#contact {
  /* Add extra padding to account for any margins and provide breathing room */
  scroll-margin-top: calc(var(--site-header-height, 96px) + 20px);
}

/* Conservative mobile adjustments (increase tap targets and legibility) */
@media (max-width: 520px) {
  :root {
    --btn-pad-vertical: 14px;
    --btn-pad-horizontal: 18px;
    --logo-height: 56px;
    --logo-width: 56px;
    --hero-title-size: 26px;
    --text-small-size: 13px;
    --wrap-pad-h: 16px;
    --wrap-pad-bottom: 20px;
    --card-pad: 16px;
    --gap-md: 16px;
    --space-xl: 20px;
  }

  /* Slightly larger base type on mobile for better readability */
  html,
  body {
    font-size: 16px;
  }

  /* Make primary controls larger */
  .btn {
    padding: var(--btn-pad-vertical) var(--btn-pad-horizontal);
    border-radius: 12px;
    font-size: 15px;
  }

  .nav-link {
    padding: 12px 14px;
    font-size: 16px;
  }

  .hero h2 {
    font-size: var(--hero-title-size);
    line-height: 1.3;
  }

  /* Better prose readability */
  .prose {
    font-size: 15px;
    line-height: 1.65;
  }

  /* Improve section spacing */
  .wrap {
    padding-left: var(--wrap-pad-h);
    padding-right: var(--wrap-pad-h);
  }
}

/* Tablet optimizations */
@media (min-width: 521px) and (max-width: 767px) {
  :root {
    --hero-title-size: 30px;
    --wrap-pad-h: 20px;
  }

  .hero h2 {
    font-size: var(--hero-title-size);
  }
}

/*
  Safari on iOS/desktop can show a black background during overscroll or when the
  viewport is pulled beyond the document. Use a fixed ::before layer on the body
  to paint a continuous background (gradient + optional image) behind the page so
  overscroll shows the expected colors.
*/
body::before {
  content: '';
  position: fixed;
  inset: 0;
  /* top:0; right:0; bottom:0; left:0; */
  z-index: -1;
  /* Place it behind all other content */
  pointer-events: none;

  /* Background layering: if --bg-image is set to a URL, it will be drawn on top
     of the gradient fallback. Use the variable in the shorthand so developers can
     toggle it by setting --bg-image: none | url(...). */
  background-image:
    var(--bg-image), linear-gradient(180deg, var(--bg-start), var(--bg-mid) 60%, var(--bg-start));
  background-repeat: no-repeat, no-repeat;
  background-position:
    center center,
    center center;
  -webkit-background-size: cover, cover;
  -moz-background-size: cover, cover;
  -o-background-size: cover, cover;
  background-size: cover, cover;
  /* Attempt a fixed visual effect for the image layer where supported; some
     mobile browsers ignore background-attachment: fixed for performance. */
  background-attachment: fixed, scroll;

  /* Use a height chain that prefers dynamic viewport units but falls back safely. */
  height: 100dvh;
  /* Preferred modern solution for dynamic toolbars */
  height: -webkit-fill-available;
  /* Older WebKit/Safari */
  height: 100vh;
  /* Fallback for older browsers */
  /* Note: width removed - inset: 0 already handles full-width coverage
     100vw causes horizontal overflow in RTL due to scrollbar width */
}

/* Fallbacks for browsers that don't support svh/dvh (older Safari, older Chrome). */
/* Keep fallbacks simple; the element is fixed so it won't affect layout. Modern units improve coverage
   but should not be required for correct behavior. */
@supports (height: 100svh) {
  html::before {
    height: 100svh;
  }
}

@supports not (height: 100svh) {
  body::before {
    height: 100vh;
  }
}

@supports (-webkit-touch-callout: none) {

  /* On some Safari builds, -webkit-fill-available helps painting; keep as optional enhancement */
  html::before {
    height: -webkit-fill-available;
  }
}

/* Debug helper: add .debug-bg-outline to html to show the background element's boundary during testing */
html.debug-bg-outline::before {
  outline: 2px dashed rgba(255, 255, 255, 0.12);
}

/* Safe area for devices with notch (merged into :root above) */

.wrap {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 var(--wrap-pad-h) var(--wrap-pad-bottom);
  box-sizing: border-box;
  margin: 0 auto;
}

/* No-JS Warning Banner - DEPRECATED: Now uses inline styles in noscript tag */
/* Old banner styles commented out - new toast-style notice in index.html
.notice-banner {
  background: linear-gradient(135deg, #d23d3d 0%, #7a3fff 100%);
  color: var(--white);
  padding: 8px 0;
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: fixed;
  top: var(--site-header-height);
  left: 0;
  right: 0;
  z-index: 9999;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.notice-banner__content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}

.notice-banner__text {
  flex: 1;
  max-width: 900px;
}

.notice-banner strong {
  display: block;
  font-size: 1em;
  margin-bottom: 2px;
  font-weight: 600;
}

.notice-banner p {
  margin: 0;
  opacity: 0.95;
  font-size: 0.9em;
  line-height: 1.4;
}

/* Dismiss button */
.notice-banner__dismiss-checkbox {
  display: none;
}

.notice-banner__dismiss-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: var(--white);
  cursor: pointer;
  font-size: 1.2em;
  line-height: 1;
  padding: 6px 10px;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
  font-weight: bold;
}

.notice-banner__dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.notice-banner__dismiss-btn:active {
  transform: scale(0.95);
}

/* Hide banner when dismissed */
.notice-banner__dismiss-checkbox:checked~.notice-banner,
.notice-banner__dismiss-checkbox:checked+.notice-banner {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* For noscript banner - checkbox needs to be outside in noscript context */
#noscript-dismiss:checked~* .noscript-banner {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Add extra padding to body content to account for the fixed notice banner */
body:has(.notice-banner) .site-header+.wrap,
body:has(.noscript-banner) .site-header+.wrap {
  padding-top: calc(var(--site-header-height, 96px) + 60px);
}

/* Adjust hero section margin when notice banner is present */
body:has(.notice-banner) .hero,
body:has(.noscript-banner) .hero {
  margin-top: calc(var(--site-header-gap) + 48px);
}

/* Mobile optimization */
@media (max-width: 768px) {
  .notice-banner {
    padding: 6px 0;
  }

  .notice-banner__content {
    padding: 0 12px;
    gap: 8px;
  }

  .notice-banner strong {
    font-size: 0.95em;
    margin-bottom: 2px;
  }

  .notice-banner p {
    font-size: 0.85em;
    line-height: 1.3;
  }

  .notice-banner__dismiss-btn {
    font-size: 1.1em;
    padding: 4px 8px;
  }

  body:has(.notice-banner) .site-header+.wrap,
  body:has(.noscript-banner) .site-header+.wrap {
    padding-top: calc(var(--site-header-height, 96px) + 48px);
  }

  body:has(.notice-banner) .hero,
  body:has(.noscript-banner) .hero {
    margin-top: calc(var(--site-header-gap) + 36px);
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .notice-banner strong {
    font-size: 0.9em;
  }

  .notice-banner p {
    font-size: 0.8em;
  }

  .notice-banner__content {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .notice-banner__dismiss-btn {
    align-self: stretch;
    padding: 6px;
  }
}

/* Missing translations banner variant */
.missing-translations-banner {
  background: linear-gradient(135deg, #ff9800 0%, #f44336 100%);
  top: calc(var(--site-header-height) + 48px);
  /* Stack below noscript if both present */
}

/* Adjust stacking if both notices are present */
body:has(.noscript-banner):has(.missing-translations-banner) .missing-translations-banner {
  top: calc(var(--site-header-height) + 54px);
}

@media (max-width: 768px) {
  .missing-translations-banner {
    top: calc(var(--site-header-height) + 42px);
  }

  body:has(.noscript-banner):has(.missing-translations-banner) .missing-translations-banner {
    top: calc(var(--site-header-height) + 48px);
  }
}

End of deprecated banner styles */

/* Skip link */
.skip-link {
  position: fixed;
  left: var(--edge-offset);
  top: var(--edge-offset);
  z-index: 11000;
  /* sit above header backdrop */
  pointer-events: none;
  /* avoid capturing pointer when hidden */
}

.skip-link a {
  background: rgba(0, 0, 0, 0.72);
  color: var(--white);
  padding: 8px var(--space-m);
  border-radius: 999px;
  display: inline-block;
  transform: translateY(-140%);
  transition:
    transform 180ms var(--hover-ease),
    opacity 160ms ease,
    box-shadow 160ms ease;
  opacity: 0;
  pointer-events: auto;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.skip-link a:focus,
.skip-link a:focus-visible,
.skip-link a:hover {
  transform: none;
  opacity: 1;
  text-decoration: none;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.55),
    0 0 10px var(--glow-brand-soft);
}

/* Keep skip link visible on keyboard focus but remove animation if reduced-motion is requested */
@media (prefers-reduced-motion: reduce) {
  .skip-link a {
    transition: none;
    /* Keep it hidden by default - only show on focus */
    transform: translateY(-140%);
    opacity: 0;
  }

  .skip-link a:focus,
  .skip-link a:focus-visible {
    /* Show immediately on focus without animation */
    transform: none;
    opacity: 1;
  }
}

/* Prevent the skip link from overlapping the header content at narrow widths */
@media (max-width: 520px) {
  .skip-link {
    top: calc(var(--edge-offset) + var(--safe-top, 0px));
    left: 8px;
  }

  .skip-link a {
    padding: 8px 12px;
    font-size: 14px;
  }
}

/* Header */
.brand {
  display: flex;
  align-items: center;
  /* ensure logo and brand text are vertically centered */
  gap: var(--gap-sm);
}

/* Logo container to allow a soft backdrop and padding separate from the header blur */
.logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  /* small breathing room between logo and header */
  border-radius: calc(var(--logo-radius) + 2px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.06));
  box-shadow:
    0 6px 18px rgba(2, 6, 23, 0.32),
    0 0 14px rgba(122, 63, 255, 0.04) inset;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

header {
  display: block;
  /* header will be full-bleed; inner container handles layout */
  padding: 0;
  /* inner controls spacing */
  --control-bg: var(--control-bg-header);
  /* slightly adjusted for the cooler palette */
  --control-border: var(--control-border-header);
}

.site-header {
  /* Use fixed header to avoid intermittent sticky behavior across browsers
     and stacking contexts (ensures header remains visible while scrolling). */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2000;
  /* raised so header stays above panels and content */
  /* Give header a subtle translucent background so backdrop-filter has pixels to blur
     and the header remains visible against page backgrounds (prevents white blending). */
  background-color: rgba(6, 8, 20, 0.08);
  padding-top: calc(var(--safe-top, 0px));
  backdrop-filter: blur(8px);
  /* stronger blur for frosted glass effect */
  -webkit-backdrop-filter: blur(8px);
  /* make the header full-bleed so the backdrop blur spans the viewport */
  width: 100%;
  /* span the layout width (matches body) */
  left: 0;
  transform: none;
  /* subtle border and shadow for contrast over varied backgrounds; default border is transparent */
  box-shadow: 0 2px 12px var(--shadow-ink-35);
  /* ease-in-out for small transitions; reduced-motion will override */
  transition:
    background-color 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease;
}

/* Ensure the translucent header visual is truly full-bleed even when inner content is constrained
   by the `.wrap` container. Use a ::before pseudo-element to paint the backdrop across the viewport. */
.site-header {
  overflow: visible;
  /* avoid clipping the pseudo-element */
}

.site-header::before {
  content: '';
  /* Use a fixed layer so the header backdrop is painted edge-to-edge and is
     not affected by other stacking contexts or positioned siblings. This
     prevents the visual 'stop' where the header background appears to end
     when overlapping other sections. */
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: var(--site-header-height, 96px);
  bottom: auto;
  z-index: 1999;
  /* just below header content (header itself is 2000) */
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 8, 20, 0.12), rgba(6, 8, 20, 0.1));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--overlay-white-09);
}

/* Ensure the inner header content sits above the fixed backdrop so controls remain interactive */
.site-header__inner {
  position: relative;
  z-index: 2000;
}

/* When header is fixed, ensure the following page content is offset to avoid being hidden under it */
.site-header+.wrap {
  padding-top: var(--site-header-height, 96px);
}

/* Tuned z-index for overlays that might appear; keep high but avoid stomping modals */
.site-header {
  z-index: 2000;
}

/* Safari/WebKit sticky workarounds
   Some versions of Safari have intermittent bugs where position:sticky elements
   disappear when the address bar collapses or during fast scrolls. Provide a
   non-invasive fallback that can be enabled via JS by adding `.site-header--fixed`.
   The fixed header visually behaves the same and we add an equivalent top padding
   to the body content to avoid layout shift. */
.site-header--fixed {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  width: 100%;
  z-index: 2000;
}

/* When the fixed header is in use, ensure page content keeps the same offset. This
   rule only affects when the class is present; it avoids forcing the padding when
   not needed. Use `--site-header-height` to compute the offset (falls back to 96px).
*/
.site-header--fixed+.wrap,
.site-header--fixed+* {
  /* adjacent content after header */
  padding-top: var(--site-header-height, 96px);
}

/* The compact header variant has been removed — header remains visible and static. */

/* Use measured header height variable as fallback for CSS-only users */

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: calc(var(--logo-radius) - 2px);
  background:
    radial-gradient(120% 80% at 10% 20%, rgba(255, 80, 80, 0.14), transparent 25%),
    linear-gradient(135deg, rgba(173, 35, 35, 0.12), rgba(10, 12, 20, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  box-shadow:
    0 8px 22px rgba(2, 6, 23, 0.36),
    0 0 18px rgba(122, 63, 255, 0.04) inset;
  transition:
    transform 220ms var(--hover-ease),
    box-shadow 220ms var(--hover-ease),
    background 220ms ease;
  padding: 6px;
  /* tighter horizontal padding */
  min-height: var(--logo-height);
  width: var(--logo-width);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.logo::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 300ms ease;
}

.logo:hover::before {
  opacity: 1;
}

.logo:hover {
  transform: translateY(var(--hover-lift-small));
  box-shadow:
    0 12px 36px rgba(2, 6, 23, 0.42),
    0 0 26px rgba(122, 63, 255, 0.08);
  background:
    radial-gradient(120% 80% at 10% 20%, rgba(255, 80, 80, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(173, 35, 35, 0.18), rgba(12, 14, 28, 0.28));
}

/* When a logo image is loaded, ensure it scales to fit the logo container without cropping */
.logo img.logo-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  /* fill the logo box */
  max-height: none;
  object-fit: contain;
  /* preserve entire image while fitting */
  border-radius: 6px;
  /* soft corners for the svg */
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}

.brand h1 {
  font-size: 18px;
  margin: 0;
  color: var(--heading);
}

nav {
  display: flex;
  gap: var(--gap-xs);
  align-items: center;
}

.nav-link {
  background: transparent;
  border: 0;
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.nav-link:hover {
  color: var(--text);
  transform: translateY(var(--hover-lift-small));
}

/* Prefer :focus-visible for keyboard focus so mouse users don't get outline while retaining accessibility */
.nav-link:focus-visible {
  color: var(--text);
  outline: none;
  /* we provide a visible focus ring via box-shadow elsewhere */
  transform: translateY(var(--hover-lift-small));
}

.nav-link {
  transition:
    color var(--hover-duration) var(--hover-ease),
    transform var(--hover-duration) var(--hover-ease);
}

/* Active / current nav state */
.nav-link[aria-current='page'],
.nav-link.active {
  color: var(--white);
  background: linear-gradient(90deg, var(--overlay-white-04), var(--overlay-white-02));
  box-shadow: 0 6px 14px var(--shadow-black-25);
}

/* Small pressed/tap animation for interactive controls (used by JS when a Read button is pressed)
   - The animation scales and fades the button slightly to give tactile feedback.
   - Respects prefers-reduced-motion and will be disabled when set. */
@keyframes press-feedback {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  40% {
    transform: translateY(2px) scale(0.985);
    opacity: 0.98;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.press-animate {
  animation: press-feedback 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .press-animate {
    animation: none !important;
  }
}

/* Underline indicator for focus/active with smooth transition */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 12px;
  /* align inside nav-link padding for consistent visuals */
  right: 12px;
  bottom: -6px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transform: scaleX(0);
  transform-origin: center center;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition:
    transform 200ms ease,
    opacity 200ms ease;
  border-radius: 2px;
  opacity: 0.95;
}

.nav-link:focus-visible::after,
.nav-link.active::after,
.nav-link[aria-current='page']::after {
  transform: scaleX(1);
}

/* Hero */
.panel {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--panel1), var(--panel2));
  box-shadow: var(--shadow-2);
  transition:
    transform var(--hover-duration) var(--hover-ease),
    box-shadow calc(var(--hover-duration) * 1.6) var(--hover-ease);
}

/* Panel semantic variants */
.panel--elevated {
  box-shadow: var(--shadow);
}

.panel--compact {
  padding: var(--panel-compact-pad);
}

.panel--flat {
  box-shadow: none;
}

.panel--glow {
  box-shadow:
    0 10px 28px var(--glow-panel-start),
    0 0 18px var(--glow-panel-end);
}

.panel--no-hover:hover {
  transform: none !important;
  box-shadow: var(--shadow-2) !important;
}

/* Additional semantic spacing variants */
.panel--dense {
  padding: var(--panel-dense-pad);
}

.panel--spacious {
  padding: var(--panel-spacious-pad);
}

/* Hover behavior variants (apply to elements via classes) */
.panel--elevated-hover:hover {
  transform: translateY(var(--hover-lift));
  box-shadow:
    0 8px 20px var(--shadow-dark-2),
    0 0 12px var(--glow-panel-soft);
}

.panel--glow:hover {
  transform: translateY(var(--hover-lift));
  box-shadow:
    0 8px 18px var(--shadow-dark-3),
    0 0 10px var(--glow-brand-soft);
}

.panel--soft-hover:hover {
  transform: translateY(var(--hover-lift));
  box-shadow:
    0 6px 18px var(--shadow-dark-4),
    0 0 8px var(--glow-panel-weak);
}

footer .translation-notice {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255, 165, 0, 0.2);
  font-size: 0.75rem;
  color: rgba(255, 165, 0, 0.7);
  text-align: center;
  line-height: 1.5;
}

footer .translation-notice a {
  color: rgba(255, 165, 0, 0.9);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

footer .translation-notice a:hover {
  color: rgba(255, 165, 0, 1);
  text-decoration-style: solid;
}

@media (max-width: 600px) {
  footer .translation-notice {
    font-size: 0.72rem;
  }
}

/* Subtle border on hover/focus for all panels to improve affordance.
   - Adds a faint, theme-appropriate border and a gentle glow.
   - Respect users who prefer reduced motion by disabling transform-related transitions.
   - Add .panel--no-hover-border to opt-out on elements that shouldn't show the border. */
.panel:hover,
.panel:focus-within {
  /* Use an inset box-shadow to emulate a 1px border without causing layout shift */
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.38),
    0 0 10px rgba(122, 63, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.panel--no-hover-border:hover,
.panel--no-hover-border:focus-within {
  border: none;
  /* opt-out */
}

@media (prefers-reduced-motion: reduce) {

  .panel,
  .panel--elevated-hover,
  .panel--glow,
  .panel--soft-hover {
    transition: none;
  }

  .panel:hover,
  .panel:focus-within {
    transform: none;
    box-shadow: var(--shadow-2);
  }
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-md);
  align-items: center;
  margin-top: var(--site-header-gap);
  /* space below header */
  padding: var(--space-xl);
  box-shadow: var(--shadow);
}

/* Better mobile hero spacing */
@media (max-width: 520px) {
  .hero {
    padding: 18px;
    gap: 14px;
    margin-top: 16px;
  }
}

@media (min-width: 521px) and (max-width: 767px) {
  .hero {
    padding: 20px;
    gap: 16px;
  }
}

/* Header inner container keeps content aligned while the header spans full width */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--header-inner-pad-vertical) var(--header-inner-pad-horizontal);
  box-sizing: border-box;
}

.nav-toggle {
  /* Hidden on larger screens; shown on mobile via media query below */
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color var(--hover-duration) var(--hover-ease);
}

/* CSS-only navigation fallback when JS is disabled */
.nav-toggle-checkbox {
  display: none;
}

.nav-toggle-label {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--hover-duration) var(--hover-ease);
}

.nav-toggle-label:hover {
  background: var(--overlay-white-04);
}

.nav-toggle-label:active {
  background: var(--overlay-white-06);
}

/* Hide button when JS is available, show checkbox label when JS is disabled */
html:not(.no-js) .nav-toggle-label {
  display: none;
}

html.no-js .nav-toggle {
  display: none;
}

html.no-js .nav-toggle-label {
  display: inline-flex;
}

.nav-toggle:hover {
  background: var(--overlay-white-04);
}

.nav-toggle:active {
  background: var(--overlay-white-06);
}

.nav-toggle:focus-visible {
  outline: var(--focus);
}

/* Primary nav defaults: horizontal layout on desktop */
#primary-nav {
  display: flex;
  gap: var(--gap-xs);
  align-items: center;
}

/* Mobile: collapse nav into an overlay panel */
@media (max-width: 520px) {

  /* Slightly more compact header on small screens to preserve vertical space */
  :root {
    --site-header-height: 68px;
    --header-inner-pad-vertical: 10px;
    --header-inner-pad-horizontal: 12px;
  }

  .site-header__inner {
    padding: 10px 12px;
  }

  .logo {
    padding: 6px 10px;
    width: auto;
  }

  .brand h1 {
    font-size: 15px;
  }

  .brand .txt-small {
    font-size: 11px;
  }

  /* Show toggle, hide inline nav */
  .nav-toggle {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
  }

  #primary-nav {
    display: none;
  }

  /* Mobile nav panel (full-width dropdown) */
  /* panel hidden by default, becomes visible when data-open=true */
  #primary-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(var(--site-header-height) + 8px);
    background: linear-gradient(180deg, var(--panel1), var(--panel2));
    border-radius: 12px;
    box-shadow:
      var(--shadow),
      0 0 0 1px var(--overlay-white-06);
    border: 1px solid var(--overlay-white-04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 2100;
    transform-origin: top center;
    transform: scaleY(0.96) translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
      transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
  }

  #primary-nav[data-open='true'] {
    opacity: 1;
    transform: scaleY(1) translateY(0);
    pointer-events: auto;
    z-index: 2100;
  }

  /* Better touch targets in mobile nav */
  #primary-nav .nav-link {
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  /* Animated hamburger icon */
  .hamburger {
    display: inline-block;
    width: 22px;
    height: 18px;
    position: relative;
  }

  .hamburger .bar {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition:
      transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1),
      opacity 180ms ease,
      background-color 180ms ease;
  }

  .hamburger .bar--top {
    top: 0;
  }

  .hamburger .bar--mid {
    top: 8px;
  }

  .hamburger .bar--bot {
    top: 16px;
  }

  /* Subtle pulse animation on the hamburger icon */
  @keyframes hamburger-pulse {

    0%,
    100% {
      transform: scale(1);
      opacity: 1;
    }

    50% {
      transform: scale(1.05);
      opacity: 0.9;
    }
  }

  /* Apply subtle hover effect to hamburger */
  .nav-toggle:hover .hamburger .bar {
    background: var(--accent-primary);
  }

  /* When expanded, morph to X */
  .nav-toggle[aria-expanded='true'] .bar--top {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-toggle[aria-expanded='true'] .bar--mid {
    opacity: 0;
    transform: scaleX(0);
  }

  .nav-toggle[aria-expanded='true'] .bar--bot {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Add a subtle glow to the X when menu is open */
  .nav-toggle[aria-expanded='true'] .hamburger .bar {
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--glow-brand-soft);
  }

  /* Staggered animation for nav links */
  @keyframes nav-link-slide-in {
    from {
      opacity: 0;
      transform: translateX(-12px);
    }

    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  #primary-nav .nav-link {
    display: block;
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 8px;
    opacity: 0;
    transform: translateX(-12px);
  }

  /* Animate nav links when menu opens */
  #primary-nav[data-open='true'] .nav-link {
    animation: nav-link-slide-in 300ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
  }

  #primary-nav[data-open='true'] .nav-link:nth-child(1) {
    animation-delay: 50ms;
  }

  #primary-nav[data-open='true'] .nav-link:nth-child(2) {
    animation-delay: 100ms;
  }

  #primary-nav[data-open='true'] .nav-link:nth-child(3) {
    animation-delay: 150ms;
  }

  #primary-nav[data-open='true'] .nav-link:nth-child(4) {
    animation-delay: 200ms;
  }

  /* CSS-only fallback for mobile navigation when JS is disabled */
  html.no-js #nav-toggle-checkbox:checked~#primary-nav {
    opacity: 1;
    transform: scaleY(1) translateY(0);
    pointer-events: auto;
    z-index: 2100;
  }

  html.no-js #nav-toggle-checkbox:checked~#primary-nav .nav-link {
    opacity: 1;
    transform: translateX(0);
  }

  html.no-js #nav-toggle-checkbox:checked~.nav-toggle-label .bar--top {
    transform: translateY(8px) rotate(45deg);
  }

  html.no-js #nav-toggle-checkbox:checked~.nav-toggle-label .bar--mid {
    opacity: 0;
    transform: scaleX(0);
  }

  html.no-js #nav-toggle-checkbox:checked~.nav-toggle-label .bar--bot {
    transform: translateY(-8px) rotate(-45deg);
  }

  html.no-js #nav-toggle-checkbox:checked~.nav-toggle-label .hamburger .bar {
    background: var(--accent-primary);
  }

  html.no-js #nav-toggle-checkbox:checked~.page-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  /* Make hero more compact and readable on small screens */
  .hero {
    padding: 12px;
    margin-top: calc(var(--site-header-gap) - 18px);
    grid-auto-rows: auto;
  }

  .hero h2 {
    font-size: 20px;
    line-height: 1.15;
    margin-bottom: 6px;
  }

  .hero p {
    max-width: 100%;
    margin-bottom: 8px;
  }

  /* Ensure the aside/card stacks under the hero content and fills available width */
  .hero>aside {
    order: 2;
    width: 100%;
  }

  .hero>div {
    order: 1;
  }

  /* Stack grid into single column and tighten spacing */
  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Better tap targets and spacing */
  .btn {
    padding: 12px 16px;
    width: auto;
  }

  /* Ensure block-level primary CTAs expand to full width when stacked */
  .hero-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-controls .btn {
    width: 100%;
  }

  .projects {
    gap: 10px;
  }

  .stats {
    gap: 8px;
  }

  /* Add more spacing between news section and footer to reduce crowding */
  #news {
    margin-bottom: 24px;
  }

  /* Footer spacing improvements */
  footer {
    padding: 12px var(--wrap-pad-h) calc(20px + var(--safe-bottom, 0px));
    margin-top: 32px;
  }

  /* Section headings - better mobile sizing */
  h2 {
    font-size: 22px;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  /* Project cards */
  .project h3 {
    font-size: 19px;
    line-height: 1.3;
  }

  /* News items */
  .news-title {
    font-size: 17px;
  }

  /* Better eyebrow visibility on mobile */
  .eyebrow {
    font-size: 12px;
    margin-bottom: 6px;
  }
}

/* Improve touch behavior on mobile */
html,
body,
#top {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

/* smoother touch scrolling for overflow regions */
body,
main {
  -webkit-overflow-scrolling: touch;
}

/* Avoid iOS auto-zoom on inputs: ensure 16px font-size on form controls */
.form-control,
input,
textarea,
select {
  font-size: 16px;
}

/* Base button styles shared across all buttons (both <button> elements and .btn class) */
button,
.btn {
  font-size: 16px;
  cursor: pointer;
  font-weight: 700;
  border: 0;
  transition:
    color var(--hover-duration) var(--hover-ease),
    transform var(--hover-duration) var(--hover-ease),
    box-shadow calc(var(--hover-duration) * 1.2) var(--hover-ease);
}

/* Ensure minimum tap sizes (44px recommended) */
.nav-toggle,
.nav-link,
.btn {
  min-height: 44px;
  min-width: 44px;
}

/* Respect user's reduced motion preference for the mobile nav animation */
@media (prefers-reduced-motion: reduce) {
  #primary-nav {
    transition: none !important;
    transform: none !important;
  }

  .hamburger .bar {
    transition: none !important;
  }

  .hamburger {
    animation: none !important;
  }

  #primary-nav .nav-link {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Respect reduced motion for animations/transitions */
@media (prefers-reduced-motion: reduce) {

  .hamburger .bar,
  #primary-nav {
    transition: none !important;
  }
}

/* Variants control hover behavior. No default per-component hover rules. */
.hero .eyebrow {
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  font-size: var(--text-eyebrow-size);
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
  padding-left: 16px;
}

.hero .eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }

  50% {
    opacity: 0.5;
    transform: translateY(-50%) scale(1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow::before {
    animation: none;
  }
}

/* Staggered fade-in animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hide elements initially before page is loaded - ONLY if JS is available */
/* Using :not(.no-js) ensures content shows even if JS fails to load */
html:not(.no-js) .hero,
html:not(.no-js) .grid>section,
html:not(.no-js) .grid>aside,
html:not(.no-js) #contact {
  opacity: 0;
}

/* Only apply animations after page is loaded and positioned */
html.loaded .hero,
html.loaded .grid>section,
html.loaded .grid>aside,
html.loaded #contact {
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {

  /* Ensure elements are visible immediately when reduced motion is enabled */
  html:not(.no-js) .hero,
  html:not(.no-js) .grid>section,
  html:not(.no-js) .grid>aside,
  html:not(.no-js) #contact {
    opacity: 1 !important;
  }

  .hero,
  .grid>section,
  .grid>aside,
  #contact {
    animation: none;
  }
}

/* Fallback eyebrow style for use outside .hero scope */
.eyebrow {
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  font-size: var(--text-eyebrow-size);
  letter-spacing: 1px;
}

.hero h2 {
  margin: 6px 0 0;
  font-size: var(--hero-title-size);
  color: var(--heading);
  text-shadow:
    0 0 8px var(--shadow-dark-1),
    0 0 6px var(--glow-brand-soft);
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 55ch;
}

.hero-controls {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  margin-top: var(--gap-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  padding: var(--btn-pad-vertical) var(--btn-pad-horizontal);
  border-radius: var(--btn-radius);
}

.btn:hover {
  transform: translateY(var(--hover-lift-small));
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
  color: var(--white);
  box-shadow: 0 0 8px var(--glow-panel-mid);
}

.btn-primary:hover {
  box-shadow: var(--btn-primary-hover-shadow);
  filter: brightness(1.08);
  /* Change text color on hover for clearer feedback; keep a subtle glow for contrast */
  color: var(--accent-highlight);
  text-shadow: 0 0 8px var(--glow-panel-light);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--btn-outline-border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent-secondary);
  color: var(--accent-primary);
  box-shadow: var(--btn-outline-hover-shadow);
}

/* Grid sections */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-md);
  margin-top: var(--gap-md);
}

/* Mobile grid improvements */
@media (max-width: 520px) {
  .grid {
    gap: 14px;
    margin-top: 16px;
  }

  /* Full width sections on mobile */
  #projects,
  #news,
  #stats,
  #contact {
    grid-column: 1;
  }
}

/* Tablet layout - start to show sidebar */
@media (min-width: 768px) and (max-width: 879px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 1fr);
    gap: 18px;
  }

  #projects,
  #news {
    grid-column: 1;
  }

  #stats {
    grid-column: 2;
    grid-row: 1 / 3;
  }
}

@media (min-width: 880px) {
  .hero {
    /* Let the content column flex while keeping the milestone card at a readable width */
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
  }

  /* Left flexible column for main content, right sidebar for stats */
  .grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  }

  /* Ensure primary sections occupy the left column and stats sit in the right sidebar */
  #projects,
  #news {
    grid-column: 1;
  }

  #stats {
    grid-column: 2;
  }

  /* Ensure columns match height: make grid items stretch and their content fill height */
  .grid>section,
  .grid>aside {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
  }

  /* Normalize heading spacing so both columns' headings align */
  .grid>section>h2,
  .grid>aside>h2 {
    margin-top: 0;
    /* remove any top margin from headings */
    margin-bottom: 12px;
    /* consistent spacing below headings */
  }

  /* Move the column interior padding to the container so headings line up */
  .grid>section>.projects,
  .grid>aside>.stats {
    padding-top: 0;
  }

  /* Allow project list and stats to expand to fill their column */
  .projects {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .projects .project {
    flex: 0 0 auto;
  }

  .stats {
    flex: 1 1 auto;
    align-items: stretch;
  }

  .stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* Projects */
.projects {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  padding-left: 0;
}

/* Remove default list bullets for top-level project list items while keeping nested lists visible */
.projects>li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.projects>li::marker {
  content: none;
}

.projects li {
  display: block;
}

.projects ul {
  margin-top: 8px;
  padding-left: 18px;
  list-style: disc;
  color: var(--muted);
}

/* Strong fallback: ensure markers are removed across browsers */
.projects,
.projects>li,
.projects li {
  list-style: none !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.projects>li::marker {
  font-size: 0;
  color: transparent;
}

.projects ul li {
  margin-top: 6px;
}

.project {
  padding: var(--card-pad);
}

/* Overlay that dims the page when mobile nav is open */
.page-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease-in-out;
  z-index: 2050;
  /* sit above header but below mobile nav which should be higher */
}

.page-overlay[data-open='true'] {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .page-overlay {
    transition: none;
  }
}

/* Service worker update toast */
.sw-toast {
  position: fixed;
  right: 16px;
  top: calc(var(--safe-top, 12px) + 12px);
  z-index: 1400;
  background: linear-gradient(90deg, rgba(8, 10, 24, 0.96), rgba(16, 18, 40, 0.96));
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sw-toast[hidden] {
  display: none;
}

.sw-toast__inner {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  .sw-toast {
    transition: none !important;
  }
}

/* Variants control hover behavior. No default per-component hover rules. */
.project h3 {
  margin: 0;
  font-size: 16px;
  color: var(--heading);
  text-shadow: 0 0 6px var(--glow-brand-soft);
  transition:
    color 200ms ease,
    text-shadow 200ms ease;
}

.project:hover h3 {
  color: var(--accent-highlight);
  text-shadow: 0 0 10px var(--glow-brand-soft);
}

.project p {
  margin: 8px 0 0;
  color: var(--muted);
}

details {
  border-radius: 8px;
  transition: all 200ms ease;
}

details summary {
  transition: color 200ms ease;
}

details:hover summary {
  color: var(--accent-highlight);
}

details[open] summary {
  color: var(--accent-primary);
}

/* Stats */
.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stat {
  flex: 1 1 140px;
  padding: 14px;
  text-align: center;
}

/* Variants control hover behavior. No default per-component hover rules. */
.stat .num {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Show stat values when JavaScript is disabled using data-target attribute */
html.no-js .stat .num.count::before {
  content: attr(data-target);
}

html.no-js .stat .num.count {
  font-size: 0;
  line-height: 0;
}

html.no-js .stat .num.count::before {
  font-size: 22px;
  line-height: 1.2;
}

/* For unique visitors stat without a data-target, show a dash */
html.no-js .stat .num.count:not([data-target])::before {
  content: '—';
}

/* Loading state for stats */
.stat .num.loading {
  position: relative;
  opacity: 0.5;
}

.stat .num.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--accent-primary);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.stat .num.error {
  opacity: 0.6;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat .num.loading::after {
    animation: none;
    border-right-color: var(--accent-primary);
  }
}

.stat .label {
  font-size: 13px;
  color: var(--muted);
}

/* Card */
.card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text);
}

/* Mobile card improvements */
@media (max-width: 520px) {
  .card {
    padding: 16px;
  }

  .panel {
    padding: 16px;
  }

  .project {
    padding: 16px;
  }

  /* Better spacing for stat cards on mobile */
  .stat {
    padding: 14px;
  }
}

/* Hover effect for cards used in contact and other panels */
/* Variants control hover behavior. No default per-component hover rules. */

/* Remove duplicate panel hover - already defined above */

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

  .card:hover,
  footer:hover {
    transform: none !important;
    transition: none !important;
    box-shadow: var(--shadow-2) !important;
  }

  .site-header {
    transition: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }
}

/* Match the time element format with the small muted label in cards */
.card time {
  color: var(--muted);
  font-size: 13px;
}

/* Footer */
footer {
  padding: 12px 18px 18px 18px;
  /* Minimal padding */
  display: flex;
  flex-direction: column;
  /* stack vertically to allow event info below */
  align-items: center;
  /* center horizontally */
  justify-content: center;
  /* center vertically */
  gap: 0;
  /* no gap, we'll handle spacing manually */
  color: var(--muted);
}

/* Footer main content (copyright and credits) in a row */
.footer-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 0.75rem;
  /* Equal spacing above the border */
}

/* Make footer text slightly smaller so the two lines match visually */
footer {
  font-size: var(--text-small-size);
}

/* Make footer text layout explicit to avoid baseline/line-height shifts */
footer {
  line-height: 1;
}

/* Keep footer children as normal flow so inline text spacing remains intact; remove margins that can offset centering */
footer>* {
  margin: 0;
}

footer span,
footer a {
  line-height: 1;
}

@media (max-width: 520px) {
  footer {
    padding-bottom: 12px;
  }

  .wrap {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
}

/* Respect device safe area insets (notches) by adding env() to footer bottom padding */
footer {
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

/* Ensure footer child containers center their content vertically */
/* Ensure footer children fully fill the footer height and have no top margin */
footer {
  min-height: 48px;
}

/* Keep footer child blocks using normal flow so inline spacing is preserved */
/* Use inline-flex for footer columns so their inline/text content is vertically centered
   while preserving normal inline spacing between words and inline elements. */
footer>div {
  display: inline-flex;
  align-items: center;
  /* vertically center text within each column */
  height: auto;
  gap: 8px;
  /* small horizontal gap between inline children */
  justify-content: center;
  /* center inline content horizontally */
}

/* Ensure first/last child have no forced margins that could offset centering */
footer>div:first-child,
footer>div:last-child {
  margin: 0;
}

footer .txt-small {
  margin: 0;
}

/* If the inline flow still collapses whitespace (e.g. due to HTML line breaks),
   give the small link a gentle left margin so it's never glued to the preceding dot. */
footer .txt-small a {
  margin-left: 8px;
}

/* Ensure the 'Back to top' link doesn't get pushed to the far right when centered
  by keeping both footer pieces as inline content separated by a middot on small
  narrow screens. If you prefer a different separator, change the content in HTML. */

/* When the page is scrolled, add a subtle border and shadow to the header to provide depth */
.site-header--scrolled {
  border-bottom-color: var(--overlay-white-09);
  box-shadow: 0 6px 18px var(--shadow-ink-25);
  background-color: rgba(6, 8, 20, 0.28);
  /* stronger translucent background when scrolled */
}

/* Accessibility & focus */
/* Avoid removing focus outlines globally. Use :focus-visible for keyboard focus styles. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: var(--focus);
  border-radius: 8px;
}

/* Visually hidden helper for screen-reader-only text */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* Global error notification */
.global-error-notification {
  position: fixed;
  top: calc(var(--site-header-height, 96px) + 12px);
  right: 16px;
  max-width: 400px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(210, 61, 61, 0.95), rgba(173, 35, 35, 0.95));
  color: var(--white);
  border-radius: 10px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 9999;
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  transition:
    opacity 300ms ease,
    transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.global-error-notification.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 520px) {
  .global-error-notification {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-error-notification {
    transition: none;
    transform: none;
  }
}

/* Ensure strong visible focus for interactive elements on high-contrast and small screens */
@media (prefers-contrast: more) {

  a:focus-visible,
  button:focus-visible {
    outline-width: 4px;
  }
}

/* Reduce motion: remove non-essential transitions/animations */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Improve focus for elements that used custom focus styles but lost outline due to box-shadow-only visuals */
.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible {
  box-shadow:
    0 0 0 4px rgba(124, 58, 237, 0.12),
    var(--shadow-dark-3);
}

/* Ensure form controls are large enough on touch devices */
input.form-control,
textarea.form-control {
  min-height: 44px;
  padding: 10px;
  border-radius: 8px;
}

/* Slightly enhance logo image rendering when loaded */
.logo img.logo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: var(--logo-width);
  max-height: var(--logo-height);
  object-fit: contain;
  border-radius: inherit;
}

/* Defensive fallback: ensure image never collapses to 0x0 */
.logo img.logo-img {
  min-width: 24px;
  min-height: 24px;
}

/* Subtle radial vignette overlay to add depth behind content */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(40% 40% at 12% 12%, rgba(122, 63, 255, 0.06), transparent 15%),
    radial-gradient(60% 50% at 85% 85%, rgba(2, 8, 50, 0.12), transparent 35%);
  mix-blend-mode: overlay;
}

/* Readability */
.prose {
  max-width: 60ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

/* Links & emphasis */
a {
  color: var(--accent-primary);
  text-decoration: none;
}

a {
  transition:
    color 0.18s ease,
    text-decoration-color 0.18s ease;
}

a:hover {
  color: var(--accent-highlight);
  text-decoration: underline;
}

/* Buttons should not behave like regular links: prevent underlines on anchor buttons */
.btn,
.btn a,
a.btn {
  text-decoration: none !important;
}

.btn:hover,
a.btn:hover {
  text-decoration: none !important;
}

strong,
b {
  color: var(--heading);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .count[data-animate='true'] {
    transition: none !important;
  }
}

/* Ensure the message block has a fixed width and adjusts height dynamically */
#message {
  resize: none;
  /* Prevent manual resizing */
  overflow-y: auto;
  /* Enable vertical scrolling if needed */
  width: 100%;
  /* Fixed width */
  min-height: 100px;
  /* Minimum height */
  max-height: 300px;
  /* Optional: Limit maximum height */
}

/* Utility helpers to replace inline styles */
.txt-small {
  font-size: var(--text-small-size);
}

.muted {
  color: var(--muted);
}

.mt-xs {
  margin-top: var(--space-xs);
}

.mt-s {
  margin-top: var(--space-s);
}

.display-block {
  display: block;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-row-center {
  display: flex;
  gap: 8px;
  align-items: center;
}

.flex-row-end {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.grid-cols-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .grid-cols-1 {
    /* Keep single column layout - items stack vertically */
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch;
  }
}

/* Form improvements */
.form-field {
  margin-bottom: var(--space-m);
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin: 4px 0;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(210, 61, 61, 0.1);
}

.form-control:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--accent-primary);
}

.form-actions {
  display: flex;
  gap: var(--space-m);
  align-items: center;
  margin-top: var(--space-lg);
}

.feedback-message {
  min-height: 1.2em;
  margin-top: 8px;
  color: var(--muted);
}

.feedback-message:not(:empty) {
  color: var(--accent-primary);
}

.feedback-message.error {
  color: var(--accent-primary);
  font-weight: 600;
}

.feedback-message.success {
  color: var(--accent-highlight);
}

/* Newsletter form */
.newsletter-form {
  margin: 0;
}

/* Hide entire newsletter card when JavaScript is disabled */
html.no-js #newsletter-card {
  display: none;
}

/* Hide entire news section when JavaScript is disabled */
html.no-js #news {
  display: none;
}

/* Hide contact form when JavaScript is disabled */
html.no-js #contact-form {
  display: none;
}

.newsletter-input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.newsletter-input {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.newsletter-submit {
  flex-shrink: 0;
  white-space: nowrap;
}

.card-title-tight {
  margin-top: 0;
}

.card-subtitle-spacing {
  margin-bottom: 12px;
}

.newsletter-help {
  margin-top: 6px;
}

/* Mobile form improvements */
@media (max-width: 520px) {
  .newsletter-input-group {
    flex-direction: column;
    gap: 10px;
  }

  .newsletter-submit {
    width: 100%;
    padding: 14px;
  }

  .newsletter-input {
    min-height: 48px;
    font-size: 16px;
    padding: 12px 14px;
  }

  .form-control {
    min-height: 48px;
    font-size: 16px;
    padding: 12px 14px;
  }

  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Better grid spacing for contact section */
  .grid-cols-1 {
    gap: 16px;
  }

  #contact {
    margin-top: 20px;
  }
}

/* Add explicit spacing between the contact panel and the footer so they don't appear cramped */
#contact {
  /* Desktop default spacing below contact to separate from footer */
  margin-bottom: 48px;
}

/* Meet the Team Section */
.team-member {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: var(--card-pad);
}

.team-member-photo img {
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.team-member-info h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.team-member-role {
  font-weight: 600;
  color: var(--accent-secondary);
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.team-member-social {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.team-member-social .social-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.team-member-social .social-link:hover {
  color: var(--accent-highlight);
}

/* Make team social links visually match the news/article share buttons (.btn-share) */
.team-member-social .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 36px;
  height: 36px;
  padding: 8px;
  background: var(--overlay-white-04);
  border: 1px solid var(--overlay-white-09);
  border-radius: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.18s ease;
  position: relative;
  box-sizing: border-box;
  overflow: visible;
}

.team-member-social .social-link:hover {
  background: var(--overlay-white-06);
  border-color: var(--accent-secondary);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.team-member-social .social-link:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(124, 58, 237, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.18);
  border-color: var(--accent-secondary);
}

/* Ensure inline SVGs in social links size correctly */
.team-member-social .social-link svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Brand-specific hover tints for team social buttons */
.team-member-social .social-link--twitter:hover {
  color: #1da1f2;
  /* Twitter/X blue */
  border-color: rgba(29, 161, 242, 0.16);
  box-shadow: 0 6px 18px rgba(29, 161, 242, 0.1);
}

.team-member-social .social-link--twitter:focus-visible {
  box-shadow:
    0 0 0 3px rgba(29, 161, 242, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.18);
  border-color: rgba(29, 161, 242, 0.28);
}

.team-member-social .social-link--linkedin:hover {
  color: #0a66c2;
  /* LinkedIn blue */
  border-color: rgba(10, 102, 194, 0.16);
  box-shadow: 0 6px 18px rgba(10, 102, 194, 0.1);
}

.team-member-social .social-link--linkedin:focus-visible {
  box-shadow:
    0 0 0 3px rgba(10, 102, 194, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.18);
  border-color: rgba(10, 102, 194, 0.28);
}

/* Entrance animation: run without JS — animate on load even when JS hasn't toggled classes. */
.team-members .team-member {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 420ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

/* Stagger a few members if present (adjust delays if you add more members) */
.team-members .team-member:nth-child(1) {
  animation-delay: 0ms;
}

.team-members .team-member:nth-child(2) {
  animation-delay: 80ms;
}

.team-members .team-member:nth-child(3) {
  animation-delay: 160ms;
}

.team-members .team-member:nth-child(4) {
  animation-delay: 240ms;
}

@media (prefers-reduced-motion: reduce) {
  .team-members .team-member {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

@media (max-width: 520px) {
  .team-member {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 520px) {

  /* On small screens, give the contact block extra breathing room for touch targets and safe-area */
  #contact {
    margin-bottom: 80px;
    /* larger value to push footer further down */
  }
}

/* Tablet form optimizations */
@media (min-width: 521px) and (max-width: 767px) {
  .newsletter-input-group {
    gap: 10px;
  }

  .form-control {
    font-size: 16px;
  }
}

/* Improve eyebrow styling in project cards */
.project .eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  vertical-align: baseline;
}

/* Definition list styling */
dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 8px 0;
}

dt {
  font-weight: 600;
  color: var(--text);
}

dd {
  color: var(--muted);
  margin: 0;
}

/* small utility to reset heading margin where used inline */
.no-top-margin {
  margin-top: 0 !important;
}

/* Blog / News styles */
#news {
  grid-column: 1 / -1;
}

#news-list {
  overflow: visible;
  max-height: none;
}

.news-post {
  display: block;
  padding: 12px;
  margin-bottom: 12px;
  overflow: visible;
  max-height: none;
}

.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
  padding: 8px 10px;
  background: linear-gradient(135deg, var(--panel1), var(--panel2));
  box-shadow:
    0 10px 26px var(--shadow-ink-25),
    0 1px 0 var(--overlay-white-04);
}

.news-filter-bar button {
  background: var(--control-bg);
  border: 1px solid var(--btn-outline-border);
  border-radius: calc(var(--btn-radius) - 2px);
  color: var(--text);
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform var(--hover-duration) var(--hover-ease),
    box-shadow var(--hover-duration) var(--hover-ease),
    background-color var(--hover-duration) var(--hover-ease),
    color var(--hover-duration) var(--hover-ease),
    border-color var(--hover-duration) var(--hover-ease);
  box-shadow:
    inset 0 1px 0 var(--overlay-white-06),
    0 4px 12px var(--shadow-ink-25);
  backdrop-filter: blur(2px);
}

.news-filter-bar button:hover {
  transform: translateY(var(--hover-lift-small));
  background: linear-gradient(135deg, var(--control-bg-header), var(--control-bg));
  border-color: var(--control-border);
}

.news-filter-bar button[aria-selected='true'] {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow:
    0 8px 22px rgba(210, 61, 61, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.news-post.search-hidden {
  display: none !important;
}

.news-post h3 {
  margin: 0 0 6px;
}

.news-post .muted {
  margin-bottom: 8px;
}

.news-date {
  display: inline-block;
  margin-bottom: 8px;
}

.news-post .excerpt {
  margin: 0 0 10px;
  color: var(--muted);
}

/* Clamp excerpt to 3 lines where supported */
.excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 3;
}

/* Modal for full post */
.news-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 6000;
}

.news-modal[aria-hidden='false'] {
  display: flex;
}

.news-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 20, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 6000;
  pointer-events: auto;
  /* Better mobile viewport handling */
  height: 100vh;
  height: 100dvh;
  /* Prevent scrolling behind modal via touch/wheel events */
  touch-action: none;
  overscroll-behavior: contain;
}

.news-modal__panel {
  position: relative;
  max-width: 900px;
  width: calc(100% - 40px);
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 6001;
  padding: 24px;
  background: linear-gradient(135deg, var(--panel1), var(--panel2));
  border: 1px solid var(--overlay-white-06);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  /* Remove default transitions - JS will handle them */
  transform: none;
  opacity: 1;
}

.news-modal__close {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 10;
  min-width: 44px;
  min-height: 44px;
}

.news-modal__close:focus-visible {
  outline: var(--focus);
}

.news-modal__title {
  margin-top: 0;
  padding-right: 76px;
  color: var(--heading);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.news-modal__content {
  margin-top: 16px;
  color: var(--text);
  line-height: 1.6;
}

/* Make images in post content smaller */
.news-modal__content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  display: block;
}

/* Limit image size in modal content */
.news-modal__content p img {
  max-width: 600px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Simplified modal content - no staggered animations */
.news-modal__meta {
  color: var(--muted);
  font-size: var(--text-small-size);
  margin-bottom: 12px;
}

.news-modal__share {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 10px 0;
  border-top: 1px solid var(--overlay-white-04);
  border-bottom: 1px solid var(--overlay-white-04);
}

.btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 8px;
  background: var(--overlay-white-04);
  border: 1px solid var(--overlay-white-09);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: visible;
}

.btn-share:hover {
  background: var(--overlay-white-06);
  border-color: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Tooltip for "Copied!" message */
.btn-share[data-copied]::after {
  content: attr(data-copied);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--accent-primary);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: tooltipFadeIn 0.3s ease forwards;
  z-index: 1000;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
  }
}

.btn-share svg {
  width: 16px;
  height: 16px;
}

.btn-share--twitter:hover {
  color: #000000;
}

.btn-share--facebook:hover {
  color: #4267b2;
}

.btn-share--copy:hover {
  color: var(--accent-highlight);
}

.news-modal__image {
  margin: 16px 0;
}

@media (prefers-reduced-motion: reduce) {

  .news-modal__panel,
  .news-modal__backdrop {
    transition: none !important;
  }

  /* Disable tooltip animation for reduced motion */
  .btn-share[data-copied]::after {
    animation: none;
    opacity: 1;
  }
}

/* Modal open state - no styles needed, avoiding scroll lock prevents layout shifts */

/* Ensure scrollbar space is always reserved to prevent layout shifts */
html,
body {
  scrollbar-gutter: stable;
}

/* Global scrollbar styling using theme variables */
/* Firefox */
html,
body {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb, var(--overlay-white-06)) var(--scrollbar-track, transparent);
}

/* WebKit browsers (Chrome, Safari, Edge) */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: var(--scrollbar-track, transparent);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb, var(--overlay-white-06));
  border-radius: 6px;
  border: 2px solid var(--scrollbar-track, transparent);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover, var(--scrollbar-thumb, var(--overlay-white-09)));
}

/* Legacy fallback */
.no-scroll {
  overflow: hidden;
}

/* Responsive tweaks for modal on small screens */
@media (max-width: 520px) {
  .news-modal__panel {
    width: calc(100% - 16px);
    padding: 20px 16px;
    border-radius: 10px;
    max-height: 92vh;
  }

  .news-post__thumb {
    max-height: 160px;
  }

  .news-modal__title {
    padding-right: 74px;
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .news-modal__close {
    right: 10px;
    top: 10px;
    min-width: 48px;
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-modal__panel {
    transition: none;
  }
}

/* Extra keyframe entrance to ensure visible animation when JS-driven transforms may be skipped */
@keyframes panel-entrance {
  from {
    transform: translateY(8px) scale(0.994);
    opacity: 0.96;
  }

  60% {
    transform: translateY(3px) scale(0.998);
    opacity: 0.99;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.panel--entering {
  animation: panel-entrance 240ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

/* ============================================
   NEWS & DEVELOPMENT SECTION
   ============================================ */

/* News section header container */
.news-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Title styling */
.news-header h2 {
  margin: 0;
  flex: 0 0 auto;
}

/* Search wrapper */
.news-search-wrapper {
  position: relative;
  flex: 0 1 auto;
  min-width: 200px;
  max-width: 320px;
  margin-bottom: 6px;
}

/* Search input */
.news-search {
  width: 100%;
  padding: 10px 36px 10px 14px;
  background: var(--overlay-white-04);
  border: 1px solid var(--overlay-white-09);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: all 180ms var(--hover-ease);
}

.news-search:hover {
  background: var(--overlay-white-06);
  border-color: var(--accent-secondary);
}

.news-search:focus,
.news-search:focus-visible {
  outline: none;
  background: var(--overlay-white-06);
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px rgba(122, 63, 255, 0.12);
}

.news-search::placeholder {
  color: var(--muted);
}

/* Search clear button */
#news-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%) !important;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: background 180ms ease, color 180ms ease;
}

#news-search-clear:hover {
  background: var(--overlay-white-06);
  color: var(--text);
  transform: translateY(-50%) !important;
}

#news-search-clear:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

/* News controls container (filters + search) */
.news-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: -1px;
  position: relative;
  z-index: 10;
  gap: 16px;
  flex-wrap: wrap;
}

/* News filter bar - tab-like interface */
.news-filter-bar {
  display: flex;
  gap: 4px;
  padding: 0 12px;
  /* Margin and z-index handled by parent .news-controls */
  flex-wrap: wrap;
  width: fit-content;
  background: transparent;
}

/* Individual filter tab buttons */
.news-filter-bar button[data-project] {
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
  position: relative;
  white-space: nowrap;
}

/* Hover state for inactive tabs */
.news-filter-bar button[data-project]:hover {
  background: var(--overlay-white-04);
  color: var(--text);
  transform: translateY(-2px);
}

/* Active tab state - merges with panel */
.news-filter-bar button[data-project][aria-selected="true"] {
  background: var(--panel1);
  /* Match panel background */
  border-color: var(--control-border);
  border-bottom: 1px solid var(--panel1);
  /* Cover the panel's top border */
  color: var(--heading);
  box-shadow:
    0 -4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 2;
  margin-bottom: -1px;
  padding-bottom: 12px;
  /* Compensate for margin shift */
}

/* Focus state for accessibility */
.news-filter-bar button[data-project]:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
  z-index: 2;
}

/* Mobile responsiveness */
@media (max-width: 520px) {
  .news-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .news-controls {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
  }

  .news-header h2 {
    font-size: 1.5rem;
  }

  .news-search-wrapper {
    max-width: none;
    width: 100%;
  }

  .news-filter-bar {
    gap: 6px;
  }

  .news-filter-bar button[data-project] {
    padding: 12px 16px;
    font-size: 13px;
    flex: 1;
    min-width: 0;
  }
}

/* Tablet adjustments */
@media (min-width: 521px) and (max-width: 767px) {
  .news-filter-bar button[data-project] {
    padding: 11px 20px;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .news-filter-bar button[data-project] {
    transition: none;
  }

  .news-filter-bar button[data-project]:hover {
    transform: none;
  }
}

/* Scrollbar space already defined above - removed duplicate */

/* Thumbnail preview in news list */
.news-post__thumb {
  width: 100%;
  max-height: 180px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 8px;
}

.news-post__thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

/* Modal image */
.news-modal__image {
  margin-top: 8px;
}

.news-modal__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Animated details expansion for 'Read more' panels */
details {
  overflow: visible;
}

details>summary {
  cursor: pointer;
  list-style: none;
  outline: none;
}

/* Hide default disclosure marker across browsers */
details>summary::-webkit-details-marker {
  display: none;
}

/* Content container inside details we animate (use a wrapper in markup, but fall back to direct sibling) */
details[open]>.details-content,
details[open]> :not(summary) {
  opacity: 1;
  transform: none;
  max-height: 1000px;
  /* large enough for most content */
  transition:
    max-height 280ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

details>.details-content,
details> :not(summary) {
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 200ms ease,
    transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {

  details>.details-content,
  details> :not(summary) {
    transition: none;
    transform: none;
    opacity: 1;
    max-height: none;
    overflow: visible;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

  /* Reset for print */
  * {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Hide non-essential elements */
  .nav-toggle,
  .page-overlay,
  .skip-link,
  footer,
  .btn,
  button,
  form,
  .newsletter-form,
  #contact-form,
  .news-modal__close,
  .global-error-notification {
    display: none !important;
  }

  /* Layout adjustments */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .wrap {
    max-width: 100%;
    padding: 0;
  }

  .site-header {
    position: static;
    border-bottom: 2px solid #000;
    padding: 10pt 0;
    background: #fff !important;
  }

  .site-header+.wrap {
    padding-top: 0;
  }

  /* Typography */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
    color: #000;
  }

  h1 {
    font-size: 18pt;
  }

  h2 {
    font-size: 16pt;
  }

  h3 {
    font-size: 14pt;
  }

  /* Links */
  a {
    text-decoration: underline;
    color: #000;
  }

  a[href^='http']:after {
    content: ' (' attr(href) ')';
    font-size: 9pt;
  }

  a[href^='#']:after,
  a[href^='mailto']:after {
    content: '';
  }

  /* Images */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Panels and cards */
  .panel,
  .card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
    padding: 10pt;
    margin-bottom: 10pt;
  }

  /* Projects */
  .project {
    border: 2px solid #000;
    padding: 10pt;
    margin-bottom: 15pt;
  }

  /* Stats - display in a clean way */
  .stats {
    display: flex;
    gap: 10pt;
    flex-wrap: wrap;
  }

  .stat {
    border: 1px solid #000;
    padding: 8pt;
    min-width: 120pt;
  }

  /* News posts */
  .news-post {
    border-bottom: 1px solid #ccc;
    padding-bottom: 10pt;
    margin-bottom: 10pt;
    page-break-inside: avoid;
  }

  /* Hide decorative elements */
  .eyebrow,
  .logo-container::before,
  .panel--glow::before,
  .panel--elevated::before {
    display: none !important;
  }

  /* Ensure good page breaks */
  section {
    page-break-before: auto;
    page-break-after: auto;
  }

  article {
    page-break-inside: avoid;
  }
}

/* === Language Switcher === */
.language-switcher {
  position: relative;
  display: inline-block;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: var(--btn-radius);
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.6;
  transition:
    opacity var(--hover-duration) var(--hover-ease),
    color var(--hover-duration) var(--hover-ease),
    background var(--hover-duration) var(--hover-ease);
}

.lang-toggle:hover {
  opacity: 1;
  color: var(--text);
  background: var(--overlay-white-02);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--accent-secondary);
  outline-offset: 2px;
}

.lang-icon {
  font-size: 14px;
  opacity: 0.7;
}

.lang-selected {
  min-width: 22px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  max-height: 180px;
  /* Height for ~3 items (3 × 50px + padding) */
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--panel1);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 200ms ease,
    transform 200ms ease,
    visibility 200ms ease;
  z-index: 1000;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--overlay-white-06) transparent;
}

/* Custom scrollbar styling for Webkit browsers */
.lang-dropdown::-webkit-scrollbar {
  width: 6px;
}

.lang-dropdown::-webkit-scrollbar-track {
  background: transparent;
  border-radius: var(--radius-sm);
}

.lang-dropdown::-webkit-scrollbar-thumb {
  background: var(--overlay-white-06);
  border-radius: var(--radius-sm);
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--overlay-white-08);
}

.lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* RTL support: Keep dropdown aligned to the toggle button edge.
   In RTL, the language switcher is positioned on the right side of the nav,
   so we keep right: 0 to prevent the dropdown from overflowing left.
   NOTE: Only apply on desktop - mobile uses centered positioning. */
[dir='rtl'] .language-switcher,
[dir='rtl'] .language-switcher * {
  direction: rtl;
}

/* Desktop RTL: Align dropdown to left edge (starting edge in RTL) */
@media (min-width: 769px) {
  [dir='rtl'] .lang-dropdown {
    left: 0;
    right: auto;
    text-align: right;
  }
}

/* Mobile/Tablet RTL: Keep centered positioning */
@media (max-width: 768px) {
  [dir='rtl'] .lang-dropdown {
    text-align: right;
    /* left: 50% and transform are already set in mobile styles */
  }
}

.lang-selected {
  max-width: 64px;
  /* prevent very long language names from expanding the header */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition:
    background var(--hover-duration) var(--hover-ease),
    color var(--hover-duration) var(--hover-ease);
  text-align: left;
  /* Prefer a single line per language entry. If the text is long, truncate with ellipsis. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-option:hover {
  background: var(--overlay-white-06);
  color: var(--white);
}

.lang-option:focus-visible {
  outline: 2px solid var(--accent-secondary);
  outline-offset: -2px;
}

.lang-option.active {
  background: var(--overlay-white-04);
  color: var(--white);
  position: relative;
}

.lang-option.active::after {
  content: '✓';
  /* Place the checkmark centered vertically and prevent it from being clipped.
     Use flex alignment by moving it into normal flow via inline-block and
     reserving space at the end of the option with padding-right. */
  display: inline-block;
  vertical-align: middle;
  margin-left: 12px;
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 15px;
}

.lang-code {
  font-weight: 700;
  color: var(--accent-highlight);
  min-width: 30px;
}

.lang-option.active .lang-code {
  color: var(--accent-primary);
}

.lang-name {
  flex: 1;
  margin-left: 12px;
  font-weight: 500;
}

/* Mobile adjustments for language switcher */
@media (max-width: 768px) {
  .lang-dropdown {
    right: auto;
    left: 50%;
    top: auto;
    bottom: calc(100% + 8px);
    width: 100%;
    transform: translateX(-50%) translateY(8px);
  }

  .lang-dropdown.open {
    transform: translateX(-50%) translateY(0);
  }

  /* Mobile nav language switcher */
  #primary-nav .language-switcher {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--control-border);
    width: 100%;
  }

  #primary-nav .lang-toggle {
    width: 100%;
    justify-content: center;
  }
}

/* === News Search === */
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.news-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.news-search {
  width: 100%;
  padding: 10px 36px 10px 12px;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  border-radius: var(--btn-radius);
  color: var(--text);
  font-size: 14px;
  transition:
    border-color var(--hover-duration) var(--hover-ease),
    box-shadow var(--hover-duration) var(--hover-ease);
}

/* Hide native search input clear button (webkit) */
.news-search::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
}

/* Hide native search input clear button (Firefox) */
.news-search::-moz-search-clear-button {
  display: none;
}

.news-search:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(210, 61, 61, 0.1);
}

.news-search::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.news-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition:
    color var(--hover-duration) var(--hover-ease),
    background var(--hover-duration) var(--hover-ease);
}

.news-search-clear:hover {
  color: var(--text);
  background: var(--overlay-white-04);
}

.news-search-clear:focus-visible {
  outline: 2px solid var(--accent-secondary);
  outline-offset: 2px;
}

.news-search-no-results {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 16px 0;
  display: block;
  visibility: visible;
  opacity: 1;
  position: relative;
  z-index: 1;
}

.news-search-no-results::before {
  content: '🔍';
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.6;
}

/* Hide when explicitly set to none */
.news-search-no-results[style*='display: none'] {
  display: none !important;
}

@media (max-width: 768px) {
  .news-header {
    flex-direction: column;
    align-items: stretch;
  }

  .news-search-wrapper {
    max-width: 100%;
  }
}

/* === Translation Notice === */
.translation-notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 380px;
  background: rgba(20, 22, 36, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-left: 4px solid rgba(255, 165, 0, 0.8);
  color: var(--white);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 9999;


  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

.translation-notice.visible {
  transform: translateX(0);
  opacity: 1;
}

.translation-notice.dismissed {
  transform: translateX(calc(100% + 40px));
  opacity: 0;
}

.notice-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notice-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.9;
}

.notice-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
}

.notice-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  font-weight: 600;
  color: rgba(255, 165, 0, 1);
}

.notice-text p {
  margin: 0;
  opacity: 0.85;
  color: rgba(255, 255, 255, 0.9);
}

.notice-stats {
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px !important;
  opacity: 0.7 !important;
  font-family: var(--font-mono, 'Courier New', monospace);
  color: rgba(255, 165, 0, 0.8) !important;
}

.notice-dismiss {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.6);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.notice-dismiss:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.notice-dismiss:focus-visible {
  outline: 2px solid rgba(255, 165, 0, 0.8);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .translation-notice {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
    padding: 14px 16px;
  }

  .notice-content {
    gap: 10px;
  }

  .notice-icon {
    font-size: 18px;
  }

  .notice-text {
    font-size: 12px;
  }

  .notice-text strong {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .notice-dismiss {
    width: 26px;
    height: 26px;
    font-size: 18px;
  }
}

/* Theme event info styling */
.theme-event-info {
  display: none;
  padding-top: 0.2rem;
  padding-bottom: 0.5rem;
  margin-top: 0;
  font-style: italic;
  opacity: 0.8;
  text-align: center;
  line-height: 1.5;
  /* draw a separator below theme info to separate it from the translation notice */
  border-bottom: 1px solid var(--overlay-white-04);
}

.theme-event-info:not(:empty) {
  display: block;
}

/* Footer translation notice styling */
.footer-translation-notice {
  display: block;
  padding-top: 0.2rem;
  padding-bottom: 0.5rem;
  margin-top: 0.25rem;
  /* draw a separator below the translation notice so each footer element is separated */
  border-bottom: 1px solid var(--overlay-white-04);
  opacity: 0.8;
  text-align: center;
  line-height: 1.5;
}

/* Add a separator between translation notice and main footer content
   so the visual dividers follow the new DOM order */
.footer-main {
  /* keep footer-main visually separated from the section above via spacing */
  padding-top: 0.75rem;
}

/* ============================================
   Accessibility: Reduced Motion Support
   ============================================ */
@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;
  }

  /* Hide all theme effect animations */
  .theme-effect {
    display: none !important;
  }
}