/* ==========================================================================
   Work Ensemble — Modern Commerce & Marketing Prototype
   Design System & Global Stylesheet
   ========================================================================== */

/* Cross-Document View Transitions (MPA progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: 180ms ease-out both page-fade-out;
  }

  ::view-transition-new(root) {
    animation: 220ms ease-in both page-fade-in;
  }
}

@keyframes page-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

:root {
  /* Palette — Warm Editorial Commerce */
  --bg: #faf9f6;
  --bg-alt: #f2efe9;
  --surface: #ffffff;
  --surface-tint: #e8f3ef;
  --surface-warm: #fdf1ec;
  --ink: #11221e;
  --ink-soft: #2e403b;
  --muted: #51635e;
  --border: #e2dfd7;
  --border-strong: #c9c4b8;

  /* Brand Accents */
  --primary: #0e6655;
  --primary-hover: #0a4e41;
  --primary-soft: #d9eee8;
  --accent: #d95333;
  --accent-hover: #b84125;
  --accent-soft: #fbe5de;

  /* Dark Surface Tokens */
  --dark-bg: #11221e;
  --dark-surface: #19312b;
  --dark-border: rgba(255, 255, 255, 0.14);
  --dark-text: #f5f7f6;
  --dark-muted: #b6c8c2;

  /* Semantic Status */
  --error: #c5221f;
  --error-bg: #fce8e6;
  --warn: #9a5b00;
  --warn-bg: #fef3dc;
  --success: #137333;
  --success-bg: #e6f4ea;

  /* Typography */
  --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout & Rhythm */
  --container: 1180px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(17, 34, 30, 0.05);
  --shadow-md: 0 10px 30px rgba(17, 34, 30, 0.08);
  --shadow-lg: 0 22px 48px rgba(17, 34, 30, 0.12);

  --header-h: 76px;
}

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

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Utilities */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 1000;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.section {
  padding-block: clamp(3.75rem, 6.5vw, 6rem);
}

.section--alt {
  background-color: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section--dark {
  background-color: var(--dark-bg);
  color: var(--dark-text);
}

.section--dark p,
.section--dark li {
  color: var(--dark-muted);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: #ffffff;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  margin-top: 0;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.25rem, 4.3vw, 3.55rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  font-weight: 700;
  margin-bottom: 0.9rem;
}

h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.42rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

p {
  margin-top: 0;
  color: var(--muted);
}

.lead {
  font-size: clamp(1.06rem, 1.35vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 62ch;
}

.section--dark .lead {
  color: var(--dark-muted);
}

.meta-line {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.section-header {
  max-width: 68ch;
  margin-bottom: clamp(2.15rem, 4vw, 3.15rem);
}

.section-header--center {
  text-align: center;
  margin-inline: auto;
}

.section-header--center .lead {
  margin-inline: auto;
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
  padding: 0.85rem 1.45rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

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

.btn--primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(14, 102, 85, 0.22);
}

.btn--primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(14, 102, 85, 0.28);
}

.btn--accent {
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(217, 83, 51, 0.24);
}

.btn--accent:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
}

.btn--secondary {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  background-color: var(--bg-alt);
  color: var(--ink);
  border-color: var(--ink);
}

.btn--ghost-dark {
  background-color: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.btn--ghost-dark:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: #ffffff;
}

.btn--sm {
  padding: 0.62rem 1.15rem;
  font-size: 0.88rem;
}

/* ==========================================================================
   Site Header & Navigation (Always High-Contrast, Sticky, Single-Line Desktop)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(250, 249, 246, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

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

.brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 32, 50, 0.18);
}

.brand__sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--primary);
  line-height: 1.15;
  margin-top: 2px;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.48rem 0.78rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}

.nav-link:hover {
  background-color: var(--bg-alt);
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  background-color: var(--surface-tint);
  color: var(--primary);
}

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

.header-cta .btn {
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-mobile {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem 1.25rem 1.5rem;
}

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

.nav-mobile__list {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.nav-mobile__list a {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.nav-mobile__list a[aria-current="page"] {
  background: var(--surface-tint);
  color: var(--primary);
}

@media (max-width: 1120px) {
  .nav-desktop,
  .header-cta {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

/* ==========================================================================
   Hero & Page Headers
   ========================================================================== */
.hero {
  padding-block: clamp(3rem, 6vw, 5.25rem) clamp(3rem, 5vw, 4.5rem);
  position: relative;
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 4.5vw, 4rem);
  align-items: center;
}

@media (max-width: 920px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
}

.hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1.85rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

.hero__proof span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.check-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Subpage Hero */
.page-hero {
  padding-block: clamp(2.75rem, 5vw, 4.25rem);
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

/* ==========================================================================
   Visual Architecture Diagrams & Mockups
   ========================================================================== */
.ensemble-board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.ensemble-board__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

.ensemble-board__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface-tint);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.flow-stack {
  display: grid;
  gap: 0.85rem;
}

