/* =========================================================================
   Bram D Media — Tech Essentials catalogue
   Plain CSS, mobile-first. Swap --accent to re-skin the whole site.
   ========================================================================= */

:root {
  /* Brand — change --accent (and --accent-ink for text on it) to re-skin.
     Soft neutral grey; ~4.8:1 on white so the small accent text stays legible.
     Going much lighter would fail contrast on labels/links. */
  --accent: #6b7280;
  --accent-hover: #4b5563;
  --accent-ink: #ffffff;

  /* Category highlight colours — shared by the product tags and the nav hover. */
  --cat-tech: #cd8330;
  --cat-ai: #3e8ad3;
  --cat-content-creation: #8a63d2;
  --cat-home: #c69214;
  --cat-top-pick: #3d9f63; /* green — the "Top pick" tag */

  /* Product "Get it" button — Apple buy-button blue */
  --cta: #0071e3;
  --cta-hover: #0077ed;
  --cta-ink: #ffffff;

  /* Neutrals */
  --bg: #f2f3f5;          /* page background — very light grey */
  --bg-soft: #f6f7f9;
  --surface: #ffffff;     /* cards & fields — pure white */
  --border: #e6e8ee;
  --border-strong: #d3d7e0;
  --ink: #14161c;         /* primary text */
  --ink-soft: #565b69;    /* secondary text */
  --ink-faint: #8b909e;   /* tertiary text */

  /* Type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, "Apple Color Emoji", sans-serif;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Shape + motion */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 20, 30, 0.06);
  --shadow-md: 0 10px 30px rgba(16, 20, 30, 0.10);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --maxw: 1200px;
  --header-h: 64px;
}

/* Optional dark tint for placeholders/footer accents kept subtle & brand-neutral */

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

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

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

/* ------------------------------------------------------------------ Header */
/* Floating "liquid glass" menubar: a translucent, blurred pill that hovers a
   little way in from the top and sides, with content scrolling behind it. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 12px 0;
  background: transparent;
}
.site-header__inner {
  position: relative;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-inline: 20px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.55));
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 10px 30px rgba(16, 20, 30, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(16, 20, 30, 0.04);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--accent);
  font-weight: 800;
}
.brand { flex: none; }
.brand__name { white-space: nowrap; }
.brand__name span { color: var(--accent); }

.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.nav-links a {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(16, 20, 30, 0.05); }
/* Each category link picks up its own highlight colour on hover/focus. */
.nav-links a[href*="category=tech"]:hover,
.nav-links a[href*="category=tech"]:focus-visible {
  color: var(--cat-tech); background: color-mix(in srgb, var(--cat-tech) 12%, transparent);
}
.nav-links a[href*="category=ai"]:hover,
.nav-links a[href*="category=ai"]:focus-visible {
  color: var(--cat-ai); background: color-mix(in srgb, var(--cat-ai) 12%, transparent);
}
.nav-links a[href*="category=content-creation"]:hover,
.nav-links a[href*="category=content-creation"]:focus-visible {
  color: var(--cat-content-creation); background: color-mix(in srgb, var(--cat-content-creation) 12%, transparent);
}
.nav-links a[href*="category=home"]:hover,
.nav-links a[href*="category=home"]:focus-visible {
  color: var(--cat-home); background: color-mix(in srgb, var(--cat-home) 12%, transparent);
}
.nav-links a[aria-current="page"] { color: var(--accent); }

/* Hamburger toggle — shown only on narrow screens */
.nav-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.nav-toggle:hover { background: rgba(16, 20, 30, 0.06); }

@media (max-width: 720px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 210px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.88));
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 16px 44px rgba(16, 20, 30, 0.22);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 11px 14px; border-radius: 12px; font-size: 1rem; }
  /* While the header search is expanded, hide the hamburger to make room */
  .header-search.is-open ~ .nav-toggle { display: none; }
}

