/* ============================================================
   ij7.tech editorial design system — components
   ============================================================ */

/* ---------- Topbar + masthead ------------------------------- */
.topbar {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  padding: 6px 0;
  text-align: center;
}
.topbar strong { font-weight: 600; }

.masthead {
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 40;
  transition: box-shadow 0.2s ease;
}
.masthead.is-stuck { box-shadow: var(--shadow); }
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}
.masthead-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.masthead-brand img { width: 32px; height: 32px; border-radius: 6px; }
.masthead-brand .brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
}
.masthead-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-top: -2px;
}

/* ---------- Primary nav -------------------------------------- */
.site-nav { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a.is-active { border-bottom-color: var(--accent); }
@media (max-width: 860px) { .site-nav { display: none; } }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 1px; }
@media (max-width: 860px) { .nav-toggle { display: flex; } }

.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer[hidden] { display: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.4); opacity: 0; transition: opacity 0.2s; }
.drawer.is-open .drawer-scrim { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 85vw);
  background: var(--paper-raised); padding: 24px 20px;
  transform: translateX(100%); transition: transform 0.25s ease;
  display: flex; flex-direction: column; gap: 18px;
}
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-close { align-self: flex-end; background: none; border: none; cursor: pointer; font-size: 1.4rem; }
.drawer-links { display: flex; flex-direction: column; gap: 14px; }
.drawer-links a { color: var(--ink); text-decoration: none; font-size: 1.05rem; font-weight: 500; }

/* ---------- Buttons -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 18px; border-radius: 6px;
  font-weight: 600; font-size: 0.92rem;
  text-decoration: none; border: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 30px; font-size: 1rem; }

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
/* The mark is a transparent WebP (the black-background JPEG read as a big
   black box on the page), so it gets a real glow that follows the artwork
   instead of a rectangular shadow. */
.hero-logo-xl {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 620px);
  max-height: 52vh;
  filter: drop-shadow(0 14px 38px color-mix(in srgb, var(--accent) 32%, transparent));
}

/* ---------- Breadcrumb ------------------------------------------ */
.breadcrumb { padding: 14px 0; font-size: 0.85rem; color: var(--text-dim); }
.breadcrumb ol { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--hairline); }
.breadcrumb a { color: var(--text-dim); }

/* ---------- Methodology strip ------------------------------------ */
.methodology-strip {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 20px 0 32px;
}
.methodology-strip h2 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--verified);
  margin: 0 0 10px;
}
.methodology-strip ol {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 6px;
}
.methodology-strip li {
  font-size: 0.9rem; color: var(--text-dim);
  padding-left: 1.6em; position: relative;
}
.methodology-strip li::before {
  content: counter(step); counter-increment: step;
  position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.78rem;
  color: var(--verified);
}
.methodology-strip ol { counter-reset: step; }

/* ---------- Verdict box ------------------------------------------ */
.verdict-box {
  background: var(--paper-raised);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 20px 24px;
  margin: 28px 0;
  box-shadow: var(--shadow);
}
.verdict-box .eyebrow { margin-bottom: 8px; }
.verdict-box p {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  margin: 0;
  max-width: none;
}
.verdict-box.caution { border-left-color: var(--caution); }
.verdict-box.verified { border-left-color: var(--verified); }

/* ---------- Comparison table -------------------------------------- */
.comparison-table-wrap { overflow-x: auto; margin: 24px 0; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.comparison-table th, .comparison-table td {
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
}
.comparison-table th {
  font-family: var(--font-mono); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-dim);
}
.comparison-table td.good { color: var(--verified); font-weight: 600; }
.comparison-table td.caution { color: var(--caution); font-weight: 600; }

/* ---------- Article layout with sidebar ---------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } }
.sidebar-related {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 18px;
  position: sticky;
  top: 90px;
}
@media (max-width: 900px) { .sidebar-related { position: static; } }
.sidebar-related h2 {
  font-family: var(--font-mono); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 12px; color: var(--text-dim);
}
.sidebar-related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sidebar-related a { font-size: 0.92rem; }
@media (max-width: 900px) {
  .sidebar-related { border: none; background: none; padding: 0; }
}

/* ---------- Hub grid cards ------------------------------------------ */
.hub-card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.hub-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.hub-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.hub-card p { margin: 0; font-size: 0.9rem; color: var(--text-dim); max-width: none; }
.hub-card .eyebrow { font-size: 0.7rem; }

