/* PetFoodCheck — Master stylesheet
   Combines: tokens + components + pages from design handoff */

/* ═══════════════════ FONTS ═══════════════════ */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

/* ═══════════════════ TOKENS ═══════════════════ */
:root {
  --brand-50:  #FFF4EC;
  --brand-100: #FFE4D1;
  --brand-200: #FFC8A3;
  --brand-300: #FFA870;
  --brand-400: #FF8744;
  --brand-500: #FF6B2C;
  --brand-600: #E6501A;
  --brand-700: #BE3C12;
  --brand-800: #8E2C0D;

  --ink-1: #1A1511;
  --ink-2: #2E2620;
  --ink-3: #5E534A;
  --ink-4: #8A7E74;
  --ink-5: #B6ABA0;
  --ink-6: #DED5C8;
  --ink-7: #F2ECE2;
  --ink-8: #F9F5EE;
  --paper: #FFFBF4;
  --white: #FFFFFF;

  --good-bg: #E6F5EC;
  --good-fg: #1E8A4F;
  --good-500: #2FB574;
  --warn-bg: #FFF2D8;
  --warn-fg: #A9780B;
  --warn-500: #F4A82A;
  --info-bg: #E8EEFF;
  --info-fg: #2F5CD6;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(26,21,17,.04), 0 1px 4px rgba(26,21,17,.04);
  --sh-2: 0 2px 4px rgba(26,21,17,.04), 0 8px 24px rgba(26,21,17,.06);
  --sh-3: 0 4px 8px rgba(26,21,17,.04), 0 16px 40px rgba(26,21,17,.08);
  --sh-brand: 0 6px 24px rgba(255,107,44,.22);

  --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: 24px;
  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.pfc {
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'ss02';
  color: var(--ink-1);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
body.pfc img, body.pfc svg { display: block; }
body.pfc a { color: inherit; text-decoration: none; }
body.pfc button { font-family: inherit; cursor: pointer; border: none; background: none; }
body.pfc input, body.pfc select { font-family: inherit; }

.num { font-family: var(--font-mono); font-feature-settings: 'tnum' 1, 'zero' 1; letter-spacing: -0.01em; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* ═══════════════════ COMPONENTS ═══════════════════ */

/* Top nav */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 251, 244, 0.88);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--ink-7);
}
.topnav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
  color: var(--ink-1);
}
.logo__mark {
  width: 34px; height: 34px; border-radius: 12px;
  background: var(--brand-500);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-brand);
}
.topnav__links { display: flex; gap: 28px; margin-left: 16px; }
.topnav__links a {
  font-weight: 500; font-size: 15px; color: var(--ink-2);
  padding: 8px 0;
  transition: color .15s;
}
.topnav__links a:hover { color: var(--brand-500); }
.topnav__actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.search {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink-8);
  border: 1px solid var(--ink-7);
  padding: 8px 12px;
  border-radius: var(--r-pill);
  width: 280px;
  transition: all .15s;
}
.search:hover { border-color: var(--brand-200); background: var(--white); }
.search__icon { color: var(--ink-4); display: inline-flex; }
.search input {
  border: none; background: transparent; outline: none; flex: 1;
  font-size: 14px; color: var(--ink-2);
}
.search input::placeholder { color: var(--ink-4); }
.search kbd {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--white); border: 1px solid var(--ink-6);
  padding: 2px 6px; border-radius: 6px; color: var(--ink-4);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  transition: all .15s;
  font-size: 15px;
}
.btn--primary {
  background: var(--brand-500); color: #fff;
  box-shadow: var(--sh-brand);
}
.btn--primary:hover { background: var(--brand-600); }
.btn--ink { background: var(--ink-1); color: #fff; }
.btn--ink:hover { background: var(--ink-2); }
.btn--ghost {
  background: var(--white); color: var(--ink-1);
  border: 1px solid var(--ink-6);
}
.btn--ghost:hover { border-color: var(--ink-4); }
.btn--soft { background: var(--brand-50); color: var(--brand-700); }
.btn--soft:hover { background: var(--brand-100); }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--lg { padding: 14px 24px; font-size: 16px; }
.btn--block { width: 100%; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--ink-8);
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--ink-7);
}
.chip--brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.chip--ink { background: var(--ink-1); color: #fff; border-color: var(--ink-1); }
.chip--good { background: var(--good-bg); color: var(--good-fg); border-color: transparent; }
.chip--warn { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.chip--sm { padding: 3px 8px; font-size: 12px; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--r-xl);
  border: 1px solid var(--ink-7);
  padding: 20px;
}
.card--flat { box-shadow: none; }
.card--elev { box-shadow: var(--sh-2); border-color: transparent; }
.card--brand { background: var(--brand-50); border-color: var(--brand-100); }

/* Stars */
.stars { display: inline-flex; align-items: center; gap: 2px; color: var(--brand-500); }
.stars svg { width: 16px; height: 16px; }
.stars--sm svg { width: 13px; height: 13px; }
.stars--lg svg { width: 20px; height: 20px; }

/* Bars */
.bar {
  height: 10px; background: var(--ink-7); border-radius: var(--r-pill);
  overflow: hidden;
}
.bar > i {
  display: block; height: 100%; background: var(--ink-2); border-radius: var(--r-pill);
  transition: width .5s ease;
}
.bar--brand > i { background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); }
.bar--good > i { background: var(--good-500); }

