﻿:root {
  --brand: #2b8ea6;
  --brand-2: #2aa7ff;
  --brand-3: #8fb4c0;
  --bg: #0b1b2a;
  --bg-2: #0a1624;
  --panel: rgba(255, 255, 255, 0.05);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #eaf2f7;
  --muted: rgba(233, 242, 247, 0.75);
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(1000px 500px at 10% -15%, rgba(42, 167, 255, 0.12), transparent 60%),
    radial-gradient(800px 400px at 90% 5%, rgba(42, 167, 255, 0.06), transparent 58%),
    radial-gradient(1000px 500px at 50% 120%, rgba(42, 167, 255, 0.04), transparent 62%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

body.theme-dark {
  --bg: #0b1b2a;
  --bg-2: #0a1624;
  --panel: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.14);
  --text: #eaf2f7;
  --muted: rgba(233, 242, 247, 0.8);
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(7, 16, 24, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  font-size: 0.94rem;
}

.brand-dot {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #0c151d center / 92% 92% no-repeat url("../img/logo-kairostech-icon-v2.jpg");
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.52rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition: 0.15s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.btn-primary {
  border: none;
  color: #05131d;
  background: linear-gradient(135deg, rgba(42, 167, 255, 0.92), rgba(76, 125, 186, 0.82));
}

.hero {
  padding: 2.2rem 0 1.2rem;
}

.hero-card {
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background:
    radial-gradient(520px 180px at 18% 0%, rgba(42, 167, 255, 0.1), transparent 62%),
    radial-gradient(420px 180px at 92% 15%, rgba(42, 167, 255, 0.05), transparent 62%),
    var(--panel);
  padding: 1.25rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-3);
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
  letter-spacing: -0.02em;
}

.hero-card p {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.meta {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.meta span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 0.32rem 0.55rem;
}

.doc-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0.8rem;
  padding: 1rem 0 2rem;
}

.toc,
.document {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--panel);
}

.toc {
  position: sticky;
  top: 92px;
  height: fit-content;
  padding: 0.9rem;
}

.toc h2 {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
}

.toc nav {
  display: grid;
  gap: 0.35rem;
}

.toc a {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
}

.toc a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.toc a.active {
  color: var(--text);
  background: rgba(42, 167, 255, 0.16);
  border: 1px solid rgba(42, 167, 255, 0.3);
}

.document {
  padding: 1rem;
}

.document section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.9rem;
  margin-bottom: 0.7rem;
  transition: 0.2s ease;
}

.document section:hover {
  border-color: rgba(42, 167, 255, 0.28);
  background: rgba(255, 255, 255, 0.045);
}

.document h2 {
  margin: 0;
  font-size: 1rem;
}

.document p,
.document li {
  color: var(--muted);
  font-size: 0.87rem;
}

.document ul,
.document ol {
  margin: 0.55rem 0 0;
  padding-left: 1rem;
}

.highlight {
  border-left: 3px solid var(--brand);
  padding-left: 0.7rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.table th,
.table td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.55rem;
  text-align: left;
}

