/* ==========================================================
   Kivik Digital Group — shared theme
   Used across: index.html, contact.html, privacy.html,
   terms.html, sms-policy.html
   ========================================================== */

:root {
  --bg: #05070f;
  --bg-soft: #0a0e1f;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f6ff;
  --muted: #8d99b8;
  --muted-strong: #b6c0d6;
  --blue: #4f8cff;
  --cyan: #38d5ff;
  --violet: #a78bfa;
  --mint: #3ee6a2;
  --warning: #ffb547;
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);
}

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

body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(79, 140, 255, 0.28), transparent 60%),
    radial-gradient(800px 500px at 95% 5%, rgba(167, 139, 250, 0.22), transparent 60%),
    radial-gradient(700px 500px at 80% 95%, rgba(56, 213, 255, 0.16), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  z-index: 0;
  pointer-events: none;
}

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

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

a { color: inherit; text-decoration: none; }
a.inline { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(56, 213, 255, 0.4); text-underline-offset: 3px; }
a.inline:hover { color: var(--text); text-decoration-color: var(--cyan); }

/* ---------- Header / nav ---------- */
header {
  padding: 24px 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}

header.scrolled {
  background: rgba(5, 7, 15, 0.7);
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 17px;
}

.logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #03101f;
  box-shadow: 0 8px 30px rgba(79, 140, 255, 0.45);
  font-weight: 900;
  font-size: 18px;
}

.nav-links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--muted-strong);
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: all .2s ease;
}

.nav-cta:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.08); }

@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #03101f;
  box-shadow: 0 12px 40px rgba(79, 140, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(79, 140, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface-strong);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Eyebrows / typography ---------- */
.section-eyebrow {
  display: inline-block;
  font-size: 13px;
  color: var(--cyan);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(120deg, #ffffff 10%, #8bdcff 50%, #a78bfa 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1, h2, h3, h4 { letter-spacing: -0.03em; font-weight: 800; }

/* ---------- Footer ---------- */
footer {
  padding: 56px 0 60px;
  border-top: 1px solid var(--border);
  margin-top: 80px;
  font-size: 13px;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

.footer-col h4 {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-strong);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.footer-col a {
  display: block;
  padding: 6px 0;
  color: var(--muted-strong);
  font-size: 14px;
  transition: color .2s ease;
}

.footer-col a:hover { color: var(--text); }

.footer-col p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-strong);
  letter-spacing: 0.01em;
}

.field label .req { color: var(--cyan); }

.field input,
.field textarea,
.field select {
  width: 100%;
  background: rgba(5, 8, 20, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 13px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(56, 213, 255, 0.5);
  background: rgba(5, 8, 20, 0.7);
  box-shadow: 0 0 0 3px rgba(56, 213, 255, 0.12);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field .help {
  font-size: 12px;
  color: var(--muted);
}

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 14px;
  background: rgba(79, 140, 255, 0.05);
  border: 1px solid rgba(79, 140, 255, 0.18);
}

.consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: rgba(5, 8, 20, 0.5);
  cursor: pointer;
  margin: 0;
  position: relative;
  transition: border-color .2s ease, background .2s ease;
  flex-shrink: 0;
}

.consent input[type="checkbox"]:hover { border-color: var(--cyan); }

.consent input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-color: var(--cyan);
}

.consent input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 4px; left: 7px;
  width: 5px; height: 10px;
  border: solid #03101f;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent label {
  font-size: 13px;
  color: var(--muted-strong);
  line-height: 1.55;
  cursor: pointer;
}

.consent label strong { color: var(--text); }

.disclosures {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}

/* ---------- Legal / prose pages ---------- */
.page-hero {
  padding: 80px 0 40px;
}

.page-hero h1 {
  margin: 12px 0 16px;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
}

.page-hero .meta {
  color: var(--muted);
  font-size: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.prose {
  max-width: 760px;
  padding: 32px 0 80px;
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.75;
}

.prose h2 {
  color: var(--text);
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 48px 0 14px;
  font-weight: 700;
}

.prose h3 {
  color: var(--text);
  font-size: 18px;
  margin: 32px 0 10px;
  font-weight: 700;
}

.prose p { margin: 0 0 16px; }
.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose ul li { margin-bottom: 8px; }
.prose strong { color: var(--text); }

.prose .callout {
  margin: 24px 0;
  padding: 20px 24px;
  border-radius: 14px;
  background: rgba(79, 140, 255, 0.06);
  border: 1px solid rgba(79, 140, 255, 0.18);
  color: var(--text);
  font-size: 15px;
}

.prose .callout strong { color: var(--cyan); }

.prose code,
.prose .keyword {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: rgba(56, 213, 255, 0.1);
  border: 1px solid rgba(56, 213, 255, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--cyan);
}

.toc {
  position: sticky;
  top: 100px;
  align-self: start;
  font-size: 13px;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}

.toc h4 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
}

.toc a {
  display: block;
  padding: 5px 0;
  color: var(--muted-strong);
  transition: color .2s ease;
}

.toc a:hover { color: var(--cyan); }

.legal-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 60px;
}

@media (max-width: 880px) {
  .legal-grid { grid-template-columns: 1fr; }
  .toc { display: none; }
}
