/* Supply Chain Software Guide — v4
   Aesthetic: Dark hero / structured light body / Playfair Display + Syne
   References: Palladium Magazine, Lux Capital, basement.studio craft level */

:root {
  --ink:        #0d0d0f;
  --ink-2:      #1c1c21;
  --ink-3:      #2e2e36;
  --body-bg:    #f8f7f4;
  --tinted-bg:  #f0ede8;
  --dark-bg:    #0f1117;
  --dark-2:     #161820;
  --white:      #ffffff;
  --muted:      #666470;
  --faint:      #9c9aa6;
  --rule:       #e2ddd8;
  --rule-dark:  #272730;
  --gold:       #c9a84c;
  --gold-light: #f0e6c8;
  --max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

body {
  font-family: 'Syne', ui-sans-serif, system-ui, sans-serif;
  background: var(--body-bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── LAYOUT ─────────────────────────────────────────────── */
.wrap {
  width: min(var(--max), calc(100% - 56px));
  margin-inline: auto;
}

/* ── ANIMATIONS ─────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.22,.68,0,1.2), transform 0.7s cubic-bezier(.22,.68,0,1.2);
}
.fade-up.in {
  opacity: 1;
  transform: translateY(0);
}

/* ── HEADER ─────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,15,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.3;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item { position: relative; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  user-select: none;
}

.caret { font-size: 10px; }

.nav-item:hover .nav-btn,
.nav-item:focus-within .nav-btn {
  color: var(--white);
  background: rgba(255,255,255,0.07);
}

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 200;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 5px;
  transition: background 0.12s;
}
.dropdown a:hover { background: rgba(255,255,255,0.06); }
.dropdown a span {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
}
.dropdown a small {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.4);
}

.cta-btn {
  padding: 9px 20px;
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.cta-btn:hover { opacity: 0.85; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--dark-bg);
  padding: 110px 0 100px;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.7;
}

.hero-eyebrow {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.35);
  padding: 5px 11px;
  border-radius: 3px;
}

.hero-h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--white);
  max-width: 14ch;
  margin-bottom: 28px;
}

.hero-h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.72;
  max-width: 52ch;
  margin-bottom: 44px;
  font-weight: 400;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 28px;
}

.hero-links a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding-right: 28px;
  transition: color 0.14s;
}
.hero-links a:hover { color: var(--gold); }

/* ── CONTEXT BAND ────────────────────────────────────────── */
.band-context {
  background: var(--ink-2);
  padding: 64px 0;
}

.band-inner {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

.band-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  padding-top: 8px;
  flex-shrink: 0;
  min-width: 160px;
}

.band-quote {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-style: italic;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
  border: none;
  padding: 0;
}

/* ── SECTIONS ────────────────────────────────────────────── */
section { scroll-margin-top: 80px; }
.section { padding: 88px 0; }
.section--tinted { background: var(--tinted-bg); }
.section--dark { background: var(--ink-2); }

.section-header {
  margin-bottom: 56px;
  max-width: 680px;
}

.section-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.section-label--light { color: rgba(201,168,76,0.8); }

.section-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 16px;
}

.h2--light { color: var(--white) !important; }

.section-desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.72;
}

.section-desc--light { color: rgba(255,255,255,0.45); }

/* ── CATEGORY GRID ───────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.cat-card {
  padding: 36px 28px 32px;
  border-right: 1px solid var(--rule);
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.2s;
}

.cat-card:last-child { border-right: none; }
.cat-card:hover { background: #fdfcfa; }

.cat-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--rule);
  line-height: 1;
  display: block;
}

.cat-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.cat-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.68;
  flex: 1;
}

.cat-examples {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}


/* ── VENDOR TABLE ────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--white);
}

.vendor-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.vendor-table thead tr {
  border-bottom: 1px solid var(--rule);
}

.vendor-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--tinted-bg);
}

.vendor-table tbody tr {
  border-bottom: 1px solid var(--rule);
  transition: background 0.12s;
}

.vendor-table tbody tr:last-child { border-bottom: none; }
.vendor-table tbody tr:hover { background: var(--body-bg); }

.vendor-table tbody td {
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--muted);
  vertical-align: middle;
}

.vdr-name {
  font-weight: 700 !important;
  color: var(--ink) !important;
  white-space: nowrap;
}

.cat-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  background: var(--tinted-bg);
  color: var(--muted);
  border: 1px solid var(--rule);
}



.tbl-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: 0.04em;
  transition: color 0.14s;
  white-space: nowrap;
}
.tbl-link:hover { color: var(--ink); }



/* ── CRITERIA ────────────────────────────────────────────── */
.criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.criteria-item {
  display: flex;
  gap: 20px;
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  align-items: flex-start;
}

/* right column: no right border */
.criteria-item:nth-child(2n) { border-right: none; }
/* last item always: no bottom border, no right border */
.criteria-item:last-child { border-bottom: none; border-right: none; }
/* if odd total: last item spans full width */
.criteria-item:last-child:nth-child(odd) { grid-column: span 2; }
/* item before last, if it's a left-column item (odd): no bottom border */
.criteria-item:nth-last-child(2):nth-child(odd) { border-bottom: none; }

.criteria-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  color: var(--rule);
  flex-shrink: 0;
  margin-top: 2px;
}

.criteria-item h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.criteria-item p {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ── FURTHER READING ─────────────────────────────────────── */
.reading-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 64px;
}

