/* ============================================
   STYLE: Editorial Paper — warm, sans-serif, timeline rows
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --paper: #f3efe6;
  --paper-2: #ece6d8;
  --card: #fbf9f3;
  --ink: #1c2117;
  --muted: #5e6356;
  --faint: #8f937f;
  --line: #d9d2c2;
  --accent: #2f5d3a;       /* forest green */
  --accent-2: #b5451b;     /* clay / terracotta */
  --accent-soft: #e7eee5;
  --gold: #c08a1e;
  --star: #c08a1e;
  --radius: 6px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
.uil { line-height: 1; vertical-align: -.1em; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, .serif { font-family: 'Inter', system-ui, sans-serif; }

/* keyboard focus ring for accessibility */
a:focus-visible, button:focus-visible, .viewp:focus-visible, .t:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

.shell { max-width: 940px; margin: 0 auto; padding: 0 28px; }

/* skip link */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 2px solid var(--ink);
  background: rgba(243,239,230,.9);
  backdrop-filter: saturate(140%) blur(10px);
}
.masthead .shell {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 28px;
}
.masthead .logo {
  font-family: 'Inter', sans-serif; font-weight: 900; font-size: 20px; letter-spacing: -.3px;
  display: inline-flex; align-items: center; gap: 9px;
}
.masthead .logo i { color: var(--accent); }
.masthead .logo img { width: 24px; height: 24px; display: block; }
.masthead .issue {
  margin-left: auto; font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.masthead nav a {
  font-size: 12px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: color .15s;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); padding: 8px 14px; border-radius: 100px;
  background: var(--card);
}
.masthead nav a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Headline block ---------- */
.headline { padding: 56px 0 30px; border-bottom: 1px solid var(--line); }
.headline .kicker {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase; font-weight: 700;
  color: var(--accent-2); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.headline .kicker::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.headline h1 {
  font-size: 56px; font-weight: 900; line-height: 1.04; letter-spacing: -1.5px;
}
.headline h1 em { font-style: italic; color: var(--accent); }
.headline .standfirst {
  margin-top: 22px; font-size: 18px; color: var(--muted); max-width: 660px;
  font-family: 'Inter', sans-serif; font-weight: 400; line-height: 1.5;
}
.headline .byline {
  margin-top: 26px; display: flex; gap: 26px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}
.headline .byline b { color: var(--ink); font-weight: 600; }
.headline .byline span { display: inline-flex; align-items: center; gap: 7px; }
.headline .byline i { color: var(--accent); }

/* ---------- Expert Pick card ---------- */
.expert-pick {
  position: relative;
  margin: 24px 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 22px 24px;
}
.expert-pick .ep-badge {
  position: absolute; top: -11px; left: 20px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--paper); background: var(--accent);
  padding: 4px 11px; border-radius: 100px;
}
.expert-pick .ep-badge i { font-size: 13px; }
.expert-pick .ep-avatar {
  margin: 0; width: 72px; height: 72px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--accent-soft); box-shadow: 0 2px 8px rgba(28,33,23,.12);
}
.expert-pick .ep-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.expert-pick .ep-body { min-width: 0; }
.expert-pick .ep-lede {
  font-size: 14px; color: var(--muted); margin: 4px 0 0;
}
.expert-pick .ep-lede strong { color: var(--accent); font-weight: 700; }
.expert-pick .ep-quote {
  margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink);
  font-weight: 500; font-style: italic;
}
.expert-pick .ep-attrib {
  margin: 10px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px;
  font-size: 12px; color: var(--faint);
}
.expert-pick .ep-attrib .ep-name { font-weight: 700; color: var(--ink); letter-spacing: .2px; }
.expert-pick .ep-attrib .ep-role { position: relative; padding-left: 12px; }
.expert-pick .ep-attrib .ep-role::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--line);
}