/* ---- Collapsing header search --------------------------------------------
   Hidden while the standalone search bar is on screen; revealed (as a magnifier
   icon to the left of the nav links) once the page is scrolled — toggled by the
   `search-collapsed` class on <body>. Clicking the icon expands an input. */
.header-search {
  display: none;
  align-items: center;
  gap: 6px;
}
/* When the standalone bar scrolls away, the icon materialises softly: a gentle
   fade with a small scale-up and a quick blur-to-sharp settle. No bounce —
   kept understated. */
body.search-collapsed .nav .header-search {
  display: inline-flex;
  animation: search-liquid-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes search-liquid-in {
  0%   { opacity: 0; transform: scale(0.82); filter: blur(3px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

.header-search__input {
  width: 0;
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 0;
  opacity: 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  pointer-events: none;
  transition: width 0.25s var(--ease), opacity 0.2s var(--ease), padding 0.25s var(--ease);
}
.header-search.is-open .header-search__input {
  width: min(260px, calc(100vw - 170px));
  padding: 0 16px;
  opacity: 1;
  pointer-events: auto;
  border: 1px solid var(--border);
}
.header-search.is-open .header-search__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}
.header-search__btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.header-search__btn:hover { background: var(--bg-soft); }
/* Chrome / iridescent rainbow icon so it pops in the bar. */
.header-search__btn svg { filter: drop-shadow(0 1px 1px rgba(16, 20, 30, 0.15)); }
/* While expanded, hide the nav links so the input has room. */
.header-search.is-open ~ .nav-links { display: none; }

/* -------------------------------------------------------------------- Hero */
.hero {
  padding: var(--sp-7) 0 var(--sp-5);
}
.hero h1 {
  margin: 0 0 var(--sp-3);
  font-size: clamp(1.9rem, 6vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.hero p {
  margin: 0;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: clamp(1rem, 3vw, 1.15rem);
}
.hero__eyebrow {
  display: inline-block;
  margin-bottom: var(--sp-3);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------------------------------------------------------- Controls (search + filters) */
/* The standalone search bar. It lives in normal flow at the top of the page and
   scrolls away — once it's out of view a compact search icon appears in the
   header (see .header-search below). */
.controls {
  padding-block: var(--sp-4);
}
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search__icon {
  position: absolute;
  left: var(--sp-4);
  color: var(--ink-faint);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 52px;
  padding: 0 var(--sp-5) 0 48px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease),
    background 0.15s var(--ease);
}
.search input::placeholder { color: var(--ink-faint); }
.search input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.filters { margin-top: var(--sp-4); }
.filter-group + .filter-group { margin-top: var(--sp-3); }
.filter-group__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--sp-2);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.chip {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-faint); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.filter-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  min-height: 22px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.filter-summary__count { font-weight: 600; }
.filter-summary__clear {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0;
}
.filter-summary__clear:hover { text-decoration: underline; }
.filter-summary[hidden] { display: none; }

/* ---------------------------------------------------------------- Sections */
.section { padding-block: var(--sp-6); }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.section__title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.section__meta { color: var(--ink-faint); font-size: 0.9rem; }
.section--featured { border-bottom: 1px solid var(--border); }

/* -------------------------------------------------------------------- Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* mobile: 2 cols */
  gap: var(--sp-4);
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1120px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

/* -------------------------------------------------------------------- Card */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.card__media {
  position: relative;
  aspect-ratio: 4 / 3; /* landscape. Change to 1/1 (square), 4/5 (portrait), 16/9 (wide) */
  background: var(--surface); /* white, so the card reads as one clean bento tile */
  overflow: hidden;
  padding: var(--sp-5); /* airy breathing room so product shots don't touch the edges */
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* show the whole product inside the padding, don't crop to the bezel */
  transition: transform 0.35s var(--ease);
}
.card:hover .card__media img { transform: scale(1.04); }
.card__badge {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  background: var(--ink);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
}
.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  flex: 1;
}
.card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.card__cat {
  --cat: var(--accent); /* fallback for any category without a mapped colour */
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px 1px 5px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cat);
  border: 1px solid var(--cat);
  border-radius: var(--radius-pill);
  background: transparent;
}
.card__cat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cat);
  flex: none;
}
/* Soften the outline + add a faint colour wash where color-mix is supported. */
@supports (color: color-mix(in srgb, red, blue)) {
  .card__cat {
    border-color: color-mix(in srgb, var(--cat) 45%, transparent);
    background: color-mix(in srgb, var(--cat) 9%, transparent);
  }
}
/* Per-category colour — outline, dot and text all share --cat. */
.card__cat--top-pick { --cat: var(--cat-top-pick); }
.card__cat--tech { --cat: var(--cat-tech); }
.card__cat--ai { --cat: var(--cat-ai); }
.card__cat--content-creation { --cat: var(--cat-content-creation); }
.card__cat--home { --cat: var(--cat-home); }
.card__name {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}
.card__note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__foot {
  margin-top: auto;
  padding-top: var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sp-3);
}
.card__price {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.card__price:empty { display: none; }
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cta);
  color: var(--cta-ink);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
  white-space: nowrap;
}
.btn-cta:hover { background: var(--cta-hover); transform: translateX(2px); }

