/* =========================================================
   GearGrade — "Bold Editorial" design system (review-only)
   ---------------------------------------------------------
   A warm, characterful identity that deliberately steps away
   from the cold grey + blue Apple look:
     • Cream paper background + ink-violet text
     • Vivid coral as the signature accent (NOT apple blue)
     • Fraunces (editorial serif) for display, Inter for UI
     • Chunky rounded cards, warm shadows, an amber companion
   Mobile-first, dependency-free. Only the components needed
   by the review-list + review-detail pages are kept.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand — warm editorial palette (distinct from Apple) */
  --brand: #ff5630;            /* signature coral */
  --brand-2: #ff8a3d;          /* amber companion */
  --brand-dark: #d83a1f;        /* hover / deep coral */
  --brand-ink: #b83218;         /* coral text on light */
  --violet: #6c4cf1;            /* secondary accent */
  --violet-soft: #efebff;

  /* Neutrals — warm, paper-like */
  --ink: #1c1726;               /* near-black with violet tint */
  --ink-2: #5c5568;             /* secondary text */
  --ink-3: #8b8497;             /* tertiary / muted */
  --line: #ece1d2;              /* warm hairline */
  --line-soft: #f3ebde;
  --bg: #fbf6ef;                /* cream paper */
  --bg-2: #f6ede0;              /* warm tint panel */
  --bg-3: #efe3d2;
  --surface: #ffffff;

  /* Layout */
  --maxw: 1100px;
  --radius: 18px;
  --radius-sm: 13px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --shadow: 0 14px 40px rgba(54,28,12,.10), 0 2px 6px rgba(54,28,12,.05);
  --shadow-sm: 0 3px 14px rgba(54,28,12,.07);
  --shadow-lg: 0 26px 70px rgba(54,28,12,.18);
  --space: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

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

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

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

a { color: var(--brand-ink); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12; color: var(--ink); font-weight: 700; letter-spacing: -.01em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 1.4em 0 .5em; }
h3 { font-size: 1.3rem; margin: 1.2em 0 .4em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-3); }

/* ---------- Buttons / CTA ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--radius-sm); font-weight: 700;
  font-size: 1rem; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s var(--ease), background .2s var(--ease),
              box-shadow .25s var(--ease), color .2s var(--ease);
  text-decoration: none; line-height: 1; position: relative;
  will-change: transform;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: 3px solid rgba(255,86,48,.4); outline-offset: 2px; }
.btn-buy { background: var(--brand); color: #fff; box-shadow: 0 8px 24px rgba(255,86,48,.32); }
.btn-buy:hover { background: var(--brand-dark); color: #fff; box-shadow: 0 12px 30px rgba(255,86,48,.42); }
.btn-ghost { background: #fff; color: var(--brand-ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); color: var(--brand-dark); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,246,239,.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-bar { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand {
  display: flex; align-items: center; gap: 10px; font-family: var(--font-display);
  font-weight: 700; font-size: 1.35rem; color: var(--ink); white-space: nowrap; letter-spacing: -.01em;
}
.brand .dot {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 12px rgba(255,86,48,.35);
  position: relative; flex: 0 0 auto;
}
.brand .dot::after {
  content: "G"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: .95rem; font-family: var(--font);
}
.brand:hover { text-decoration: none; color: var(--ink); }

.search-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: rgba(255,255,255,.7);
  color: var(--ink-2); cursor: pointer; font-size: .95rem; font-weight: 600;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.search-btn:hover { background: #fff; border-color: var(--brand); color: var(--brand-ink); }

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(28,23,38,.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; align-items: flex-start; justify-content: center; padding-top: 12vh;
  opacity: 0; transition: opacity .25s var(--ease);
}
.search-overlay.open { display: flex; opacity: 1; }
.search-box {
  background: #fff; width: min(720px, 94vw); border-radius: var(--radius-lg); padding: 22px;
  box-shadow: var(--shadow-lg); transform: translateY(-12px) scale(.98); transition: transform .3s var(--ease);
  border: 1px solid var(--line);
}
.search-overlay.open .search-box { transform: none; }
.search-box input {
  width: 100%; padding: 17px 20px; font-size: 1.15rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); outline: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  font-family: var(--font);
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255,86,48,.16); }
.search-results { margin-top: 12px; max-height: 52vh; overflow: auto; }
.search-results a { display: block; padding: 12px 10px; border-radius: var(--radius-sm); border-bottom: 1px solid var(--line-soft); color: var(--ink); transition: background .15s var(--ease); }
.search-results a:hover { background: var(--bg-2); text-decoration: none; }
.search-results .meta { font-size: .8rem; color: var(--ink-3); }
.search-close { float: right; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--ink-3); line-height: 1; border-radius: 50%; width: 36px; height: 36px; transition: background .2s var(--ease); }
.search-close:hover { background: var(--bg-2); }

/* ---------- Masthead (page title block — not a carousel) ---------- */
.masthead { padding: 64px 0 8px; max-width: 760px; }
.masthead .kicker {
  color: var(--brand-dark); font-weight: 700; font-size: .82rem;
  letter-spacing: .12em; text-transform: uppercase; margin: 0 0 12px;
}
.masthead h1 { letter-spacing: -.02em; }
.masthead .lede { font-size: 1.18rem; color: var(--ink-2); max-width: 60ch; }

/* ---------- Category filter chips ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.chip {
  appearance: none; cursor: pointer; font-family: var(--font); font-weight: 600; font-size: .95rem;
  padding: 9px 18px; border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(255,86,48,.28); }

/* ---------- Section ---------- */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; letter-spacing: -.01em; font-family: var(--font-display); }
.section-head a { font-weight: 700; color: var(--brand-ink); }