/* ---------- Methodology / rules note ---------- */
.note-block { padding: 26px 0; border-bottom: 1px solid var(--line); }
.note-block .inner {
  display: grid; grid-template-columns: 150px 1fr; gap: 26px;
}
.note-block .tag {
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 15px; color: var(--accent);
  border-left: 3px solid var(--accent); padding-left: 14px; height: fit-content;
}
.note-block p { font-size: 13.5px; color: var(--muted); line-height: 1.75; }
.note-block p + p { margin-top: 12px; }
.note-block strong { color: var(--ink); }
.note-block ul { margin: 10px 0 0 0; padding-left: 18px; }
.note-block li { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ---------- Section label ---------- */
.section-label {
  padding: 34px 0 10px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.section-label h2 { font-size: 15px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink); font-weight: 700; }
.section-label .count { font-size: 12.5px; color: var(--faint); }

/* ---------- Ranked rows (timeline list) ---------- */
.rows { padding-bottom: 10px; }

.rows { scroll-margin-top: 90px; }
.entry {
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr 212px;
  gap: 26px;
  padding: 30px 22px;
  margin: 0 -22px;
  border-top: 1px solid var(--line);
  border-radius: 12px;
  align-items: start;
  transition: background .2s, box-shadow .2s, transform .2s;
}
.entry + .entry { border-top: 1px solid var(--line); }
.entry:hover {
  background: var(--card);
  box-shadow: 0 10px 30px rgba(28,33,23,.08);
  transform: translateY(-2px);
  border-top-color: transparent;
  z-index: 1;
}
.entry:last-of-type { border-bottom: 1px solid var(--line); }
.entry:last-of-type:hover { border-bottom-color: transparent; }

.entry .rank {
  font-family: 'Inter', sans-serif; font-weight: 900; font-size: 46px; line-height: .9;
  color: var(--line); letter-spacing: -2px;
}
.entry .rank .hash { font-size: 15px; vertical-align: super; color: var(--faint); margin-right: 1px; }

.entry .main { min-width: 0; }
.entry .idrow { display: flex; align-items: center; gap: 13px; }
.entry .badge {
  width: 44px; height: 44px; border-radius: 9px; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px; font-family: 'Inter', sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.entry h3 { font-size: 23px; font-weight: 700; letter-spacing: -.4px; line-height: 1.1; }
.entry .for {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  font-family: 'Inter', sans-serif;
}
.entry .for b { color: var(--accent-2); font-weight: 600; }

.entry .pick-flag {
  display: inline-block; margin-left: 10px; vertical-align: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--paper); background: var(--accent); padding: 3px 9px; border-radius: 3px;
}

.entry .excerpt { font-size: 14px; color: var(--muted); line-height: 1.7; margin-top: 14px; }

/* trust chips */
.entry .chips { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.entry .chips .chip {
  font-size: 11.5px; font-weight: 600; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.entry .chips .chip i { color: var(--accent-2); }

/* highlight strip */
.entry .highlight {
  margin-top: 14px; display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; font-weight: 500; color: var(--ink);
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0; padding: 11px 14px;
}
.entry .highlight i { color: var(--gold); font-size: 15px; margin-top: 1px; flex: none; }

/* services as inline tags */
.entry .tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.entry .tags .t {
  font-size: 11.5px; font-weight: 500; color: var(--ink);
  background: var(--accent-soft); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 100px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; transition: background .15s, border-color .15s, color .15s;
}
.entry .tags .t i { color: var(--accent); }
.entry .tags .t:hover, .entry .tags .t.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.entry .tags .t:hover i, .entry .tags .t.active i { color: #fff; }

.entry .foot { margin-top: 18px; display: flex; align-items: center; gap: 18px; }
.entry .viewp {
  font-size: 12.5px; font-weight: 600; color: var(--accent); cursor: pointer;
  border-bottom: 1px solid var(--accent); padding-bottom: 1px; transition: opacity .15s;
}
.entry .viewp:hover { opacity: .65; }
.entry .visit {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 0 0 1px; margin: 0; line-height: inherit;
  transition: color .15s, border-color .15s;
}
.entry .visit:hover { color: var(--accent-2); border-color: var(--accent-2); }

/* right column — scores panel */
.entry .scorecol {
  border-left: 1px solid var(--line); padding-left: 22px;
}
.scoreblock { margin-bottom: 16px; }
.scoreblock:last-child { margin-bottom: 0; }
.scoreblock .k {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700;
  color: var(--faint); margin-bottom: 4px;
}
.scoreblock.ed .k { color: var(--accent-2); }
.scoreblock .num {
  font-family: 'Inter', sans-serif; font-weight: 900; font-size: 34px; line-height: 1; color: var(--ink);
}
.scoreblock.ed .num { color: var(--accent); }
.scoreblock .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.scoreblock .stars { color: var(--star); font-size: 12px; letter-spacing: 1px; margin-left: 2px; }
/* thin progress bar under each score (0–5 scale) */
.scoreblock .bar {
  height: 4px; border-radius: 100px; background: var(--line); margin-top: 8px; overflow: hidden;
}
.scoreblock .bar > span {
  display: block; height: 100%; border-radius: 100px; width: 0;
  background: var(--faint); transition: width .9s cubic-bezier(.2,.7,.2,1);
}
.scoreblock.ed .bar > span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.entry.lead { background: linear-gradient(90deg, var(--card), transparent 85%); }
.entry.lead:hover { background: var(--card); }
.entry.lead .rank { color: var(--accent); }
.entry.lead .scorecol { border-left-color: var(--accent); }

/* clickable company name -> profile */
.entry h3 a { color: inherit; display: inline; transition: color .15s; }
.entry h3 a:hover { color: var(--accent); }

.entry .foot .arrow { transition: transform .15s; }
.entry .viewp:hover .arrow, .entry .visit:hover .arrow { transform: translateX(2px); }

/* ---------- Interleaved promo strip ---------- */
.promo-strip {
  margin: 10px 0; padding: 26px 28px; border-radius: var(--radius);
  background: var(--accent); color: var(--paper);
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.promo-strip .pico {
  width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: rgba(255,255,255,.14); font-size: 22px;
}
.promo-strip h3 { font-size: 20px; font-weight: 700; color: var(--paper); }
.promo-strip p { font-size: 13px; color: rgba(243,239,230,.78); margin-top: 2px; }
.promo-strip .pbtn {
  margin-left: auto; cursor: pointer; border: none;
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 700; letter-spacing: .5px;
  color: var(--accent); background: var(--paper); padding: 12px 22px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 7px; transition: transform .15s;
}
.promo-strip .pbtn:hover { transform: translateY(-2px); }

/* ---------- Verify + closing CTA ---------- */
.verify-block {
  margin-top: 10px; padding: 22px 0; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); line-height: 1.75;
}
.verify-block strong { color: var(--ink); }

.closing {
  margin: 36px 0 70px; padding: 40px; border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}
.closing h3 { font-family: 'Inter', sans-serif; font-size: 27px; font-weight: 800; color: var(--paper); letter-spacing: -.4px; }
.closing p { font-size: 14px; color: rgba(243,239,230,.72); margin-top: 8px; max-width: 520px; }
.closing .cbtn {
  margin-left: auto; cursor: pointer; white-space: nowrap;
  font-weight: 700; font-size: 14px; color: var(--ink); background: var(--gold);
  padding: 15px 28px; border-radius: 100px; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s;
}
.closing .cbtn:hover { transform: translateY(-2px); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .headline h1 { font-size: 42px; }
  .entry { grid-template-columns: 54px 1fr; }
  .entry .rank { font-size: 34px; }
  .entry .scorecol {
    grid-column: 1 / -1; border-left: none; padding-left: 0;
    border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px;
    display: flex; gap: 32px;
  }
  .note-block .inner { grid-template-columns: 1fr; gap: 10px; }
  .expert-pick { grid-template-columns: 1fr; gap: 14px; text-align: center; justify-items: center; }
  .expert-pick .ep-attrib { justify-content: center; }
  .promo-strip, .closing { flex-direction: column; align-items: flex-start; }
  .promo-strip .pbtn, .closing .cbtn { margin-left: 0; }
}
@media (max-width: 520px) {
  .shell { padding: 0 18px; }
  .headline { padding: 38px 0 24px; }
  .headline h1 { font-size: 31px; }
  .masthead .shell { padding: 14px 16px; }
  .masthead nav a { padding: 7px 11px; font-size: 11px; }
  .masthead .issue { display: none; }
  .entry { grid-template-columns: 44px 1fr; gap: 16px; padding: 24px 16px; margin: 0 -16px; }
}

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

/* ============================================
   PROFILE — side drawer
   ============================================ */
.profile-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(28,33,23,.4);
  opacity: 0; visibility: hidden; transition: opacity .25s;
}
.profile-overlay.open { opacity: 1; visibility: visible; }
.profile-panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(560px, 100%); overflow-y: auto;
  background: var(--paper);
  border-left: 2px solid var(--ink);
  box-shadow: -30px 0 80px rgba(28,33,23,.2);
  transform: translateX(100%); transition: transform .3s ease;
}
.profile-overlay.open .profile-panel { transform: translateX(0); }

.profile-hero {
  position: relative; padding: 28px 30px 24px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-2);
}
.profile-close {
  position: absolute; top: 20px; right: 22px; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-size: 18px; cursor: pointer; display: grid; place-items: center; transition: border-color .15s, color .15s;
}
.profile-close:hover { border-color: var(--accent-2); color: var(--accent-2); }
.profile-top { display: flex; align-items: center; gap: 15px; }
.profile-logo {
  width: 54px; height: 54px; border-radius: 11px; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 18px; font-family: 'Inter', sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.profile-rankchip {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 3px; margin-bottom: 7px;
}
.profile-name { font-family: 'Inter', sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -.4px; line-height: 1.12; }
.profile-tagline { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.profile-scorebar { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.profile-score {
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 16px;
  display: flex; align-items: center; gap: 11px; background: var(--paper);
}
.profile-score .num { font-family: 'Inter', sans-serif; font-size: 26px; font-weight: 900; line-height: 1; }
.profile-score.ed .num { color: var(--accent); }
.profile-score .meta { font-size: 10.5px; color: var(--muted); line-height: 1.35; }

.profile-body { padding: 26px 30px 36px; }
.profile-section { margin-bottom: 26px; }
.profile-section h4 {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-2);
  font-weight: 700; margin-bottom: 13px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.profile-section p { font-size: 14px; color: var(--ink); line-height: 1.75; }
.profile-section p + p { margin-top: 10px; }

.profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-facts .pf {
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px;
  display: flex; align-items: center; gap: 10px; background: var(--card);
}
.profile-facts .pf i { color: var(--accent); font-size: 18px; flex: none; }
.profile-facts .pf .k { font-size: 10.5px; color: var(--muted); }
.profile-facts .pf .v { font-size: 13px; font-weight: 600; }

.profile-note {
  border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 13px 16px;
  background: var(--accent-soft); font-size: 13px; color: var(--ink); line-height: 1.6;
}
.profile-note .tag { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .5px; color: var(--accent); margin-bottom: 5px; }

.profile-services { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-services .chip {
  border: 1px solid var(--line); border-radius: 100px; padding: 7px 13px; font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 7px; background: var(--card);
}
.profile-services .chip i { color: var(--accent); }

.profile-verified { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.profile-verified li { display: flex; gap: 9px; font-size: 13px; color: var(--ink); line-height: 1.55; }
.profile-verified li i { color: var(--accent); font-size: 15px; margin-top: 2px; flex: none; }

.profile-sources { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.profile-sources li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.profile-sources li i { color: var(--accent); flex: none; }

.profile-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.profile-actions .pbtn {
  flex: 1; min-width: 160px; text-align: center; cursor: pointer;
  padding: 13px 20px; border-radius: 100px; font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.profile-actions .pbtn.primary { color: var(--paper); background: var(--accent); border: none; }
.profile-actions .pbtn.primary:hover { filter: brightness(1.1); }
.profile-actions .pbtn.secondary { color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.profile-actions .pbtn.secondary:hover { border-color: var(--accent); color: var(--accent); }

body.profile-locked { overflow: hidden; }

@media (max-width: 520px) {
  .profile-hero { padding: 22px 20px; }
  .profile-body { padding: 20px 20px 28px; }
  .profile-facts { grid-template-columns: 1fr; }
  .profile-name { font-size: 20px; }
}
