/* ==========================================================================
   KEIFA TOOLS HUB — DESIGN SYSTEM & TOKENS
   Refined, Lightweight, Accessible & High-Performance
   ========================================================================== */

:root {
  /* Brand Core Colors */
  --brand: #0b6b58;
  --brand-hover: #075646;
  --brand-active: #054236;
  --brand-subtle: #e8f5f1;
  --brand-glow: rgba(11, 107, 88, 0.12);
  --brand-border: rgba(11, 107, 88, 0.22);

  /* Secondary Accents */
  --accent-gold: #b47116;
  --accent-gold-soft: #fdf8f0;
  --accent-emerald: #059669;

  /* Surfaces & Canvas (Light Mode) */
  --bg-page: #f8faf9;
  --surface-card: #ffffff;
  --surface-card-hover: #ffffff;
  --surface-elevated: #ffffff;
  --surface-subtle: #f1f5f3;
  --surface-glass: rgba(255, 255, 255, 0.95);

  /* Borders & Dividers */
  --border-subtle: #e2e8e5;
  --border-medium: #cbd5d1;
  --border-focus: #0b6b58;

  /* Text & Typography */
  --text-main: #13241f;
  --text-muted: #4b635a;
  --text-faint: #748b82;
  --text-on-brand: #ffffff;

  /* Shadows (Minimal, High-Performance) */
  --shadow-xs: 0 1px 2px rgba(19, 36, 31, 0.04);
  --shadow-sm: 0 2px 5px rgba(19, 36, 31, 0.06);
  --shadow-md: 0 4px 12px rgba(19, 36, 31, 0.07);
  --shadow-lg: 0 10px 24px rgba(19, 36, 31, 0.09);

  /* Layout & Geometry */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --container-max: 1240px;
  --transition-fast: 0.16s ease;
  --transition-smooth: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Design System */
[data-theme="dark"] {
  --brand: #10b981;
  --brand-hover: #34d399;
  --brand-active: #059669;
  --brand-subtle: rgba(16, 185, 129, 0.14);
  --brand-glow: rgba(16, 185, 129, 0.25);
  --brand-border: rgba(16, 185, 129, 0.32);

  --accent-gold: #f59e0b;
  --accent-gold-soft: rgba(245, 158, 11, 0.12);
  --accent-emerald: #10b981;

  --bg-page: #08100e;
  --surface-card: #0f1c18;
  --surface-card-hover: #142420;
  --surface-elevated: #152722;
  --surface-subtle: #13211d;
  --surface-glass: rgba(15, 28, 24, 0.95);

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-focus: #10b981;

  --text-main: #f2fbf7;
  --text-muted: #95aca3;
  --text-faint: #627970;
  --text-on-brand: #052018;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.65);
}

/* Base Reset & Core Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Readex Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-page);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-page);
}

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

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

input, select {
  font-family: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Accessibility: Focus Visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   Header & Sticky Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow var(--transition-fast);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-main);
  transition: opacity var(--transition-fast);
}

.brand:hover {
  opacity: 0.88;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: var(--brand);
  color: var(--text-on-brand);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 6px var(--brand-glow);
}

.brand-text strong {
  color: var(--brand);
  font-weight: 700;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: var(--brand-subtle);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  white-space: nowrap;
}

.brand-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  padding: 0.35rem 0.2rem;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lang-toggle-btn,
.theme-toggle-btn,
.header-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.lang-toggle-btn:hover,
.theme-toggle-btn:hover,
.header-search-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-main);
  background: var(--surface-subtle);
}

.header-search-btn kbd {
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 0.68rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  color: var(--text-faint);
}

.btn-portal-main {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background var(--transition-fast);
  white-space: nowrap;
}

.btn-portal-main:hover {
  background: var(--brand-hover);
}

/* ==========================================================================
   Section 1 — Compact Hero (Phase 2 Requirement)
   ========================================================================== */

.hero-compact {
  padding: 2.25rem 0 1.5rem;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, var(--surface-subtle) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-container {
  max-width: 860px;
  margin: 0 auto;
}

.hero-kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

/* Hero Search Field */
.hero-search-wrapper {
  max-width: 640px;
  margin: 0 auto 1.25rem;
}

.hero-search-box {
  display: flex;
  align-items: center;
  background: var(--surface-card);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.hero-search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--brand-glow), var(--shadow-md);
}

.search-icon-box {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  flex-shrink: 0;
  margin-left: 0.5rem;
}

[dir="ltr"] .search-icon-box {
  margin-left: 0;
  margin-right: 0.5rem;
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.98rem;
  outline: none;
  padding: 0.4rem 0.25rem;
}

.hero-search-input::placeholder {
  color: var(--text-faint);
  font-size: 0.92rem;
}

.search-clear-btn {
  display: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.search-clear-btn.visible {
  display: inline-flex;
}

.search-clear-btn:hover {
  background: var(--border-medium);
  color: var(--text-main);
}

.search-kbd-hint {
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 0.72rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  color: var(--text-faint);
  flex-shrink: 0;
}



/* ==========================================================================
   Section 2 — Tools Directory (Phase 2 Requirement)
   ========================================================================== */

.tools-section {
  padding: 2.5rem 0 3.5rem;
  flex: 1;
}

.section-header-compact {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.section-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

/* Controls Toolbar */
.tools-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-pills-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--border-medium);
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
  font-weight: 600;
  box-shadow: 0 2px 6px var(--brand-glow);
}

.pill-count {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text-on-brand);
}

