/* ============================================================
   UpriSys - dark / deep-red / gold theme
   Single stylesheet. Order: tokens → base → layers → header →
   buttons → sections → cards → steps → chips → quote → FAQ →
   reveal → responsive → reduced-motion.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  --bg: #0d0406;
  --surface: #1a0b0e;
  --raised: #241014;
  --border: #3d1a20;

  --red: #c41e2a;
  --red-hover: #e02535;
  --red-glow: rgba(196, 30, 42, 0.35);

  --gold: #d4a94f;
  --gold-light: #e8c87a;
  --gold-glow: rgba(212, 169, 79, 0.28);

  --text: #f5f0eb;
  --muted: #b8a8a0;

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

  --header-h: 64px;
}

/* ---------- 2. Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--gold-light);
  text-decoration: none;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

::selection {
  background: var(--red);
  color: #fff;
}

/* ---------- 3. Layers: canvas behind, content above ---------- */
#sea {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

main, section, footer {
  position: relative;
  z-index: 1;
}

.site-header,
header {
  z-index: 10;
}

/* ---------- 4. Header ---------- */
.site-header,
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

header.scrolled {
  background: rgba(13, 4, 6, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand img {
  height: 48px;
  width: auto;
}

#navLinks {
  display: flex;
  align-items: center;
  gap: 16px;
}

#navLinks .btn-primary {
  margin-left: auto;
}

#navLinks ul {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#navLinks a:not(.btn) {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.02em;
  padding: 8px 2px;
  transition: color 0.2s ease;
}

#navLinks a:not(.btn):hover {
  color: var(--gold);
}

#navToggle {
  display: none;
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 15px;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: center;
  min-height: 38px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--red-hover);
  box-shadow: 0 0 24px var(--red-glow);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.btn-secondary:hover {
  background: rgba(212, 169, 79, 0.1);
}

/* ---------- 6. Sections, hero, grids, cards ---------- */
section {
  padding: 52px 0;
  scroll-margin-top: 96px;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--header-h) 0;
}

/* legibility overlay behind hero text - sits under content, above canvas */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(13, 4, 6, 0.82) 0%,
    rgba(13, 4, 6, 0.55) 45%,
    rgba(13, 4, 6, 0.15) 100%
  );
}

.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  max-width: 14em;
}

.hero .subhead,
.hero-sub {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--muted);
  max-width: 44em;
}

.hero-ctas,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 32px 0 20px;
}

.hero-note {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 16px;
}

h2 {
  font-size: 40px;
  margin-bottom: 24px;
}

.section-lead,
.lead {
  color: var(--muted);
  max-width: 46em;
  font-size: 18px;
  margin-bottom: 48px;
}

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: rgba(212, 169, 79, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--gold-glow);
}

.card h3 {
  font-size: 26px;
  margin: 12px 0 12px;
}

.card .card-desc,
.card > p:not(.eyebrow):not(.badge) {
  color: var(--muted);
  flex-grow: 0;
}

.card-badge,
.badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--gold-light);
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- 7. Capabilities lists: gold dot markers ---------- */
.caps,
.capabilities {
  list-style: none;
  margin: 20px 0 24px;
  padding: 0;
}

.caps li,
.capabilities li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  margin-bottom: 8px;
}

.caps li::before,
.capabilities li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- 8. How-it-works steps ---------- */
.steps {
  position: relative;
}

.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

/* connecting hairline across the 3-column row */
.steps::before {
  content: '';
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-glow), transparent);
  pointer-events: none;
}

.step-eyebrow,
.step .eyebrow {
  display: inline-block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 14px;
}

.step h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.step p {
  color: var(--muted);
  margin: 0;
}

/* ---------- 9. Why grid + stat chips ---------- */
.why-item {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.why-item .num,
.why-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.why-item h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.why-item p {
  color: var(--muted);
  margin: 0;
}

.chips,
.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 48px;
}

.chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 22px;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: 10px;
}

.chip .chip-value,
.chip-num {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--gold-light);
  line-height: 1.2;
}

