/*--------------------------------------------------------------
  urbi.tools Design System — Override Layer
  Loaded after Revision's style.css
--------------------------------------------------------------*/

/* ── Self-hosted fonts (no external Google Fonts request) ─── */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── CSS Custom Properties: Dark (default) ───────────────── */
:root,
body[data-scheme="dark"] {
  --ut-bg:         oklch(0.16 0.02 260);
  --ut-fg:         oklch(0.96 0.01 260);
  --ut-surface:    oklch(0.20 0.025 260);
  --ut-card:       oklch(0.20 0.025 260);
  --ut-primary:    oklch(0.82 0.18 145);
  --ut-primary-fg: oklch(0.15 0.02 260);
  --ut-muted:      oklch(0.24 0.025 260);
  --ut-muted-fg:   oklch(0.70 0.02 260);
  --ut-accent:     oklch(0.70 0.18 290);
  --ut-border:     oklch(1 0 0 / 8%);
  --ut-radius:     0.75rem;
  --ut-glow:       0 0 0 1px color-mix(in oklab, oklch(0.82 0.18 145) 35%, transparent),
                   0 10px 40px -10px color-mix(in oklab, oklch(0.82 0.18 145) 50%, transparent);
}

/* ── CSS Custom Properties: Light ────────────────────────── */
body[data-scheme="light"] {
  --ut-bg:         oklch(0.98 0.004 260);
  --ut-fg:         oklch(0.14 0.02 260);
  --ut-surface:    oklch(0.96 0.005 260);
  --ut-card:       oklch(1 0 0);
  --ut-primary:    oklch(0.50 0.18 145);
  --ut-primary-fg: oklch(0.98 0 0);
  --ut-muted:      oklch(0.93 0.008 260);
  --ut-muted-fg:   oklch(0.45 0.02 260);
  --ut-accent:     oklch(0.50 0.20 290);
  --ut-border:     oklch(0 0 0 / 9%);
  --ut-glow:       0 0 0 1px color-mix(in oklab, oklch(0.50 0.18 145) 35%, transparent),
                   0 10px 40px -10px color-mix(in oklab, oklch(0.50 0.18 145) 50%, transparent);
}

/* ── Global Base ──────────────────────────────────────────── */
html, body, .cs-site { background-color: var(--ut-bg) !important; color: var(--ut-fg) !important; }

body {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.cs-entry__title a {
  font-family: "Space Grotesk", "Inter", sans-serif !important;
  letter-spacing: -0.02em;
  color: var(--ut-fg) !important;
}

code, pre, kbd, samp { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace !important; }

.cs-site-inner, .cs-site-primary, .cs-site-content { background: transparent !important; }

/* Hide Revision header & footer — replaced by urbi.tools versions */
.cs-header-before, .cs-header { display: none !important; }
.cs-footer { display: none !important; }

/* Remove Revision page gradient */
:root { --cs-site-background: var(--ut-bg) !important; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes ut-fade-in-up  { from { opacity:0; transform:translateY(22px); } to { opacity:1; transform:translateY(0); } }
@keyframes ut-fade-in     { from { opacity:0; } to { opacity:1; } }
@keyframes ut-float       { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-7px); } }
@keyframes ut-pulse-glow  {
  0%,100% { box-shadow: 0 0 0 1px color-mix(in oklab, var(--ut-primary) 35%, transparent), 0 10px 40px -10px color-mix(in oklab, var(--ut-primary) 50%, transparent); }
  50%      { box-shadow: 0 0 0 1px color-mix(in oklab, var(--ut-primary) 55%, transparent), 0 15px 50px -8px color-mix(in oklab, var(--ut-primary) 70%, transparent); }
}

.ut-hero-badge    { animation: ut-fade-in-up 0.5s ease both; animation-delay: 0.05s; }
.ut-hero-title    { animation: ut-fade-in-up 0.6s ease both; animation-delay: 0.15s; }
.ut-hero-subtitle { animation: ut-fade-in-up 0.6s ease both; animation-delay: 0.28s; }
.ut-hero-actions  { animation: ut-fade-in-up 0.6s ease both; animation-delay: 0.40s; }
.ut-hero-stats    { animation: ut-fade-in-up 0.6s ease both; animation-delay: 0.52s; }
.ut-btn-glow      { animation: ut-pulse-glow 2.4s ease-in-out infinite; }
.ut-float         { animation: ut-float 4s ease-in-out infinite; }

[data-animate]                      { opacity:0; transform:translateY(20px); transition:opacity 0.55s ease, transform 0.55s ease; }
[data-animate="left"]               { transform:translateX(-20px); }
[data-animate="right"]              { transform:translateX(20px); }
[data-animate="scale"]              { transform:scale(0.95); }
[data-animate="fade"]               { transform:none; }
[data-animate][data-visible="true"] { opacity:1 !important; transform:none !important; }
[data-delay="1"] { transition-delay:0.07s; }
[data-delay="2"] { transition-delay:0.14s; }
[data-delay="3"] { transition-delay:0.21s; }
[data-delay="4"] { transition-delay:0.28s; }
[data-delay="5"] { transition-delay:0.35s; }
[data-delay="6"] { transition-delay:0.42s; }

/* ── Layout Utilities ─────────────────────────────────────── */
.ut-container {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.ut-grid-bg {
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--ut-fg) 5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--ut-fg) 5%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
}

.ut-section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ut-primary);
}

.ut-section-label--accent { color: var(--ut-accent); }

