/* ==========================================================================
   AIImageSearchTechniques.com — Design System & Editorial Stylesheet
   Baseline: Approved mock v2 with Readability Overhaul & Varied Editorial Layouts
   ========================================================================== */

:root {
  /* Color Palette — Warm Ivory, Dark Green/Charcoal, Restrained Lime/Sage Accents */
  --ink: #13231f;
  --ink-2: #24352f;
  --forest: #1e4439;
  --forest-2: #2f5d50;
  --paper: #f4f0e7;
  --paper-2: #ebe5d9;
  --paper-3: #ddd5c6;
  --white: #fbfaf6;
  --lime: #d5e56d;
  --sage: #a8b99d;
  --rust: #a46245;
  --plum: #62566a;
  --sky: #8baab0;
  --muted: #505c56; /* Calibrated for WCAG AA 4.5:1 on ivory */
  --rule: rgba(19, 35, 31, 0.18);
  --rule-strong: rgba(19, 35, 31, 0.42);
  --shadow: 0 24px 70px rgba(19, 35, 31, 0.11);
  --shadow-sm: 0 6px 20px rgba(19, 35, 31, 0.06);

  /* Typography Tokens */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

  /* Sizing & Layout */
  --max: 1460px;
  --content-max: 72ch;
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--paper);
  font-size: 18px; /* Base 18px */
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px; /* Main body copy: 18px */
  line-height: 1.7; /* Comfortable line-height 1.65–1.75 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle architectural grid texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(90deg, transparent 0, transparent 119px, rgba(19, 35, 31, 0.018) 120px),
    repeating-linear-gradient(0deg, transparent 0, transparent 119px, rgba(19, 35, 31, 0.012) 120px);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: var(--lime);
  color: var(--ink);
}

/* Accessibility Focus States */
:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Typography & Layout Primitives */
.shell {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}

.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* Eyebrows / Technical Labels: 12px minimum */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hairline {
  border-top: 1px solid var(--rule);
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

p {
  font-size: 18px;
  line-height: 1.7;
  max-width: var(--content-max);
}

.lead, .deck {
  font-size: 21px; /* Lead / deck copy: 20–21px */
  line-height: 1.65;
  color: #2b3933;
  max-width: 820px;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 6.8vw, 110px);
  line-height: 0.88;
  letter-spacing: -0.055em;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 4.4vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
}

.sub-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

/* Section Containers */
.section {
  padding: 104px 0;
  border-bottom: 1px solid var(--rule);
}

.section.tight {
  padding: 72px 0;
}

.section.dark {
  background-color: var(--ink);
  color: var(--paper);
}

.section.dark p {
  color: #d1dad4;
}

.section.dark .lead {
  color: #e5ece7;
}

.section.paper2 {
  background-color: var(--paper-2);
}

.section.white {
  background-color: var(--white);
}

.kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 38px;
}

.section.dark .kicker-row {
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

.kicker-row span:last-child {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.section.dark .kicker-row span:last-child {
  color: #9cb0a4;
}

/* Buttons: 14px */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  padding: 13px 22px;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
  text-decoration: none;
  line-height: 1.2;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--ink);
  color: var(--paper);
}

.btn-dark:hover {
  background: var(--forest);
  border-color: var(--forest);
}

.btn-lime {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}

.btn-lime:hover {
  background: #c3d653;
  border-color: #c3d653;
}

.btn-ghost-light {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--paper);
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--paper);
}

/* Header & Primary Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 240, 231, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

.header-row {
  height: 82px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo {
  height: 46px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  object-position: left center;
  filter: saturate(0.9) contrast(1.05);
}

.brand-kicker {
  border-left: 1px solid var(--rule);
  padding-left: 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 130px;
}

/* Navigation: 15px */
.primary-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}

.primary-nav a {
  position: relative;
  padding: 30px 0 26px;
  color: var(--ink);
  transition: color 0.18s ease;
}

.primary-nav a:hover,
.primary-nav a.active {
  color: var(--forest);
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 22px;
  height: 2px;
  background: var(--ink);
  transition: right 0.22s ease;
}

