/* ═══════════════════════════════════════════════════════════
   KreAtfy Legal — Clean black, flat design
   No gradients · no glassmorphism
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #111111;
  --border: #222222;
  --border-strong: #333333;
  --text: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #777777;
  --accent: #ff4500;
  --accent-hover: #ff6a33;
  --header-h: 68px;
  --max: 1100px;
  --prose: 700px;
  --radius: 10px;
  --font: "Inter", "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

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

/* ─── Header ─────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  flex-shrink: 0;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 2px;
}

.brand-text strong {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav a.active {
  color: var(--accent);
}

.nav-cta {
  margin-left: 8px !important;
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 9px 16px !important;
  border-radius: 6px !important;
}

.nav-cta:hover {
  background: var(--accent-hover) !important;
  color: #fff !important;
}

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

/* ─── Landing ────────────────────────────────────────────── */

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

.landing-hero {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.landing-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin: 0 auto 24px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.hero-kicker {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 14px;
}

/* Page hero label (terms/privacy) — plain text, no pill */
.badge {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 14px;
  border-radius: 0;
}

.badge::before {
  display: none;
}

.landing-hero h1 {
  font-family: var(--font);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--text);
  text-wrap: balance;
}

.landing-hero h1 em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}

.landing-hero > p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 24px;
}

.landing-hero > p strong {
  color: var(--text);
  font-weight: 500;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
}

.hero-pill strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Document cards */
.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
  min-height: 0;
}

.doc-card:hover {
  border-color: var(--border-strong);
  color: inherit;
}

.doc-card-band {
  height: 88px;
  position: relative;
  flex-shrink: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.doc-card-band.terms,
.doc-card-band.privacy {
  background: var(--surface-2);
}

.doc-card-band .band-pattern {
  display: none;
}

.doc-card-band .band-icon {
  position: absolute;
  right: 20px;
  bottom: 18px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.doc-card-band .band-icon svg {
  width: 20px;
  height: 20px;
}

.doc-card-band .band-label {
  position: absolute;
  left: 20px;
  bottom: 22px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.doc-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.doc-card-body h2 {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--text);
}

.doc-card-body p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  flex: 1;
}

.doc-card .card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

.doc-card .card-meta::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.doc-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent);
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
}

.doc-card:hover .card-link {
  color: var(--accent-hover);
}

/* Trust strip */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.trust-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.trust-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: normal;
}

.trust-item span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.landing-foot {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.landing-foot a {
  color: var(--accent);
  font-weight: 500;
}

/* ─── Legal document pages ───────────────────────────────── */

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

.page-hero {
  margin-bottom: 32px;
  max-width: 720px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-family: var(--font);
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}

.page-hero .lede {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 540px;
  margin-bottom: 20px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
}

.meta-chip strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.legal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  background: transparent;
  border: none;
  border-radius: 0;
}

.toc-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  margin-bottom: 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}

.toc nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Chapter index — streaming-docs style, not left-border AI pattern */
.toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  padding: 9px 8px 9px 4px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  text-decoration: none;
  transition: color 0.12s ease;
}

.toc a .toc-num {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.45;
  text-align: right;
  padding-top: 1px;
}

.toc a .toc-text {
  font-weight: 400;
  color: inherit;
  min-width: 0;
}

.toc a:hover {
  color: var(--text-secondary);
  background: transparent;
}

.toc a:hover .toc-num {
  color: var(--text-secondary);
}

/* Selected: inverted number badge + white title (desktop primary) */
.toc a.active {
  color: var(--text);
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-weight: 400;
}

.toc a.active .toc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  margin-right: 0;
  padding: 0;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.toc a.active .toc-text {
  font-weight: 600;
  color: var(--text);
  padding-top: 3px;
}

@media (min-width: 901px) {
  .legal-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .toc a {
    padding: 10px 4px;
  }
}

/* Article — flat black surface */
.prose {
  max-width: none;
  min-width: 0;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 40px 40px 48px;
  position: relative;
  overflow: visible;
  box-shadow: none;
}

.prose::before,
.prose::after {
  display: none;
}

.notice {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 36px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  box-shadow: none;
}

.notice strong {
  display: block;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section {
  margin-bottom: 40px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.section-number {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section h2 {
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  line-height: 1.3;
}

.subsection {
  margin-bottom: 20px;
}

.subsection h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: normal;
}

.subsection p,
.section > p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.65;
  font-size: 0.95rem;
  font-weight: 400;
}

.prose ul {
  list-style: none;
  margin: 10px 0 16px;
  padding: 0;
}

.prose ul li {
  position: relative;
  padding: 6px 0 6px 20px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  line-height: 1.6;
  font-size: 0.95rem;
  font-weight: 400;
  border-radius: 0;
  transition: none;
}

.prose ul li:hover {
  background: transparent;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.85em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: none;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent);
}

.caps {
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.7;
}

.contact-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-top: 12px;
  box-shadow: none;
}

.contact-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.contact-card dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.contact-card dd {
  color: var(--text);
  margin: 0;
  font-weight: 500;
  font-size: 0.95rem;
}

.contact-card a {
  font-weight: 500;
  text-decoration: none;
}

.ack {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 24px 28px;
  margin: 40px 0 24px;
  text-align: center;
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  font-style: normal;
}

.copyright-line {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ─── Footer ─────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px 40px;
  background: var(--bg);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.footer-brand {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-brand strong {
  color: var(--text);
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

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

/* ─── Back to top ────────────────────────────────────────── */

.back-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  box-shadow: none;
}

.back-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.back-top:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.back-top svg {
  width: 18px;
  height: 18px;
}

/* ─── Print ──────────────────────────────────────────────── */

@media print {
  .site-header,
  .toc,
  .back-top,
  .site-footer,
  .menu-toggle {
    display: none !important;
  }

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

  .legal-layout {
    display: block;
  }

  .prose {
    border: none;
    padding: 0;
    background: #fff;
  }

  .page-hero h1,
  .page-hero .lede,
  .section h2,
  .subsection h3 {
    color: #111;
  }
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .toc {
    position: static;
    max-height: none;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .toc nav {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .toc a.active .toc-num {
    background: var(--text);
    color: var(--bg);
  }

  .doc-grid {
    grid-template-columns: 1fr;
  }

  .prose {
    padding: 28px 24px 36px;
  }

  .contact-card dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .trust-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 60px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px 16px;
    gap: 2px;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    width: 100%;
    padding: 12px 14px;
  }

  .nav-cta {
    margin-left: 0 !important;
    text-align: center;
    margin-top: 4px;
  }

  .landing {
    padding-top: 36px;
  }

  .page {
    padding: 28px 16px 72px;
  }

  .prose {
    padding: 24px 18px 32px;
  }

  .back-top {
    bottom: 16px;
    right: 12px;
  }
}