.controls-secondary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sort-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sort-select {
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}

.sort-select:hover,
.sort-select:focus {
  border-color: var(--border-focus);
}

.view-toggle-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  padding: 2px;
}

.view-toggle-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text-faint);
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  color: var(--text-main);
}

.view-toggle-btn.active {
  background: var(--brand);
  color: var(--text-on-brand);
}

.view-toggle-btn svg {
  width: 16px;
  height: 16px;
}

/* Results Status Bar */
.results-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Tool Cards Grid (Phase 3 Requirement)
   ========================================================================== */

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

/* List View Alternative */
.tools-grid.list-view {
  grid-template-columns: 1fr;
}

.tools-grid.list-view .tool-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
}

.tools-grid.list-view .tool-card-body {
  margin-bottom: 0;
}

.tools-grid.list-view .tool-card-actions {
  flex-direction: column;
  width: 170px;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* Card Structure */
.tool-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition-fast);
  position: relative;
  box-shadow: var(--shadow-xs);
}

.tool-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card[data-upcoming="true"] {
  border-style: dashed;
  background: var(--surface-subtle);
}

.tool-card[data-upcoming="true"]:hover {
  transform: none;
  box-shadow: var(--shadow-xs);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tool-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.tool-card:hover .tool-icon-wrap {
  transform: scale(1.05);
}

.tool-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.tool-badge-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.tool-badge-pill.badge-highlight {
  background: var(--brand-subtle);
  color: var(--brand);
  border-color: var(--brand-border);
}

.tool-badge-pill.badge-upcoming {
  background: var(--accent-gold-soft);
  color: var(--accent-gold);
  border-color: rgba(180, 113, 22, 0.25);
}

.tool-card-title-group {
  margin-bottom: 0.5rem;
}

.tool-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.tool-kicker {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--brand);
}

.tool-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.tool-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.feature-pill svg {
  color: var(--brand);
  flex-shrink: 0;
}

/* Card Actions */
.tool-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-launch-tool {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: 0.86rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.btn-launch-tool:hover {
  background: var(--brand-hover);
  box-shadow: 0 2px 8px var(--brand-glow);
}

.btn-launch-tool svg {
  width: 15px;
  height: 15px;
  transition: transform var(--transition-fast);
}

.btn-launch-tool:hover svg {
  transform: translateX(-3px);
}

[dir="ltr"] .btn-launch-tool:hover svg {
  transform: translateX(3px);
}

.btn-spec-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-spec-details:hover {
  background: var(--surface-card);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-coming-soon {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-faint);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: not-allowed;
  white-space: nowrap;
}

/* Empty State */
.empty-state {
  display: none;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  margin-top: 1rem;
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: var(--text-faint);
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto 1.25rem;
}

.btn-reset-search {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.btn-reset-search:hover {
  background: var(--brand-hover);
}

/* ==========================================================================
   Section 3 — What's New (Phase 2 Requirement)
   ========================================================================== */

.whats-new-section {
  padding: 2.25rem 0;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.whats-new-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.whats-new-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.whats-new-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--brand);
  color: var(--text-on-brand);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.whats-new-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.whats-new-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.whats-new-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.whats-new-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.whats-new-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.whats-new-version {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
}

.whats-new-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.whats-new-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.whats-new-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
  transition: gap var(--transition-fast);
}

.whats-new-link:hover {
  color: var(--brand-hover);
  gap: 0.45rem;
}

.whats-new-link svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Section 4 — Supporting SEO Content & Engineering Integration
   ========================================================================== */

.supporting-seo-section {
  padding: 3rem 0;
}

.seo-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.seo-text-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.seo-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seo-card-title svg {
  width: 20px;
  height: 20px;
  color: var(--brand);
}

.seo-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.seo-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.seo-link-item a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--brand);
  transition: color var(--transition-fast);
}