.chip .chip-label,
.chip-label {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 10. Investor band + quote ---------- */
.investor-band,
#investors {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.investor-band ul {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
}

.investor-band ul li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  margin-bottom: 10px;
}

.investor-band ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.investor-ctas,
#investors .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.quote-band {
  padding: 48px 0;
}

.quote-band blockquote {
  margin: 0;
  padding: 8px 0 8px 32px;
  border-left: 3px solid var(--gold);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 28px;
  line-height: 1.4;
}

.quote-band cite {
  display: block;
  margin-top: 16px;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- 11. FAQ ---------- */
.faq-list,
.faq {
  border-top: 1px solid var(--border);
}

.faq-list details,
.faq details {
  border-bottom: 1px solid var(--border);
}

.faq-list summary,
.faq summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 22px 40px 22px 0;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.faq-list summary::-webkit-details-marker,
.faq summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::marker,
.faq summary::marker {
  content: '';
}

.faq-list summary::after,
.faq summary::after {
  content: '+';
  position: absolute;
  right: 8px;
  top: 50%;
  color: var(--gold);
  font-size: 24px;
  line-height: 1;
  transform: translateY(-50%);
  transition: transform 0.2s ease;
}

.faq-list details[open] summary::after,
.faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq-list summary:hover,
.faq-list details[open] summary,
.faq summary:hover,
.faq details[open] summary {
  color: var(--gold);
}

.faq-list details p,
.faq details p {
  color: var(--muted);
  margin: 0;
  padding: 0 40px 22px 0;
  max-width: 46em;
}

/* ---------- 12. Reveal - no-JS safe ---------- */
/* Hidden state only when JS is running AND motion is allowed. */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  html.js .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* No-JS or reduced-motion: .reveal is simply visible. */

/* ---------- 13. Footer + CTA ---------- */
.footer-cta {
  padding: 96px 0;
  text-align: center;
}

.site-footer,
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--surface);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--gold);
}

/* ---------- 13b. Responsive ---------- */
@media (max-width: 860px) {
  section {
    padding: 44px 0;
  }

  h2 {
    font-size: 32px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* connecting hairline is wrong in one column */
  .steps::before {
    display: none;
  }

  .quote-band blockquote {
    font-size: 23px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  section {
    padding: 40px 0;
  }

  h2 {
    font-size: 28px;
  }

  .card {
    padding: 24px;
  }

  .step {
    padding: 24px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .chips,
  .stat-chips {
    gap: 12px;
  }

  .chip {
    width: 100%;
  }
}

/* Mobile nav: hamburger disclosure + dropdown panel */
@media (max-width: 760px) {
  #navToggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
  }

  #navToggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gold);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  #navToggle[aria-expanded='true'] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  #navToggle[aria-expanded='true'] span:nth-child(2) {
    opacity: 0;
  }

  #navToggle[aria-expanded='true'] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  #navLinks {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px 24px 16px;
    background: rgba(13, 4, 6, 0.96);
    border-bottom: 1px solid var(--border);
  }

  #navLinks.open {
    display: flex;
  }

  #navLinks ul {
    display: block;
  }

  #navLinks a:not(.btn),
  #navLinks .btn {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 17px;
    border-bottom: 1px solid rgba(61, 26, 32, 0.5);
  }

  #navLinks .btn {
    width: 100%;
    margin-top: 8px;
  }

  #navLinks li:last-child a:not(.btn) {
    border-bottom: none;
  }

  /* header CTA hides into the panel via markup order on small screens */
  .header-cta {
    display: none;
  }
}

/* ---------- 14. Reduced motion: kill all movement ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Sign-in "coming soon" note */
.signin-note {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid rgba(212, 169, 79, 0.55);
  border-radius: 8px;
  box-shadow: 0 8px 32px var(--gold-glow);
  color: var(--gold-light);
  font-size: 15px;
  letter-spacing: 0.06em;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.signin-note.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 760px) {
  :root { --header-h: 52px; }
  .brand img { height: 35px; }
}