.flow-node {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.05rem;
  background: var(--bg);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
}

.flow-node--hub {
  background: var(--dark-bg);
  border-color: var(--dark-bg);
  color: #ffffff;
}

.flow-node--hub .flow-node__label {
  color: #ffffff;
}

.flow-node--hub .flow-node__meta {
  color: var(--dark-muted);
}

.flow-node__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  flex-shrink: 0;
}

.flow-node--hub .flow-node__icon {
  background: rgba(155, 229, 210, 0.16);
  border-color: rgba(155, 229, 210, 0.28);
  color: #9be5d2;
}

.flow-node__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.25;
}

.flow-node__meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

.flow-node__badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  white-space: nowrap;
}

.flow-node--hub .flow-node__badge {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.flow-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  margin-block: -0.25rem;
}

.flow-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .flow-split {
    grid-template-columns: 1fr;
  }
}

.flow-mini {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.flow-mini__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  margin: 0 0 0.25rem;
}

.flow-mini__desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

/* ==========================================================================
   Logo / Platform Strip
   ========================================================================== */
.ecosystem-strip {
  border-block: 1px solid var(--border);
  background: var(--surface);
  padding-block: 1.5rem;
}

.ecosystem-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.ecosystem-strip__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
}

.platform-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.platform-pill {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-pill);
}

.platform-pill--featured {
  background: var(--surface-tint);
  border-color: #b7ddd1;
  color: var(--primary);
}

/* ==========================================================================
   Grids & Cards
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

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

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

@media (max-width: 960px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

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

.card--featured {
  border: 2px solid var(--primary);
  position: relative;
  box-shadow: var(--shadow-md);
}

.card--dark {
  background: var(--dark-surface);
  border-color: var(--dark-border);
  color: var(--dark-text);
}

.card--dark h3,
.card--dark h4 {
  color: #ffffff;
}

.card--dark p,
.card--dark li {
  color: var(--dark-muted);
}

.card--dark strong {
  color: #ffffff;
}

.card--dark a {
  color: #9be5d2;
}

.card--dark a:hover {
  color: #ffffff;
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-tint);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 1.2rem;
}

.card__icon--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.card__footer {
  margin-top: auto;
  padding-top: 1.25rem;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--primary);
  text-decoration: none;
}

.card__link:hover {
  text-decoration: underline;
}

.check-list {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.check-list li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.section--dark .check-list li,
.card--dark .check-list li {
  color: var(--dark-muted);
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 800;
}

.section--dark .check-list li::before,
.card--dark .check-list li::before {
  color: #9be5d2;
}

/* Stat / Metric Callouts */
.metric-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (max-width: 720px) {
  .metric-band {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
}

.metric-card__value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: #9be5d2;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.metric-card__label {
  font-size: 0.9rem;
  color: var(--dark-muted);
  margin: 0;
}

/* ==========================================================================
   Interactive Estimator (shopify.html)
   ========================================================================== */
.estimator {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 880px) {
  .estimator {
    grid-template-columns: 1fr;
  }
}

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

.estimator__group-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip-option {
  position: relative;
}

.chip-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip-option label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 150ms ease;
}

.chip-option input:checked + label {
  background: var(--surface-tint);
  border-color: var(--primary);
  color: var(--primary);
}

.chip-option input:focus-visible + label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.estimator__result {
  background: var(--dark-bg);
  color: var(--dark-text);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  box-shadow: var(--shadow-lg);
}

.estimator__result h3 {
  color: #ffffff;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.estimator__price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: #9be5d2;
  margin: 0.75rem 0 0.25rem;
}

.estimator__timeline {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--dark-muted);
  margin-bottom: 1.25rem;
}

.estimator__list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 1rem 0;
  border-block: 1px solid var(--dark-border);
  display: grid;
  gap: 0.5rem;
}

.estimator__list li {
  font-size: 0.9rem;
  color: var(--dark-text);
  padding-left: 1.35rem;
  position: relative;
}

.estimator__list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #9be5d2;
}

/* ==========================================================================
   Interactive Tab Switcher (local-seo-aeo.html & seo-aeo-audit.html)
   ========================================================================== */
.preview-switcher {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.preview-tab {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.preview-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.preview-panel {
  padding: 1.75rem;
}

.preview-panel[hidden] {
  display: none;
}

.serp-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.serp-query {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.1rem;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}

.serp-result {
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
}

.serp-result__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  flex-wrap: wrap;
}

.serp-rating {
  font-size: 0.85rem;
  font-weight: 700;
  color: #b45309;
}

.serp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.serp-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: var(--surface-tint);
  color: var(--primary);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
}

