/* Shared polish: accessibility, motion, typography, chrome */
/*
  Design system (premium SaaS-style)
  Primary #0590CE on white ≈ 4.6:1 on large text; pair with #52525b body for 7:1+.
*/
:root {
  --ds-primary: #0590ce;
  --ds-primary-hover: #0478ad;
  --ds-primary-soft: #e8f4fa;
  --ds-primary-glow: rgba(5, 144, 206, 0.12);
  --ds-ink: #18181b;
  --ds-ink-secondary: #3f3f46;
  --ds-ink-muted: #52525b;
  --ds-ink-subtle: #71717a;
  --ds-surface: #ffffff;
  --ds-canvas: #fafafa;
  --ds-canvas-warm: #f4f4f5;
  --ds-border: #e4e4e7;
  --ds-border-strong: #d4d4d8;
  --ds-shadow-xs: 0 1px 0 rgba(0, 0, 0, 0.04);
  --ds-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --ds-shadow-md: 0 12px 40px -20px rgba(24, 24, 27, 0.14);
  --ds-shadow-lg: 0 24px 56px -28px rgba(24, 24, 27, 0.2);
  --ds-radius-sm: 0.5rem;
  --ds-radius-md: 0.75rem;
  --ds-radius-lg: 1rem;
  --ds-radius-xl: 1.25rem;
  --ds-section-y: clamp(3.25rem, 5vw, 4.5rem);
  --ds-font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --ds-font-sans: "Inter", system-ui, sans-serif;
  --ds-text-xs: 0.75rem;
  --ds-text-sm: 0.875rem;
  --ds-text-base: 1rem;
  --ds-text-lg: 1.125rem;
  --ds-text-xl: 1.25rem;
  --ds-text-2xl: 1.5rem;
  --ds-text-display: clamp(1.875rem, 4vw, 3rem);
  --site-revo: var(--ds-primary);
  --site-line: var(--ds-border);
}

.ds-inner {
  margin-left: auto;
  margin-right: auto;
  max-width: 72rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .ds-inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.ds-band {
  position: relative;
  border-bottom: 1px solid var(--ds-border);
}

.ds-band--surface {
  background: var(--ds-surface);
}

.ds-band--muted {
  background: linear-gradient(180deg, var(--ds-canvas) 0%, var(--ds-canvas-warm) 100%);
}

.ds-band--cta {
  background: linear-gradient(180deg, #eef2f6 0%, var(--ds-canvas) 45%, var(--ds-canvas-warm) 100%);
}

.ds-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ds-primary);
}

.ds-section-title {
  font-family: var(--ds-font-display);
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ds-ink);
}

.ds-lead {
  margin-top: 0.75rem;
  max-width: 42rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ds-ink-muted);
}

.ds-card {
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-xs), var(--ds-shadow-sm);
  transition:
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ds-card--soft {
  background: linear-gradient(180deg, #fcfcfd 0%, var(--ds-canvas) 100%);
}

.ds-card--inset {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@media (hover: hover) and (pointer: fine) {
  .ds-card--hover:hover {
    border-color: var(--ds-border-strong);
    box-shadow: var(--ds-shadow-md);
    transform: translateY(-2px);
  }
}

.ds-stack-header {
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.ds-footer {
  border-top: 1px solid var(--ds-border);
  background: linear-gradient(180deg, var(--ds-canvas-warm) 0%, var(--ds-surface) 0.35rem);
}

html {
  text-size-adjust: 100%;
  color-scheme: light;
  scrollbar-gutter: stable;
}

body {
  text-rendering: optimizeLegibility;
}

@media (hover: none) and (pointer: coarse) {
  body {
    -webkit-tap-highlight-color: rgba(5, 144, 206, 0.14);
  }
}

#site-main p {
  line-height: 1.65;
}

#site-main .leading-relaxed {
  line-height: 1.65;
}

::selection {
  background: rgba(5, 144, 206, 0.2);
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  z-index: 200;
  padding: 0.65rem 1.1rem;
  background: var(--site-revo);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25;
  border-radius: 0.5rem;
  text-decoration: none;
  transform: translateY(-130%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skip-link:focus {
  outline: none;
  transform: translateY(1rem);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--site-revo);
}

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

  .skip-link {
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

#site-header.nav-scrolled {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--site-line);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}

#site-main {
  scroll-margin-top: 5.75rem;
  min-height: min(50vh, 28rem);
  overflow-wrap: break-word;
}

#site-main[tabindex="-1"]:focus {
  outline: 2px solid var(--site-revo);
  outline-offset: 4px;
}

@media (prefers-contrast: more) {
  :root {
    --site-line: #a1a1aa;
  }

  .text-muted {
    color: #3f3f46 !important;
  }

  .text-muted-light {
    color: #52525b !important;
  }
}

#site-header a:focus-visible,
#site-header button:focus-visible,
#site-main a:focus-visible,
#site-main button:focus-visible {
  outline: 2px solid var(--site-revo);
  outline-offset: 3px;
}

