/* ==========================================================================
   Inventree — base styles. No build step, no framework, no external fonts.
   ========================================================================== */

:root {
  /* Brand palette — matched to the Inventree logo (forest green mark + sage
     accent nodes + dark charcoal wordmark on light background). The site
     uses a dark theme, so the light sage tone becomes the primary accent on
     screen and the deep forest green sits underneath as surface/depth. */
  --brand-forest: #1b4d3a;
  --brand-forest-deep: #123529;
  --brand-sage: #7fbf8a;
  --brand-sage-light: #a8d9ac;
  --brand-ink: #131a17;

  --bg: #0b1611;
  --bg-alt: #101d17;
  --surface: #15241d;
  --surface-2: #1b2e24;
  --line: rgba(238, 243, 240, 0.10);
  --line-strong: rgba(238, 243, 240, 0.18);
  --text: #eef3ee;
  --text-dim: #a9bab0;
  --text-faint: #7c8f83;
  --accent: var(--brand-sage);
  --accent-strong: var(--brand-sage-light);
  --accent-2: var(--brand-forest);
  --amber: #f2b866;
  --radius: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(94, 230, 165, 0.07), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(55, 201, 208, 0.06), transparent 40%);
  background-attachment: fixed;
}

img, svg { max-width: 100%; display: block; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-dim); }
.small { font-size: 0.85rem; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--surface); color: var(--text);
  padding: 0.75rem 1rem; z-index: 1000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

h1, h2, h3, h4 {
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.1rem, 4vw + 1rem, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--text-dim); }
.article-body p, .article-body li { color: var(--text); }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.wrap-narrow { max-width: 780px; }

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0 0 0.9em;
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.85em 1.5em; border-radius: 999px; font-weight: 600;
  font-size: 0.95rem; text-decoration: none; border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #06120d; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-small { padding: 0.55em 1.1em; font-size: 0.85rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }
.text-link { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 600; }
.text-link svg { width: 1em; height: 1em; }

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 18, 16, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; position: relative; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 31px; color: var(--accent); flex-shrink: 0; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-dot { color: var(--accent); }

.nav-toggle-input { display: none; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; z-index: 20;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

.site-nav { display: flex; align-items: center; gap: 1.8rem; }
.site-nav ul { list-style: none; display: flex; gap: 1.6rem; margin: 0; padding: 0; }
.site-nav a { color: var(--text-dim); font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent-strong); text-decoration: none; }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 1.2rem 1.5rem 1.6rem;
    display: none;
  }
  .site-nav ul { flex-direction: column; gap: 1rem; }
  .nav-toggle-input:checked ~ .site-nav { display: flex; }
  .site-nav .btn { margin-top: 1rem; align-self: flex-start; }
}

/* Hero --------------------------------------------------------------------- */
.hero { padding: 4.5rem 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: center; }
.hero-copy .lede { font-size: 1.1rem; max-width: 55ch; }
.hero-graphic { color: var(--accent); opacity: 0.9; }
.contour { width: 100%; height: auto; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-graphic { max-width: 260px; margin: 0 auto; opacity: 0.6; }
}

/* Strip of stats ------------------------------------------------------------ */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.strip-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding: 1.8rem 1.5rem; }
.strip-item { display: flex; flex-direction: column; gap: 0.2rem; }
.strip-item span:first-child { color: var(--accent); font-size: 1.3rem; font-weight: 700; }
.strip-item span:last-child { color: var(--text-dim); font-size: 0.85rem; }
@media (max-width: 700px) { .strip-inner { grid-template-columns: repeat(2, 1fr); } }

/* Sections ------------------------------------------------------------------ */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 2.4rem; }
.two-col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3 { grid-template-columns: 1fr; } }

/* Cards ----------------------------------------------------------------------- */
.card {
  display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem;
  color: var(--text); transition: border-color 0.15s ease, transform 0.15s ease;
}
a.card:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-2px); }
.card h3 { margin-bottom: 0.2rem; }
.card p { margin-bottom: 0.4rem; font-size: 0.94rem; }
.card-icon { width: 28px; height: 28px; color: var(--accent); }
.card-icon svg { width: 100%; height: 100%; }
.card-link { display: inline-flex; align-items: center; gap: 0.4em; color: var(--accent-strong); font-weight: 600; font-size: 0.88rem; margin-top: auto; }
.card-link svg { width: 1em; height: 1em; }