/* ---------- FAQ accordion -------------------------------------------- */
.faq-list { border-top: 1px solid var(--hairline); margin-top: 20px; }
.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 16px 0; font-family: var(--font-display); font-size: 1.05rem;
  font-weight: 600; color: var(--ink); display: flex; justify-content: space-between;
}
.faq-q::after { content: "+"; color: var(--accent); font-size: 1.3rem; }
.faq-item.open .faq-q::after { content: "\2212"; }
.faq-a { display: none; padding: 0 0 16px; color: var(--text-dim); }
.faq-item.open .faq-a { display: block; }

/* ---------- Callout (compliance reminders) ---------------------------- */
.callout {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--caution);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 0.92rem;
}

/* ---------- Footer ----------------------------------------------------- */
.site-footer { border-top: 1px solid var(--hairline); padding: 48px 0 24px; margin-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-h { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin: 0 0 10px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--ink); font-size: 0.9rem; text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-note, .footer-age { font-size: 0.82rem; color: var(--text-dim); max-width: 42ch; }
.footer-bottom { border-top: 1px solid var(--hairline); margin-top: 32px; padding-top: 16px; font-size: 0.82rem; color: var(--text-dim); }

/* ---------- Fixed download bar + scroll-top ---------------------------- */
.fab-download {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(120%);
  opacity: 0; transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 50; text-decoration: none;
}
.fab-download.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.scroll-top {
  position: fixed; bottom: 20px; right: 20px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--paper-raised); border: 1px solid var(--hairline);
  box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  display: flex; align-items: center; justify-content: center;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }

/* ---------- Scroll-reveal -------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.4s ease, transform 0.4s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Cascade the cards inside a .reveal-group rather than snapping them in
   together. Delay only — the transition itself is unchanged, so nothing here
   can hold up first paint. */
.reveal-group > .reveal:nth-child(2) { transition-delay: 60ms; }
.reveal-group > .reveal:nth-child(3) { transition-delay: 120ms; }
.reveal-group > .reveal:nth-child(4) { transition-delay: 180ms; }
.reveal-group > .reveal:nth-child(5) { transition-delay: 240ms; }
.reveal-group > .reveal:nth-child(6) { transition-delay: 300ms; }
.reveal-group > .reveal:nth-child(7) { transition-delay: 360ms; }

/* ============================================================
   Section rhythm
   `main > section` carried no padding at all, so consecutive sections ran
   together and relied entirely on heading margins for separation.
   ============================================================ */
main > section { padding-block: clamp(30px, 4.6vw, 56px); }

/* The first block in a section would otherwise stack its own margin-top on
   top of that padding (h2 carries 2.2em, the boxed panels carry 20px). */
main > section > .container > :first-child,
main > section > .container > .eyebrow:first-child + h2 { margin-top: 0; }

/* ---------- Hero ----------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(34px, 5.5vw, 76px) clamp(26px, 3.6vw, 44px);
  background: radial-gradient(
    64% 116% at 50% 0%,
    color-mix(in srgb, var(--accent) 7%, transparent),
    transparent 72%
  );
}
.hero h1 { margin-bottom: 0.34em; }
.hero .lede { margin-bottom: 1em; }
.hero .byline { margin-bottom: 0; }

/* ---------- Card polish ---------------------------------------------- */
.hub-card {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
/* Accent rule that wipes in from the left on hover/focus. */
.hub-card::after {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.hub-card:hover,
.hub-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--hairline));
}
.hub-card:hover::after,
.hub-card:focus-visible::after { transform: scaleX(1); }
.hub-card h3 { transition: color 0.2s ease; }
.hub-card:hover h3 { color: var(--accent); }

/* ---------- Button polish -------------------------------------------- */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn:active { transform: translateY(0); }
/* Shine sweep. Sits above the background but below the label. */
.btn::after {
  content: "";
  position: absolute; top: 0; left: -60%;
  width: 38%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.26), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
  pointer-events: none;
}
.btn:hover::after { left: 125%; }
.fab-download:hover { transform: translateX(-50%) translateY(-2px); }

/* ---------- Nav underline -------------------------------------------- */
.site-nav a { transition: color 0.18s ease, border-color 0.18s ease; }
.site-nav a:hover { color: var(--accent); }

/* ---------- Motion opt-out -------------------------------------------
   Everything above is decorative. Users who ask for reduced motion get the
   finished state with no movement at all.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-group > .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    transition-delay: 0ms !important;
  }
  .hub-card,
  .hub-card::after,
  .btn,
  .site-nav a,
  .fab-download { transition: none; }
  .hub-card:hover,
  .hub-card:focus-visible,
  .btn:hover,
  .btn:active { transform: none; }
  .btn::after { display: none; }
  .fab-download:hover { transform: translateX(-50%); }
}
