/* ==========================================================================
   Kin Kwan Engineering Co. Limited — legal.css
   Shared stylesheet for privacy.html and terms-of-service.html
   Loaded ONLY by the legal pages (never style.css).
   ========================================================================== */

:root {
  --bg: #0B0E14;
  --bg-soft: #0F131D;
  --surface: #141826;
  --surface-2: #1A2033;
  --border: #272E42;
  --border-soft: #1C2233;
  --text: #E8EAED;
  --text-muted: #9BA5B8;
  --text-dim: #6C7590;
  --accent: #8B5CF6;
  --accent-deep: #7C3AED;
  --accent-magenta: #C026D3;
  --accent-soft: #B79CF8;
  --on-accent: #FFFFFF;
  --radius: 16px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

/* Body background MUST be defined here — legal pages do not load style.css */
.legal-page {
  background-color: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ==========================================================================
   Legal header — <header> element with a solid gradient background
   The h1 title color contrasts strongly with this background.
   ========================================================================== */
.legal-header {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent-magenta));
  padding: 110px 0 72px;
  text-align: center;
}

.legal-header .legal-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #F1EAFE;
}

.legal-header h1 {
  margin-top: 14px;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  line-height: 1.15;
}

.legal-header .legal-meta {
  margin-top: 16px;
  font-size: 15px;
  color: #F1EAFE;
}

/* ==========================================================================
   Legal content body
   ========================================================================== */
.legal-content {
  padding: 70px 0 60px;
  background-color: var(--bg);
}

.legal-content .container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Scope-isolation: guarantee homepage section styling can never pollute
   the legal body content. */
.legal-page .legal-content section {
  background-color: transparent !important;
}

.legal-content section {
  margin-bottom: 48px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--border-soft);
}

.legal-content section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-content h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  scroll-margin-top: 90px;
}

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

.legal-content p {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 16px;
}

.legal-content p strong {
  color: var(--text);
}

.legal-content ul {
  margin: 0 0 16px 22px;
  color: var(--text-muted);
  font-size: 16px;
}

.legal-content li {
  margin-bottom: 8px;
}

/* ==========================================================================
   Table of contents
   ========================================================================== */
.toc {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 48px;
}

.toc .toc-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 16px;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  margin: 0;
}

.toc ol li {
  counter-increment: toc;
  margin-bottom: 10px;
}

.toc ol li a {
  color: var(--text-muted);
  font-size: 15px;
  display: flex;
  gap: 12px;
}

.toc ol li a:hover {
  color: var(--accent-soft);
}

.toc ol li a::before {
  content: counter(toc, decimal-leading-zero);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Legal footer — links back to the homepage
   ========================================================================== */
.legal-footer {
  background-color: var(--bg);
  border-top: 1px solid var(--border-soft);
  padding: 28px 0;
  text-align: center;
}

.legal-footer .container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-footer p {
  color: var(--text-dim);
  font-size: 14px;
}

.legal-footer a {
  color: var(--accent-soft);
  font-weight: 600;
}

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

.legal-footer .foot-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  list-style: none;
}

.legal-footer .foot-links a {
  font-size: 14px;
  font-weight: 500;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 760px) {
  .legal-header {
    padding: 90px 0 56px;
  }

  .legal-header h1 {
    font-size: 32px;
  }

  .legal-content {
    padding: 50px 0 44px;
  }

  .legal-content h2 {
    font-size: 22px;
  }
}
