/* =========================================================================
   ClaudeCad — base styles
   Color + spacing tokens are defined in :root (see partials/head.njk for the
   CMS-driven color overrides). This is intentionally a clean, neutral baseline
   that the real design will refine.
   ========================================================================= */

:root {
  /* Fallback tokens (overridden inline from site settings). */
  --color-primary: #1c1b19;
  --color-accent: #d97757;
  --color-bg: #faf9f5;
  --color-surface: #ffffff;
  --color-text: #1c1b19;
  --color-muted: #6b6a66;
  --color-border: rgba(28, 27, 25, 0.12);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: ui-serif, Georgia, "Times New Roman", serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --maxw-narrow: 720px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Layout helpers ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.container--narrow { max-width: var(--maxw-narrow); }

.section { padding-block: var(--space-lg); }
@media (min-width: 768px) { .section { padding-block: var(--space-xl); } }

.section__heading { margin-bottom: 0.75rem; }
.section__heading--center { text-align: center; }
.section__intro { color: var(--color-muted); max-width: 640px; margin: 0 auto 2.5rem; text-align: center; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0 0 0.75rem;
}
.eyebrow--center { text-align: center; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---- Buttons ----------------------------------------------------------- */
.btn-group { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-accent); }
.btn--secondary { background: transparent; color: var(--color-primary); border-color: var(--color-border); }
.btn--secondary:hover { border-color: var(--color-primary); }
.btn--ghost { background: transparent; color: var(--color-accent); padding-inline: 0.4rem; }
.btn--ghost:hover { text-decoration: underline; }

/* ---- Header / nav ------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.site-header__brand { font-weight: 700; font-size: 1.15rem; color: var(--color-primary); }
.site-header__brand:hover { text-decoration: none; }
.site-header__logo { max-height: 32px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav__list { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav__link { color: var(--color-text); font-weight: 500; font-size: 0.95rem; padding: 0.25rem 0; }
.site-nav__link:hover { color: var(--color-accent); text-decoration: none; }
.site-nav__link.is-active { color: var(--color-accent); }

.site-header__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.site-header__toggle-bar { width: 24px; height: 2px; background: var(--color-primary); transition: transform 0.2s ease, opacity 0.2s ease; }

@media (max-width: 820px) {
  .site-header__toggle { display: flex; }
  .site-nav {
    position: absolute;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem;
    transform: translateY(-130%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { transform: translateY(0); }
  .site-nav__list { flex-direction: column; gap: 0.75rem; width: 100%; }
  [data-nav-toggle][aria-expanded="true"] .site-header__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  [data-nav-toggle][aria-expanded="true"] .site-header__toggle-bar:nth-child(2) { opacity: 0; }
  [data-nav-toggle][aria-expanded="true"] .site-header__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---- Hero -------------------------------------------------------------- */
.hero__inner { display: grid; gap: var(--space-md); align-items: center; }
.hero--split .hero__inner { grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .hero--split .hero__inner { grid-template-columns: 1.05fr 0.95fr; gap: var(--space-lg); }
}
.hero--centered .hero__inner { grid-template-columns: 1fr; text-align: center; max-width: 760px; margin-inline: auto; }
.hero--centered .btn-group { justify-content: center; }
.hero__heading { margin-bottom: 0.75rem; }
.hero__text { font-size: 1.15rem; color: var(--color-muted); }
.hero__image { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.hero--inverted { background: var(--color-primary); color: #fff; }
.hero--inverted .hero__text { color: rgba(255, 255, 255, 0.8); }

/* ---- Image placeholder ------------------------------------------------- */
.image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  width: 100%;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(0,0,0,0.03) 12px, rgba(0,0,0,0.03) 24px),
    var(--color-surface);
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius);
  color: var(--color-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

/* ---- Cards ------------------------------------------------------------- */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.card-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .card-grid--cols-3, .card-grid--cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__icon { font-size: 1.6rem; color: var(--color-accent); margin-bottom: 0.75rem; }
.card__media { margin: -1.5rem -1.5rem 1rem; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.card__title { margin-bottom: 0.4rem; }
.card__text { color: var(--color-muted); margin-bottom: 0.75rem; }
.card__link { font-weight: 600; font-size: 0.9rem; }

/* ---- Stats ------------------------------------------------------------- */
.stats--accent { background: var(--color-primary); color: #fff; border-radius: var(--radius); }
.stats--accent .section__heading { color: #fff; }
.stats__grid { display: grid; gap: 2rem; margin: 0; text-align: center; }
.stats__grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.stats__grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.stats__grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .stats__grid { grid-template-columns: repeat(2, 1fr); } }
.stats__value { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; }
.stats__label { margin: 0; opacity: 0.75; font-size: 0.95rem; }

/* ---- Logos ------------------------------------------------------------- */
.logos__heading { text-align: center; color: var(--color-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1.5rem; }
.logos__row { list-style: none; display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: center; align-items: center; margin: 0; padding: 0; }
.logos__item { opacity: 0.7; transition: opacity 0.15s ease; }
.logos__item:hover { opacity: 1; }
.logos__image { max-height: 38px; width: auto; }
.logos .image-placeholder { min-height: 38px; width: 120px; }

/* ---- CTA --------------------------------------------------------------- */
.cta__inner { text-align: center; max-width: 680px; margin-inline: auto; }
.cta--accent .cta__inner {
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-lg) var(--space-md);
  border-radius: var(--radius);
  max-width: var(--maxw);
}
.cta--accent .cta__heading { color: #fff; }
.cta--accent .cta__text { color: rgba(255,255,255,0.82); }
.cta .btn-group { justify-content: center; }

/* ---- Media / gallery --------------------------------------------------- */
.media-block__figure { margin: 0; }
.media-block__figure--full { max-width: 100%; }
.media-block__image { border-radius: var(--radius); width: 100%; }
.media-block__caption, .gallery__caption { color: var(--color-muted); font-size: 0.85rem; margin-top: 0.6rem; text-align: center; }

.gallery__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.gallery__grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.gallery__grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.gallery__grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .gallery__grid { grid-template-columns: repeat(2, 1fr); } }
.gallery__image { border-radius: var(--radius-sm); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---- Prose / text block ------------------------------------------------ */
.prose { font-size: 1.05rem; }
.prose h2, .prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose img { border-radius: var(--radius); margin-block: 1.5rem; }
.text-block--center { text-align: center; }
.text-block--center .prose { margin-inline: auto; }

/* ---- Contact form ------------------------------------------------------ */
.contact-details { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.6rem; }
.contact-details li { display: flex; gap: 0.75rem; }
.contact-details strong { min-width: 80px; color: var(--color-muted); font-weight: 600; }

.contact-form { display: grid; gap: 1.25rem; }
.form-row { display: grid; gap: 0.4rem; }
.form-row label { font-weight: 600; font-size: 0.9rem; }
.form-row input, .form-row textarea {
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--color-accent); outline: none; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-lg) var(--space-md);
  margin-top: var(--space-lg);
}
.site-footer__top { display: grid; gap: 2.5rem; grid-template-columns: 1.5fr 2fr; }
@media (max-width: 760px) { .site-footer__top { grid-template-columns: 1fr; } }
.site-footer__brand-link { font-weight: 700; color: var(--color-primary); font-size: 1.1rem; }
.site-footer__blurb { color: var(--color-muted); max-width: 320px; margin-top: 0.75rem; }
.site-footer__social { list-style: none; display: flex; gap: 1rem; padding: 0; margin: 1rem 0 0; }
.site-footer__columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.5rem; }
.site-footer__heading { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); margin-bottom: 0.75rem; }
.site-footer__columns ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.site-footer__columns a, .site-footer__social a { color: var(--color-text); font-size: 0.95rem; }
.site-footer__columns a:hover, .site-footer__social a:hover { color: var(--color-accent); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--color-border); margin-top: 2.5rem; padding-top: 1.5rem;
}
.site-footer__copy { color: var(--color-muted); font-size: 0.85rem; margin: 0; }
.site-footer__legal { list-style: none; display: flex; gap: 1.25rem; padding: 0; margin: 0; }
.site-footer__legal a { color: var(--color-muted); font-size: 0.85rem; }