.code-card {
  background: #0d1b18;
  color: #e4f2ee;
  border-radius: var(--radius-md);
  padding: 1.35rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  border: 1px solid rgba(155, 229, 210, 0.18);
}

/* Audit Score Status Indicators (Text + Icon + Color) */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.score-badge--pass {
  background: var(--success-bg);
  color: var(--success);
}

.score-badge--warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.score-badge--fail {
  background: var(--error-bg);
  color: var(--error);
}

/* ==========================================================================
   Instant URL SEO & AEO Auditor (seo-aeo-audit.html)
   ========================================================================== */
.audit-tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-lg);
}

.audit-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: start;
}

@media (max-width: 680px) {
  .audit-bar {
    grid-template-columns: 1fr;
  }
}

.audit-bar .field {
  margin-bottom: 0;
}

.audit-bar__btn {
  margin-top: 2.85rem;
  min-height: 48px;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .audit-bar__btn {
    margin-top: 0;
    width: 100%;
  }
}

.sample-urls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.sample-urls__list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sample-url-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface-tint);
  border: 1px solid #c5e3da;
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.sample-url-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.audit-scanning {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
}

.audit-scanning__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.audit-scanning__top strong {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--ink);
}

.audit-scanning__pct {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
}

.audit-scanning__detail {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.audit-progress-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
  margin-top: 0.9rem;
}

.audit-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-pill);
  transition: width 450ms ease;
}

.scan-dimensions {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scan-dimensions li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.32rem 0.72rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: all 200ms ease;
}

.scan-dimensions li.is-active {
  border-color: var(--primary);
  background: var(--surface-tint);
  color: var(--primary);
}

.scan-dimensions li.is-done {
  border-color: #b7dfc4;
  background: var(--success-bg);
  color: var(--success);
}

.scan-dimensions li.is-done::before {
  content: "✓ ";
}

.scan-dimensions li.is-active::before {
  content: "● ";
}

.audit-results {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 1.75rem;
}

.audit-results[hidden] {
  display: none;
}

.audit-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr);
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 820px) {
  .audit-summary-grid {
    grid-template-columns: 1fr;
  }
}

.score-hero-card {
  background: var(--dark-bg);
  color: var(--dark-text);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

@media (max-width: 480px) {
  .score-hero-card {
    flex-direction: column;
    text-align: center;
  }
}

.score-ring {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring__bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 9;
}

.score-ring__fg {
  fill: none;
  stroke: #9be5d2;
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 450ms ease;
}

.score-ring__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
}

.score-ring__value small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dark-muted);
  margin-top: -0.35rem;
}

.score-hero-card h3 {
  color: #ffffff;
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.score-hero-card p {
  color: var(--dark-muted);
  font-size: 0.88rem;
  margin-bottom: 0;
}

.detected-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

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

@media (max-width: 520px) {
  .detected-meta {
    grid-template-columns: 1fr;
  }
}

.detected-item__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detected-item__val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  margin-top: 2px;
}

.subscore-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 1020px) {
  .subscore-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 440px) {
  .subscore-row {
    grid-template-columns: 1fr;
  }
}

.subscore-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}

.subscore-pill__name {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.subscore-pill__num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}

/* Gated Fix List Box */
.fixes-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.fixes-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.fix-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.fix-item--locked {
  opacity: 0.72;
  background: repeating-linear-gradient(
    -45deg,
    var(--surface),
    var(--surface) 10px,
    var(--bg-alt) 10px,
    var(--bg-alt) 20px
  );
}

.fix-item__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--ink);
}

.fix-item__detail {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.fix-unlock-box {
  margin-top: 1.25rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-md);
  background: var(--dark-bg);
  color: var(--dark-text);
}