/* ── urbi.tools Header ────────────────────────────────────── */
.ut-header {
  position: sticky;
  top: var(--cs-adminmbar-offset, 0px);
  z-index: 200;
  border-bottom: 1px solid transparent;
  background: color-mix(in oklab, var(--ut-bg) 40%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.ut-header.ut-scrolled {
  border-bottom-color: var(--ut-border);
  background: color-mix(in oklab, var(--ut-bg) 80%, transparent);
  box-shadow: 0 1px 20px -4px rgb(0 0 0 / 0.15);
}

.ut-header__inner {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
  display: flex;
  height: 5rem;
  align-items: center;
  justify-content: space-between;
  transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ut-header.ut-scrolled .ut-header__inner { height: 65px; }

/* Logo */
.ut-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none !important;
  color: var(--ut-fg) !important;
}

.ut-logo__icon {
  display: grid;
  height: 2.25rem;
  width: 2.25rem;
  place-items: center;
  border-radius: 0.5rem;
  background: var(--ut-primary);
  color: var(--ut-primary-fg);
  box-shadow: var(--ut-glow);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.ut-logo:hover .ut-logo__icon { transform: scale(1.05); }

.ut-logo__text {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ut-fg) !important;
}

.ut-logo__dot { color: var(--ut-primary); }

.ut-logo__img {
  height: 2rem;
  width: auto;
  max-width: 10rem;
  display: block;
  object-fit: contain;
}

/* Dark/light logo switching */
body[data-scheme="dark"]  .ut-logo__img--light { display: block; }
body[data-scheme="dark"]  .ut-logo__img--dark  { display: none; }
body[data-scheme="light"] .ut-logo__img--light { display: none; }
body[data-scheme="light"] .ut-logo__img--dark  { display: block; }
/* Default (no scheme attr yet): show light logo */
.ut-logo__img--dark { display: none; }

/* Desktop nav */
.ut-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.ut-nav li { margin: 0; padding: 0; }

.ut-nav__link {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none !important;
  color: var(--ut-muted-fg) !important;
  transition: color 0.2s, background 0.2s;
}

.ut-nav__link:hover        { color: var(--ut-fg) !important; background: var(--ut-muted); }
.ut-nav__link.ut-nav-active { color: var(--ut-primary) !important; background: color-mix(in oklab, var(--ut-primary) 10%, transparent); }

.ut-nav__link.ut-nav-active::after {
  content: '';
  position: absolute;
  bottom: 0.125rem;
  left: 50%;
  transform: translateX(-50%);
  height: 2px;
  width: 1rem;
  border-radius: 9999px;
  background: var(--ut-primary);
}

/* ── Dropdown menus ────────────────────────────────────── */
.ut-nav__item--has-children {
  position: relative;
}

.ut-nav__item--has-children > .ut-nav__link {
  padding-right: 1.5rem;
}

.ut-nav__item--has-children > .ut-nav__link::before {
  content: '';
  position: absolute;
  right: 0.55rem;
  top: 50%;
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.2s;
}

.ut-nav__item--has-children:hover > .ut-nav__link::before,
.ut-nav__item--has-children:focus-within > .ut-nav__link::before {
  transform: translateY(-30%) rotate(225deg);
}

.ut-nav__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 13rem;
  list-style: none;
  margin: 0;
  padding: 0.375rem 0.375rem 0.375rem;
  padding-top: 0.625rem;
  background: var(--ut-card);
  border: 1px solid var(--ut-border);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px -4px oklch(0 0 0 / 0.12);
  z-index: 200;
}

.ut-nav__item--has-children:hover .ut-nav__dropdown,
.ut-nav__item--has-children:focus-within .ut-nav__dropdown {
  display: block;
}

.ut-nav__dropdown-link {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ut-muted-fg) !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.ut-nav__dropdown-link:hover      { color: var(--ut-fg) !important; background: var(--ut-muted); }
.ut-nav__dropdown-link.ut-nav-active { color: var(--ut-primary) !important; }

/* Mobile sub-menu */
.ut-mobile-menu__sub {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin: 0.125rem 0 0.25rem 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--ut-border);
}

.ut-mobile-menu__sub-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ut-muted-fg) !important;
  text-decoration: none !important;
  transition: color 0.15s, background 0.15s;
}

.ut-mobile-menu__sub-link:hover         { color: var(--ut-fg) !important; background: var(--ut-muted) !important; }
.ut-mobile-menu__sub-link.ut-nav-active { color: var(--ut-primary) !important; background: color-mix(in oklab, var(--ut-primary) 8%, transparent); }

/* Header right controls */
.ut-header__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Scheme toggle — works with Revision's cscoDarkMode JS */
.cs-site-scheme-toggle.ut-scheme-btn {
  display: grid !important;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0 !important;
  border-radius: 0.375rem !important;
  background: none !important;
  border: none !important;
  cursor: pointer;
  color: var(--ut-muted-fg) !important;
  transition: color 0.2s, background 0.2s;
}

.cs-site-scheme-toggle.ut-scheme-btn:hover,
.cs-site-scheme-toggle.ut-scheme-btn:focus,
.cs-site-scheme-toggle.ut-scheme-btn:focus-visible {
  color: var(--ut-fg) !important;
  background: var(--ut-muted) !important;
  outline: none !important;
  box-shadow: none !important;
}
.cs-site-scheme-toggle.ut-scheme-btn svg { width: 1rem; height: 1rem; }

/* Show correct icon by scheme — high specificity to beat svg { display: block } */
.cs-site-scheme-toggle.ut-scheme-btn .ut-icon-sun  { display: none !important; }
.cs-site-scheme-toggle.ut-scheme-btn .ut-icon-moon { display: block !important; }
body[data-scheme="dark"]  .cs-site-scheme-toggle.ut-scheme-btn .ut-icon-sun  { display: block !important; }
body[data-scheme="dark"]  .cs-site-scheme-toggle.ut-scheme-btn .ut-icon-moon { display: none !important; }
body[data-scheme="light"] .cs-site-scheme-toggle.ut-scheme-btn .ut-icon-sun  { display: none !important; }
body[data-scheme="light"] .cs-site-scheme-toggle.ut-scheme-btn .ut-icon-moon { display: block !important; }

/* CTA button */
.ut-btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background: var(--ut-primary);
  color: var(--ut-primary-fg) !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: var(--ut-glow);
  transition: opacity 0.2s;
}

.ut-btn-cta:hover { opacity: 0.9; color: var(--ut-primary-fg) !important; }

/* Mobile controls */
.ut-mobile-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 768px) { .ut-mobile-controls { display: none; } }

/* Hamburger button */
.ut-hamburger-btn {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ut-fg);
  transition: background 0.2s;
}

.ut-hamburger-btn:hover,
.ut-hamburger-btn[aria-expanded="true"] { background: var(--ut-muted); }

