/* ============================================================
   QOSE Customer Portal — Design System
   Qontra brand palette. Space Grotesk / Inter / IBM Plex Mono.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --near-black: #05070A;
  --deep-navy: #0B1C2C;
  --graphite: #2A2F36;
  --cyan: #00C2FF;
  --soft-white: #E6EDF3;

  --text-primary: var(--soft-white);
  --text-muted: rgba(230, 237, 243, 0.66);
  --text-faint: rgba(230, 237, 243, 0.4);

  --surface-0: var(--near-black);
  --surface-1: var(--deep-navy);
  --surface-2: #101f30;
  --border: rgba(42, 47, 54, 0.9);
  --border-soft: rgba(230, 237, 243, 0.1);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --max-width: 1120px;
  --content-width: 700px;

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

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em 0; color: var(--text-muted); }

code, .mono {
  font-family: var(--font-mono);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.9em;
  display: block;
}

::selection { background: var(--cyan); color: var(--near-black); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

button { font-family: inherit; }

/* ---------- Layout helpers ---------- */

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

.prose {
  max-width: var(--content-width);
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 7, 10, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--soft-white);
}
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; display: block; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  margin-left: 6px;
  padding-left: 6px;
  border-left: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--soft-white); text-decoration: none; }
.nav-links a.active { color: var(--cyan); }

.nav-cta {
  background: var(--cyan);
  color: var(--near-black) !important;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem !important;
}
.nav-cta:hover { text-decoration: none; opacity: 0.88; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--soft-white);
  width: 38px;
  height: 38px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--near-black);
    border-bottom: 1px solid var(--border-soft);
    padding: 18px 28px 24px;
    gap: 18px;
  }
}

/* ---------- Hero / canvas backdrop ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-inner {
  position: relative;
  z-index: 2;
  padding: 110px 28px 90px;
}
.hero--tall .hero-inner { padding: 130px 28px 110px; }
.hero--short .hero-inner { padding: 56px 28px 48px; }

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,7,10,0.15) 0%, rgba(5,7,10,0.55) 70%, var(--near-black) 100%);
  z-index: 1;
  pointer-events: none;
}

.hero p.lede {
  font-size: 1.1rem;
  max-width: 620px;
  color: var(--text-muted);
}
.hero p.hook {
  font-size: 1.15rem;
  max-width: 620px;
  color: var(--cyan);
  margin-top: 14px;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-body);
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--cyan);
  color: var(--near-black);
}
.btn-primary:hover { opacity: 0.88; }

.btn-secondary {
  background: transparent;
  color: var(--soft-white);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-disabled {
  background: var(--graphite);
  color: var(--text-faint);
  cursor: not-allowed;
  border-color: var(--border);
}

/* ---------- Sections ---------- */

.section {
  padding: 76px 0;
}
.section-alt {
  background: var(--surface-1);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.section-head {
  margin-bottom: 44px;
  max-width: 620px;
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: rgba(0, 194, 255, 0.4); }
.card h3 { margin-bottom: 0.5em; }
.card h3 a { color: var(--soft-white); }
.card h3 a:hover { color: var(--cyan); text-decoration: none; }
.card p { margin-bottom: 0; font-size: 0.94rem; }
.card .card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(0, 194, 255, 0.1);
  border: 1px solid rgba(0, 194, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Sidebar / doc layout ---------- */

.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 780px) {
  .doc-layout { grid-template-columns: 1fr; gap: 30px; }
}

.doc-sidebar {
  position: sticky;
  top: 88px;
}
.doc-sidebar-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.doc-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.doc-sidebar a {
  color: var(--text-muted);
  font-size: 0.92rem;
}
.doc-sidebar a:hover { color: var(--soft-white); text-decoration: none; }
.doc-sidebar a.active { color: var(--cyan); }

.doc-content h2 {
  margin-top: 2.2em;
  padding-top: 0.4em;
}
.doc-content h2:first-child { margin-top: 0; }
.doc-content ul, .doc-content ol {
  color: var(--text-muted);
  padding-left: 1.3em;
}
.doc-content li { margin-bottom: 0.5em; }

/* ---------- FAQ ---------- */

details.faq-item {
  border-bottom: 1px solid var(--border-soft);
  padding: 18px 0;
}
details.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--soft-white);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
details.faq-item[open] summary::after { transform: rotate(45deg); }
details.faq-item p {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 0.95rem;
}
.faq-group-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 2.4em 0 0.6em;
}
.faq-group-title:first-child { margin-top: 0; }

/* ---------- Table ---------- */

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.4em 0;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
table.data-table th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}
table.data-table td { color: var(--text-muted); }

/* ---------- Timeline (Updates) ---------- */

.timeline-entry {
  border-left: 2px solid var(--border);
  padding: 4px 0 32px 26px;
  position: relative;
}
.timeline-entry::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 194, 255, 0.15);
}
.timeline-entry:last-child { padding-bottom: 4px; }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.timeline-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(0, 194, 255, 0.3);
  color: var(--cyan);
  margin-left: 10px;
}
.timeline-entry h3 { margin: 8px 0 6px; }
.timeline-entry--future::before {
  background: var(--text-faint);
  box-shadow: 0 0 0 4px rgba(230, 237, 243, 0.08);
}
.timeline-entry--future .timeline-tag {
  color: var(--text-faint);
  border-color: rgba(230, 237, 243, 0.25);
}

/* ---------- Forms ---------- */

.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--soft-white);
}
.form-field .hint {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 4px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
  border-color: var(--cyan);
}
.form-field textarea { resize: vertical; min-height: 120px; }

.notice {
  background: rgba(0, 194, 255, 0.07);
  border: 1px solid rgba(0, 194, 255, 0.28);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.notice strong { color: var(--soft-white); }
.notice-error {
  background: rgba(255, 90, 90, 0.08);
  border-color: rgba(255, 90, 90, 0.35);
}
.form-status { display: none; margin-top: 22px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 50px 0 40px;
  background: var(--near-black);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand img { width: 22px; height: 22px; }
.footer-brand span {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--soft-white);
}
.footer-cols {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}
.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer-col a {
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-col a:hover { color: var(--cyan); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border-soft);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-faint);
}
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--cyan); }
.footer-tagline {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ---------- Page header (non-hero interior pages) ---------- */

.page-head {
  padding: 54px 0 10px;
}
.page-head .eyebrow { margin-bottom: 14px; }
.page-head p.lede {
  color: var(--text-muted);
  max-width: 620px;
  font-size: 1.02rem;
}