.primary-nav a:hover::after,
.primary-nav a.active::after {
  right: 0;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-btn {
  display: none;
  width: 46px;
  height: 46px;
  background: transparent;
  border: 1px solid var(--rule-strong);
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mobile-drawer {
  display: none;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  padding: 24px 24px 32px;
}

.mobile-drawer.open {
  display: grid;
  gap: 8px;
}

.mobile-drawer a {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 17px;
  font-weight: 500;
}

/* ==========================================================================
   Homepage Hero Layout
   ========================================================================== */
.home-hero {
  border-bottom: 1px solid var(--rule);
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(580px, 1.1fr);
}

.hero-copy {
  padding: 72px clamp(28px, 4.2vw, 72px) 64px max(24px, calc((100vw - min(100vw - 48px, var(--max))) / 2));
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-copy .display {
  margin: 28px 0 28px;
  max-width: 820px;
}

.hero-copy .display em {
  font-style: italic;
  color: var(--forest-2);
}

.hero-definition {
  max-width: 680px;
  font-size: 19px;
  line-height: 1.7;
  color: #384640;
}

.hero-definition strong {
  color: var(--ink);
}

.hero-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.hero-notes b {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  display: block;
}

.hero-notes span {
  display: block;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Hero Visual Search Analyzer (Instrument)
   ========================================================================== */
.hero-tool {
  background: var(--paper-2);
  padding: 38px max(24px, calc((100vw - min(100vw - 48px, var(--max))) / 2)) 40px clamp(24px, 3.2vw, 56px);
  display: flex;
  align-items: center;
}

.instrument {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  min-height: 660px;
  display: flex;
  flex-direction: column;
}

.instrument-head {
  height: 62px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.instrument-head .live {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cad3c9;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(213, 229, 109, 0.18);
}

.instrument-body {
  display: grid;
  grid-template-columns: 190px 1fr;
  flex: 1;
}

.tool-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px 14px;
  background: #0f1c19;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-sidebar .group {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7d8b83;
  padding: 12px 10px 6px;
}

.tool-tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: #b5c2b9;
  font-size: 14px;
  text-align: left;
  transition: all 0.18s ease;
}

.tool-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
}

.tool-tab.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(213, 229, 109, 0.35);
  color: var(--lime);
  font-weight: 600;
}

.tool-tab span:last-child {
  font-family: var(--mono);
  font-size: 12px;
  opacity: 0.7;
}

.tool-main {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tool-start h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 2.5vw, 32px);
  font-weight: 400;
  margin: 10px 0 12px;
}

.tool-start p {
  font-size: 15px; /* SaaS interface text: 14–15px */
  line-height: 1.62;
  color: #bec7c1;
  max-width: 580px;
  margin-bottom: 22px;
}

.input-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
  width: fit-content;
}

.input-switch button {
  background: transparent;
  border: none;
  color: #bcc6bf;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: 0.16s ease;
}

.input-switch button.active {
  background: var(--lime);
  color: var(--ink);
}

.dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  min-height: 165px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dropzone:hover {
  border-color: var(--lime);
  background: rgba(213, 229, 109, 0.04);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.dropzone small {
  font-size: 13px; /* Captions / helper: 12–13px */
  color: #9aa8a0;
}

.dropzone .preview-image {
  max-height: 140px;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.url-entry {
  display: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 24px;
  margin-bottom: 16px;
}

.url-entry.active {
  display: block;
}

.url-entry input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--paper);
  padding: 12px 16px;
  font-size: 15px;
  margin-top: 10px;
}

.url-entry input:focus {
  border-color: var(--lime);
  outline: none;
}

.url-entry p {
  font-size: 14px;
  color: #9ba79f;
  margin: 12px 0 0;
}

.analyze-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.analyze-note {
  font-size: 13px;
  color: #9cb0a4;
}

/* Analyzer Scanning State */
.scan {
  display: none;
  padding: 20px 0;
}

.scan.active {
  display: block;
}

.scan-steps {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.scan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  font-size: 14px;
}

.scan-row.done {
  border-left-color: var(--lime);
}