/* Animated hamburger → X icon */
.ut-hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 18px;
  height: 18px;
}

.ut-hamburger-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.2s ease,
              width     0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Open state — animate to X */
.ut-hamburger-btn[aria-expanded="true"] .ut-hamburger-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.ut-hamburger-btn[aria-expanded="true"] .ut-hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.ut-hamburger-btn[aria-expanded="true"] .ut-hamburger-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Backdrop */
.ut-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgb(0 0 0 / 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ut-menu-backdrop.ut-open { opacity: 1; pointer-events: auto; }

/* Body scroll lock */
body.ut-menu-open { overflow: hidden; }

/* Mobile menu panel — grid-rows animation for natural easing */
.ut-mobile-menu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.22s ease;
}

.ut-mobile-menu.ut-open {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

.ut-mobile-menu__inner {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100dvh - 65px);
  border-top: 1px solid var(--ut-border);
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ut-mobile-menu__inner nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ut-mobile-menu__link {
  display: flex;
  align-items: center;
  padding: 0.6875rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none !important;
  color: var(--ut-fg) !important;
  transition: background 0.15s, color 0.15s;
}

.ut-mobile-menu__link:hover         { color: var(--ut-fg) !important; background: var(--ut-muted) !important; }
.ut-mobile-menu__link.ut-nav-active {
  color: var(--ut-primary) !important;
  background: color-mix(in oklab, var(--ut-primary) 10%, transparent);
}

/* Footer CTA row */
.ut-mobile-menu__footer {
  margin-top: 0.625rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ut-border);
}

.ut-mobile-menu__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none !important;
  color: var(--ut-primary-fg) !important;
  background: var(--ut-primary);
  box-shadow: var(--ut-glow);
  transition: opacity 0.2s;
}

.ut-mobile-menu__cta:hover { opacity: 0.88; }

/* ── urbi.tools Footer ────────────────────────────────────── */
.ut-footer { margin-top: 6rem; }

/* Newsletter band */
.ut-newsletter {
  border-top: 1px solid var(--ut-border);
  border-bottom: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-surface) 40%, transparent);
}

.ut-newsletter__inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 3rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .ut-newsletter__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

.ut-newsletter__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-primary) 8%, transparent);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ut-primary);
  margin-bottom: 0.75rem;
}

.ut-newsletter__badge svg { width: 0.875rem; height: 0.875rem; }

.ut-newsletter__title {
  font-family: "Space Grotesk", sans-serif !important;
  font-size: clamp(1.4rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ut-fg) !important;
  margin: 0 0 0.5rem;
}

.ut-newsletter__text { color: var(--ut-muted-fg); font-size: 0.875rem; line-height: 1.625; margin: 0; }

.ut-newsletter__list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.ut-newsletter__list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ut-muted-fg);
}

.ut-newsletter__list svg { width: 0.875rem; height: 0.875rem; color: var(--ut-primary); flex-shrink: 0; }

.ut-newsletter__form { display: flex; gap: 0.5rem; width: 100%; max-width: 24rem; }

.ut-newsletter__input {
  flex: 1;
  min-width: 0;
  border-radius: 0.375rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-bg);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--ut-fg);
  outline: none;
  transition: box-shadow 0.2s;
  font-family: inherit;
}

.ut-newsletter__input:focus { box-shadow: 0 0 0 2px color-mix(in oklab, var(--ut-primary) 50%, transparent); }
.ut-newsletter__input::placeholder { color: var(--ut-muted-fg); }

.ut-newsletter__submit {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.375rem;
  background: var(--ut-primary);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ut-primary-fg);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
  font-family: inherit;
}

.ut-newsletter__submit:hover { opacity: 0.9; }
.ut-newsletter__submit svg   { width: 0.875rem; height: 0.875rem; }

.ut-newsletter__note { margin-top: 0.5rem; font-size: 0.6875rem; color: var(--ut-muted-fg); }

.ut-newsletter__success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ut-primary);
}

.ut-newsletter__success svg { width: 1.25rem; height: 1.25rem; }

/* Footer main grid */
.ut-footer__grid {
  max-width: 72rem;
  margin-inline: auto;
  padding: 2.5rem 1.25rem;
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) { .ut-footer__grid { grid-template-columns: repeat(3, 1fr); } }

.ut-footer__brand-logo { margin-bottom: 0.75rem; }

.ut-footer__brand-desc { font-size: 0.875rem; color: var(--ut-muted-fg); max-width: 18rem; line-height: 1.625; }

.ut-footer__col-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--ut-fg); }

.ut-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.ut-footer__link,
.ut-footer__links li a,
.ut-footer__links .menu-item > a {
  font-size: 0.875rem;
  color: var(--ut-muted-fg) !important;
  text-decoration: none !important;
  transition: color 0.2s;
}

.ut-footer__link:hover,
.ut-footer__links li a:hover,
.ut-footer__links .menu-item > a:hover { color: var(--ut-fg) !important; }

.ut-footer__link--accent { color: var(--ut-primary) !important; }

.ut-footer__email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--ut-muted-fg) !important;
  text-decoration: none !important;
  transition: color 0.2s;
}

.ut-footer__email:hover { color: var(--ut-fg) !important; }
.ut-footer__email svg   { width: 1rem; height: 1rem; flex-shrink: 0; }

/* Footer bottom bar */
.ut-footer__bottom { border-top: 1px solid var(--ut-border); }

.ut-footer__bottom-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--ut-muted-fg);
}

/* Legal links in bottom bar */
.ut-footer__legal-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.125rem 0.25rem;
}

.ut-footer__legal-link {
  font-size: 0.75rem;
  color: var(--ut-muted-fg) !important;
  text-decoration: none !important;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.ut-footer__legal-link:hover {
  color: var(--ut-fg) !important;
  background: var(--ut-muted);
}

/* Also ensure wp_nav_menu wrapper <ul> inside bottom bar is flex */
.ut-footer__bottom-inner .ut-footer__legal-links { display: flex; }

@media (max-width: 639px) {
  .ut-footer__bottom-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* ── Hero Section ─────────────────────────────────────────── */
.ut-hero { position: relative; overflow: hidden; }

.ut-hero__bg { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; }

.ut-hero__inner { padding: 5rem 1.25rem 6rem; position: relative; max-width: 72rem; margin-inline: auto; }

.ut-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-surface) 60%, transparent);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: var(--ut-muted-fg);
}