.seo-link-item a:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

.seo-link-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
  flex-shrink: 0;
}

/* Governing Standards Strip */
.standards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.standard-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.standard-code {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 0.25rem;
}

.standard-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* FAQ Accordion */
.faq-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.faq-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.faq-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

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

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item[open] {
  border-color: var(--brand-border);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon {
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
  color: var(--brand);
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Specification Modal
   ========================================================================== */

.spec-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.spec-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.spec-modal-card {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--surface-card);
  z-index: 2;
}

.modal-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.modal-icon-box svg {
  width: 22px;
  height: 22px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-kicker {
  font-size: 0.78rem;
  color: var(--brand);
  font-weight: 500;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface-subtle);
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--border-medium);
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-desc-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.modal-feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-feature-item svg {
  color: var(--accent-emerald);
  flex-shrink: 0;
}

.modal-standards-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--surface-card);
  position: sticky;
  bottom: 0;
}

.modal-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: 0.86rem;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.modal-launch-btn:hover {
  background: var(--brand-hover);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--surface-card);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-bio p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 0.75rem;
  max-width: 320px;
}

.footer-col-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--brand);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-scroll-top {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.btn-scroll-top:hover {
  color: var(--brand);
}

/* ==========================================================================
   Responsive Adaptations (Phase 5 Requirement)
   Desktop: 3 columns, Tablet: 2 columns, Mobile: 1 column
   ========================================================================== */

@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .whats-new-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .standards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 992px) {
  .nav-links {
    display: none;
  }
  .header-search-btn {
    display: none; /* Hero search is right below; avoid header clutter */
  }
}

@media (max-width: 768px) {
  .brand-badge {
    display: none;
  }
  .nav {
    height: 58px;
    padding: 0 0.75rem;
  }
  .nav-actions {
    gap: 0.35rem;
  }
  .lang-toggle-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    height: 34px;
  }
  .theme-toggle-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
  }
  .btn-portal-main {
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
    height: 34px;
  }
  .hero-title {
    font-size: 1.45rem;
  }
  .hero-desc {
    font-size: 0.92rem;
  }

  .search-kbd-hint {
    display: none; /* Hide / shortcut on touch devices */
  }
  .seo-content-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav {
    height: 54px;
    padding: 0 0.65rem;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    border-radius: 8px;
  }
  .brand-text strong {
    font-size: 1.02rem;
  }
  .hero-compact {
    padding: 1.25rem 0 0.85rem;
  }
  .hero-kicker-pill {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    margin-bottom: 0.6rem;
  }
  .hero-title {
    font-size: 1.25rem;
    line-height: 1.35;
    margin-bottom: 0.45rem;
  }
  .hero-desc {
    font-size: 0.84rem;
    line-height: 1.5;
    margin-bottom: 0.85rem;
  }
  .tools-section {
    padding: 1.25rem 0 2.5rem;
  }
  .section-kicker {
    display: none; /* Hide redundant kicker on small screens */
  }
  .section-title {
    font-size: 1.2rem;
  }
  .tools-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }
  .filter-pills-wrap {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-bottom: 0;
    overflow-x: visible;
  }
  .filter-pill {
    padding: 0.38rem 0.72rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }
  .controls-secondary {
    justify-content: space-between;
    width: 100%;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .tool-card {
    padding: 1rem;
  }
  .whats-new-grid {
    grid-template-columns: 1fr;
  }
  .standards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .brand-text strong {
    font-size: 0.95rem;
  }
  .btn-portal-main span {
    font-size: 0.74rem;
  }
  .nav-actions {
    gap: 0.25rem;
  }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* LTR Specific Adjustments */
[dir="ltr"] .brand-mark {
  font-family: 'Plus Jakarta Sans', sans-serif;
}
