/* ===================================================================
   Metabench — design tokens (light / populist edition)
   Palette: warm off-white base, slate text, brass/amber accent.
   Type: DM Sans (display + body) + JetBrains Mono (scores & labels).
   Signature: brass score badges + subtle card elevation on hover.
   =================================================================== */

:root {
  /* Color */
  --bg:         #F8F7F4;
  --bg-card:    #FFFFFF;
  --bg-raised:  #ECEAE5;
  --line:       #DDD9D0;
  --line-soft:  #EDEBE6;

  --ink-900:    #1A1F24;
  --ink-700:    #3A4149;
  --ink-500:    #6B7680;
  --ink-300:    #9AA3AC;

  /* Brand accent — matches the themetascore logo (teal #0D5C60, amber #E8BA3E) */
  --brass:        #0D5C60;
  --brass-bright: #317478;
  --brass-bg:     #EBF2F2;
  --accent-amber: #E8BA3E;

  --score-top:  #2A6F46;
  --score-high: #3E7C4F; 
  --score-mid:  #C28A2E;
  --score-low:  #C0492D;

  /* Type */
  --font-display: 'DM Sans', 'Segoe UI', sans-serif;
  --font-body:    'DM Sans', 'Segoe UI', sans-serif;
  --font-mono: 'Inter', 'Segoe UI', sans-serif;

  /* Layout */
  --max-width: 1180px;
  --radius:    5px;
  --radius-lg: 8px;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: 3.5rem;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (max-width: 640px) {
  .container { padding: 0 var(--space-3); }
}

/* Subtle dot-grid background — lighter, less "terminal" than the line grid */
.freq-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(0,0,0,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
}

/* ===================================================================
   Header
   =================================================================== */

.brand-logo {
  height: clamp(2rem, 4vw + 1rem, 3rem);  /* 32px on phones, up to 48px on desktop */
  width: auto;
  max-width: 100%;
}

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0 var(--space-1);
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;   /* was: baseline */
  gap: 0.55rem;
  flex-shrink: 0;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.brand-mark span { color: var(--brass); }

.brand-tag {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-300);
  border-left: 1px solid var(--line);
  padding-left: 0.6rem;
  white-space: nowrap;
  margin: 0;
}

.main-nav {
  display: flex;
  gap: var(--space-4);
  font-size: 0.88rem;
  font-weight: 500;
}

.main-nav a {
  color: var(--ink-500);
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--brass);
  border-bottom-color: var(--brass);
}

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

/* Search row */
.header-search-row {
  padding: var(--space-2) 0 var(--space-3);
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 760px;
}

.search-input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 3.2rem 0.85rem 2.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder { color: var(--ink-300); }

.search-input:focus {
  outline: none;
  border-color: var(--brass);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(13,92,96,0.15);
}

@media (max-width: 640px) {
  .search-input::placeholder { color: transparent; }
}

.search-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--ink-300);
  pointer-events: none;
}

.search-submit {
  position: absolute;
  right: 0.4rem;
  background: var(--brass);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-submit:hover { background: var(--brass-bright); }

/* Live results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-hover);
  max-height: 420px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.search-results.is-open { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.7rem var(--space-3);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s ease;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.is-active { background: var(--brass-bg); }

.search-result-thumb {
  width: 36px;
  height: 36px;
  background: var(--bg-raised);
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ink-300);
}

.search-result-text { flex: 1; min-width: 0; }

.search-result-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-300);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-result-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.search-empty {
  padding: var(--space-3);
  font-size: 0.88rem;
  color: var(--ink-300);
  text-align: center;
}

/* ===================================================================
   Hero
   =================================================================== */

.hero {
  position: relative;
  z-index: 1;
  padding: var(--space-5) 0 var(--space-4);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg-card);
}

.hero-waveform {
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  width: 100%;
  height: auto;
  opacity: 0.2;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: var(--space-2);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
  color: var(--ink-900);
}

.hero p {
  font-size: 1.05rem;
  color: var(--ink-500);
  max-width: 540px;
  margin: 0 0 var(--space-4);
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: var(--space-5);
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brass);
}

.hero-stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-300);
  margin-top: 0.15rem;
}

/* ===================================================================
   Photo hero (homepage only) — background photo, heading + subheading +
   search bar centered on the photo, "Browse by category" as its own
   section below (moved out of the hero so it doesn't crowd the photo
   on mobile), stats re-homed into their own strip beneath that.
   =================================================================== */

