:root {
  /* Global theme = Image Converter blue system */
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --theme: #2563eb;
  --theme-bright: #3b82f6;
  --theme-deep: #1d4ed8;
  --theme-dim: #eff6ff;
  --header-h: 58px;
  --content-w: 80%;
  --content-max: 1120px;
  --rail-w: 120px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body.theme-future {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

.wrap {
  width: min(var(--content-w), var(--content-max));
  margin-inline: auto;
}

.site-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  width: min(var(--content-w), var(--content-max));
  margin-inline: auto;
  min-height: 40vh;
}

.site-main {
  min-width: 0;
  padding: 0 0 72px;
}

.ad-rail {
  display: none;
}

.ad-rail__slot {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  min-height: 260px;
  border: 0;
  background: transparent;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand__logo {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--theme);
  position: relative;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 5px 4px 4px 5px;
  border-radius: 2px;
  background: #fff;
}

.brand__name {
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.site-auth {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.site-auth__link {
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 8px;
}

.site-auth__link:hover {
  color: var(--theme);
  background: var(--theme-dim);
}

.site-auth__btn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--theme);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

.site-auth__btn:hover {
  background: var(--theme-deep);
}

.mobile-auth {
  display: flex;
  gap: 10px;
  padding: 14px 0 4px;
}

.site-nav {
  display: none;
  align-items: center;
  gap: 4px;
}

.nav-cat {
  position: relative;
}

.nav-cat__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 8px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.nav-cat__btn svg {
  opacity: 0.7;
}

.nav-cat__btn:hover,
.nav-cat.is-open .nav-cat__btn,
.nav-cat.is-hover .nav-cat__btn {
  color: var(--theme);
  background: var(--theme-dim);
}

.nav-cat__menu {
  display: none;
  position: absolute;
  /* Bridge the gap so mouse can travel without leaving the open menu */
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: 14px 8px 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-top-color: transparent;
  border-radius: 0 0 10px 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  z-index: 60;
}

.nav-cat.is-open .nav-cat__menu,
.nav-cat.is-hover .nav-cat__menu,
.nav-cat:focus-within .nav-cat__menu {
  display: grid;
  gap: 2px;
}

.nav-cat__menu a {
  display: block;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-soft);
}

.nav-cat__menu a:hover {
  color: var(--theme);
  background: var(--theme-dim);
}

.nav-cat__link {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 8px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
  white-space: nowrap;
}

.nav-cat__link:hover {
  color: var(--theme);
  background: var(--theme-dim);
}

.nav-cat__menu--wide {
  min-width: 300px;
}

.nav-cat__menu.nav-cat__menu--cols {
  min-width: 540px;
  width: min(720px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  padding: 16px 12px 12px;
  gap: 4px 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nav-cat.is-open .nav-cat__menu.nav-cat__menu--cols,
.nav-cat.is-hover .nav-cat__menu.nav-cat__menu--cols,
.nav-cat:focus-within .nav-cat__menu.nav-cat__menu--cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 12px;
}

.nav-cat__menu.nav-cat__menu--cols a {
  white-space: nowrap;
}

.nav-cat__menu-more {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-weight: 600;
  color: var(--theme);
}

/* Wide panel: center in header so it stays fully on-screen */
.nav-cat--image-converter {
  position: static;
}

.nav-cat--image-converter .nav-cat__menu.nav-cat__menu--cols {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.nav-cat--video .nav-cat__menu a {
  white-space: nowrap;
}

.mobile-nav__link {
  display: block;
  padding: 12px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.mobile-nav__link:hover {
  color: var(--theme);
}

.nav-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.nav-toggle__bar {
  width: 14px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s var(--ease);
}

.site-header.is-open .nav-toggle__bar:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.site-header.is-open .nav-toggle__bar:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-nav {
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
}

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

.mobile-nav__inner {
  display: flex;
  flex-direction: column;
  padding: 8px 0 12px;
}

.mobile-cat {
  border-bottom: 1px solid var(--line);
  padding: 4px 0 8px;
}

.mobile-cat:last-child {
  border-bottom: 0;
}

.mobile-cat summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.mobile-cat summary::-webkit-details-marker {
  display: none;
}

.mobile-cat a {
  display: block;
  padding: 8px 0 8px 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
}

.mobile-cat a:hover {
  color: var(--theme);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn--primary {
  background: var(--theme);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--theme-deep);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.btn--ghost:hover {
  border-color: var(--theme);
  color: var(--theme);
  background: var(--theme-dim);
}

.btn__chev {
  font-family: var(--font-mono);
  transition: transform 0.18s var(--ease);
}

.btn--primary:hover .btn__chev {
  transform: translateX(3px);
}

.site-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  padding: 48px 0 0;
}

.site-footer__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 32px;
}

.site-footer__brand {
  flex: 1 1 auto;
  max-width: 420px;
  min-width: 280px;
}

.site-footer__tagline {
  margin: 12px 0 0;
  max-width: none;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer__meta {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--theme);
}

.site-footer__cols {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 8px 40px;
  margin-left: auto;
  min-width: 0;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.footer-col__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--theme);
}

.footer-col__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-col a {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  transition: color 0.15s;
  white-space: nowrap;
}

.footer-col a:hover {
  color: var(--theme);
}

.site-footer__bottom {
  border-top: 1px solid var(--line);
}

.site-footer__bottom-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer__bottom p {
  margin: 0;
}

.site-footer__top {
  font-weight: 600;
  color: var(--text-soft);
}

.site-footer__top:hover {
  color: var(--theme);
}

@media (max-width: 899px) {
  :root {
    --content-w: 92%;
  }

  .site-footer__inner {
    flex-wrap: wrap;
    gap: 24px;
  }

  .site-footer__brand {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .site-footer__cols {
    flex: 1 1 100%;
    margin-left: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 20px;
  }

  .footer-col a {
    white-space: normal;
  }
}

@media (max-width: 639px) {
  .site-footer__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 640px) {
  body.theme-future {
    font-size: 16px;
  }
}

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

  .site-auth {
    display: inline-flex;
  }

  .nav-toggle,
  .mobile-nav {
    display: none !important;
  }
}

@media (min-width: 1180px) {
  .site-shell {
    width: min(calc(var(--content-w) + var(--rail-w) * 2 + 32px), calc(var(--content-max) + var(--rail-w) * 2 + 32px));
    grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--rail-w);
    column-gap: 16px;
  }

  .ad-rail {
    display: block;
    padding-top: 20px;
  }
}

@media (min-width: 1400px) {
  :root {
    --rail-w: 140px;
    --content-max: 1180px;
  }
}

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

  .pulse-dot {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