.ut-hero__badge svg { width: 0.875rem; height: 0.875rem; color: var(--ut-primary); }

.ut-hero__title {
  margin: 1.5rem 0 0;
  font-size: clamp(2.25rem, 6vw, 3.75rem) !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  max-width: 48rem;
  color: var(--ut-fg) !important;
}

.ut-hero__title-accent { color: var(--ut-primary); }

.ut-hero__subtitle {
  margin: 1.25rem 0 0;
  font-size: 1.125rem;
  color: var(--ut-muted-fg);
  max-width: 42rem;
  line-height: 1.625;
}

.ut-hero__actions {
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.ut-hero__btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  background: var(--ut-primary);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ut-primary-fg) !important;
  text-decoration: none !important;
  box-shadow: var(--ut-glow);
  transition: opacity 0.2s;
}

.ut-hero__btn-primary:hover { opacity: 0.9; }

.ut-hero__btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-surface) 60%, transparent);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ut-fg) !important;
  text-decoration: none !important;
  transition: background 0.2s;
}

.ut-hero__btn-secondary:hover { background: var(--ut-muted); }

.ut-hero__stats {
  margin: 3rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 28rem;
}

.ut-stat {
  border-radius: 0.75rem;
  border: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-surface) 60%, transparent);
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.ut-stat__icon  { font-size: 1.125rem; margin-bottom: 0.25rem; }
.ut-stat__value { font-family: "Space Grotesk", sans-serif; font-size: 1.5rem; font-weight: 600; color: var(--ut-primary); }
.ut-stat__label { font-size: 0.75rem; color: var(--ut-muted-fg); }

/* ── Tools Preview ────────────────────────────────────────── */
.ut-tools-section  { max-width: 72rem; margin-inline: auto; padding: 4rem 1.25rem; }
.ut-posts-section  { max-width: 72rem; margin-inline: auto; padding: 4rem 1.25rem; }

.ut-tools-header, .ut-posts-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.ut-tools-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px)  { .ut-tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ut-tools-grid { grid-template-columns: repeat(3, 1fr); } }

.ut-tool-card {
  display: block;
  border-radius: 0.75rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-card);
  padding: 1.25rem;
  text-decoration: none !important;
  color: var(--ut-fg) !important;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.ut-tool-card:hover { border-color: color-mix(in oklab, var(--ut-primary) 40%, transparent); background: var(--ut-muted); }

.ut-tool-card__header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }

.ut-tool-card__icon {
  display: grid;
  height: 2.5rem;
  width: 2.5rem;
  place-items: center;
  border-radius: 0.5rem;
  background: color-mix(in oklab, var(--ut-primary) 10%, transparent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ut-primary);
  flex-shrink: 0;
}

.ut-tool-card__title    { font-weight: 600; color: var(--ut-fg); font-size: 1rem; }
.ut-tool-card__category { font-size: 0.75rem; color: var(--ut-muted-fg); }
.ut-tool-card__desc     { font-size: 0.875rem; color: var(--ut-muted-fg); line-height: 1.5; }

.ut-tool-card__cta {
  display: inline-flex;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--ut-primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.ut-tool-card:hover .ut-tool-card__cta { opacity: 1; }
.ut-tool-card__cta svg { width: 0.875rem; height: 0.875rem; margin-left: 0.25rem; }

.ut-view-all {
  display: none;
  font-size: 0.875rem;
  color: var(--ut-primary) !important;
  text-decoration: none !important;
  transition: opacity 0.2s;
}

@media (min-width: 768px) { .ut-view-all { display: inline-flex; } }
.ut-view-all:hover { opacity: 0.8; }

.ut-view-all--accent { color: var(--ut-accent) !important; }

/* ── Feature Strip ────────────────────────────────────────── */
.ut-features {
  border-top: 1px solid var(--ut-border);
  border-bottom: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-muted) 30%, transparent);
  padding: 2.5rem 1.25rem;
}

.ut-features__grid {
  max-width: 72rem;
  margin-inline: auto;
  display: grid;
  gap: 1.5rem;
  text-align: center;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) { .ut-features__grid { grid-template-columns: repeat(3, 1fr); } }

.ut-feature__icon {
  display: grid;
  height: 2.5rem;
  width: 2.5rem;
  place-items: center;
  border-radius: 0.5rem;
  background: color-mix(in oklab, var(--ut-primary) 10%, transparent);
  color: var(--ut-primary);
  margin: 0 auto 0.5rem;
}

.ut-feature__icon svg { width: 1.25rem; height: 1.25rem; }
.ut-feature__title    { font-weight: 600; font-size: 0.875rem; color: var(--ut-fg); }
.ut-feature__desc     { font-size: 0.75rem; color: var(--ut-muted-fg); max-width: 12.5rem; margin: 0.25rem auto 0; }

/* ── Blog Post Cards ──────────────────────────────────────── */
.ut-blog-content {
  max-width: 72rem;
  margin-inline: auto;
  padding: 3rem 1.25rem 4rem;
}

.ut-posts-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) { .ut-posts-grid { grid-template-columns: repeat(2, 1fr); } }

.ut-post-card {
  display: block;
  border-radius: 1rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-card);
  overflow: hidden;
  text-decoration: none !important;
  color: var(--ut-fg) !important;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.ut-post-card:hover { border-color: color-mix(in oklab, var(--ut-primary) 40%, transparent); background: color-mix(in oklab, var(--ut-muted) 30%, transparent); }

.ut-post-card__cover {
  display: grid;
  place-items: center;
  aspect-ratio: 16/10;
  font-size: 3rem;
  background: color-mix(in oklab, var(--ut-muted) 40%, transparent);
  overflow: hidden;
}

.ut-post-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.ut-post-card__body  { padding: 1.25rem; }

.ut-post-card__meta  {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ut-muted-fg);
  margin-bottom: 0.5rem;
}

