/* ==========================================================================
   PSP — Power Systems Projects
   Design tokens
   ========================================================================== */

:root {
  /* Core palette (derived from PSP's existing presentation brand) */
  --navy-950: #0B1D30;   /* deepest background, hero */
  --navy-900: #122A43;   /* section background, dark */
  --navy-800: #1B3A5C;   /* card background, dark sections */
  --navy-700: #28527D;   /* borders / dividers on dark */
  --cyan-500: #17B8CE;   /* primary accent — broker / signal */
  --cyan-400: #3DD1E6;   /* accent hover / highlight */

  /* Tier accent colors — each tier of the product hierarchy gets one */
  --tier1-gateway:  #17B8CE; /* cyan  — Tier 1: Gateways */
  --tier2-mesh:     #2E9E5B; /* green — Tier 2: Mesh */
  --tier3-meter:    #D6A11B; /* amber — Tier 3: Meter-level */
  --tier-other:     #8B6FC9; /* violet — Other products */

  /* Light section palette */
  --paper-50:  #F4F7FA;
  --paper-100: #E7EDF3;
  --ink-900:   #142840;
  --ink-600:   #45566C;
  --ink-400:   #7C8CA0;

  /* Status */
  --status-amber-bg: #FFF4DD;
  --status-amber-fg: #8A5B00;
  --status-amber-border: #E8C066;

  /* Type */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --container: 1140px;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper-50);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }
a { color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* -------------------------------------------------------------------------
   Top banner — ICASA certification notice (site-wide)
   ------------------------------------------------------------------------- */
.icasa-banner {
  background: var(--status-amber-bg);
  color: var(--status-amber-fg);
  border-bottom: 1px solid var(--status-amber-border);
  font-size: 0.9rem;
  text-align: center;
  padding: 8px 16px;
}
.icasa-banner strong { font-weight: 600; }

/* -------------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------------- */
.site-header {
  background: var(--navy-950);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 2px solid var(--cyan-500);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand small {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  color: var(--cyan-400);
  text-transform: uppercase;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: #C9D8E6;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.nav-cta {
  background: var(--cyan-500) !important;
  color: var(--navy-950) !important;
  font-weight: 600 !important;
}
.nav-cta:hover {
  background: var(--cyan-400) !important;
}
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--navy-950);
    flex-direction: column;
    gap: 0;
    padding: 8px;
    display: none;
    border-bottom: 2px solid var(--cyan-500);
  }
  .nav-links.open { display: flex; }
  .nav-toggle {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
  }
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: #fff;
  padding: 72px 0 64px;
}
.hero .eyebrow {
  font-family: var(--font-mono);
  color: var(--cyan-400);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin-bottom: 14px;
}
.hero h1 { color: #fff; max-width: 20ch; }
.hero p.lede {
  color: #C9D8E6;
  font-size: 1.15rem;
  max-width: 56ch;
}
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--cyan-500);
  color: var(--navy-950);
}
.btn-primary:hover { background: var(--cyan-400); }
.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.btn-outline:hover { border-color: #fff; }
.btn-ghost {
  background: transparent;
  border-color: var(--navy-700);
  color: var(--navy-900);
}
.btn-ghost:hover { background: var(--paper-100); }
.btn-small { padding: 8px 14px; font-size: 0.85rem; }

/* -------------------------------------------------------------------------
   Signature element — the signal rail
   A vertical dashed line with a node per tier, echoing the real
   gateway -> mesh -> meter signal path. Used on the products page.
   ------------------------------------------------------------------------- */
.signal-rail {
  position: relative;
  padding-left: 34px;
}
.signal-rail::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background-image: linear-gradient(var(--navy-700) 60%, transparent 40%);
  background-size: 2px 12px;
  background-repeat: repeat-y;
}
.tier-node {
  position: relative;
  margin-bottom: 56px;
}
.tier-node:last-child { margin-bottom: 0; }
.tier-node::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--tier-color, var(--cyan-500));
  background: var(--paper-50);
}
.tier-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--tier-color, var(--cyan-500));
  font-weight: 600;
  margin-bottom: 4px;
}
.tier-heading { margin-bottom: 6px; }
.tier-desc {
  color: var(--ink-600);
  max-width: 68ch;
  margin-bottom: 22px;
}