.hero-photo {
  position: relative;
  width: 100%;
  overflow: hidden;
  height: clamp(440px, 42vw, 620px);
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
}
@media (max-width: 720px) {
  .hero-photo { height: clamp(420px, 90vw, 560px); }
}
.hero-photo-bg {
  position: absolute; inset: 0; z-index: 0;
  background-image: url('/assets/images/metabench_main.jpg');
  background-size: cover;
  background-position: center;
}
.hero-photo-scrim {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse 620px 220px at 50% 52%,
      rgba(248,247,244,0.85) 0%, rgba(248,247,244,0.4) 55%, rgba(248,247,244,0) 78%);
}
.hero-photo-container { position: relative; z-index: 2; height: 100%; }

/* Heading + subheading + search bar move together as one group, centered
   in the photo both ways. */
.hero-photo-anchor {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, calc(-50% + var(--hero-anchor-offset, 0px)));
  width: min(640px, 92%);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2);
}
.hero-photo-anchor h1 {
  margin: 0;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  letter-spacing: -0.01em; color: var(--ink-900); line-height: 1.15;
  text-shadow: 0 0 18px rgba(248,247,244,0.95), 0 0 6px rgba(248,247,244,0.95);
}
.hero-photo-anchor > p {
  margin: 0;
  font-size: clamp(0.9rem, 1.6vw, 1.05rem); color: var(--ink-700);
  text-shadow: 0 0 14px rgba(248,247,244,0.95), 0 0 5px rgba(248,247,244,0.95);
}
.hero-search-form.search-form {
  position: relative;
  width: 100%;
  margin-top: var(--space-1);
  max-width: none;
  box-shadow: var(--shadow-card-hover);
}
.hero-search-form .search-input {
  background: var(--bg-card);
  border-width: 1.5px;
  padding-top: 1rem;
  padding-bottom: 1rem;
  font-size: 1.05rem;
}

@media (max-width: 560px) {
  .hero-photo-anchor { width: 94%; }
}

/* Browse-by-category — its own slim section, directly above the stats
   strip, rather than overlaid on the photo. */
.category-section { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); background: var(--bg-card); }
.category-section-inner {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.7rem;
}
.category-section-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-300); white-space: nowrap; }
.category-section-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

/* Re-homed stats strip (used to live inside the old text hero) */
.hero-stats-strip { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); background: var(--bg-card); }
.hero-stats-strip-inner { display: flex; justify-content: center; gap: var(--space-5); flex-wrap: wrap; text-align: center; }

/* Keep all three stats on a single row on narrow screens instead of
   wrapping to two — shrink sizing to fit rather than let the row break. */
@media (max-width: 560px) {
  .hero-stats-strip-inner { flex-wrap: nowrap; gap: var(--space-1); }
  .hero-stats-strip .container { padding-left: var(--space-2); padding-right: var(--space-2); }
  .hero-stats-strip .hero-stat-value { font-size: 1.05rem; }
  .hero-stats-strip .hero-stat-label { font-size: 0.58rem; letter-spacing: 0.02em; margin-top: 0.1rem; }
}

/* ===================================================================
   Category strip
   =================================================================== */

.category-strip {
  position: relative;
  z-index: 1;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
}

.category-strip-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.category-strip-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-300);
  margin-right: var(--space-2);
}

.category-pill {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  color: var(--ink-500);
  transition: all 0.15s ease;
}

.category-pill.active {
  border-color: var(--brass);
  color: var(--brass);
  background: var(--brass-bg);
}

.category-pill.is-soon {
  color: var(--ink-300);
  cursor: default;
  border-style: dashed;
}

/* ===================================================================
   Sections / product rails
   =================================================================== */

.section {
  position: relative;
  z-index: 1;
  padding: var(--space-5) 0;
}

.how-it-works .container.section {
  padding: var(--space-4) var(--space-4);
}