.fixed-download-btn:focus-visible,
.back-to-top:focus-visible {
  outline: 2px solid var(--site-revo);
  outline-offset: 2px;
}

.skip-link:focus-visible {
  outline: none;
}

/* —— Home hero: depth, rhythm, framed visual —— */
.hero-mesh {
  isolation: isolate;
}

.hero-mesh::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(5, 144, 206, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 0%, rgba(5, 144, 206, 0.06), transparent 45%);
}

.hero-mesh::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5.5rem;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(to top, rgba(10, 10, 12, 0.85), transparent);
}

.hero-mesh > p[aria-hidden="true"] {
  z-index: 0;
}

.hero-mesh .relative.z-10 {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(207, 250, 254, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-eyebrow-dot {
  height: 0.375rem;
  width: 0.375rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #22d3ee;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.65);
}

.hero-title-line {
  display: block;
  font-weight: 500;
  color: #a1a1aa;
  letter-spacing: -0.02em;
}

.hero-title-accent {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--ds-font-display);
  font-size: clamp(1.85rem, 4.5vw, 3.15rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  background: linear-gradient(105deg, #fff 0%, #f4f4f5 45%, #a1a1aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title-sub {
  display: block;
  margin-top: 0.85rem;
  font-size: clamp(1rem, 2.4vw, 1.375rem);
  font-weight: 400;
  line-height: 1.45;
  color: #a1a1aa;
  max-width: 36rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 2rem;
}

.hero-cta-primary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.65rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--ds-primary);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 14px 40px -10px rgba(5, 144, 206, 0.55);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.hero-cta-primary:hover {
  background: var(--ds-primary-hover);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 18px 48px -10px rgba(5, 144, 206, 0.58);
  transform: translateY(-1px);
}

.hero-cta-secondary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 9999px;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.hero-cta-secondary:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.hero-index-panel {
  border-radius: var(--ds-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1rem 1rem 1.125rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-index-panel > span:first-child {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #71717a;
}

.hero-index-panel a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #a1a1aa;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.hero-index-panel a:hover {
  color: #67e8f9;
  transform: translateX(3px);
}

.hero-index-panel a.hero-index-download {
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  color: #5eead4;
}

.hero-index-panel a.hero-index-download:hover {
  color: #99f6e4;
}

.hero-visual-shell {
  /* Tighter than --ds-radius-xl so the hero frame reads more “window” than “pill” */
  border-radius: 0.5rem;
  padding: 0.5rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 28px 80px -24px rgba(0, 0, 0, 0.65);
}

.hero-visual-shell figure {
  border-radius: 0.375rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #18181b;
}

.hero-carousel-bar {
  margin-top: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

.hero-carousel-bar button {
  border-radius: 0.25rem;
}

.hero-caption {
  margin-top: 0.5rem;
  text-align: right;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #71717a;
}

/* Homepage: registry-cleaner *.webp blocks under section headers */
.home-section-visual {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: min(100%, 36rem);
  height: clamp(10.5rem, 22vw, 14.5rem);
  background: #f4f4f5;
}

.home-section-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

@media (min-width: 640px) {
  .home-section-visual {
    max-width: min(100%, 40rem);
    height: clamp(11rem, 20vw, 15rem);
  }
}

@media (min-width: 1024px) {
  .home-section-visual {
    max-width: min(100%, 42rem);
    height: clamp(11.5rem, 18vw, 15.5rem);
  }
}

.hero-mobile-links {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #71717a;
}

.hero-mobile-links a {
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero-mobile-links a:hover {
  color: #67e8f9;
}

.hero-mobile-links a.text-cyan-400 {
  color: #22d3ee;
}

@media (prefers-reduced-motion: reduce) {
  .hero-cta-primary:hover,
  .hero-index-panel a:hover {
    transform: none;
  }

  .hero-eyebrow {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .hero-index-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-mesh .hero-enter-stagger > * {
    animation: site-hero-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .hero-mesh .hero-enter-stagger > *:nth-child(1) {
    animation-delay: 0.04s;
  }

  .hero-mesh .hero-enter-stagger > *:nth-child(2) {
    animation-delay: 0.11s;
  }

  .hero-mesh .hero-enter-stagger > *:nth-child(3) {
    animation-delay: 0.18s;
  }

  .hero-mesh .hero-enter-stagger > *:nth-child(4) {
    animation-delay: 0.25s;
  }

  .hero-mesh .hero-enter-stagger > *:nth-child(5) {
    animation-delay: 0.32s;
  }
}

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

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

#site-main a[class*="rounded-xl"][class*="border-line"].group {
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  #site-main a[class*="rounded-xl"][class*="border-line"].group:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px -24px rgba(24, 24, 27, 0.25);
  }
}

#site-main .max-w-readable a.text-revo,
#site-main p a.text-revo {
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

#site-main video {
  max-width: 100%;
}

.site-phrase-chip {
  display: block;
  border: 1px solid var(--site-line);
  border-radius: 0.75rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #3f3f46;
  background: rgba(255, 255, 255, 0.85);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  #site-main li:hover .site-phrase-chip {
    border-color: rgba(5, 144, 206, 0.4);
    background: rgba(232, 244, 250, 0.75);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  }
}

#site-main img {
  height: auto;
  max-width: 100%;
}

#site-main code {
  word-break: break-word;
}

/* Hide legacy inline language UI on first paint (main.js removes it; avoids FOUC / “cramped then jump”) */
#site-header [data-lang-switch],
#site-header [data-lang-switch-mobile],
#site-header nav a.nav-link-main[hreflang],
#site-header #mobile-nav a[hreflang] {
  display: none !important;
}

