/* ============================================================
   Pokiyo - shared styles for legal pages (Privacy, Terms)
   ============================================================ */

:root {
  --bg: #070c16;
  --bg-soft: #0c1424;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef2f8;
  --text-muted: #93a0b4;
  --accent: #10b981;
  --accent-bright: #34d399;
  --accent-2: #22d3ee;
  --warn: #fbbf24;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(16, 185, 129, 0.35); }

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

/* ============ Background ambience ============ */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}
.orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(16,185,129,0.32), transparent 65%);
  top: -220px; left: -160px;
}
.orb-2 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(34,211,238,0.2), transparent 65%);
  bottom: -200px; right: -140px;
}
.grid-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 40%, transparent 100%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============ Header ============ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(7,12,22,0.96) 62%, rgba(7,12,22,0));
  backdrop-filter: blur(10px);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.logo-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: #081120;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}
.logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.header-nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--surface); border-color: var(--border); }
.nav-link[aria-current="page"] {
  color: var(--accent-bright);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.28);
}

/* ============ Title block ============ */
.legal-hero { padding: 26px 0 34px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.legal-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5.4vw, 50px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.gradient-text {
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.legal-hero .lede {
  margin-top: 16px;
  max-width: 62ch;
  font-size: 16.5px;
  color: var(--text-muted);
}
.updated {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.updated-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
}

/* ============ Layout: TOC + content ============ */
.legal-layout {
  display: grid;
  grid-template-columns: 244px 1fr;
  gap: 48px;
  align-items: start;
  padding-bottom: 80px;
}

.toc {
  position: sticky;
  top: 104px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(8px);
}
.toc h2 {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toc ol { list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s, background 0.18s;
}
.toc a::before {
  content: counter(toc) ". ";
  color: rgba(147, 160, 180, 0.6);
}
.toc a:hover { color: var(--text); background: var(--surface-strong); }
.toc a.active {
  color: var(--accent-bright);
  background: rgba(16, 185, 129, 0.1);
}
.toc a.active::before { color: var(--accent); }

/* ============ Prose ============ */
.legal-body { min-width: 0; }

.legal-section {
  scroll-margin-top: 96px;
  padding: 26px 0;
}
.legal-section + .legal-section { border-top: 1px solid var(--border); }

.legal-section h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.sec-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.legal-section h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 18px 0 8px;
  color: var(--text);
}
.legal-section p { color: var(--text-muted); margin-bottom: 12px; font-size: 15.5px; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section strong { color: var(--text); font-weight: 600; }

.legal-section ul { list-style: none; margin: 4px 0 12px; }
.legal-section ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 15.5px;
}
.legal-section ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.7);
}

/* Callout box */
.callout {
  border: 1px solid rgba(16, 185, 129, 0.26);
  background: rgba(16, 185, 129, 0.07);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 4px 0 12px;
  font-size: 15px;
  color: var(--text-muted);
}
.callout.warn {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.07);
}
.callout strong { color: var(--text); }
.callout p:last-child { margin-bottom: 0; }

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 6px 0 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 420px;
}
th, td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface);
}
td { color: var(--text-muted); }
td:first-child { color: var(--text); font-weight: 500; }
tr:last-child td { border-bottom: none; }

/* Contact card */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.contact-avatar {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: #081120;
  flex: none;
}
.contact-card .who { font-weight: 600; color: var(--text); }
.contact-card .mail { font-size: 14.5px; }

/* Placeholder marker - replace before publishing */
.todo {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  border: 1px dashed rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.1);
  color: var(--warn);
  font-size: 0.92em;
  font-weight: 500;
}

/* ============ Footer ============ */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 26px 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-muted);
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent-bright); }

/* ============ Back to top ============ */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: 44px; height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(13, 22, 38, 0.9);
  backdrop-filter: blur(10px);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, color 0.2s, border-color 0.2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--accent-bright); border-color: rgba(16, 185, 129, 0.4); }
.to-top svg { width: 18px; height: 18px; fill: currentColor; }

/* ============ Reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.d-1 { animation-delay: 0.05s; }
.d-2 { animation-delay: 0.13s; }
.d-3 { animation-delay: 0.21s; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 26px; }
  .toc { position: static; }
  .toc ol { columns: 2; column-gap: 18px; }
}

@media (max-width: 560px) {
  .page { padding: 0 18px; }
  .site-header { padding: 18px 0; }
  .logo-name { font-size: 19px; }
  .logo-mark { width: 34px; height: 34px; font-size: 17px; }
  .nav-link { padding: 7px 11px; font-size: 12.5px; }
  .toc ol { columns: 1; }
  footer { justify-content: center; text-align: center; }
}
