/* =========================================================
   CheeseBridge — shared design system
   Single source of truth for site-wide styling.
   New pages link this file; legacy pages migrate over time.
   ========================================================= */

:root {
  --bg: #ffffff;
  --text: #172033;
  --muted: #5f6b7a;
  --card: #f7f9fc;
  --border: #e3e8ef;
  --brand: #d89b2b;
  --brand-dark: #9b6414;
  --brand-tint: #fff7e7;
  --brand-tint-border: #f3d28d;
  --max-width: 1180px;

  /* code syntax colours (guide pages) */
  --code-bg: #101827;
  --code-text: #f4f7fb;
  --tag: #7dd3fc;
  --value: #facc15;
  --key: #86efac;

  /* status colours for venture badges */
  --status-live-bg: #e8f6ee;
  --status-live-text: #1c7a44;
  --status-dev-bg: #fff7e7;
  --status-dev-text: #8a5a11;
  --status-soon-bg: #eef1f6;
  --status-soon-text: #5f6b7a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 650;
}

a:hover { text-decoration: underline; }

a:focus,
button:focus {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  background: #fff;
  color: var(--text);
  padding: 10px 14px;
  border: 2px solid var(--brand);
  border-radius: 8px;
  z-index: 999;
}

.skip-link:focus { left: 12px; }

/* ---------- Header / nav ---------- */
header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.logo {
  font-weight: 850;
  font-size: 1.3rem;
  color: var(--text);
}

.logo-cheese { color: var(--brand-dark); }

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  align-items: center;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 90px 20px 70px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--brand-tint);
  border: 1px solid var(--brand-tint-border);
  color: #8a5a11;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 22px;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 22px;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 760px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ---------- Buttons ---------- */
.button-primary,
.button-secondary {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.15s ease;
}

.button-primary {
  background: var(--brand);
  color: #111;
}

.button-secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.button-primary:hover,
.button-secondary:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 70px;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.section-intro {
  color: var(--muted);
  max-width: 800px;
  margin-bottom: 32px;
}

/* ---------- Grids & cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.08);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.97rem;
}

.tool-links,
.guide-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-links a,
.guide-links a { width: fit-content; }

/* ---------- Venture cards (company portfolio) ---------- */
.venture-card {
  display: flex;
  flex-direction: column;
}

.venture-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.venture-head h3 { margin: 0; }

.status {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.status-live { background: var(--status-live-bg); color: var(--status-live-text); }
.status-dev  { background: var(--status-dev-bg);  color: var(--status-dev-text); }
.status-soon { background: var(--status-soon-bg); color: var(--status-soon-text); }

.venture-card p { flex: 1; }

.venture-card .venture-link { margin-top: auto; }

/* ---------- Document / article pages (legal, guides) ---------- */
.doc {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 70px;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.doc h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.04em;
}

.doc h2 {
  font-size: 1.55rem;
  margin-top: 46px;
  margin-bottom: 12px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.doc .intro {
  font-size: 1.12rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.doc ul { padding-left: 22px; }

.notice-box,
.meta {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin: 24px 0;
}

/* ---------- Toolkit / directory pages ---------- */
.toolkit-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 20px 70px;
}

.toolkit-page .hero {
  max-width: 920px;
  margin: 0 0 34px;
  padding: 0;
  text-align: left;
}

.toolkit-page h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.08;
  margin: 0 0 18px;
  letter-spacing: -0.04em;
}

.toolkit-page h2 {
  font-size: 1.8rem;
  margin-top: 52px;
  margin-bottom: 14px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.toolkit-page h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.toolkit-page .intro {
  font-size: 1.16rem;
  color: var(--muted);
  margin-bottom: 0;
}

.toolkit-page .summary-box,
.toolkit-page .takeaways-box,
.toolkit-page .trust-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  margin: 24px 0;
}

.toolkit-page .summary-box ul,
.toolkit-page .takeaways-box ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.toolkit-page .category-grid,
.toolkit-page .tool-grid,
.toolkit-page .guide-grid {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.toolkit-page .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.toolkit-page .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.toolkit-page .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.toolkit-page .category-card,
.toolkit-page .tool-card,
.toolkit-page .guide-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.toolkit-page .category-card:hover,
.toolkit-page .tool-card:hover,
.toolkit-page .guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.08);
  text-decoration: none;
}

.toolkit-page .category-card p,
.toolkit-page .tool-card p,
.toolkit-page .guide-card span {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 400;
}