.fix-unlock-box h4 {
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.fix-unlock-box p {
  color: var(--dark-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.fix-unlock-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
}

@media (max-width: 620px) {
  .fix-unlock-form {
    grid-template-columns: 1fr;
  }
}

.fix-unlock-form .field {
  margin-bottom: 0;
}

.fix-unlock-box .field label {
  color: #ffffff;
}

.fix-unlock-box .field .hint {
  color: var(--dark-muted);
}

.fix-unlock-box input[type="email"] {
  background: #ffffff;
  color: var(--ink);
}

.fix-unlock-box .error-msg {
  color: #ffb4ab;
}

.fix-unlock-box .form-success p {
  color: var(--ink);
}

.fix-unlock-form__btn {
  margin-top: 2.85rem;
  min-height: 46px;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .fix-unlock-form__btn {
    margin-top: 0;
    width: 100%;
  }
}

/* ==========================================================================
   Pricing & Responsive Data Tables (per Modern Web Guidance responsive-table)
   ========================================================================== */
.price-tag {
  font-family: var(--font-display);
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  margin: 0.65rem 0 0.3rem;
}

.price-tag span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}

.comparison-table caption {
  text-align: left;
  padding: 1rem 1.2rem 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 0.98rem;
}

.comparison-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.comparison-table th,
.comparison-table td {
  text-align: left;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.comparison-table thead th {
  background: var(--bg-alt);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

.comparison-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--surface);
  font-weight: 700;
  color: var(--ink);
  z-index: 1;
}

.comparison-table tbody tr:last-child th,
.comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.comparison-table td {
  color: var(--ink-soft);
}

@container (width < 600px) {
  .comparison-table,
  .comparison-table thead,
  .comparison-table tbody,
  .comparison-table tr,
  .comparison-table th,
  .comparison-table td {
    display: block;
  }

  .comparison-table thead {
    display: none;
  }

  .comparison-table tbody tr {
    margin: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .comparison-table tbody th {
    position: sticky;
    inset-block-start: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
  }

  .comparison-table td {
    border-bottom: 1px solid var(--border);
  }

  .comparison-table td:last-child {
    border-bottom: 0;
  }

  .comparison-table td:nth-child(2)::before {
    content: var(--col-2) ": ";
    font-weight: 700;
    color: var(--ink);
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
  }

  .comparison-table td:nth-child(3)::before {
    content: var(--col-3) ": ";
    font-weight: 700;
    color: var(--ink);
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
  }

  .comparison-table td:nth-child(4)::before {
    content: var(--col-4) ": ";
    font-weight: 700;
    color: var(--ink);
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
  }
}

/* ==========================================================================
   Accessible Accordion (<details> per Modern Web Guidance)
   ========================================================================== */
.accordion {
  display: grid;
  gap: 0.85rem;
  max-width: 820px;
}

.accordion--center {
  margin-inline: auto;
}

.accordion details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 180ms ease;
}

.accordion details[open] {
  border-color: var(--primary);
}

.accordion summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.03rem;
  color: var(--ink);
  cursor: pointer;
}

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

.accordion summary::before {
  content: "";
  inline-size: 1.05em;
  block-size: 1.05em;
  flex-shrink: 0;
  background-color: var(--primary);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}

.accordion details[open] > summary::before {
  rotate: 0deg;
}

.accordion details::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.accordion details:not([open])::details-content {
  block-size: 0;
}

.accordion details[open]::details-content {
  block-size: auto;
}

.accordion__body {
  padding: 0.1rem 1.35rem 1.35rem 3.15rem;
  color: var(--muted);
  font-size: 0.96rem;
}

.accordion__body p {
  margin-bottom: 0.75rem;
}

.accordion__body p:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .accordion summary::before {
    transition: rotate 200ms ease;
  }

  .accordion details::details-content {
    transition: block-size 280ms ease-in-out, content-visibility 280ms ease-in-out allow-discrete;
  }
}

/* ==========================================================================
   Accessible Forms (contact.html & seo-aeo-audit.html)
   ========================================================================== */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 880px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-md);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 620px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

.form-grid .field {
  margin-bottom: 0;
}

.field label,
.field legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.hint {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
  margin-bottom: 0.45rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.9rem;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
}

.field fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.35rem;
}

@media (max-width: 560px) {
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

.checkbox-tile {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.checkbox-tile input {
  margin-top: 0.22rem;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.checkbox-tile:has(input:checked) {
  border-color: var(--primary);
  background: var(--surface-tint);
  color: var(--ink);
}

.error-msg {
  display: none;
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.4rem;
}

:is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--error);
  background-color: var(--error-bg);
}

:is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) + .error-msg {
  display: block;
}

:is(input, select, textarea):is(:user-valid, .user-valid-fallback) {
  border-color: var(--success);
}

.form-success {
  background: var(--success-bg);
  border: 1.5px solid var(--success);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: var(--ink);
}

.form-success h3 {
  color: var(--success);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   CTA Banner & Footer
   ========================================================================== */
.cta-banner {
  background: linear-gradient(135deg, var(--dark-bg) 0%, #163a31 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4.5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto;
  gap: 1.75rem;
  align-items: center;
}

@media (max-width: 780px) {
  .cta-banner {
    grid-template-columns: 1fr;
  }
}

.cta-banner h2 {
  color: #ffffff;
  margin-bottom: 0.65rem;
}

.cta-banner p {
  color: var(--dark-muted);
  margin-bottom: 0;
  max-width: 56ch;
}

.site-footer {
  background: var(--dark-bg);
  color: var(--dark-muted);
  padding-block: 4rem 2.25rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 2.25rem;
  padding-bottom: 2.75rem;
  border-bottom: 1px solid var(--dark-border);
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.site-footer .brand {
  color: #ffffff;
  margin-bottom: 0.9rem;
}

.site-footer .brand__sub {
  color: #9be5d2;
}

.site-footer h3 {
  color: #ffffff;
  font-size: 0.94rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

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

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  color: #91aaa3;
}
