/* ============================================================================
   Cactus Software design system
   Light first with deep green bands. Manrope throughout, Inter only for figures
   that need to line up. Bloom pink is a rare spark, never a theme colour.
   Shared primitives live here; section-specific styles sit in each component.
   ========================================================================== */

/* ---- Tokens --------------------------------------------------------------- */
:root {
  --cs-green: #1D5C45;          /* primary: buttons, links, icons (7.9:1 on white) */
  --cs-green-hover: #174A38;
  --cs-deep: #0F2A21;           /* dark bands: hero, feature band, contact, footer */
  --cs-deep-raised: #143829;    /* cards and panels sitting on --cs-deep */
  --cs-line-on-deep: rgba(227, 238, 231, 0.18); /* hairlines and diagram lines on dark */
  --cs-text: #12241D;           /* body text (16.2:1 on white) */
  --cs-mint: #E3EEE7;           /* soft sections, chips, selected states */
  --cs-surface: #F5F8F6;
  --cs-border: #DCE5DF;
  --cs-muted: #4B5563;          /* secondary text on light (7.5:1) */
  --cs-on-deep-muted: #A7C4B5;  /* secondary text on --cs-deep (8.2:1) */
  --cs-bloom: #F2557A;          /* rare accent: decorative or on dark only (3.3:1 on white) */
  --cs-bloom-text: #C42F57;     /* bloom for text on white (5.4:1) */
  --cs-success: #1A7F4B;
  --cs-warning: #B54708;
  --cs-error: #B42318;
  --cs-radius: 14px;
  --cs-radius-sm: 8px;
  --cs-shadow: 0 0 0 1px #DCE5DF, 0 1px 2px rgba(15, 42, 33, 0.06);
  --cs-font: "Manrope", system-ui, sans-serif;
  --cs-font-data: "Inter", system-ui, sans-serif;
  --cs-container: 1200px;

  /* Derived values (not in the brand brief) */
  --cs-input-border: #7A8C82;   /* form field borders, 3.5:1 on white */
  --cs-status-ok: #3FAE74;      /* status dots on dark panels; always paired with text */
  --cs-status-warn: #E08A3C;
  --cs-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --cs-dur: 150ms;
}

/* ---- Reset and base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  /* Deep base under the fixed animated background; light sections paint over it. */
  background: var(--cs-deep);
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* clears the sticky header for in-page links */
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--cs-font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--cs-text);
  background: transparent; /* lets the fixed .tech-bg show through the deep bands */
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--cs-green); text-decoration: none; text-underline-offset: 3px; }
ul, ol { list-style: none; }
::selection { background: var(--cs-mint); color: var(--cs-text); }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }

/* Blazor's <FocusOnNavigate> focuses the h1 for screen readers; no ring for that. */
h1:focus { outline: none; }