.table th {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.note {
  font-size: 0.8rem;
  color: rgba(233, 242, 247, 0.85);
}

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.15rem 0 1.8rem;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.footer-wrap p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.footer-links a {
  padding: 0.34rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.74rem;
}

@media (max-width: 1024px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 980px) {
  .nav {
    align-items: start;
    flex-direction: column;
    padding: 0.55rem 0;
  }

  .actions {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  .btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .nav {
    min-height: 68px;
    align-items: start;
    flex-direction: column;
    padding: 0.6rem 0;
  }

  .brand {
    font-size: 0.86rem;
  }

  .brand-dot {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .actions {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    justify-content: flex-start;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .actions::-webkit-scrollbar {
    height: 6px;
  }

  .actions::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
  }

  .btn {
    font-size: 0.76rem;
    padding: 0.48rem 0.72rem;
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 1rem, var(--max));
  }

  .hero {
    padding: 1.3rem 0 0.9rem;
  }

  .hero-card {
    border-radius: 18px;
    padding: 0.95rem;
  }

  h1 {
    font-size: clamp(1.2rem, 6vw, 1.5rem);
  }

  .document {
    border-radius: 14px;
    padding: 0.75rem;
  }

  .document section {
    border-radius: 12px;
    padding: 0.7rem;
  }

  .document h2 {
    font-size: 0.94rem;
  }

  .document p,
  .document li {
    font-size: 0.84rem;
  }

  .table {
    font-size: 0.76rem;
  }

  .table th,
  .table td {
    padding: 0.42rem;
  }
}

@media print {
  .topbar,
  .toc,
  .footer,
  .actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .hero-card,
  .document,
  .document section {
    border: 1px solid #ddd;
    box-shadow: none;
    background: #fff;
  }

  .document p,
  .document li,
  .note {
    color: #222;
  }
}

.btn-theme-toggle {
  min-width: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.btn-theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.btn-theme-toggle:hover svg {
  transform: scale(1.08) rotate(8deg);
}

.btn-theme-toggle.is-dark svg {
  transform: rotate(12deg);
}

.btn-theme-toggle:focus,
.btn-theme-toggle:focus-visible {
  outline: none;
}

body:not(.theme-dark) {
  --bg: #f6f8fb;
  --bg-2: #eef3f8;
  --panel: #ffffff;
  --stroke: rgba(25, 60, 92, 0.16);
  --text: #17283b;
  --muted: #4e657f;
  --brand-3: #547693;
  color: #17283b;
  background:
    radial-gradient(1000px 500px at 10% -15%, rgba(42, 167, 255, 0.1), transparent 60%),
    linear-gradient(180deg, #f6f8fb, #eef3f8);
}

body:not(.theme-dark) .topbar {
  background: rgba(248, 251, 255, 0.92);
  border-bottom-color: rgba(20, 51, 78, 0.14);
}

body:not(.theme-dark) .hero-card,
body:not(.theme-dark) .toc,
body:not(.theme-dark) .document,
body:not(.theme-dark) .document section,
body:not(.theme-dark) .footer-links a {
  background: #ffffff;
  border-color: rgba(25, 60, 92, 0.16);
  box-shadow: 0 10px 24px rgba(21, 39, 60, 0.08);
}

body:not(.theme-dark) .hero-card {
  background:
    radial-gradient(500px 180px at 18% 0%, rgba(42, 167, 255, 0.08), transparent 62%),
    #ffffff;
}

body:not(.theme-dark) .brand,
body:not(.theme-dark) .hero-card h1,
body:not(.theme-dark) .document h2,
body:not(.theme-dark) .table th {
  color: #17283b;
}

body:not(.theme-dark) .eyebrow {
  color: #547693;
}

body:not(.theme-dark) .hero-card p,
body:not(.theme-dark) .meta span,
body:not(.theme-dark) .toc a,
body:not(.theme-dark) .document p,
body:not(.theme-dark) .document li,
body:not(.theme-dark) .note,
body:not(.theme-dark) .footer-wrap p {
  color: #4e657f;
}

body:not(.theme-dark) .btn {
  color: #1f3650;
  background: #ffffff;
  border-color: rgba(25, 60, 92, 0.18);
}

body:not(.theme-dark) .btn-theme-toggle {
  background: #f4f8fd;
  border-color: rgba(25, 60, 92, 0.22);
  color: #1f4e79;
}

body:not(.theme-dark) .btn-primary {
  color: #ffffff;
  border: none;
  background: linear-gradient(135deg, rgba(42, 167, 255, 0.92), rgba(76, 125, 186, 0.82));
}

body:not(.theme-dark) .toc a,
body:not(.theme-dark) .meta span,
body:not(.theme-dark) .document p,
body:not(.theme-dark) .document li,
body:not(.theme-dark) .note,
body:not(.theme-dark) .table td,
body:not(.theme-dark) .footer-wrap p {
  color: #405b74;
}

body:not(.theme-dark) .document h2,
body:not(.theme-dark) .toc h2,
body:not(.theme-dark) .document strong,
body:not(.theme-dark) .table th {
  color: #17283b;
}

body:not(.theme-dark) .document a {
  color: #1f5f8d;
  font-weight: 700;
}

body:not(.theme-dark) .document a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

body:not(.theme-dark) .document section {
  background: #fbfdff;
  border-color: rgba(25, 60, 92, 0.16);
}

body:not(.theme-dark) .toc a:hover {
  color: #1f5f8d;
  background: rgba(42, 167, 255, 0.1);
}

body:not(.theme-dark) .toc a.active {
  color: #1f5f8d;
  background: rgba(42, 167, 255, 0.14);
  border: 1px solid rgba(42, 167, 255, 0.28);
}

body:not(.theme-dark) .table th,
body:not(.theme-dark) .table td {
  border-color: rgba(25, 60, 92, 0.2);
}

body:not(.theme-dark) .table th {
  background: #f5f9fe;
}

/* Light mode hard-contrast fix for all legal documents */
body:not(.theme-dark) .document,
body:not(.theme-dark) .document section,
body:not(.theme-dark) .toc {
  color: #2e4a63;
}

body:not(.theme-dark) .document h1,
body:not(.theme-dark) .document h2,
body:not(.theme-dark) .document h3,
body:not(.theme-dark) .document strong,
body:not(.theme-dark) .toc h2 {
  color: #17283b !important;
}

body:not(.theme-dark) .document p,
body:not(.theme-dark) .document li,
body:not(.theme-dark) .document td,
body:not(.theme-dark) .document th,
body:not(.theme-dark) .document span,
body:not(.theme-dark) .toc a,
body:not(.theme-dark) .note {
  color: #3f5d77 !important;
}

body:not(.theme-dark) .document a,
body:not(.theme-dark) .footer a {
  color: #1f5f8d !important;
}