/* ---- Documentation (hub + tutorials) ----------------------------------- */
.docs-layout { padding-block: var(--space-md); }
.docs-layout__inner {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 820px) {
  .docs-layout__inner { grid-template-columns: 1fr; gap: var(--space-md); }
}

.docs-sidebar { position: sticky; top: 80px; }
@media (max-width: 820px) {
  .docs-sidebar { position: static; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.5rem 1rem; }
}
.docs-sidebar__toggle {
  display: none;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 0;
  cursor: pointer;
  color: var(--color-text);
}
@media (max-width: 820px) {
  .docs-sidebar__toggle { display: flex; justify-content: space-between; align-items: center; }
  .docs-sidebar__nav { display: none; padding-bottom: 0.75rem; }
  .docs-sidebar__nav.is-open { display: block; }
}
.docs-sidebar__home {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  padding: 0.35rem 0;
  margin-bottom: 0.5rem;
}
.docs-sidebar__home.is-active { color: var(--color-accent); }
.docs-sidebar__group { margin-bottom: 1.5rem; }
.docs-sidebar__heading {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin: 0 0 0.5rem;
}
.docs-sidebar__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.docs-sidebar__link {
  display: block;
  padding: 0.35rem 0.6rem;
  margin-left: -0.6rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.92rem;
}
.docs-sidebar__link:hover { background: var(--color-bg); text-decoration: none; color: var(--color-accent); }
.docs-sidebar__link.is-active {
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: var(--color-accent);
  font-weight: 600;
}