/* Lists ------------------------------------------------------------------------ */
.check-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-direction: column; gap: 0.7rem; }
.check-list li { display: flex; align-items: flex-start; gap: 0.6rem; color: var(--text); }
.check-list svg { width: 1.1em; height: 1.1em; color: var(--accent); flex-shrink: 0; margin-top: 0.2em; }

.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-links a { color: var(--text-dim); font-size: 0.92rem; }
.footer-links a:hover { color: var(--accent-strong); }

/* FAQ (native details/summary — no JS) ------------------------------------------ */
.faq-list { display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.2rem 1.1rem; }
.faq-item summary {
  cursor: pointer; padding: 1rem 0; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; flex-shrink: 0; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-answer { padding: 0 0 1.1rem; }
.faq-answer p { margin: 0; }

.quick-answer {
  background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: 1.1rem 1.4rem; margin-bottom: 2rem;
}
.quick-answer p { margin: 0; color: var(--text); }

/* Industry detail blocks --------------------------------------------------------- */
.industry-list { display: flex; flex-direction: column; }
.industry-detail { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.industry-detail:first-child { padding-top: 0; }
.industry-detail:last-child { border-bottom: none; }
.industry-detail-grid { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; align-items: center; }
.industry-detail-grid .media-slot { margin-bottom: 0; }
@media (max-width: 700px) { .industry-detail-grid { grid-template-columns: 1fr; } }

/* CTA band ------------------------------------------------------------------------ */
.cta-band { padding: 3.5rem 0; background: var(--surface); border-top: 1px solid var(--line); }
.cta-band-inner { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { margin-bottom: 0.3rem; }
.cta-band .lede { margin: 0; max-width: 55ch; }

/* Breadcrumbs ---------------------------------------------------------------------- */
.breadcrumbs { padding: 1.2rem 1.5rem 0; font-size: 0.85rem; color: var(--text-faint); }
.breadcrumbs a { color: var(--text-faint); }
.crumb-sep { margin: 0 0.5em; }

/* Contact ---------------------------------------------------------------------------- */
.contact-line { display: flex; align-items: flex-start; gap: 0.7rem; }
.contact-line .card-icon { width: 22px; height: 22px; margin-top: 0.15em; }
.contact-form { display: flex; flex-direction: column; gap: 0.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.contact-form label { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.6rem; }
.contact-form input, .contact-form textarea {
  background: var(--bg-alt); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0.7em 0.9em; color: var(--text); font-family: inherit; font-size: 0.95rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-form button { margin-top: 1rem; align-self: flex-start; }

/* Footer ------------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 3.5rem 0 1.5rem; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.5rem; }
.footer-col h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 0.9rem; }
.footer-email { display: inline-flex; align-items: center; gap: 0.5em; }
.footer-email svg { width: 1.1em; height: 1.1em; color: var(--accent); }
.coords { color: var(--text-faint); font-size: 0.8rem; margin-top: 0.6rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--text-faint); flex-wrap: wrap; }
@media (max-width: 860px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-inner { grid-template-columns: 1fr; } }

/* Media slots — img and placeholder are stacked; img is hidden until it
   successfully loads (see onload in templates.js), so uploading a real photo
   to /images/<filename> (even directly via a hosting file manager, no
   rebuild needed) swaps the placeholder out automatically. ------------------ */
.media-slot {
  position: relative; width: 100%; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 1.6rem; background: var(--surface);
}
.media-slot-img {
  display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.media-placeholder {
  border: 1.5px dashed var(--line-strong);
  background: repeating-linear-gradient(135deg, var(--surface) 0 14px, var(--surface-2) 14px 28px);
}
.media-placeholder-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1.2rem 1.5rem; max-width: 42ch; margin: 0 auto;
}
.media-placeholder-icon { display: inline-block; width: 30px; height: 30px; color: var(--text-faint); margin-bottom: 0.5rem; }
.media-placeholder-icon svg { width: 100%; height: 100%; }
.media-placeholder-label { font-weight: 700; color: var(--text-dim); margin: 0 0 0.3em; text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.06em; }
.media-placeholder-brief { color: var(--text-faint); font-size: 0.85rem; margin: 0 0 0.5em; }
.media-placeholder-file { color: var(--accent); font-size: 0.78rem; margin: 0; opacity: 0.85; }
.media-slot-sm { margin-bottom: 1rem; }
.media-slot-sm .media-placeholder-inner { padding: 0.8rem 1rem; }
.media-slot-portrait { max-width: 260px; }

/* Article ------------------------------------------------------------------------------- */
.article-body h2 { margin-top: 2rem; }
.article-card p { font-size: 0.94rem; }

/* Focus visibility -------------------------------------------------------------------------- */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

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