/* revouninstaller.io — shared experience layer */

:root {
  color-scheme: light;
  --site-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --site-header-offset: 5.25rem;
}

html {
  scroll-padding-top: var(--site-header-offset);
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html {
    overflow-x: hidden;
  }
}

main img,
main video {
  max-width: 100%;
  height: auto;
}

/* Skip link: clearer depth when keyboard-focused */
body > a[href="#main"] {
  transition: box-shadow 0.25s var(--site-ease), transform 0.25s var(--site-ease);
}

body > a[href="#main"]:focus-visible {
  box-shadow: 0 14px 44px -10px rgba(12, 13, 15, 0.35);
}

/* Long-form blog: readable link affordance on fine pointers */
@media (hover: hover) and (pointer: fine) {
  .article-body a:hover,
  a.blog-read-more:hover {
    text-decoration: underline;
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(5, 144, 206, 0.55);
  }
}

@media print {
  .fixed-download-btn,
  .back-to-top,
  #nav-toggle {
    display: none !important;
  }

  #mobile-nav {
    display: none !important;
  }

  body > header.fixed {
    position: static !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #fff !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }

  html {
    scroll-padding-top: 0;
  }

  .hero-shell {
    box-shadow: none !important;
    break-inside: avoid;
  }

  main a.site-card-lift,
  main a.site-card-lift:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  .hero-carousel-slide {
    transition: none !important;
  }

  .hero-shell {
    animation: none !important;
  }

  main a.site-card-lift,
  main a.site-card-lift:hover,
  main a.site-card-lift:active {
    transform: none !important;
  }
}

body {
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

#hero-heading {
  text-wrap: balance;
}

