@import url("fonts.css");

/* ============================================================
   AllToolio — wayfinding design system
   Pictogram people, signal colours with fixed meaning, one display face.
   ============================================================ */

:root {
  --bg: #f2f4f6;
  --bg-alt: #e8ecf1;
  --surface: #fbfcfd;
  --surface-2: #eef1f5;
  --surface-hover: #e4e9f0;
  --text: #17223b;
  --text-muted: #525e77;
  --border: #d6dce5;
  --border-strong: #b6c0cf;
  --primary: #1e5bd6;
  --primary-strong: #1649b0;
  --primary-soft: #e2eafb;
  --accent: #ffc21a;
  --accent-soft: #fff2c7;
  --success: #0e7c5b;
  --danger: #c93a24;
  --muted: #525e77;

  --c-tools: #1e5bd6;
  --c-tools-fg: #fbfcfd;
  --c-image: #ffc21a;
  --c-image-fg: #17223b;
  --c-games: #d53e26;
  --c-games-fg: #fbfcfd;
  --c-excel: #0c7f5e;
  --c-excel-fg: #fbfcfd;

  --shadow-sm: 0 1px 0 rgba(23, 34, 59, 0.08);
  --shadow: 0 1px 0 rgba(23, 34, 59, 0.06), 0 6px 18px rgba(23, 34, 59, 0.07);
  --shadow-lg: 0 20px 48px rgba(23, 34, 59, 0.18);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 28px;

  --font-display: "Bricolage Grotesque", "Geologica", "Albert Sans", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Albert Sans", "Geologica", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --ring: 0 0 0 3px var(--bg), 0 0 0 6px var(--primary);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0e1628;
  --bg-alt: #121c31;
  --surface: #16213a;
  --surface-2: #1b2743;
  --surface-hover: #22304f;
  --text: #e8edf5;
  --text-muted: #a0adc3;
  --border: #2a3856;
  --border-strong: #3b4b6d;
  --primary: #7ea3ff;
  --primary-strong: #a3bdff;
  --primary-soft: #1b2b52;
  --accent: #ffc21a;
  --accent-soft: #3a3217;
  --success: #3cc79a;
  --danger: #ff7a66;
  --muted: #a0adc3;

  --c-tools: #2f69e6;
  --c-games: #d8452d;
  --c-excel: #11866a;

  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 8px 22px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 22px 52px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ============ BASE ============ */
[hidden] {
  display: none !important;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

a {
  color: var(--primary);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--primary-strong);
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow {
  max-width: 760px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  flex: none;
}

.brand:hover {
  color: var(--text);
}

.brand-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
}

.brand-icon img {
  width: 38px;
  height: 38px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.035em;
}

.brand-name span {
  color: inherit;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.site-nav a,
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font: 600 0.97rem/1 var(--font-sans);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.site-nav a:hover,
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle[aria-expanded="true"] {
  background: var(--surface-hover);
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.theme-toggle,
.mobile-menu-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.theme-toggle:hover,
.mobile-menu-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.theme-toggle:active,
.mobile-menu-toggle:active {
  transform: translateY(1px);
}

.theme-icon {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.theme-icon svg,
.mobile-menu-toggle svg {
  width: 22px;
  height: 22px;
}

.mobile-menu-toggle {
  display: none;
}

/* ============ NAV DROPDOWN ============ */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-caret {
  display: inline-block;
  font-size: 0.8em;
  transition: transform 0.18s var(--ease);
}

.nav-dropdown-toggle[aria-expanded="true"] .nav-dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 120;
  display: none;
  width: min(680px, 86vw);
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 0.75rem;
}

.nav-dropdown-menu.open {
  display: grid;
}

.nav-dropdown-menu .nav-dropdown-group {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 0.25rem 0;
}

.nav-dropdown-menu .nav-dropdown-group-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  font: 700 0.85rem/1.2 var(--font-sans);
  color: var(--text-muted);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.nav-dropdown-menu a:hover {
  background: var(--surface-hover);
}

.nav-dropdown-menu .nav-hint {
  display: block;
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

/* Signal tile (category colour carrying a white or ink pictogram) */
.nav-icon,
.tile {
  --tile: var(--c-tools);
  --tile-fg: var(--c-tools-fg);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--tile);
  color: var(--tile-fg);
}

.nav-icon svg,
.tile svg {
  width: 62%;
  height: 62%;
}

[data-cat="games"] {
  --tile: var(--c-games);
  --tile-fg: var(--c-games-fg);
}

[data-cat="image"] {
  --tile: var(--c-image);
  --tile-fg: var(--c-image-fg);
}

[data-cat="excel"] {
  --tile: var(--c-excel);
  --tile-fg: var(--c-excel-fg);
}

[data-cat="tools"] {
  --tile: var(--c-tools);
  --tile-fg: var(--c-tools-fg);
}

[data-cat="all"] {
  --tile: var(--text);
  --tile-fg: var(--bg);
}

/* ============ MOBILE NAV ============ */
.mobile-nav {
  display: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0.5rem 0 1rem;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.4rem;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.mobile-nav a:hover {
  background: var(--surface-hover);
}

.mobile-nav .nav-icon {
  width: 32px;
  height: 32px;
}

.mobile-nav .mobile-nav-section {
  margin: 0.9rem 0.4rem 0.3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

/* ============ LANGUAGE SWITCHER ============ */
.lang-selector {
  position: relative;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 42px;
  padding: 0 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 700 0.92rem/1 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.lang-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.lang-flag {
  display: inline-grid;
  place-items: center;
}

.lang-flag svg {
  width: 20px;
  height: 20px;
}

.lang-caret {
  font-size: 0.75em;
  color: var(--text-muted);
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 130;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  width: 340px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.lang-menu[hidden] {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: 500 0.95rem/1.2 var(--font-sans);
  text-align: left;
  cursor: pointer;
}

.lang-option:hover {
  background: var(--surface-hover);
}

.lang-option.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.lang-option .lang-flag {
  display: inline-grid;
  place-items: center;
  min-width: 2.1rem;
  height: 1.6rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font: 700 0.72rem/1 var(--font-sans);
  letter-spacing: 0.02em;
}

.lang-option.active .lang-flag {
  background: var(--primary);
  color: #fbfcfd;
}

/* ============ BREADCRUMBS / BACK TO TOP ============ */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 1.25rem 0 0.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumbs a:hover {
  color: var(--text);
  text-decoration: underline;
}

.breadcrumbs .sep {
  opacity: 0.6;
}

.breadcrumbs .current {
  color: var(--text);
  font-weight: 700;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--primary);
  color: #fbfcfd;
}

/* ============ HERO ============ */
.hero {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3.25rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.hero h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(2.6rem, 3.6vw + 1.1rem, 4.6rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero h1 span {
  display: block;
}

.hero-subtitle {
  max-width: 34rem;
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 1.18rem;
  line-height: 1.55;
}

.search-box {
  position: relative;
  max-width: 34rem;
}

.search-box .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  color: var(--text);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 64px;
  padding: 0 3.25rem 0 3.4rem;
  border: 2px solid var(--text);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font: 500 1.08rem/1 var(--font-sans);
  box-shadow: 4px 4px 0 var(--text);
  transition: box-shadow 0.16s var(--ease), transform 0.16s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.search-box input:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--primary);
  border-color: var(--primary);
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover {
  background: var(--surface-hover);
}

.search-hint {
  min-height: 1.5rem;
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-width: 34rem;
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-langs-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.35rem;
  color: var(--text);
  font-weight: 700;
}

.hero-langs-label svg {
  width: 20px;
  height: 20px;
}

.lang-chip {
  min-width: 2.1rem;
  padding: 0.22rem 0.4rem;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: 700 0.74rem/1 var(--font-sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.lang-chip:hover {
  border-color: var(--text);
}

.lang-chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* ============ SLIDER (homepage carousel) ============ */
.slider {
  position: relative;
}

.slider-viewport {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 460px;
  background: var(--c-tools);
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 1.25rem 1.75rem 1.6rem;
  background: var(--tile, var(--c-tools));
  color: var(--tile-fg, var(--c-tools-fg));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0s linear 0.45s;
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s var(--ease), visibility 0s;
}

.slide-art {
  display: grid;
  place-items: center;
  min-height: 0;
}

.slide-art img {
  width: min(100%, 420px);
  height: auto;
  max-height: 290px;
  object-fit: contain;
  transform: translateY(10px);
  transition: transform 0.6s var(--ease);
}

.slide.is-active .slide-art img {
  transform: none;
}

.slide-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem 1.25rem;
}

.slide-title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.45rem, 1.2vw + 1rem, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: inherit;
}

.slide-desc {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  opacity: 0.92;
}

.slide-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.8rem 1.1rem;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.slide-cta svg {
  width: 20px;
  height: 20px;
}

.slide-cta:hover {
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 6px 0 rgba(23, 34, 59, 0.22);
}

.slide-cta:active {
  transform: translateY(1px);
  box-shadow: none;
}

.slide-cta:focus-visible {
  box-shadow: 0 0 0 3px var(--tile), 0 0 0 6px var(--tile-fg);
}

.slider-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.slider-dots {
  display: flex;
  flex: 1;
  gap: 6px;
}

.slider-dot {
  position: relative;
  flex: 1;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.slider-dot::before,
.slider-dot::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 3px;
}

.slider-dot::before {
  right: 0;
  background: var(--border-strong);
}

.slider-dot::after {
  width: 0;
  background: var(--text);
}

.slider-dot[aria-current="true"]::after {
  width: 100%;
}

.slider.is-playing .slider-dot[aria-current="true"]::after {
  width: 0;
  animation: slider-progress var(--slide-ms, 6500ms) linear forwards;
}

@keyframes slider-progress {
  to {
    width: 100%;
  }
}

.slider-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.slider-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.slider-btn:active {
  transform: translateY(1px);
}

.slider-btn svg {
  width: 22px;
  height: 22px;
}

/* ============ SECTIONS ============ */
.section {
  padding: clamp(2.25rem, 5vw, 4rem) 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 44rem;
  margin-bottom: 1.75rem;
}

.section-eyebrow {
  display: none;
}

.section-head h2,
.trust-copy h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 1.6vw + 1.1rem, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.section-head .lead,
.lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.08rem;
}

/* ============ PRIVACY / HOW IT WORKS (pictogram trio) ============ */
.trust-grid {
  display: grid;
  gap: 2rem;
}

.trust-copy {
  max-width: 46rem;
}

.trust-copy p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

.trust-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.mini-feature {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  padding: 1.25rem 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mini-icon {
  display: block;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 6 / 5;
  border-radius: 12px;
  background: var(--surface-2);
}

[data-theme="dark"] .mini-icon {
  background: #eef1f5;
}

.mini-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mini-feature strong {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mini-feature p {
  margin: 0;
  color: var(--text-muted);
}

/* ============ CATEGORY SIGNS ============ */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem 0.4rem 0.4rem;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: 700 1rem/1 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.category-filter .tile {
  width: 34px;
  height: 34px;
}

.category-filter:hover {
  border-color: var(--text);
}

.category-filter:active {
  transform: translateY(1px);
}

.category-filter.active {
  background: var(--tile, var(--text));
  border-color: var(--tile, var(--text));
  color: var(--tile-fg, var(--bg));
}

.category-filter.active .tile {
  background: color-mix(in srgb, var(--tile-fg) 18%, transparent);
  color: var(--tile-fg);
}

.category-filter[data-cat="all"].active .tile {
  background: color-mix(in srgb, var(--bg) 18%, transparent);
}

/* ============ TOOL DIRECTORY (wayfinding board) ============ */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2rem;
  border-top: 2px solid var(--text);
}

.resource-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.2rem 1rem;
  padding: 1rem 0.5rem 1rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.16s var(--ease);
}

.resource-card:hover {
  background: linear-gradient(90deg, var(--surface-hover), transparent 85%);
  color: var(--text);
}

.resource-card:focus-visible {
  border-radius: 12px;
}

.resource-card .tile {
  grid-row: span 2;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  transition: transform 0.18s var(--ease);
}

.resource-card:hover .tile {
  transform: translateX(3px);
}

.resource-card h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.resource-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.97rem;
  line-height: 1.45;
}

.resource-top,
.resource-tags,
.resource-badge,
.resource-cta {
  display: none;
}

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.empty-state h3 {
  color: var(--text);
  font-size: 1.35rem;
}

/* ============ ABOUT ============ */
.feature-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 2.1rem;
  color: var(--text-muted);
}

.feature-list li strong {
  color: var(--text);
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 6px;
  background: var(--c-excel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23FBFCFD' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}

/* ============ AD SLOTS (managed by js/ads.js) ============ */
/* margin-block only: a slot on a .container must keep its auto side margins */
.ad-slot {
  margin-block: 1.5rem;
  display: flex;
  justify-content: center;
}

.ad-slot__box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background:
    repeating-linear-gradient(45deg, var(--surface-2) 0 12px, var(--surface) 12px 24px);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.ad-slot__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ad-slot__note {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.ad-slot--billboard,
.ad-slot--halfpage {
  margin-block: 1.75rem;
}

.ad-slot--halfpage .ad-slot__box {
  max-width: 300px;
}

.ad-slot--anchor {
  position: sticky;
  bottom: 0;
  z-index: 90;
  margin: 0.75rem auto 0;
}

/* ============ LAYOUT: CONTENT + SIDEBAR ============ */
.layout-with-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.5rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 1rem;
  padding-top: clamp(2.25rem, 5vw, 4rem);
}

.sidebar:not(:has(.ad-slot:not([hidden]))) {
  display: none;
}

.layout-with-side:not(:has(.sidebar .ad-slot:not([hidden]))) {
  grid-template-columns: minmax(0, 1fr);
}

/* ============ FEEDBACK FORM ============ */
.feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 46rem;
}

.feedback-form {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-weight: 700;
  font-size: 0.95rem;
}

/* Scoped to the homepage form: tool pages style their own controls in tools.css (radios must stay inline). */
.feedback-form .field input,
.feedback-form .field select,
.feedback-form .field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: 500 1rem/1.4 var(--font-sans);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.feedback-form .field textarea {
  min-height: 140px;
  resize: vertical;
}

.feedback-form .field input:focus,
.feedback-form .field select:focus,
.feedback-form .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.2rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 700 1rem/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.btn:hover {
  background: var(--surface-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fbfcfd;
}

.btn-primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #fbfcfd;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover {
  color: #0e1628;
}

.btn-secondary {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary-strong);
}

.btn-ghost {
  background: none;
  border-color: transparent;
}

.feedback-status {
  min-height: 1.5rem;
  margin-top: 1rem;
  font-weight: 700;
}

.feedback-summary {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ============ FOOTER ============ */
.site-footer {
  margin-top: 1rem;
  padding: 3rem 0 2.5rem;
  background: #17223b;
  color: #c5cedc;
  --text: #fbfcfd;
  --text-muted: #aab5c7;
  --border-strong: #3b4b6d;
  --surface-hover: #22304f;
}

[data-theme="dark"] .site-footer {
  background: #0a1120;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.footer-inner p {
  margin: 0 0 0.5rem;
}

.footer-note {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-cols {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}

.footer-col h3 {
  margin: 0 0 0.8rem;
  color: #fbfcfd;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fbfcfd;
  text-decoration: underline;
}

#footer-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
}

.privacy-settings-button {
  justify-self: start;
  margin-top: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
  font: 600 0.9rem/1 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.privacy-settings-button:hover {
  background: var(--surface-hover);
  color: #fbfcfd;
}

.site-footer :focus-visible {
  box-shadow: 0 0 0 3px #17223b, 0 0 0 6px #7ea3ff;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1060px) {
  .layout-with-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    padding-top: 0;
  }
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .slider-viewport {
    min-height: 430px;
  }
}

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

  .mobile-menu-toggle {
    display: inline-grid;
  }

  .resources-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .trust-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .mini-feature {
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    gap: 0.6rem;
    min-height: 64px;
  }

  .brand-name {
    font-size: 1.2rem;
  }

  .lang-toggle {
    padding: 0 0.55rem;
  }

  .lang-caret {
    display: none;
  }

  .lang-menu {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 72px;
    width: auto;
  }

  .slider-viewport {
    min-height: 470px;
  }

  .slide {
    padding: 1rem 1.1rem 1.25rem;
  }

  .slide-copy {
    grid-template-columns: minmax(0, 1fr);
  }

  .slide-cta {
    justify-self: start;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .mini-feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .mini-icon {
    max-width: 180px;
  }
}

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

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

  .slide-art img {
    transform: none;
  }
}