.scan-state {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Analyzer Result State */
.analyzer-result {
  display: none;
}

.analyzer-result.active {
  display: block;
}

.proto-badge {
  display: inline-block;
  background: rgba(213, 229, 109, 0.15);
  color: var(--lime);
  border: 1px solid rgba(213, 229, 109, 0.35);
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.score-line {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 28px;
  align-items: center;
  margin: 18px 0 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.score-line .score-num {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 400;
  line-height: 0.9;
  color: var(--lime);
}

.score-line .score-num small {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: #aebcb2;
  margin-top: 6px;
}

.metric-bars {
  display: grid;
  gap: 10px;
}

.metric {
  display: grid;
  grid-template-columns: 140px 1fr 34px;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.metric span {
  color: #b5c2b9;
}

.metric .bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  display: block;
}

.metric .bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--lime);
}

.metric b {
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
  color: var(--paper);
}

.mini-findings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.mini-findings div {
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-findings b {
  font-family: var(--serif);
  font-size: 24px;
  display: block;
  color: var(--paper);
}

.mini-findings span {
  font-size: 13px;
  color: #9cb0a4;
  display: block;
  margin-top: 4px;
}

.result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.score-method-link {
  font-size: 13px;
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* ==========================================================================
   Intent Band (Choose by Intent)
   ========================================================================== */
.intent-band {
  background: var(--paper-2);
  padding: 46px 0;
  border-bottom: 1px solid var(--rule);
}

.intent-grid {
  display: grid;
  grid-template-columns: 320px repeat(3, 1fr);
  gap: 28px;
  align-items: start;
}

.intent-intro h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.25;
  margin: 8px 0 0;
}

.intent-card {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 175px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.intent-card:hover {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
}

.intent-card .num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  color: var(--forest);
}

.intent-card h3 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 10px 0 8px;
}

.intent-card p {
  font-size: 15px;
  line-height: 1.55;
  color: #404f47;
  margin: 0;
}

/* ==========================================================================
   Major Section: Reverse vs Visual vs Recognition
   ========================================================================== */
.distinction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  margin-top: 48px;
}

.distinction-card {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
}

.distinction-card .badge {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  padding: 4px 10px;
  background: var(--paper-2);
  margin-bottom: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.distinction-card h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 14px;
}

.distinction-card .question {
  font-size: 17px;
  font-weight: 600;
  font-style: italic;
  color: var(--forest-2);
  margin-bottom: 16px;
  line-height: 1.5;
}

.distinction-card p {
  font-size: 17px;
  line-height: 1.68;
  color: #384640;
  margin-bottom: 24px;
}

.distinction-spec {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 10px;
}

.distinction-spec-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.distinction-spec-item span:first-child {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.distinction-spec-item span:last-child {
  font-weight: 600;
}

/* ==========================================================================
   Pipeline Architecture (How Image Search Works)
   ========================================================================== */
.pipeline-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.pipeline-step {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
}

.pipeline-step .step-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  color: var(--forest);
  margin-bottom: 12px;
}

.pipeline-step h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 12px;
  line-height: 1.25;
}

.pipeline-step p {
  font-size: 16px;
  line-height: 1.65;
  color: #3f4c46;
  margin-bottom: 18px;
}

.tech-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.tech-tag {
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 8px;
  background: var(--paper-2);
  color: var(--ink-2);
}

/* ==========================================================================
   Varied Editorial Layouts for the 9 Techniques
   (Rejecting repetitive SaaS card grids)
   ========================================================================== */
.techniques-editorial {
  display: flex;
  flex-direction: column;
  gap: 72px;
  margin-top: 56px;
}

/* Layout Style A: Full-Width Asymmetric Feature */
.technique-hero-feature {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 48px;
  align-items: center;
}

.technique-hero-feature h3 {
  font-family: var(--serif);
  font-size: clamp(32px, 3.5vw, 44px);
  line-height: 1.05;
  margin: 12px 0 16px;
}

.technique-hero-feature p {
  font-size: 18px;
  line-height: 1.7;
  color: #33403a;
  margin-bottom: 24px;
}

.technique-meta-box {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 28px;
  display: grid;
  gap: 16px;
}

.technique-meta-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
}

.technique-meta-row strong {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Layout Style B: Two-Column Split Comparison */
.technique-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.technique-split-card {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
}

.technique-split-card h3 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  margin: 10px 0 14px;
}

.technique-split-card p {
  font-size: 17px;
  line-height: 1.68;
  color: #384640;
  margin-bottom: 24px;
}

/* Layout Style C: Typographic Editorial Trio */
.technique-trio-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.technique-trio-item {
  border-top: 2px solid var(--ink);
  padding-top: 24px;
}

.technique-trio-item .num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 8px;
  display: block;
}

.technique-trio-item h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 12px;
}

.technique-trio-item p {
  font-size: 16px;
  line-height: 1.65;
  color: #404f47;
  margin-bottom: 16px;
}

.technique-inline-spec {
  font-size: 14px;
  padding: 12px 14px;
  background: var(--paper-2);
  border-left: 3px solid var(--forest);
  margin-top: 14px;
}