.col-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 0 0 16px;
  border-bottom: 1px solid var(--rule-dark);
}

.reading-link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-dark);
  cursor: pointer;
  transition: none;
}

.reading-link:last-child { border-bottom: none; }

.rl-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  line-height: 1.3;
  grid-column: 1;
  grid-row: 1;
  transition: color 0.14s;
}

.reading-link:hover .rl-title { color: var(--gold); }

.rl-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.3);
  line-height: 1.55;
  grid-column: 1;
  grid-row: 2;
}

.rl-arrow {
  font-size: 1rem;
  color: rgba(255,255,255,0.2);
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  transition: color 0.14s, transform 0.14s;
}

.reading-link:hover .rl-arrow {
  color: var(--gold);
  transform: translateX(3px);
}

/* ── FOOTER ──────────────────────────────────────────────── */
.footer {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 32px 0;
}

.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-name {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
}

.footer-note {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .wrap { width: calc(100% - 40px); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-card { border-bottom: 1px solid var(--rule); }
  .cat-card:nth-child(2) { border-right: none; }
  .cat-card:last-child { border-right: none; border-bottom: none; }
  .cat-card:nth-child(3) { border-bottom: none; }
  .band-inner { flex-direction: column; gap: 16px; }
  .reading-cols { gap: 0 40px; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .nav { display: none; }
  .hero { padding: 72px 0 64px; }
  .hero-h1 { font-size: 2.6rem; }
  .section { padding: 60px 0; }
  .cat-grid { grid-template-columns: 1fr; }
  .cat-card { border-right: none !important; border-bottom: 1px solid var(--rule) !important; }
  .cat-card:last-child { border-bottom: none !important; }
  .criteria-grid { grid-template-columns: 1fr; }
  .criteria-item { border-right: none !important; }
  .criteria-item:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--rule) !important; }
  .criteria-item:last-child { border-bottom: none !important; grid-column: span 1; }
  .reading-cols { grid-template-columns: 1fr; gap: 0; }
  .reading-col:first-child { margin-bottom: 40px; }
  .footer-wrap { flex-direction: column; align-items: flex-start; }
}


/* ── SUBPAGE HERO ────────────────────────────────────────── */
.subhero {
  background: var(--dark-bg);
  padding: 80px 0 72px;
  position: relative;
  overflow: hidden;
}

.subhero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.subhero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(201,168,76,0.2);
}

.subhero-inner { position: relative; max-width: 780px; }

.subhero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 24px;
}

.subhero-eyebrow a {
  color: rgba(255,255,255,0.3);
  transition: color 0.14s;
}
.subhero-eyebrow a:hover { color: var(--gold); }
.subhero-eyebrow span { color: rgba(255,255,255,0.15); }

.subhero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--white);
  margin-bottom: 24px;
}

.subhero h1 em {
  font-style: italic;
  color: var(--gold);
}

.subhero-deck {
  font-size: 1rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.72;
  max-width: 56ch;
}

/* ── ALTERNATIVES GRID ───────────────────────────────────── */
.alt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.alt-card {
  padding: 32px 24px 28px;
  background: var(--white);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.18s;
}

.alt-card:hover { background: #fdfcfa; }
.alt-card:nth-child(3n) { border-right: none; }
.alt-card:nth-last-child(-n+3):nth-child(3n+1),
.alt-card:nth-last-child(-n+2):nth-child(3n+1),
.alt-card:last-child { border-bottom: none; }

.alt-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--rule);
  line-height: 1;
}

.alt-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.alt-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.68;
  flex: 1;
}

.alt-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--tinted-bg);
  color: var(--faint);
  border: 1px solid var(--rule);
  align-self: flex-start;
}


/* ── DECISION LIST ───────────────────────────────────────── */
.decision-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.decision-item {
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
}

.decision-item:last-child { border-right: none; }

.decision-item h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.decision-item p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.68;
}

/* ── CONCEPT CALLOUT ─────────────────────────────────────── */
.concept-callout {
  border-left: 3px solid var(--gold);
  padding: 20px 28px;
  background: rgba(201,168,76,0.05);
  border-radius: 0 6px 6px 0;
  margin-top: 32px;
  max-width: 720px;
}

.concept-callout p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.65;
}

/* ── CTA BAND (dark section) ─────────────────────────────── */
.cta-band { max-width: 680px; }

.cta-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.cta-btn-ghost {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.35);
  transition: color 0.14s;
}

.cta-btn-ghost:hover { color: rgba(255,255,255,0.7); }

/* ── RESPONSIVE (subpages) ───────────────────────────────── */
@media (max-width: 860px) {
  .alt-grid { grid-template-columns: repeat(2, 1fr); }
  .alt-card:nth-child(2n) { border-right: none; }
  .alt-card:nth-child(3n) { border-right: 1px solid var(--rule); }
  .alt-card:nth-child(2n):not(:nth-child(3n)) { border-right: none; }
  .decision-list { grid-template-columns: 1fr; }
  .decision-item { border-right: none; border-bottom: 1px solid var(--rule); }
  .decision-item:last-child { border-bottom: none; }
}

@media (max-width: 600px) {
  .subhero { padding: 60px 0 52px; }
  .subhero h1 { font-size: 2.2rem; }
  .alt-grid { grid-template-columns: 1fr; }
  .alt-card { border-right: none !important; }
  .alt-card:last-child { border-bottom: none !important; }
}