.ut-post-card__cat   { border-radius: 0.25rem; background: var(--ut-muted); padding: 0.125rem 0.5rem; color: color-mix(in oklab, var(--ut-fg) 80%, transparent); }

.ut-post-card__title {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: var(--ut-fg) !important;
  margin: 0 0 0.5rem !important;
  transition: color 0.2s;
}

.ut-post-card:hover .ut-post-card__title { color: var(--ut-primary) !important; }

.ut-post-card__excerpt {
  font-size: 0.875rem;
  color: var(--ut-muted-fg);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Tools Hub Page ───────────────────────────────────────── */
.ut-page-header { max-width: 72rem; margin-inline: auto; padding: 4rem 1.25rem 2rem; }

.ut-page-header__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-primary) 8%, transparent);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ut-primary);
  margin-bottom: 0.75rem;
}

.ut-page-header__badge svg { width: 0.75rem; height: 0.75rem; }

.ut-page-header__title {
  font-size: clamp(2rem, 5vw, 3rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--ut-fg) !important;
  margin: 0.5rem 0 0.75rem !important;
}

.ut-page-header__desc { color: var(--ut-muted-fg); font-size: 1.125rem; max-width: 36rem; }

.ut-tools-category       { max-width: 72rem; margin-inline: auto; padding: 0 1.25rem 3rem; }
.ut-tools-category__title {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  color: var(--ut-fg) !important;
  margin: 0 0 1rem !important;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ut-border);
}

/* ── Individual Tool Pages ────────────────────────────────── */
.ut-tool-page { max-width: 72rem; margin-inline: auto; padding: 2rem 1.25rem 4rem; }

.ut-tool-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--ut-muted-fg) !important;
  text-decoration: none !important;
  transition: color 0.2s;
  margin-bottom: 2rem;
}

.ut-tool-back:hover { color: var(--ut-fg) !important; }
.ut-tool-back svg   { width: 1rem; height: 1rem; }

.ut-tool-shell {
  border: 1px solid var(--ut-border);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--ut-card);
}

.ut-tool-shell__header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-surface) 60%, transparent);
}

.ut-tool-shell__icon {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ut-primary);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.ut-tool-shell__title {
  font-family: "Space Grotesk", sans-serif !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--ut-fg) !important;
  margin: 0 0 0.25rem !important;
}

.ut-tool-shell__desc { color: var(--ut-muted-fg); font-size: 0.875rem; }
.ut-tool-shell__body { padding: 1.5rem; }

/* Two-pane layout */
.ut-two-pane { display: grid; gap: 1rem; }

@media (min-width: 768px) { .ut-two-pane { grid-template-columns: 1fr 1fr; } }

.ut-pane { display: flex; flex-direction: column; gap: 0.5rem; }

.ut-pane__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ut-muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ut-pane__actions { display: flex; align-items: center; justify-content: space-between; }

.ut-textarea {
  width: 100%;
  min-height: 12rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-bg);
  color: var(--ut-fg);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  padding: 0.75rem;
  resize: vertical;
  outline: none;
  transition: box-shadow 0.2s;
  box-sizing: border-box;
}

.ut-textarea:focus { box-shadow: 0 0 0 2px color-mix(in oklab, var(--ut-primary) 50%, transparent); }

/* Buttons */
.ut-copy-btn, .ut-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-surface);
  color: var(--ut-muted-fg);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
}

.ut-copy-btn:hover { color: var(--ut-fg); background: var(--ut-muted); }
.ut-copy-btn svg   { width: 0.875rem; height: 0.875rem; }

.ut-action-btn:hover, .ut-action-btn.ut-active {
  color: var(--ut-primary);
  border-color: color-mix(in oklab, var(--ut-primary) 40%, transparent);
  background: color-mix(in oklab, var(--ut-primary) 8%, transparent);
}

/* Case Converter */
.ut-case-outputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (min-width: 640px) { .ut-case-outputs { grid-template-columns: repeat(3, 1fr); } }

.ut-case-output {
  border: 1px solid var(--ut-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: var(--ut-bg);
}

.ut-case-output__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ut-muted-fg);
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ut-case-output__value {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: var(--ut-primary);
  word-break: break-all;
  min-height: 1.25rem;
}

/* Word Counter Stats */
.ut-wc-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (min-width: 640px) { .ut-wc-stats { grid-template-columns: repeat(3, 1fr); } }

.ut-wc-stat {
  border: 1px solid var(--ut-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: var(--ut-bg);
  text-align: center;
}

.ut-wc-stat__value { font-family: "Space Grotesk", sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--ut-primary); }
.ut-wc-stat__label { font-size: 0.75rem; color: var(--ut-muted-fg); }

/* Unit Converter */
.ut-unit-section { margin-top: 1.5rem; }

.ut-unit-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: end;
  margin-top: 0.75rem;
}

.ut-label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--ut-muted-fg); margin-bottom: 0.375rem; }

.ut-select, .ut-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-bg);
  color: var(--ut-fg);
  font-size: 0.875rem;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.ut-input:focus, .ut-select:focus { box-shadow: 0 0 0 2px color-mix(in oklab, var(--ut-primary) 50%, transparent); }

.ut-swap-btn {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-surface);
  color: var(--ut-muted-fg);
  cursor: pointer;
  transition: color 0.2s;
  align-self: end;
  flex-shrink: 0;
  font-family: inherit;
}

.ut-swap-btn:hover { color: var(--ut-primary); }
.ut-swap-btn svg   { width: 1rem; height: 1rem; }

.ut-unit-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* Image Converter */
.ut-img-drop {
  border: 2px dashed var(--ut-border);
  border-radius: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--ut-muted-fg);
}

.ut-img-drop:hover, .ut-img-drop.ut-dragover {
  border-color: color-mix(in oklab, var(--ut-primary) 50%, transparent);
  background: color-mix(in oklab, var(--ut-primary) 5%, transparent);
}

.ut-img-drop svg   { width: 2.5rem; height: 2.5rem; margin: 0 auto 0.75rem; color: var(--ut-muted-fg); display: block; }
.ut-img-drop p     { font-size: 0.875rem; margin: 0; }
.ut-img-drop small { font-size: 0.75rem; color: var(--ut-muted-fg); }