/* Media placeholder (no image) */
.media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #24262b, #33363d);
  color: rgba(255, 255, 255, 0.5);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.04em;
}

/* ------------------------------------------------------------- Empty state */
.empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--ink-soft);
}
.empty__icon { font-size: 2.5rem; margin-bottom: var(--sp-3); }
.empty h3 { margin: 0 0 var(--sp-2); color: var(--ink); font-size: 1.15rem; }
.empty p { margin: 0 0 var(--sp-4); }
.empty[hidden] { display: none; }

/* ------------------------------------------------------- Category tiles page */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}
@media (min-width: 720px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 160px;
  padding: var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat-tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; opacity: 0.9;
}
.cat-tile__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(8, 11, 22, 0.82));
}
.cat-tile__label { position: relative; color: #fff; display: flex; flex-direction: column; gap: 2px; }
.cat-tile__name { font-size: 1.1rem; font-weight: 800; }
.cat-tile__count { font-size: 0.85rem; opacity: 0.8; }

/* ----------------------------------------------------------------- Prose (about) */
.prose { max-width: 68ch; }
.prose h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -0.02em; margin: 0 0 var(--sp-4); }
.prose h2 { font-size: 1.3rem; margin: var(--sp-6) 0 var(--sp-3); letter-spacing: -0.01em; }
.prose p { color: var(--ink-soft); margin: 0 0 var(--sp-4); }
.prose a { color: var(--accent); font-weight: 600; }
.prose a:hover { text-decoration: underline; }

/* --------------------------------------------------------- Disclosure banner */
.disclosure-bar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
  padding: var(--sp-2) var(--sp-4);
}
.disclosure-bar strong { color: var(--ink); font-weight: 700; }

/* ------------------------------------------------------------------ Footer */
/* Minimal footer: same colour as the page, set off by a thin top divider. */
.site-footer {
  margin-top: var(--sp-8);
  background: var(--bg);
  color: var(--ink-soft);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--ink); }
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-block: var(--sp-5);
}
.footer-brand__name { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.footer-brand__name span { color: var(--accent); }
.footer-brand__name .footer-brand__by { font-weight: 600; color: var(--ink-faint); }
.site-footer__legal {
  font-size: 0.78rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--sp-3);
}
.site-footer__legal .disclosure { max-width: 62ch; }
.site-footer__legal .disclosure strong { color: var(--ink-soft); font-weight: 700; }

/* --------------------------------------------------------------- Utilities */
@media (min-width: 560px) { .hide-sm { display: none; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
}