@media (max-width: 640px) {
  .how-it-works .container.section {
    padding: var(--space-3) var(--space-3);
  }
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title small {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-300);
  letter-spacing: 0;
}

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brass);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.section-link:hover { color: var(--brass-bright); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

@media (max-width: 980px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.product-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-media svg { width: 46%; opacity: 0.25; }

/* Every card image (real photo or placeholder) fits the same 4:3 box */
.product-card-media {
  overflow: hidden;
}
.product-card-media > img {
  width: 80%;
  height: 80%;
  object-fit: contain;       /* scale to fit without cropping or stretching */
  mix-blend-mode: multiply;  /* white photo backgrounds blend into the grey box */
}

.product-card-score {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--bg-card);
  border: 3px solid var(--line);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.product-card-score {
  padding-top: 3px;   /* optical nudge — digits have no descender, so
                         flex-centering leaves them sitting slightly high */
}

.score-top  { color: var(--score-top);  border-color: var(--score-top)  !important; }
.score-high { color: var(--score-high); border-color: var(--score-high) !important; }
.score-mid  { color: var(--score-mid);  border-color: var(--score-mid) !important; }
.score-low  { color: var(--score-low);  border-color: var(--score-low) !important; }
.score-unscored { color: var(--ink-300); }

.product-card-body { padding: var(--space-3); }

.product-card-brand {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.3rem;
}

.product-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.80rem;
  color: var(--ink-300);
}

/* ===================================================================
   How it works
   =================================================================== */

.how-it-works {
  background: #FAFAF8;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: calc(100% - 2 * var(--space-4));
  max-width: calc(var(--max-width) - 2 * var(--space-4));
  margin: 10px auto;
}

@media (max-width: 640px) {
  .how-it-works {
    width: calc(100% - 2 * var(--space-3));
  }
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

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

.how-item-mark {
  font-size: 0.80rem;
  color: var(--brass);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.how-item h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: var(--ink-900);
}

.how-item p {
  color: var(--ink-500);
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.65;
}

/* ===================================================================
   Product rows — text/score view used on the homepage (index.php).
   Migrated from index-noimages-preview.php. Rendered by
   includes/partials/product-row.php. The .score-top/.score-high/
   .score-mid/.score-low colour classes already exist above and are
   reused as-is. Paste this block at the end of style.css.
   =================================================================== */

.product-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.product-row:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: var(--brass);
}

.product-row-score {
  flex-shrink: 0;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  background: var(--bg-card);
  border: 3px solid var(--line);
}

.product-row-body {
  flex: 1;
  min-width: 0;   /* lets the name ellipsis work inside the flex row */
}

.product-row-brand {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.15rem;
}

.product-row-name {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-row-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-300);
  margin-top: 0.15rem;
}

.product-row-arrow {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--ink-300);
  transition: transform 0.15s ease, color 0.15s ease;
}

.product-row:hover .product-row-arrow {
  color: var(--brass);
  transform: translateX(3px);
}


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

.site-footer {
  position: relative;
  z-index: 1;
  padding: var(--space-4) 0;
  font-size: 0.8rem;
  color: var(--ink-300);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  border-top: 1px solid var(--line);
}

.site-footer a { color: var(--ink-300); }
.site-footer a:hover { color: var(--brass); }

/* ===================================================================
   Utility / accessibility
   =================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}


/* ===================================================================
   How it works: collapsible
   =================================================================== */

.how-details > summary {
  display: flex;
  width: 100%;
  list-style: none;
  cursor: pointer;
  margin-bottom: 0;
}
.how-details > summary {
  /* existing lines stay, add: */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}



.how-details[open] > summary { margin-bottom: var(--space-4); }  }
}

.how-details > summary:focus-visible {
  outline: 2px solid var(--ink-300);
  outline-offset: 4px;
}

.how-chevron {
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--brass);
  border-bottom: 2px solid var(--brass);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  align-self: center;
  pointer-events: none;
}
.how-details[open] .how-chevron { transform: rotate(-135deg); }

@media (max-width: 640px) {
  .brand {
    flex-shrink: 1;       /* allow the brand block to shrink */
    min-width: 0;
    align-items: center;  /* centre tag against the logo */
    gap: 0.6rem;
  }
  .brand-mark {
    flex: 0 1 auto;
    min-width: 0;
  }
  .brand-logo {
    width: 100%;
    max-width: 200px;     /* adjust to taste */
    height: auto;
  }
  .brand-tag {
    white-space: normal;  /* lets "Hardware, Benchmarked" wrap */
    max-width: 6.5rem;    /* forces a break after "Hardware," */
    line-height: 1.35;
    font-size: 0.62rem;
    flex: 0 1 auto;
  }
}