.technique-inline-spec strong {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ==========================================================================
   Visual Search Glossary
   ========================================================================== */
.glossary-section {
  background: var(--paper);
}

.glossary-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.glossary-search {
  width: 100%;
  max-width: 420px;
  padding: 12px 16px;
  border: 1px solid var(--rule-strong);
  background: var(--white);
  font-size: 15px;
}

.glossary-search:focus {
  outline: 2px solid var(--forest);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.glossary-card {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
}

.glossary-card .term-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.glossary-card h3,
.glossary-card h4 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.glossary-card .term-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--forest-2);
  text-transform: uppercase;
}

.glossary-card p {
  font-size: 15px;
  line-height: 1.62;
  color: #3b4841;
  margin: 0;
}

/* ==========================================================================
   Comparison Matrix (When to Use Each Technique)
   ========================================================================== */
.matrix-wrap {
  overflow-x: auto;
  margin-top: 36px;
  border: 1px solid var(--rule);
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px; /* Tables: 14–15px */
  line-height: 1.5;
  text-align: left;
  min-width: 900px;
}

.matrix-table th,
.matrix-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.matrix-table th:last-child,
.matrix-table td:last-child {
  border-right: none;
}

.matrix-table thead th {
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 2;
}

.matrix-table tbody tr:hover {
  background: rgba(213, 229, 109, 0.06);
}

.matrix-table td.primary-cell {
  font-weight: 600;
  font-family: var(--serif);
  font-size: 17px;
  background: rgba(244, 240, 231, 0.35);
}

.matrix-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 2px;
}

.matrix-badge.optimal {
  background: #e1eed2;
  color: #21431e;
}

.matrix-badge.secondary {
  background: #e8eaeb;
  color: #3b4247;
}

.matrix-badge.poor {
  background: #fae8e5;
  color: #72271d;
}

/* ==========================================================================
   Image-Search Tools & Entities Section
   (Substantial, readable profiles — not a row of logos)
   ========================================================================== */
.tools-category-header {
  margin: 64px 0 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.tools-category-header h3 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  margin: 0;
}

.tools-category-header span {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
}

.tool-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 12px;
}

.tool-card-head h4 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  margin: 0;
}

.tool-card-head a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tool-tag {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--forest-2);
  padding: 3px 8px;
  background: var(--paper-2);
}

.tool-card-desc {
  font-size: 16px; /* Tool descriptions: 15–16px */
  line-height: 1.65;
  color: #33423a;
  margin-bottom: 22px;
}

.tool-spec-grid {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 12px;
  font-size: 14px;
}

.tool-spec-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  line-height: 1.5;
}

.tool-spec-row strong {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   Image SEO & Audit Module
   ========================================================================== */
.seo-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.audit-panel {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.audit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.audit-head strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}

.audit-head span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.audit-url {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.audit-url input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  font-size: 15px;
}

.audit-url input:focus {
  border-color: var(--forest);
  outline: none;
}

.audit-table {
  display: grid;
  gap: 12px;
}

.audit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--paper-2);
  border-left: 3px solid var(--rule);
  font-size: 14px;
}

.audit-row div b {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  margin-bottom: 4px;
}

.audit-row div span {
  font-size: 13px;
  color: var(--muted);
}

.pill {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  padding: 4px 10px;
  text-transform: uppercase;
}

.pill.good {
  background: #ddead1;
  color: #1a421b;
}

.pill.warn {
  background: #fae7cf;
  color: #783e0c;
}

/* ==========================================================================
   Search Practice: Best Practices & Common Mistakes
   ========================================================================== */
.practice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 48px;
}

.practice-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.practice-column h3 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0;
}

.practice-item {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 28px 24px;
}

.practice-item .item-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 8px;
  display: block;
}

.practice-item h4 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  margin-bottom: 10px;
}

.practice-item p {
  font-size: 17px; /* Explanatory text: 17–18px */
  line-height: 1.68;
  color: #3b4741;
  margin: 0;
}

/* ==========================================================================
   Visible Source & Evidence Architecture
   ========================================================================== */
.evidence-box {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 36px 32px;
  margin-top: 56px;
}

.evidence-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}

.evidence-header h4 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  margin: 0;
}

.evidence-header span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.citation-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  font-size: 14px;
  line-height: 1.55;
}

.citation-item {
  color: #384640;
}

.citation-item strong {
  color: var(--ink);
}