/* category card titles stay black; the "View…" link text keeps the brand colour */
.toolkit-page .category-card h3 { color: var(--text); }

.toolkit-page .count {
  display: inline-block;
  background: var(--brand-tint);
  border: 1px solid var(--brand-tint-border);
  color: #8a5a11;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.toolkit-page .popular-list {
  columns: 2;
  padding-left: 22px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .toolkit-page .category-grid,
  .toolkit-page .tool-grid,
  .toolkit-page .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .toolkit-page .category-grid,
  .toolkit-page .tool-grid,
  .toolkit-page .guide-grid {
    grid-template-columns: 1fr;
  }
  .toolkit-page .popular-list { columns: 1; }
}

/* ---------- Guide / article pages (JSON & XML hubs) ---------- */
.guide-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
}

.guide-page main { min-width: 0; }

.guide-page h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.04em;
}

.guide-page h2 {
  font-size: 1.65rem;
  margin-top: 52px;
  margin-bottom: 12px;
  line-height: 1.25;
  scroll-margin-top: 100px;
}

.guide-page h3 {
  font-size: 1.2rem;
  margin-top: 28px;
}

.guide-page .intro {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.guide-page .meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 32px;
}

.guide-page .badge {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 4px 10px;
  border-radius: 999px;
}

.guide-page .summary-box,
.guide-page .tool-card,
.guide-page .faq-item,
.guide-page .reference-box,
.guide-page .note-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin: 24px 0;
}

.guide-page .summary-box ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.guide-page .code-block {
  position: relative;
  margin: 24px 0;
}

.guide-page pre {
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 22px;
  border-radius: 14px;
  font-size: 0.95rem;
  margin: 0;
}

.guide-page code {
  font-family: Consolas, Monaco, "Courier New", monospace;
}

.guide-page .tag { color: var(--tag); }
.guide-page .value { color: var(--value); }
.guide-page .key { color: var(--key); }

.guide-page .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.8rem;
}

.guide-page .copy-btn:hover { background: rgba(255, 255, 255, 0.16); }

.guide-page .copy-btn:focus {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.guide-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.guide-page th,
.guide-page td {
  border: 1px solid var(--border);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.guide-page th { background: var(--card); }

.guide-page .cta {
  display: inline-block;
  background: var(--brand);
  color: #111;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 800;
  margin-top: 8px;
  margin-right: 10px;
}

.guide-page .cta:hover {
  text-decoration: none;
  background: #efb84b;
  transform: translateY(-1px);
}

.guide-page .related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.guide-page .related-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.guide-page .related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.08);
  text-decoration: none;
}

.guide-page .related-card strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.guide-page .related-card span {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.guide-page aside {
  position: sticky;
  top: 100px;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  background: #fff;
}

.guide-page aside h2 {
  font-size: 1rem;
  margin-top: 0;
}

.guide-page aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-page aside li {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

@media (max-width: 860px) {
  .guide-page {
    grid-template-columns: 1fr;
  }
  .guide-page aside { position: static; }
  .guide-page .related-grid { grid-template-columns: 1fr; }
}

/* ---------- About / content components ---------- */
.feature-box,
.contact-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  margin: 28px 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.category-list {
  columns: 2;
  margin: 16px 0 0;
  padding-left: 22px;
}

.cta {
  display: inline-block;
  background: var(--brand);
  color: #111;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 800;
  margin-top: 10px;
  margin-right: 10px;
}

.cta:hover {
  text-decoration: none;
  background: #efb84b;
  transform: translateY(-1px);
}

@media (max-width: 920px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .card-grid { grid-template-columns: 1fr; }
  .category-list { columns: 1; }
}

/* ---------- Highlight box ---------- */
.highlight-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
}

.highlight-box ul {
  margin: 14px 0 0;
  padding-left: 20px;
  columns: 2;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 34px 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.footer-links a {
  color: var(--brand-dark);
  font-weight: 650;
}

.footer-inner p { margin: 0; }

/* keep header/footer chrome on-brand even on tool pages that set their own body font/link colours */
header,
footer { font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.nav-links a { color: var(--brand-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav { flex-direction: column; align-items: flex-start; }
  .grid,
  .grid-2 { grid-template-columns: 1fr; }
  .highlight-box ul { columns: 1; }
  .hero { padding-top: 70px; }
  h1 { font-size: 2.7rem; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