/* Navbar language switcher (built by js/main.js) */
#site-header {
  overflow: visible;
}

#site-header > nav {
  position: relative;
  z-index: 12;
  overflow: visible;
}

#site-header #mobile-nav {
  position: relative;
  z-index: 20;
}

.site-lang-nav-group {
  position: relative;
  z-index: 1;
  align-items: center;
}

.site-lang {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  align-self: center;
}

.site-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--ds-ink-secondary);
  border: 1px solid var(--ds-border);
  background: #fff;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.site-lang-btn:hover {
  border-color: var(--ds-border-strong);
  background: var(--ds-canvas-warm);
  color: var(--ds-ink);
}

.site-lang-btn__caret {
  font-size: 0.65rem;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.site-lang--open .site-lang-btn__caret {
  transform: rotate(180deg);
}

.site-lang-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  inset-inline-end: 0;
  left: auto;
  box-sizing: border-box;
  width: max-content;
  min-width: 11.5rem;
  max-width: min(14.5rem, calc(100vw - 1rem));
  padding: 0;
  overflow: hidden;
  border-radius: var(--ds-radius-md);
  border: 1px solid var(--ds-border);
  background: var(--ds-surface);
  box-shadow:
    var(--ds-shadow-md),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

.site-lang-panel__scroll {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  max-height: min(20rem, calc(100vh - 6rem));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.site-lang-panel--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.site-lang-item {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: start;
  overflow-wrap: break-word;
  word-break: normal;
  border-radius: 0.45rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--ds-ink-secondary);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a.site-lang-item:hover {
  background: var(--ds-primary-soft);
  color: var(--ds-primary);
}

.site-lang-item--current {
  font-weight: 600;
  color: var(--ds-primary);
  cursor: default;
}

#site-header.header--hero .site-lang-btn {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.2);
}

#site-header.header--hero .site-lang-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

#site-header.header--hero .site-lang-panel {
  border-color: var(--ds-border);
  background: var(--ds-surface);
}

#site-header.nav-scrolled .site-lang-btn {
  color: var(--ds-ink-secondary);
  border-color: var(--ds-border);
  background: #fff;
}

#site-header.nav-scrolled .site-lang-btn:hover {
  background: var(--ds-canvas-warm);
  color: var(--ds-ink);
}

@media (max-width: 22rem) {
  .site-lang-panel {
    right: 0.25rem;
    width: calc(100vw - 0.75rem);
    max-width: calc(100vw - 0.75rem);
    min-width: 0;
  }
}

/* RTL pages (e.g. Hebrew under /il/): mirror fixed UI chrome */
[dir="rtl"] .fixed-download-btn {
  right: auto;
  left: 0;
  border-radius: 0 9999px 9999px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  border-left: none;
  padding: 0.65rem 1rem 0.65rem 0.9rem;
}

[dir="rtl"] .fixed-download-btn:hover {
  transform: translateY(-50%) translateX(2px);
}

[dir="rtl"] .back-to-top {
  right: auto;
  left: 1.25rem;
}

@media print {
  .skip-link,
  .fixed-download-btn,
  .back-to-top,
  .site-lang {
    display: none !important;
  }

  #site-header {
    position: static !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #fff !important;
    border-bottom: 1px solid #ccc !important;
  }

  #site-main {
    min-height: 0;
  }

  body {
    background: #fff !important;
  }

  a {
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
    word-break: break-all;
  }
}