/* Footer */
.site-footer {
  background: var(--ink-8);
  margin-top: 120px;
  padding: 48px 0 32px;
  border-top: 1px solid var(--ink-7);
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
}
.foot-desc { color: var(--ink-3); font-size: 14px; margin: 12px 0 0; }
.foot-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; }
.foot-cols h5 { font-size: 13px; color: var(--ink-4); margin: 0 0 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.foot-cols a { display: block; font-size: 14px; color: var(--ink-2); padding: 4px 0; }
.foot-cols a:hover { color: var(--brand-500); }
.site-footer__bottom {
  max-width: var(--container); margin: 32px auto 0; padding: 20px var(--gutter) 0;
  border-top: 1px solid var(--ink-7);
  color: var(--ink-4); font-size: 12px; line-height: 1.55;
}

/* Placeholder images */
.ph-img {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(135deg, var(--ink-8) 0 10px, var(--ink-7) 10px 11px);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4); font-family: var(--font-mono); font-size: 11px;
}
.ph-img__inner {
  background: rgba(255, 251, 244, .8);
  padding: 4px 10px; border-radius: 6px;
}

/* ═══════════════════ REVIEW PAGE ═══════════════════ */

.review-header { padding: 28px 0 0; }
.breadcrumb { font-size: 13px; color: var(--ink-4); margin-bottom: 12px; }
.breadcrumb a { color: var(--ink-4); }
.breadcrumb a:hover { color: var(--brand-500); }
.breadcrumb .sep { margin: 0 6px; color: var(--ink-6); }

.review-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  padding: 20px 0 60px;
  align-items: start;
}