.ut-img-preview { margin-top: 1rem; display: none; }
.ut-img-preview img { max-width: 100%; border-radius: 0.5rem; border: 1px solid var(--ut-border); }

.ut-format-select { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* Language Detector result */
.ut-lang-result {
  margin-top: 1rem;
  border: 1px solid var(--ut-border);
  border-radius: 0.5rem;
  padding: 1rem;
  background: var(--ut-bg);
}

.ut-lang-result__name {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ut-primary);
  margin-bottom: 0.25rem;
}

.ut-lang-result__conf { font-size: 0.75rem; color: var(--ut-muted-fg); }

/* Override Revision post styles for blog archive */
.cs-entry {
  border-radius: 1rem !important;
  border: 1px solid var(--ut-border) !important;
  background: var(--ut-card) !important;
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease !important;
}

.cs-entry:hover { border-color: color-mix(in oklab, var(--ut-primary) 40%, transparent) !important; }

/* Pagination */
.cs-button, .cs-load-more {
  background: var(--ut-primary) !important;
  color: var(--ut-primary-fg) !important;
  border-radius: 0.375rem !important;
  border: none !important;
}

.cs-posts-area__pagination .page-numbers         { color: var(--ut-fg) !important; }
.cs-posts-area__pagination .page-numbers.current { background: var(--ut-primary) !important; color: var(--ut-primary-fg) !important; }

/* Content area background fix */
.cs-content-area, .cs-main-content { background: transparent !important; }

/* Sidebar widget bg */
.cs-sidebar .widget { background: var(--ut-card) !important; border: 1px solid var(--ut-border) !important; border-radius: 0.75rem !important; }

/* Single post */
.entry-content { color: var(--ut-fg) !important; }
.entry-content a { color: var(--ut-primary) !important; }
.entry-content code {
  background: color-mix(in oklab, var(--ut-muted) 60%, transparent) !important;
  border-radius: 0.25rem !important;
  padding: 0.125rem 0.375rem !important;
  font-size: 0.875em !important;
}

.entry-content pre {
  position: relative !important;
  background: oklch(0.14 0.02 260) !important;
  border-radius: 0.5rem !important;
  /* extra top padding leaves room for the lang badge + copy btn */
  padding: 2.5rem 1.25rem 1.25rem !important;
  overflow-x: auto;
  color: oklch(0.92 0.01 260) !important;
}

body[data-scheme="light"] .entry-content pre {
  background: oklch(0.93 0.006 260) !important;
  color: oklch(0.14 0.02 260) !important;
}

/* Language badge — top-left */
.ut-code-lang {
  position: absolute;
  top: 0.625rem;
  left: 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: oklch(0.5 0.01 260);
  pointer-events: none;
  user-select: none;
  font-family: "JetBrains Mono", monospace;
}

body[data-scheme="light"] .ut-code-lang { color: oklch(0.55 0.01 260); }

/* Copy button — top-right */
.ut-code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.625rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid oklch(1 0 0 / 12%);
  background: oklch(1 0 0 / 6%);
  color: oklch(0.65 0.01 260);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  line-height: 1;
}

/* Always show on touch devices */
@media (hover: none) { .ut-code-copy-btn { opacity: 1; } }

.entry-content pre:hover .ut-code-copy-btn { opacity: 1; }
.ut-code-copy-btn:hover { background: oklch(1 0 0 / 14%); color: oklch(0.92 0 0); }
.ut-code-copy-btn svg   { width: 0.8125rem; height: 0.8125rem; flex-shrink: 0; }

body[data-scheme="light"] .ut-code-copy-btn {
  border-color: oklch(0 0 0 / 10%);
  background: oklch(0 0 0 / 4%);
  color: oklch(0.45 0.01 260);
}

body[data-scheme="light"] .ut-code-copy-btn:hover {
  background: oklch(0 0 0 / 9%);
  color: oklch(0.15 0.01 260);
}

/* hljs theme overrides — keep our dark bg, just let hljs colour the tokens */
.entry-content pre .hljs { background: transparent !important; padding: 0 !important; }

/* ── CTA button: hide on mobile, show on desktop ──────────── */
.ut-btn-cta--desktop { display: none; }
@media (min-width: 768px) { .ut-btn-cta--desktop { display: inline-flex; } }

/* ── Standalone templates: neutralise Revision wrappers ──── */
body.ut-landing .cs-header-before,
body.ut-landing .cs-header,
body.ut-landing .cs-footer,
body.ut-tools-page .cs-header-before,
body.ut-tools-page .cs-header,
body.ut-tools-page .cs-footer,
body.ut-tool-page-body .cs-header-before,
body.ut-tool-page-body .cs-header,
body.ut-tool-page-body .cs-footer,
body.ut-blog-archive .cs-header-before,
body.ut-blog-archive .cs-header,
body.ut-blog-archive .cs-footer,
body.ut-single-post .cs-header-before,
body.ut-single-post .cs-header,
body.ut-single-post .cs-footer,
body.ut-page .cs-header-before,
body.ut-page .cs-header,
body.ut-page .cs-footer { display: none !important; }

/* Remove extra padding/margin injected by Revision's main wrapper */
body.ut-landing .cs-site-primary,
body.ut-tools-page .cs-site-primary,
body.ut-tool-page-body .cs-site-primary,
body.ut-blog-archive .cs-site-primary,
body.ut-single-post .cs-site-primary,
body.ut-page .cs-site-primary {
  padding: 0 !important;
  margin: 0 !important;
}

/* Admin bar offset for standalone templates */
body.ut-landing.admin-bar .ut-header,
body.ut-tools-page.admin-bar .ut-header,
body.ut-tool-page-body.admin-bar .ut-header,
body.ut-blog-archive.admin-bar .ut-header,
body.ut-single-post.admin-bar .ut-header,
body.ut-page.admin-bar .ut-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.ut-landing.admin-bar .ut-header,
  body.ut-tools-page.admin-bar .ut-header,
  body.ut-tool-page-body.admin-bar .ut-header,
  body.ut-blog-archive.admin-bar .ut-header,
  body.ut-single-post.admin-bar .ut-header,
  body.ut-page.admin-bar .ut-header {
    top: 46px;
  }
}