/* -------------------------------------------------------------------------
   Product cards
   ------------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--paper-100);
  border-left: 4px solid var(--tier-color, var(--cyan-500));
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.product-card .thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--paper-100);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-card .model {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-400);
  margin-bottom: 2px;
}
.product-card h3 { margin-bottom: 8px; }
.product-card .desc { color: var(--ink-600); font-size: 0.95rem; flex-grow: 1; }
.product-card .price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  padding-top: 14px;
  border-top: 1px solid var(--paper-100);
}
.price-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-900);
}
.price-tag .unit { color: var(--ink-400); font-size: 0.8rem; font-weight: 400; }
.spec-toggle summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--navy-800);
  padding: 6px 0;
  list-style: none;
}
.spec-toggle summary::-webkit-details-marker { display: none; }
.spec-toggle summary::before {
  content: "+ ";
  color: var(--tier-color, var(--cyan-500));
  font-weight: 700;
}
.spec-toggle[open] summary::before { content: "– "; }
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin-top: 8px;
}
.spec-table td {
  padding: 6px 0;
  border-bottom: 1px dashed var(--paper-100);
  vertical-align: top;
}
.spec-table td:first-child {
  color: var(--ink-400);
  font-family: var(--font-mono);
  width: 42%;
  padding-right: 12px;
}
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Generic sections
   ------------------------------------------------------------------------- */
.section { padding: 64px 0; }
.section-dark {
  background: var(--navy-900);
  color: #fff;
}
.section-dark .ink-600-eq { color: #C9D8E6; }
.section-alt { background: #fff; }
.section-header { max-width: 68ch; margin-bottom: 40px; }
.section-header .eyebrow {
  font-family: var(--font-mono);
  color: var(--cyan-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  margin-bottom: 10px;
}
.section-dark .section-header .eyebrow { color: var(--cyan-400); }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.stat-card {
  background: var(--navy-800);
  border-radius: var(--radius-md);
  padding: 22px;
  border-top: 3px solid var(--cyan-500);
}
.stat-card h4 { color: #fff; font-size: 1rem; margin-bottom: 8px; }
.stat-card p { color: #C9D8E6; font-size: 0.92rem; margin: 0; }

.arch-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0;
}
.arch-node {
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #fff;
}
.arch-arrow { color: var(--cyan-500); font-size: 1.2rem; }

/* -------------------------------------------------------------------------
   Tables (manuals list, support, etc.)
   ------------------------------------------------------------------------- */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--paper-100);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.doc-row .doc-name { font-weight: 600; }
.doc-row .doc-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-400); }
.doc-status {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.doc-status.pending {
  background: var(--status-amber-bg);
  color: var(--status-amber-fg);
  border: 1px solid var(--status-amber-border);
}

/* -------------------------------------------------------------------------
   FAQ / accordion (Support page)
   ------------------------------------------------------------------------- */
.faq-item {
  background: #fff;
  border: 1px solid var(--paper-100);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  padding: 4px 20px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "▸ "; color: var(--cyan-500); }
.faq-item[open] summary::before { content: "▾ "; }
.faq-item .faq-answer { color: var(--ink-600); padding-bottom: 18px; }

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.form-card {
  background: #fff;
  border: 1px solid var(--paper-100);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 640px;
}
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--paper-100);
  background: var(--paper-50);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink-900);
}
.form-row textarea { resize: vertical; min-height: 110px; }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--cyan-500);
  outline-offset: 1px;
}
.form-hint { font-size: 0.82rem; color: var(--ink-400); margin-top: 4px; }
.form-success, .form-error {
  display: none;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.9rem;
}
.form-success { background: #E5F6EC; color: #1E6B3E; border: 1px solid #A9DDBE; }
.form-error { background: #FBE6E6; color: #A33; border: 1px solid #F0B8B8; }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  background: var(--navy-950);
  color: #97A9BE;
  padding: 48px 0 28px;
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-grid h4 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { text-decoration: none; color: #97A9BE; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid var(--navy-800);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