/* Hub */
.docs-hub__header { margin-bottom: var(--space-md); }
.docs-hub__title { margin-bottom: 0.5rem; }
.docs-hub__intro { color: var(--color-muted); max-width: 60ch; font-size: 1.05rem; }
.docs-hub__group { margin-top: var(--space-md); }
.docs-hub__heading { font-size: 1.3rem; margin-bottom: 1rem; }
.docs-hub__empty { color: var(--color-muted); }
.docs-card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.docs-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.docs-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; }
.docs-card__link { display: block; padding: 1.25rem; color: inherit; }
.docs-card__link:hover { text-decoration: none; }
.docs-card__title { font-size: 1.05rem; margin-bottom: 0.35rem; }
.docs-card__text { color: var(--color-muted); font-size: 0.92rem; margin-bottom: 0.75rem; }
.docs-card__meta { font-size: 0.78rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Article */
.docs-article { max-width: 760px; min-width: 0; }
.docs-breadcrumb { font-size: 0.85rem; color: var(--color-muted); margin-bottom: 1rem; }
.docs-breadcrumb a { color: var(--color-muted); }
.docs-breadcrumb a:hover { color: var(--color-accent); }
.docs-article__header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--color-border); }
.docs-article__title { margin-bottom: 0.5rem; }
.docs-article__summary { font-size: 1.15rem; color: var(--color-muted); margin-bottom: 1rem; }
.docs-article__meta { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 0; font-size: 0.85rem; color: var(--color-muted); }
.docs-badge {
  display: inline-block;
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-accent);
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

/* Prose extras for docs bodies (code, tables, callouts) */
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.prose pre {
  background: var(--color-primary);
  color: #f5f5f2;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 7%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--color-border); }
.prose th { font-weight: 600; background: var(--color-bg); }
.prose h2 { scroll-margin-top: 80px; }
.prose h3 { scroll-margin-top: 80px; }

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