:focus-visible { outline: 3px solid var(--cs-green); outline-offset: 3px; border-radius: 4px; }
.on-deep :focus-visible { outline-color: #fff; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--cs-green); color: #fff; padding: 12px 16px; border-radius: var(--cs-radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---- Layout --------------------------------------------------------------- */
.container { max-width: calc(var(--cs-container) + 48px); margin: 0 auto; padding-inline: 24px; }
.section { position: relative; overflow: hidden; padding-block: 96px; background: #fff; }
.section--mint { background: var(--cs-mint); }
.section > .container { position: relative; z-index: 1; }
/* Deep bands are transparent so the fixed background shows; its solid --cs-deep
   base keeps text contrast the same as a flat band. */
.on-deep { background: transparent; color: #fff; }
.on-deep h2, .on-deep h3 { color: #fff; }

/* ---- Type ----------------------------------------------------------------- */
.eyebrow {
  display: block; margin-bottom: 12px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cs-green);
}
.on-deep .eyebrow { color: var(--cs-on-deep-muted); }
.h2 { font-size: 36px; margin-bottom: 16px; }
.lead { font-size: 18px; color: var(--cs-muted); max-width: 62ch; }
.on-deep .lead { color: var(--cs-on-deep-muted); }
.section-head { margin-bottom: 48px; }
.section-head--split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; }
.num { font-family: var(--cs-font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent;
  font: 600 16px/1.2 var(--cs-font); text-align: center; cursor: pointer;
  transition: background-color var(--cs-dur) var(--cs-ease), border-color var(--cs-dur) var(--cs-ease), color var(--cs-dur) var(--cs-ease);
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--cs-green); color: #fff; }
.btn-primary:hover { background: var(--cs-green-hover); }
.btn-secondary { background: #fff; color: var(--cs-green); border-color: var(--cs-green); }
.btn-secondary:hover { background: var(--cs-mint); }
.on-deep .btn-primary { background: #fff; color: var(--cs-deep); }
.on-deep .btn-primary:hover { background: var(--cs-mint); }
.on-deep .btn-secondary { background: transparent; color: #fff; border-color: var(--cs-mint); }
.on-deep .btn-secondary:hover { background: rgba(227, 238, 231, 0.08); }
.btn[disabled] { opacity: 0.7; cursor: not-allowed; }

/* ---- Cards, chips, icons -------------------------------------------------- */
.card { background: #fff; border-radius: var(--cs-radius); box-shadow: var(--cs-shadow); padding: 28px; }
.card h3 { font-size: 20px; margin: 16px 0 8px; }
.card p { color: var(--cs-muted); font-size: 16px; }

.link-card { display: flex; flex-direction: column; color: inherit; transition: box-shadow var(--cs-dur) var(--cs-ease); }
.link-card:hover { box-shadow: 0 0 0 2px var(--cs-green), 0 1px 2px rgba(15, 42, 33, 0.06); }
.link-card__go { margin-top: auto; padding-top: 20px; display: flex; justify-content: flex-end; color: var(--cs-green); }
.link-card__go svg { transition: transform var(--cs-dur) var(--cs-ease); }
.link-card:hover .link-card__go svg { transform: translateX(3px); }

.icon-circle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cs-mint); color: var(--cs-green);
}
.icon-circle svg { width: 20px; height: 20px; }
.section--mint .icon-circle { background: #fff; }
.section--mint .card .icon-circle { background: var(--cs-mint); }
.on-deep .icon-circle { background: rgba(227, 238, 231, 0.1); color: var(--cs-mint); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--cs-mint); color: var(--cs-text); font-size: 15px; font-weight: 500; line-height: 1.4; }
.section--mint .chip { background: #fff; }
.chip--free { padding: 3px 10px; background: var(--cs-green); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--ok { background: var(--cs-status-ok); }
.dot--warn { background: var(--cs-status-warn); }

/* ---- Stats (hero and Proof) ---------------------------------------------- */
.stat__num { display: block; font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--cs-deep); }
.stat__label { display: block; max-width: 22ch; margin-top: 8px; font-size: 15px; color: var(--cs-muted); }
.on-deep .stat__num { color: #fff; }
.on-deep .stat__label { color: var(--cs-on-deep-muted); }

/* ---- Grids ---------------------------------------------------------------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Breadcrumbs ---------------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 14px; color: var(--cs-muted); }
.crumbs a { color: var(--cs-green); text-decoration: underline; }
.on-deep .crumbs { color: var(--cs-on-deep-muted); }
.on-deep .crumbs a { color: #fff; }

/* ---- Animated background (Components/Layout/TechBackground.razor) ---------
   Fixed behind everything. Visible only through the transparent deep bands.
   A small rAF scroll handler sets --bg-scale for a gentle zoom (desktop only). */
:root { --bg-scale: 1.04; }
.tech-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--cs-deep); pointer-events: none; }
.tech-bg__inner { position: absolute; inset: -8%; transform: scale(var(--bg-scale)); will-change: transform; }
.tech-bg__glow { position: absolute; border-radius: 50%; }
.tech-bg__glow--a { width: 46vw; height: 46vw; left: 4%; top: 6%; background: radial-gradient(circle, rgba(63, 174, 116, 0.13), transparent 68%); animation: techDriftA 24s ease-in-out infinite; }
.tech-bg__glow--b { width: 40vw; height: 40vw; right: 2%; bottom: 4%; background: radial-gradient(circle, rgba(227, 238, 231, 0.07), transparent 68%); animation: techDriftB 30s ease-in-out infinite; }
.tech-bg__glow--c { width: 28vw; height: 28vw; right: 24%; top: 38%; background: radial-gradient(circle, rgba(29, 92, 69, 0.35), transparent 68%); animation: techDriftA 34s ease-in-out infinite reverse; }
@keyframes techDriftA { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(4%, 3%); } }
@keyframes techDriftB { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-3%, -4%); } }
.tech-bg__lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.tech-bg__lines .flow { fill: none; stroke: var(--cs-mint); stroke-width: 1.1; stroke-dasharray: 4 11; opacity: 0.32; animation: techDash 3.4s linear infinite; }
.tech-bg__lines .flow.s2 { animation-duration: 4.6s; opacity: 0.22; }
.tech-bg__lines .flow.s3 { animation-duration: 5.6s; opacity: 0.26; }
.tech-bg__lines .node { fill: var(--cs-mint); opacity: 0.55; }
.tech-bg__lines .node--g { fill: var(--cs-status-ok); opacity: 0.7; }
.tech-bg__lines .node-ring { fill: none; stroke: rgba(227, 238, 231, 0.3); stroke-width: 1; }
@keyframes techDash { to { stroke-dashoffset: -30; } }
.tech-bg__particles { position: absolute; inset: 0; }
.tech-bg__particles i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: var(--cs-mint); opacity: 0; animation: techParticle linear infinite; }
.tech-bg__particles i.g { background: var(--cs-status-ok); }
@keyframes techParticle {
  0%   { opacity: 0; transform: translateY(0); }
  12%  { opacity: 0.75; }
  88%  { opacity: 0.75; }
  100% { opacity: 0; transform: translateY(-78vh); }
}

/* Light-section accent (Components/Layout/SectionTech.razor) */
.sec-tech {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 96% 92% at 50% 45%, #000 58%, transparent 100%);
          mask-image: radial-gradient(ellipse 96% 92% at 50% 45%, #000 58%, transparent 100%);
}
.sec-tech__lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.sec-tech .sline { fill: none; stroke: rgba(29, 92, 69, 0.32); stroke-width: 1.2; stroke-dasharray: 4 10; animation: techDash 3.6s linear infinite; }
.sec-tech .sline.g { stroke: rgba(29, 92, 69, 0.22); animation-duration: 4.8s; }
.sec-tech .snode { fill: var(--cs-green); opacity: 0.45; }
.sec-tech__particles i { position: absolute; bottom: -8px; width: 3px; height: 3px; border-radius: 50%; background: var(--cs-green); opacity: 0; animation: techParticle linear infinite; }
.sec-tech__particles i.g { background: var(--cs-status-ok); }

/* ---- Blazor error UI ------------------------------------------------------ */
#blazor-error-ui {
  display: none; position: fixed; left: 50%; bottom: 24px; z-index: 1000; transform: translateX(-50%);
  align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 18px; border: 1px solid var(--cs-line-on-deep); border-radius: 12px;
  background: var(--cs-deep); color: #fff; font-size: 15px;
  box-shadow: 0 16px 40px -12px rgba(15, 42, 33, 0.55);
}
/* Blazor sets display:block inline when it shows the bar; keep the row layout. */
#blazor-error-ui[style*="block"] { display: flex !important; }
#blazor-error-ui .reload { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px; background: #fff; color: var(--cs-deep); font-weight: 600; }
#blazor-error-ui .reload:hover { background: var(--cs-mint); }
#blazor-error-ui .dismiss { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--cs-on-deep-muted); font: inherit; font-size: 18px; cursor: pointer; }
#blazor-error-ui .dismiss:hover { color: #fff; }
#blazor-error-ui :focus-visible { outline-color: #fff; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 959px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .section-head--split { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 768px) {
  /* Lighter background on small screens: no lines, particles or zoom */
  .tech-bg__particles, .tech-bg__lines, .sec-tech__particles { display: none; }
  .tech-bg__inner { transform: none; }
}
@media (max-width: 599px) {
  .section { padding-block: 64px; }
  .h2 { font-size: 28px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .card { padding: 24px 20px; }
  .stat__num { font-size: 36px; }
}

/* ---- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tech-bg__inner { transform: none !important; }
  .tech-bg__particles, .sec-tech__particles { display: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