/* ── Blog archive page header (matches tools hub style) ───── */
.ut-blog-page-header {
  max-width: 72rem;
  margin-inline: auto;
  padding: 4rem 1.25rem 3rem;
  border-bottom: 1px solid var(--ut-border);
}

.ut-blog-page-header__title {
  font-size: clamp(2rem, 5vw, 3rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--ut-fg) !important;
  margin: 0.75rem 0 0.75rem !important;
}

.ut-blog-page-header__desc {
  color: var(--ut-muted-fg);
  font-size: 1.0625rem;
  max-width: 40rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

/* Category filter chips */
.ut-blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ut-blog-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.375rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-card);
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ut-muted-fg) !important;
  text-decoration: none !important;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.ut-blog-filter:hover {
  border-color: color-mix(in oklab, var(--ut-accent) 50%, transparent);
  color: var(--ut-fg) !important;
  background: var(--ut-muted);
}

.ut-blog-filter--active {
  border-color: var(--ut-accent);
  background: color-mix(in oklab, var(--ut-accent) 10%, transparent);
  color: var(--ut-accent) !important;
}

.ut-blog-filter__count {
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--ut-muted-fg);
  opacity: 0.7;
}

/* ── Featured / spotlight post ────────────────────────────── */
.ut-blog-spotlight-wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding: 2rem 1.25rem 0;
}

.ut-blog-spotlight {
  display: grid;
  border-radius: 1rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-card);
  overflow: hidden;
  text-decoration: none !important;
  color: var(--ut-fg) !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}

@media (min-width: 768px) { .ut-blog-spotlight { grid-template-columns: 5fr 4fr; } }

.ut-blog-spotlight:hover {
  border-color: color-mix(in oklab, var(--ut-accent) 40%, transparent);
  box-shadow: 0 8px 32px -8px oklch(0 0 0 / 30%);
}

.ut-blog-spotlight__cover {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--ut-muted);
  overflow: hidden;
  display: grid;
  place-items: center;
}

@media (min-width: 768px) {
  .ut-blog-spotlight__cover {
    aspect-ratio: unset;
    min-height: 18rem;
  }
}

.ut-blog-spotlight__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.ut-blog-spotlight:hover .ut-blog-spotlight__cover img { transform: scale(1.04); }

.ut-blog-spotlight__placeholder { font-size: 3.5rem; }

.ut-blog-spotlight__cat-badge {
  position: absolute;
  top: 0.875rem;
  left: 0.875rem;
  border-radius: 0.375rem;
  background: color-mix(in oklab, var(--ut-bg) 75%, transparent);
  border: 1px solid var(--ut-border);
  backdrop-filter: blur(8px);
  padding: 0.1875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ut-accent);
}

.ut-blog-spotlight__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.875rem;
  padding: 1.75rem 1.75rem;
  border-left: 1px solid var(--ut-border);
}

@media (max-width: 767px) { .ut-blog-spotlight__body { border-left: none; border-top: 1px solid var(--ut-border); } }

.ut-blog-spotlight__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ut-accent);
}

.ut-blog-spotlight__eyebrow svg { color: var(--ut-accent); }

.ut-blog-spotlight__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ut-muted-fg);
}

.ut-blog-spotlight__title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.02em;
  color: var(--ut-fg) !important;
  margin: 0 !important;
  transition: color 0.2s;
}

.ut-blog-spotlight:hover .ut-blog-spotlight__title { color: var(--ut-accent) !important; }

.ut-blog-spotlight__excerpt {
  font-size: 0.9375rem;
  color: var(--ut-muted-fg);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ut-blog-spotlight__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ut-accent);
  transition: gap 0.2s;
}

.ut-blog-spotlight:hover .ut-blog-spotlight__cta { gap: 0.625rem; }

/* ── Blog posts grid (archive) ────────────────────────────── */
.ut-blog-grid {
  max-width: 72rem;
  margin-inline: auto;
  padding: 2.5rem 1.25rem 5rem;
}

.ut-blog-grid__header {
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--ut-border);
}

.ut-blog-grid__heading {
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: var(--ut-muted-fg) !important;
  margin: 0 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ut-blog-grid__posts {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px)  { .ut-blog-grid__posts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ut-blog-grid__posts { grid-template-columns: repeat(3, 1fr); } }

/* ── Blog pagination ──────────────────────────────────────── */
.ut-blog-pagination { padding: 0; }

.ut-blog-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.ut-blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--ut-border);
  font-size: 0.875rem;
  color: var(--ut-fg) !important;
  text-decoration: none !important;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}

.ut-blog-pagination .page-numbers:hover {
  border-color: color-mix(in oklab, var(--ut-primary) 40%, transparent);
  background: var(--ut-muted);
}

.ut-blog-pagination .page-numbers.current {
  background: var(--ut-primary) !important;
  border-color: transparent;
  color: var(--ut-primary-fg) !important;
}

/* ── Blog empty state ─────────────────────────────────────── */
.ut-blog-empty {
  text-align: center;
  padding: 6rem 1.25rem;
  max-width: 32rem;
  margin-inline: auto;
}

.ut-blog-empty__icon  { font-size: 3rem; margin-bottom: 1rem; }
.ut-blog-empty__title { font-size: 1.25rem; font-weight: 600; color: var(--ut-fg); margin-bottom: 0.5rem; }
.ut-blog-empty__desc  { font-size: 1rem; color: var(--ut-muted-fg); margin-bottom: 2rem; }

/* ── Generic page (About, Contact, Privacy, etc.) ────────── */
.ut-page-shell-header {
  padding: 2.5rem 1.75rem 2rem;
  border-bottom: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-surface) 60%, transparent);
}

.ut-page-shell-header__title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ut-fg);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.ut-page-shell-header__lead {
  font-size: 1.0625rem;
  color: var(--ut-muted-fg);
  margin: 0;
  line-height: 1.6;
  max-width: 52ch;
}