body.page-redirect {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-top: 5rem;
  box-sizing: border-box;
  background: linear-gradient(165deg, #f8fafc 0%, #e8f6fc 42%, #f1f5f9 100%);
  color: #475569;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.page-redirect p {
  margin: 0;
  padding: 2rem;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}

/* Frosted header — reads “premium” without heavy JS */
body > header.fixed {
  overflow: visible;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: rgba(255, 255, 255, 0.86) !important;
  border-bottom-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

body > header.fixed > .mx-auto.flex {
  overflow: visible;
}

/* Primary header (all locales): one horizontal row on desktop — no wrapped nav row, no nav scrollbar */
@media (min-width: 1024px) {
  body > header.fixed > .mx-auto.flex {
    flex-wrap: nowrap;
  }

  body > header.fixed > .mx-auto.flex > nav {
    flex-wrap: nowrap;
    overflow-x: visible;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  body > header.fixed > .mx-auto.flex > nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  body > header.fixed > .mx-auto.flex > nav > a {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* Typical laptop widths: slightly tighter nav so long labels + language control stay on one line */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  body > header.fixed > .mx-auto.flex > nav {
    gap: 0.5rem;
    font-size: 0.8125rem;
  }
}

/* Injected language control: never let the header flex row shrink it to zero (was breaking layout on many locales). */
body > header.fixed > .mx-auto.flex > .site-lang {
  flex-shrink: 0;
}

/* Hero shell: subtle entrance */
@media (prefers-reduced-motion: no-preference) {
  .hero-shell {
    animation: site-hero-rise 0.75s var(--site-ease) both;
  }
}

@keyframes site-hero-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Browse / topic cards: confident hover depth */
main a.site-card-lift,
.fixed-download-btn,
.back-to-top {
  touch-action: manipulation;
}

main a.site-card-lift {
  transition:
    transform 0.4s var(--site-ease),
    box-shadow 0.4s var(--site-ease),
    border-color 0.25s ease;
  will-change: transform;
}

main a.site-card-lift:hover {
  transform: translateY(-3px);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 20px 50px -18px rgba(15, 23, 42, 0.18);
}

main a.site-card-lift:active {
  transform: translateY(-1px);
  transition-duration: 0.12s;
}

/* Fixed chrome */
.back-to-top {
  transition:
    opacity 0.25s ease,
    visibility 0.25s,
    background 0.2s,
    transform 0.2s var(--site-ease),
    box-shadow 0.2s ease;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.08),
    0 12px 28px -8px rgba(5, 144, 206, 0.2);
}

.back-to-top:focus-visible {
  outline: 2px solid #0590ce;
  outline-offset: 3px;
}

.fixed-download-btn {
  transition:
    background 0.2s,
    padding-right 0.2s,
    transform 0.25s var(--site-ease),
    box-shadow 0.25s ease;
}

.fixed-download-btn:hover {
  transform: translateY(-50%) translateX(-3px);
  box-shadow: -6px 8px 28px -6px rgba(5, 144, 206, 0.45);
}

.fixed-download-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Keyboard focus: visible rings sit above frosted chrome */
header a:focus-visible,
header button:focus-visible,
main a:focus-visible,
main button:focus-visible,
footer a:focus-visible {
  outline: 2px solid #0590ce;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Language switcher (injected by js/site.js) — same chrome on every locale / RTL page */
.site-lang {
  --site-lang-accent: #0590ce;
  --site-lang-accent-ink: #0478ad;
  --site-lang-border: #e2e8f0;
  --site-lang-surface: #fff;
  --site-lang-muted: #64748b;
  --site-lang-text: #1e293b;
  --site-lang-panel-max: min(18rem, calc(100vw - 2.25rem));

  /* Isolate from Tailwind header flex + RTL body: keep one compact column (button + panel). */
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  align-self: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 60;
  min-width: 3.25rem;
  width: auto;
  max-width: min(18rem, calc(100vw - 2.25rem));
  margin-inline-start: 0.35rem;
  isolation: isolate;
  box-sizing: border-box;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Noto Sans",
    "Noto Sans Hebrew",
    "Noto Sans JP",
    "Noto Sans SC",
    sans-serif;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--site-lang-text);
}

.site-lang.is-open {
  z-index: 100;
}

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

.site-lang__btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: 2.5rem;
  min-width: 3.25rem;
  max-width: 100%;
  padding: 0 0.625rem;
  border-radius: 0.5rem;
  border: 1px solid var(--site-lang-border);
  background: var(--site-lang-surface);
  color: inherit;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.site-lang__btn-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.site-lang__btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.site-lang.is-open .site-lang__btn {
  border-color: #bae6fd;
  color: var(--site-lang-accent-ink);
  box-shadow: 0 0 0 1px rgba(5, 144, 206, 0.12);
}

.site-lang__code {
  display: block;
  min-width: 1.85rem;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-lang__chev {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--site-lang-muted);
  margin-top: 1px;
}

.site-lang.is-open .site-lang__chev {
  border-top-color: var(--site-lang-accent);
}

.site-lang__panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: auto;
  right: 0;
  box-sizing: border-box;
  width: var(--site-lang-panel-max);
  min-width: 11.5rem;
  max-width: var(--site-lang-panel-max);
  /* Short viewports / mobile URL bar: keep the list scrollable inside the viewport */
  max-height: min(16rem, calc(100vh - 5.5rem));
  max-height: min(16rem, calc(100dvh - 5.5rem));
  padding: 0.375rem;
  border-radius: 0.625rem;
  border: 1px solid var(--site-lang-border);
  background: var(--site-lang-surface);
  direction: ltr;
  text-align: start;
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.08),
    0 12px 28px -8px rgba(15, 23, 42, 0.12);
  /* Clip horizontal bleed (mixed scripts / RTL); vertical scroll only inside the panel. */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.site-lang__panel--up {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

/* RTL pages: widget stays LTR; anchor panel to the physical start edge of the control (Hebrew headers). */
html[dir="rtl"] body > header.fixed .site-lang__panel {
  left: 0;
  right: auto;
}

.site-lang__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  width: 100%;
  min-width: 0;
}

.site-lang__list > li {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.site-lang__link {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 2.5rem;
  padding: 0.375rem 0.65rem;
  gap: 0.25rem;
  border-radius: 0.4375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--site-lang-text);
  text-decoration: none;
  text-align: start;
  overflow: hidden;
  flex-wrap: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-lang__label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  unicode-bidi: isolate;
  overflow-wrap: normal;
  word-break: normal;
}

.site-lang__link:hover {
  background: #f1f5f9;
  color: var(--site-lang-accent);
}

.site-lang__link.is-active {
  background: #e0f4fc;
  color: var(--site-lang-accent-ink);
  font-weight: 600;
}

@media (max-width: 1023px) {
  .site-lang {
    margin-inline-start: 0.25rem;
    --site-lang-panel-max: min(18rem, calc(100vw - 1.25rem));
  }

  .site-lang__panel {
    max-height: min(14rem, calc(100vh - 6rem));
    max-height: min(14rem, calc(100dvh - 6rem));
  }
}

html[dir="rtl"] .site-lang {
  margin-inline-start: 0.35rem;
}

/* Respect Windows high-contrast */
@media (forced-colors: active) {
  .hero-shell {
    border: 1px solid CanvasText;
  }

  .hero-carousel-wrap {
    border: 1px solid CanvasText;
  }

  body > header.fixed {
    background: Canvas !important;
  }

  .site-lang__btn,
  .site-lang__panel {
    border-color: CanvasText;
  }

  .site-lang__link.is-active {
    background: Highlight;
    color: HighlightText;
  }
}

/* Professional site footer */
.site-footer {
  background: #0c0d0f;
  color: #cbd5e1;
  border-top: 1px solid #1e293b;
}
.site-footer__link {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: #fff;
}