.review-hero {
  display: grid; grid-template-columns: 280px 1fr; gap: 32px;
  background: var(--white);
  border-radius: var(--r-2xl);
  padding: 28px;
  border: 1px solid var(--ink-7);
  margin-bottom: 24px;
}
.review-hero__media {
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--ink-8);
  position: relative;
}
.review-hero__media .ph-img__inner { font-size: 13px; padding: 6px 14px; }
.review-hero__media img { width: 100%; height: 100%; object-fit: contain; }
.review-hero__info h1 {
  font-size: 28px; font-weight: 800; letter-spacing: -0.025em;
  margin: 8px 0 10px; line-height: 1.25;
}
.review-hero__brand { font-size: 14px; color: var(--brand-600); font-weight: 600; }
.review-hero__rating {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0 16px;
}
.review-hero__rating .score { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.review-hero__rating .count { font-size: 13px; color: var(--ink-4); }
.review-hero__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.review-hero__summary {
  padding: 14px 16px;
  background: var(--brand-50);
  border-radius: var(--r-lg);
  font-size: 14px;
  color: var(--brand-800);
  line-height: 1.55;
}
.review-hero__summary b { font-weight: 700; }

/* DM Dashboard */
.dm-dashboard {
  background: var(--white); border-radius: var(--r-2xl);
  padding: 28px; border: 1px solid var(--ink-7); margin-bottom: 24px;
}
.dm-dashboard__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
}
.dm-dashboard__head h2 { font-size: 20px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.015em; }
.dm-dashboard__head p { font-size: 13px; color: var(--ink-4); margin: 0; }
.dm-dashboard__toggle {
  display: inline-flex; background: var(--ink-8); border-radius: var(--r-pill); padding: 4px;
}
.dm-dashboard__toggle button {
  font-size: 12px; font-weight: 600; padding: 6px 14px;
  border-radius: var(--r-pill); color: var(--ink-3); transition: all .15s;
}
.dm-dashboard__toggle button.active { background: var(--ink-1); color: #fff; }

.dm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dm-metric {
  border: 1px solid var(--ink-7);
  border-radius: var(--r-lg);
  padding: 16px;
  background: var(--ink-8);
  transition: all .15s;
}
.dm-metric:hover { background: var(--white); border-color: var(--brand-200); }
.dm-metric__label { font-size: 12px; color: var(--ink-4); font-weight: 600; }
.dm-metric__value {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  margin: 4px 0 6px;
  font-family: var(--font-mono); font-feature-settings: 'tnum' 1;
}
.dm-metric__compare {
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 8px; border-radius: var(--r-pill); font-weight: 600;
}
.dm-metric__compare--up { background: var(--good-bg); color: var(--good-fg); }
.dm-metric__compare--down { background: var(--info-bg); color: var(--info-fg); }
.dm-metric__compare--mid { background: var(--ink-7); color: var(--ink-3); }

.dm-bars {
  margin-top: 20px; padding-top: 20px;
  border-top: 1px dashed var(--ink-7);
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px;
}
.dm-bar__head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.dm-bar__head b { font-family: var(--font-mono); }
.dm-bar__avg { font-size: 11px; color: var(--ink-4); margin-top: 4px; font-family: var(--font-mono); }

/* Section cards */
.section-card {
  background: var(--white); border-radius: var(--r-2xl);
  padding: 28px; border: 1px solid var(--ink-7); margin-bottom: 24px;
}
.section-card h2 { font-size: 20px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.015em; }
.section-card > p { font-size: 13px; color: var(--ink-4); margin: 0 0 20px; }

/* Ingredients */
.ing-list { display: flex; flex-direction: column; gap: 10px; }
.ing-item {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 16px;
  padding: 14px 16px; background: var(--ink-8); border-radius: var(--r-lg);
}
.ing-item__rank {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink-1); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.ing-item__rank--top { background: var(--brand-500); }
.ing-item__name { font-weight: 700; font-size: 15px; }
.ing-item__note { font-size: 12px; color: var(--ink-4); margin-top: 2px; }

/* External reviews */
.ext-reviews { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ext-review {
  background: var(--ink-8); border-radius: var(--r-lg); padding: 16px;
  display: grid; grid-template-columns: 80px 1fr; gap: 14px;
  transition: all .15s;
}
.ext-review:hover { background: var(--ink-7); }
.ext-review__thumb {
  width: 80px; height: 56px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px;
}
.ext-review__title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.ext-review__meta { font-size: 12px; color: var(--ink-4); margin-top: 4px; }

/* Sidebar */
.review-sidebar {
  position: sticky; top: 88px;
  display: flex; flex-direction: column; gap: 16px;
}
.buy-card {
  background: var(--white); border-radius: var(--r-2xl);
  padding: 20px; border: 1px solid var(--ink-7);
  box-shadow: var(--sh-2);
}
.buy-card__label { font-size: 12px; color: var(--ink-4); font-weight: 600; }
.buy-card__price {
  font-size: 32px; font-weight: 800; letter-spacing: -0.025em;
  margin: 4px 0 2px;
  font-family: var(--font-mono); font-feature-settings: 'tnum' 1;
}
.buy-card__meta { font-size: 12px; color: var(--ink-4); margin-bottom: 16px; }
.buy-card__ctas { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.buy-card__history {
  padding: 12px; background: var(--ink-8); border-radius: var(--r-md); font-size: 12px;
}
.buy-card__history__row { display: flex; justify-content: space-between; margin: 3px 0; }
.buy-card__history__row b { font-family: var(--font-mono); color: var(--ink-2); }

/* Calculator */
.calc-card {
  background: linear-gradient(160deg, var(--brand-50), var(--ink-8));
  border-radius: var(--r-2xl);
  padding: 20px;
  border: 1px solid var(--brand-100);
}
.calc-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.calc-card__head h3 { font-size: 16px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.calc-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.calc-row__label { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.calc-row__input { display: flex; align-items: center; gap: 4px; }
.calc-stepper {
  display: inline-flex; align-items: center;
  background: var(--white); border: 1px solid var(--ink-6);
  border-radius: var(--r-pill); overflow: hidden;
}
.calc-stepper button {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-weight: 700;
}
.calc-stepper button:hover { background: var(--ink-8); color: var(--brand-500); }
.calc-stepper input {
  width: 48px; text-align: center; border: none; outline: none;
  background: transparent; font-weight: 700; font-size: 14px;
  font-family: var(--font-mono);
}
.calc-seg {
  display: inline-flex; background: var(--white); border: 1px solid var(--ink-6);
  border-radius: var(--r-pill); padding: 2px;
}
.calc-seg button {
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--r-pill); color: var(--ink-3); transition: all .15s;
}
.calc-seg button.active { background: var(--ink-1); color: #fff; }

.calc-output {
  margin-top: 14px; padding: 14px;
  background: var(--white); border-radius: var(--r-lg);
  border: 1px dashed var(--brand-200);
}
.calc-output__row { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin: 3px 0; }
.calc-output__row b { font-family: var(--font-mono); color: var(--ink-1); font-weight: 700; }
.calc-output__big {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--brand-200);
  display: flex; justify-content: space-between; align-items: baseline;
}
.calc-output__big .label { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.calc-output__big .amount {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--brand-600);
  font-family: var(--font-mono); font-feature-settings: 'tnum' 1;
}

/* Related */
.related-list { display: flex; flex-direction: column; gap: 8px; }
.related-item {
  display: grid; grid-template-columns: 48px 1fr auto;
  align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-md);
  transition: all .1s; cursor: pointer;
}
.related-item:hover { background: var(--ink-8); }
.related-item__thumb {
  width: 48px; height: 48px; border-radius: var(--r-sm);
  background: var(--ink-8); overflow: hidden;
}
.related-item__name { font-size: 13px; font-weight: 600; line-height: 1.35; }
.related-item__meta { font-size: 11px; color: var(--ink-4); font-family: var(--font-mono); }

/* Price tier comparison */
.price-compare { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.price-compare__col {
  background: var(--ink-8); padding: 16px;
  border-radius: var(--r-lg); position: relative;
}
.price-compare__col--this {
  background: var(--brand-50);
  border: 2px solid var(--brand-500);
}
.price-compare__pill {
  position: absolute; top: -10px; left: 12px;
  background: var(--brand-500); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-pill);
  letter-spacing: .04em; text-transform: uppercase;
}
.price-compare__name { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.price-compare__price { font-size: 12px; color: var(--ink-4); font-family: var(--font-mono); margin-bottom: 10px; }
.price-compare__metric { font-size: 11px; color: var(--ink-4); }
.price-compare__metric b {
  display: block; font-size: 18px; color: var(--ink-1);
  font-family: var(--font-mono); font-weight: 800; letter-spacing: -0.01em; margin-top: 2px;
}

/* Disclosure */
.disclosure {
  background: var(--ink-8);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.55;
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.disclosure svg { color: var(--ink-4); flex-shrink: 0; margin-top: 1px; }