.citation-item a {
  color: var(--forest-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Modal Dialog: How This Score Is Calculated
   ========================================================================== */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(19, 35, 31, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--paper);
  color: var(--ink);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--rule-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  padding: 40px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: 1px solid var(--rule-strong);
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-dialog h3 {
  font-family: var(--serif);
  font-size: 32px;
  margin: 12px 0 16px;
}

.modal-pillar {
  border-top: 1px solid var(--rule);
  padding: 20px 0;
}

.modal-pillar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.modal-pillar-head b {
  font-family: var(--serif);
  font-size: 20px;
}

.modal-pillar-head span {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--forest);
  font-weight: 600;
}

.modal-pillar p {
  font-size: 15px;
  line-height: 1.6;
  color: #3b4741;
  margin: 0;
}

/* ==========================================================================
   Internal Guide Page Templates
   ========================================================================== */
.page-hero {
  padding: 72px 0 54px;
  border-bottom: 1px solid var(--rule);
  background: var(--white);
}

.breadcrumb {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.breadcrumb a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.page-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: start;
}

.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 4.5vw, 64px);
  line-height: 1.05;
  margin: 14px 0 20px;
}

.page-factbox {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 28px;
  display: grid;
  gap: 18px;
}

.page-factbox .fact {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
}

.page-factbox .fact:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.page-factbox .fact b {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  margin-bottom: 4px;
}

.page-factbox .fact span {
  font-size: 14px;
  color: #435249;
}

.guide-article {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 64px;
  padding: 72px 0 96px;
}

.guide-toc {
  position: sticky;
  top: 108px;
  align-self: start;
  border-right: 1px solid var(--rule);
  padding-right: 28px;
}

.guide-toc h4,
.guide-toc-title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  font-weight: 650;
}

.guide-toc nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
}

.guide-toc nav a {
  color: #405047;
  transition: color 0.16s ease;
}

.guide-toc nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.guide-body {
  max-width: 800px;
}

.guide-body h2 {
  font-family: var(--serif);
  font-size: 34px;
  margin: 48px 0 18px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.guide-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.guide-body h3 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 32px 0 14px;
}

.guide-body p {
  font-size: 18px;
  line-height: 1.72;
  margin-bottom: 24px;
}

.guide-body ul, .guide-body ol {
  font-size: 18px;
  line-height: 1.72;
  margin-bottom: 24px;
  padding-left: 28px;
}

.guide-body li {
  margin-bottom: 10px;
}

.guide-callout {
  background: var(--paper-2);
  border-left: 4px solid var(--forest);
  padding: 24px 28px;
  margin: 32px 0;
}

.guide-callout b {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  margin-bottom: 8px;
}

.guide-callout p {
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding: 84px 0 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 56px;
  margin-bottom: 56px;
}

.footer-brand p {
  font-size: 16px;
  line-height: 1.65;
  color: #405047;
  max-width: 380px;
  margin-top: 16px;
}

.footer-col h4,
.footer-col-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 20px;
}

.footer-col nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
}

.footer-col nav a {
  color: #43534a;
  transition: color 0.16s ease;
}

.footer-col nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--rule);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px; /* Captions/helper: 12–13px */
  color: var(--muted);
}

/* ==========================================================================
   Responsive Adaptations (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 1200px) {
  .home-hero {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 64px 0;
  }
  .hero-tool {
    padding: 48px 0;
  }
  .intent-grid {
    grid-template-columns: 1fr 1fr;
  }
  .pipeline-flow {
    grid-template-columns: 1fr 1fr;
  }
  .technique-hero-feature {
    grid-template-columns: 1fr;
  }
  .technique-trio-row {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .glossary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .distinction-grid {
    grid-template-columns: 1fr;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .seo-layout {
    grid-template-columns: 1fr;
  }
  .practice-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .guide-article {
    grid-template-columns: 1fr;
  }
  .guide-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .primary-nav, .header-actions .btn {
    display: none;
  }
  .icon-btn {
    display: inline-flex;
  }
  .hero-notes {
    grid-template-columns: 1fr;
  }
  .instrument-body {
    grid-template-columns: 1fr;
  }
  .tool-sidebar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .tool-sidebar .group {
    display: none;
  }
  .score-line {
    grid-template-columns: 1fr;
  }
  .technique-split-row {
    grid-template-columns: 1fr;
  }
  .citation-list {
    grid-template-columns: 1fr;
  }
  .page-hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  html, body {
    font-size: 17px; /* Mobile copy remains at least ~17px */
  }
  p, .lead, .deck {
    font-size: 17px;
  }
  .intent-grid {
    grid-template-columns: 1fr;
  }
  .pipeline-flow {
    grid-template-columns: 1fr;
  }
  .glossary-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .mini-findings {
    grid-template-columns: 1fr;
  }
}

/* Accessibility: Respect Reduced Motion Preferences */
@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;
  }
}