/* ── Single Post (tool-shell layout) ─────────────────────── */

/* Post header — inside ut-tool-shell, replaces ut-tool-shell__header */
.ut-post-shell-header {
  padding: 2rem 1.75rem;
  border-bottom: 1px solid var(--ut-border);
  background: color-mix(in oklab, var(--ut-surface) 60%, transparent);
}

.ut-post-shell-header__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--ut-muted-fg);
  margin-bottom: 1rem;
}

.ut-post-shell-header__cat {
  border-radius: 0.25rem;
  background: color-mix(in oklab, var(--ut-accent) 12%, transparent);
  padding: 0.125rem 0.5rem;
  color: var(--ut-accent);
  font-weight: 500;
  text-decoration: none !important;
  transition: background 0.2s;
}

.ut-post-shell-header__cat:hover { background: color-mix(in oklab, var(--ut-accent) 20%, transparent); }

.ut-post-shell-header__title {
  font-family: "Space Grotesk", sans-serif !important;
  font-size: clamp(1.625rem, 4vw, 2.5rem) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em;
  color: var(--ut-fg) !important;
  margin: 0 0 1rem !important;
}

.ut-post-shell-header__lead {
  font-size: 1rem;
  color: var(--ut-muted-fg);
  line-height: 1.65;
  margin: 0 0 1.5rem;
}

.ut-post-shell-header__author {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ut-border);
}

.ut-post-shell-header__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--ut-muted);
}

.ut-post-shell-header__avatar img { width: 100%; height: 100%; object-fit: cover; }
.ut-post-shell-header__author-name  { font-size: 0.875rem; font-weight: 600; color: var(--ut-fg); }
.ut-post-shell-header__author-label { font-size: 0.75rem; color: var(--ut-muted-fg); }

/* Featured image — flush inside the card */
.ut-post-shell-cover {
  overflow: hidden;
  aspect-ratio: 16/7;
  background: var(--ut-muted);
  border-bottom: 1px solid var(--ut-border);
}

.ut-post-shell-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Content body — extra padding vs tool shell default */
.ut-post-shell-body { padding: 2rem 1.75rem !important; }

/* Tags */
.ut-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ut-border);
}

.ut-post-tag {
  border-radius: 0.375rem;
  border: 1px solid var(--ut-border);
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  color: var(--ut-muted-fg) !important;
  text-decoration: none !important;
  transition: border-color 0.2s, color 0.2s;
}

.ut-post-tag:hover { border-color: var(--ut-primary); color: var(--ut-primary) !important; }

/* Related posts section — sits outside the card, below it */
.ut-post-related {
  margin-top: 3rem;
  padding-top: 0;
}

/* ── Prev / Next Navigation ───────────────────────────────── */
.ut-post-nav {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ut-border);
}

@media (min-width: 640px) { .ut-post-nav { grid-template-columns: 1fr 1fr; } }

/* Comments */
.ut-post-comments {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ut-border);
}

.ut-post-comments .comments-title {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: var(--ut-fg) !important;
  margin-bottom: 1.5rem !important;
}

.ut-post-comments .comment-body { border-bottom: 1px solid var(--ut-border); padding: 1.25rem 0; }
.ut-post-comments .comment-author { font-weight: 600; color: var(--ut-fg); font-size: 0.875rem; }
.ut-post-comments .comment-meta   { font-size: 0.75rem; color: var(--ut-muted-fg); margin-bottom: 0.5rem; }
.ut-post-comments .comment-content p { font-size: 0.9375rem; color: var(--ut-fg); line-height: 1.65; }
.ut-post-comments #respond { margin-top: 2rem; }
.ut-post-comments #reply-title { font-size: 1.125rem !important; font-weight: 700 !important; color: var(--ut-fg) !important; margin-bottom: 1rem !important; }

.ut-post-comments input[type="text"],
.ut-post-comments input[type="email"],
.ut-post-comments input[type="url"],
.ut-post-comments textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ut-border);
  background: var(--ut-bg);
  color: var(--ut-fg);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: box-shadow 0.2s;
  margin-bottom: 0.75rem;
}

.ut-post-comments input:focus,
.ut-post-comments textarea:focus { box-shadow: 0 0 0 2px color-mix(in oklab, var(--ut-primary) 50%, transparent); }

.ut-post-comments .submit,
.ut-post-comments input[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.375rem;
  background: var(--ut-primary);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ut-primary-fg);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.ut-post-comments .submit:hover { opacity: 0.9; }

.ut-post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: var(--ut-radius);
  border: 1px solid var(--ut-border);
  background: var(--ut-card);
  padding: 1.125rem 1.25rem;
  text-decoration: none !important;
  color: var(--ut-fg) !important;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.ut-post-nav__item:hover {
  border-color: color-mix(in oklab, var(--ut-primary) 40%, transparent);
  background: var(--ut-muted);
  transform: translateY(-1px);
}

.ut-post-nav__dir {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ut-muted-fg);
}

.ut-post-nav__item--next .ut-post-nav__dir { justify-content: flex-end; }

.ut-post-nav__inner {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.ut-post-nav__inner--right { flex-direction: row-reverse; }

.ut-post-nav__thumb {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--ut-muted);
}

.ut-post-nav__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ut-post-nav__text { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }

.ut-post-nav__item--next .ut-post-nav__text { text-align: right; }

.ut-post-nav__cat {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ut-accent);
}

.ut-post-nav__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ut-fg);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ut-post-nav__item:hover .ut-post-nav__title { color: var(--ut-primary); }


/* Neutralise Revision's layout wrappers for all ut-* templates
   (get_header/get_footer pages: 404, search, tag archives, etc.) */
.cs-site-inner,
.cs-site-primary,
.cs-site-content,
.cs-container,
.cs-main-content {
  background: transparent !important;
}

/* Remove Revision's default padding from the main content wrapper
   on any page that uses get_header() + get_footer() */
.cs-site-primary { padding: 0 !important; margin: 0 !important; }

/* Hide the old Revision header/footer partials everywhere — they are
   now replaced by ut-header/ut-footer in header.php and footer.php */
.cs-header,
.cs-header-before,
.cs-footer { display: none !important; }