/* ---------- Article cards (list page) ---------- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 600px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.a-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.a-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--brand); text-decoration: none; }
.a-card-cover {
  aspect-ratio: 16/9; background: linear-gradient(135deg, var(--brand), var(--violet));
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
  color: rgba(255,255,255,.92); border-bottom: 1px solid var(--line-soft);
}
.a-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.a-card-cover--empty { background: linear-gradient(135deg, #ff7a4d, #6c4cf1); }
.a-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.a-tag {
  align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-ink); background: var(--violet-soft); padding: 4px 10px; border-radius: var(--radius-pill);
}
.a-card-title { font-family: var(--font-display); font-size: 1.22rem; line-height: 1.2; margin: 0; color: var(--ink); }
.a-card-excerpt { color: var(--ink-2); font-size: .94rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.a-card-meta { margin-top: auto; padding-top: 8px; font-size: .82rem; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.a-card-meta span:not(:last-child)::after { content: "·"; margin-left: 8px; color: var(--line); }

/* ---------- Article detail page ---------- */
.article { padding-bottom: 40px; }
.article-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #ff6a3d, #7b5cf0);
  color: #fff; border-radius: var(--radius-lg); margin: 24px auto 0;
  max-width: 760px;
  padding: clamp(30px, 5vw, 60px) clamp(20px, 4.5vw, 54px);
}
.article-hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 86% 0%, rgba(255,255,255,.30), transparent 60%),
    radial-gradient(55% 70% at 0% 100%, rgba(0,0,0,.16), transparent 60%);
}
.article-hero .container { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding-left: 0; padding-right: 0; }
.article-kicker {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; opacity: .95; margin: 0 0 16px;
  padding: 6px 13px; border: 1px solid rgba(255,255,255,.4); border-radius: var(--radius-pill);
}
.article-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.14;
  margin: 0 0 18px; max-width: 22ch; color: #fff;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .92rem; opacity: .96;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.22);
}
.article-meta span { display: inline-flex; align-items: center; gap: 7px; }
.article-cover { width: 100%; max-width: 760px; max-height: 440px; object-fit: cover; border-radius: var(--radius-lg); margin: clamp(20px, 3vw, 30px) auto 8px; box-shadow: var(--shadow); }
.article-cover--empty { display: none; }
.article-body { max-width: 760px; margin: 0 auto; font-size: 1.08rem; line-height: 1.75; color: var(--ink); }
.article-body h2 { font-family: var(--font-display); margin-top: 1.8em; }
.article-body img { border-radius: var(--radius); margin: 18px 0; }
.article-back { display: flex; align-items: center; gap: 8px; max-width: 760px; margin: 24px auto 0; color: var(--brand-ink); font-weight: 600; }
.article-back:hover { color: var(--brand-dark); }

/* ---------- Product links block (end of article) ---------- */
.product-links {
  max-width: 760px; margin: 44px auto 10px; padding: 26px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.product-links::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 6px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.pl-head { margin-bottom: 18px; }
.pl-kicker { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-ink); background: var(--violet-soft); padding: 4px 12px; border-radius: var(--radius-pill); margin-bottom: 8px; }
.pl-head h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 0; }
.pl-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .pl-grid { grid-template-columns: 1fr 1fr; } }
.pl-grid--single { grid-template-columns: 1fr; }
.pl-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease);
  text-decoration: none; color: var(--ink);
}
.pl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand); text-decoration: none; }
.pl-card:focus-visible { outline: 3px solid rgba(255,86,48,.4); outline-offset: 2px; }
.pl-img { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 12px; background: linear-gradient(135deg, var(--bg-2), var(--bg-3)); display: grid; place-items: center; font-size: 1.6rem; overflow: hidden; }
.pl-img img { width: 100%; height: 100%; object-fit: cover; }
.pl-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.pl-name { font-weight: 700; font-size: 1rem; color: var(--ink); line-height: 1.25; }
.pl-note { font-size: .84rem; color: var(--ink-2); }
.pl-price { font-weight: 800; color: var(--brand-dark); font-size: 1.05rem; }
.pl-cta { margin-top: 4px; font-weight: 700; color: var(--brand-ink); font-size: .9rem; }
.pl-card:hover .pl-cta { color: var(--brand-dark); }
.pl-disclosure { font-size: .8rem; color: var(--ink-3); margin: 16px 0 0; text-align: center; }

/* ---------- Footer (minimal) ---------- */
.site-footer { background: var(--ink); color: #e9e2da; margin-top: 64px; padding: 48px 0 28px; border-top: 4px solid var(--brand); }
.footer-inner { display: flex; flex-direction: column; gap: 14px; }
.brand--foot { color: #fff; font-size: 1.2rem; }
.brand--foot .dot { box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.site-footer .muted {
  color: #c5bcb0; font-size: .92rem; line-height: 1.65; margin: 0;
  max-width: 100%; overflow-wrap: break-word; text-wrap: pretty;
}
.site-footer .copy { font-size: .82rem; color: #b6ac9f; margin: 0; }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
html.reveal-on .reveal { opacity: 0; transform: translateY(18px); }
html.reveal-on .reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, html.reveal-on .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Page transition cover ---------- */
.page-cover {
  position: fixed; inset: 0; z-index: 200; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  opacity: 0; pointer-events: none; transition: opacity .28s var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.page-cover.active { opacity: 1; pointer-events: all; }
.page-cover .spinner {
  width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Page enter fade ---------- */
.page-enter { animation: pageEnter .5s var(--ease); }
@keyframes pageEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Toast (form feedback) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 14px 22px; border-radius: var(--radius-pill);
  font-size: .95rem; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 210;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease);
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #1f9d6b; }
.toast.error { background: #e23d54; }

:target { scroll-margin-top: 80px; }
