/* Shared TraceBye page chrome: brand tokens, fonts, type, the floating nav,
   buttons, gradient background and footer. Used by the website (site.css) and the
   privacy / terms pages (services/api/legal/legal.css): both builds prepend this file,
   so every page looks the same and links to the others. Edit shared rules only here.
   Brand: iris blue #5B69FF → #2F37D1, ink #121317, ivory #F5F3EE. */
@font-face { font-family: 'Jakarta'; src: url('fonts/PlusJakartaSans-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('fonts/PlusJakartaSans-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Jakarta'; src: url('fonts/PlusJakartaSans-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --bg: #F6F5FB;
  --surface: #FFFFFF;
  --ink: #121317;
  --ink-2: #4A4D5A;
  --ink-3: #6E7180;
  --ivory: #F5F3EE;
  --hair: rgba(18, 19, 23, .08);
  --iris: #5B69FF;
  --iris-deep: #2F37D1;
  --iris-soft: #B2B9FF;
  --grad: linear-gradient(100deg, #5B69FF 0%, #8A5BFF 45%, #FF6FA0 100%);
  --like: #FF5C8A; --repost: #19B39E; --save: #4F6BE0; --comment: #F2A12E; --post: #8A4FE0; --msg: #1D8FD0; --subs: #F0603F;
  --radius: 28px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: 'Jakarta', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.wrap.narrow { width: min(820px, 100% - 2 * var(--gutter)); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--ivory); }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--iris); outline-offset: 3px; border-radius: 8px; }

/* ── Display type ─────────────────────────────────────── */
.display { font-weight: 800; text-transform: uppercase; letter-spacing: -.035em; line-height: .92; font-size: clamp(46px, 9.4vw, 128px); }
.display.sm { font-size: clamp(38px, 6.4vw, 84px); }
.display .line { display: block; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.lang-zh .display { letter-spacing: -.01em; line-height: 1.04; }
.kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--iris-deep); }
.kicker::before { content: ''; width: 22px; height: 3px; border-radius: 3px; background: var(--grad); }
.lead { max-width: 640px; margin-top: 22px; font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); }

/* ── Navigation: floating dark pill ───────────────────── */
.nav-wrap { position: fixed; inset: 14px 0 auto; z-index: 50; padding-inline: var(--gutter); pointer-events: none; }
.nav { pointer-events: auto; display: flex; align-items: center; gap: 8px; max-width: 1180px; margin: 0 auto; padding: 8px 8px 8px 14px; border-radius: 999px; background: rgba(18, 19, 23, .92); color: var(--ivory); box-shadow: 0 18px 40px rgba(18, 19, 23, .22); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a, .nav-lang { white-space: nowrap; padding: 9px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; color: rgba(245, 243, 238, .82); }
.nav-links a:hover, .nav-lang:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-lang { border: 1px solid rgba(255, 255, 255, .16); }
.nav-cta { white-space: nowrap; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; color: #fff; background: linear-gradient(180deg, #5B69FF, #2F37D1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.nav-cta:hover { filter: brightness(1.08); }

/* ── Pastel gradient blobs ────────────────────────────── */
.blobs { position: absolute; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.blobs i { position: absolute; width: 46vw; height: 46vw; min-width: 340px; min-height: 340px; border-radius: 50%; filter: blur(80px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.blobs .b1 { background: #8D96FF; top: -18%; left: -10%; }
.blobs .b2 { background: #FFB3C9; top: -24%; right: -12%; animation-delay: -6s; }
.blobs .b3 { background: #FFD9A8; top: 26%; right: 18%; opacity: .45; animation-delay: -12s; }
.blobs .b4 { background: #C9B5FF; top: 30%; left: 4%; opacity: .4; animation-delay: -3s; }
@keyframes drift { to { transform: translate3d(4vw, 3vw, 0) scale(1.08); } }

/* ── Buttons ──────────────────────────────────────────── */
.store { white-space: nowrap; display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 26px 0 20px; border-radius: 18px; background: var(--ink); color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; box-shadow: 0 14px 30px rgba(18, 19, 23, .22); transition: transform .2s ease, box-shadow .2s ease; }
a.store:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(18, 19, 23, .28); }
.store.is-soon { background: rgba(18, 19, 23, .86); cursor: default; }
.store.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
.store-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* ── Footer ───────────────────────────────────────────── */
.footer { padding: 70px 0 40px; background: var(--ink); color: rgba(245, 243, 238, .7); font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 30px; }
.footer .brand { color: var(--ivory); }
.footer-brand p { margin-top: 14px; font-weight: 700; color: var(--ivory); text-transform: uppercase; letter-spacing: .02em; }
.footer h3 { margin-bottom: 14px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: rgba(245, 243, 238, .45); }
.footer-grid a, .footer-grid span { display: block; margin-bottom: 8px; text-decoration: none; }
.footer-grid a:hover { color: #fff; }
.footer-base { margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 6px; font-size: 13px; color: rgba(245, 243, 238, .45); }

/* ── Responsive (shared parts) ────────────────────────── */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-lang { margin-left: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .display { font-size: clamp(40px, 11.6vw, 72px); }
  .display.sm { font-size: clamp(32px, 9.2vw, 56px); }
  .lead { margin-top: 16px; }
  .kicker { margin-bottom: 12px; }
  .store { min-height: 54px; font-size: 16px; }
  .footer { padding: 48px 0 calc(28px + env(safe-area-inset-bottom)); }
  .footer-grid { gap: 22px 16px; }
  .footer-base { margin-top: 32px; }
  .brand span { font-size: 17px; }
  .nav { padding: 6px 6px 6px 10px; }
  .nav-cta { padding: 9px 16px; }
  .nav-lang { padding: 8px 12px; }
}
@media (max-width: 360px) {
  .nav .brand span { display: none; }
  .store { padding: 0 18px 0 14px; font-size: 15px; gap: 10px; }
  .nav-lang { padding: 7px 10px; font-size: 14px; }
  .nav-cta { padding: 8px 13px; font-size: 14px; }
  .brand { gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
}
/* Landscape phones: keep content clear of the notch / Dynamic Island. */
@supports (padding: max(0px)) {
  .wrap { width: min(1180px, 100% - 2 * max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right))); }
  .nav-wrap { padding-inline: max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right)); }
}
/* Touch screens get no hover lift that would stick after a tap. */
@media (hover: none) {
  a.store:hover { transform: none; box-shadow: 0 14px 30px rgba(18, 19, 23, .22); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Privacy, terms and legal overview pages. Shared chrome (tokens, fonts, nav, footer,
   gradient background) is services/api/website/chrome.css, which build.mjs prepends,
   so these pages match the home page. Only document-specific rules live here. */

/* ── Page head ────────────────────────────────────────── */
.doc-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(118px, 13vw, 156px) 0 clamp(40px, 5vw, 64px); }
.doc-hero .blobs { -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent); }
.doc-hero .blobs i { opacity: .42; }
.doc-hero .display { max-width: 15ch; overflow-wrap: anywhere; }
.lang-zh .doc-hero .display { max-width: none; }
.doc-tabs { display: inline-flex; gap: 4px; margin: 0 0 26px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--hair); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.doc-tabs a { padding: 8px 18px; border-radius: 999px; font-size: 15px; font-weight: 700; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.doc-tabs a:hover { color: var(--ink); }
.doc-tabs a[aria-current="page"] { background: var(--ink); color: var(--ivory); }
.doc-hero .kicker { display: flex; }
.effective { display: inline-flex; gap: 8px; margin-top: 24px; padding: 7px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); font-size: 14px; font-weight: 600; color: var(--ink-3); }
.effective time { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ── Document ─────────────────────────────────────────── */
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start; padding-bottom: clamp(64px, 8vw, 110px); }
.contents { position: sticky; top: 100px; max-height: calc(100dvh - 120px); overflow-y: auto; padding: 18px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); }
.contents summary { display: flex; align-items: center; min-height: 32px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); cursor: pointer; list-style: none; }
.contents summary::-webkit-details-marker { display: none; }
.contents summary::after { content: '−'; margin-left: auto; font-size: 18px; letter-spacing: 0; }
.contents details:not([open]) summary::after { content: '+'; }
.contents ol { list-style: none; margin: 8px 0 0; padding: 0; }
.contents a { display: block; padding: 7px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink-2); text-decoration: none; }
.contents a:hover { background: var(--bg); color: var(--ink); }

.document { max-width: 760px; min-width: 0; padding: clamp(24px, 4vw, 48px); border-radius: 32px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair), 0 10px 30px rgba(18, 19, 23, .04); }
.document section { scroll-margin-top: 100px; }
.document section + section { margin-top: 40px; padding-top: 36px; border-top: 1px solid var(--hair); }
.document h2 { margin-bottom: 16px; font-size: clamp(21px, 2.2vw, 26px); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; text-transform: uppercase; }
.lang-zh .document h2 { text-transform: none; letter-spacing: 0; }
.document p, .document li { color: var(--ink-2); line-height: 1.75; overflow-wrap: anywhere; }
.document p + p { margin-top: 14px; }
.document ul { margin: 14px 0 0; padding-left: 1.2em; }
.document li + li { margin-top: 8px; }
.document li::marker { color: var(--iris); }
.document a, .contact-list a { color: var(--iris-deep); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.document a:hover, .contact-list a:hover { text-decoration-thickness: 2px; }

/* ── Legal overview ───────────────────────────────────── */
.overview { padding-bottom: clamp(64px, 8vw, 110px); }
.doc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.doc-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 230px; padding: 30px; border-radius: 28px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair), 0 10px 30px rgba(18, 19, 23, .04); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease; }
.doc-card:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--hair), 0 22px 44px rgba(47, 55, 209, .1); }
.doc-card-k { font-size: 14px; font-weight: 800; letter-spacing: .08em; color: var(--ink-3); }
.doc-card strong { margin-top: auto; font-size: clamp(28px, 3vw, 38px); font-weight: 800; letter-spacing: -.03em; text-transform: uppercase; }
.lang-zh .doc-card strong { text-transform: none; }
.doc-card span:not([class]) { color: var(--ink-2); }
.doc-card-go { position: absolute; top: 26px; right: 26px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 20px; }
.doc-card:nth-child(2) .doc-card-go { background: var(--grad); }
.contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.contact-list > div { padding: 22px 26px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); }
.contact-list h2 { margin-bottom: 6px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.operator { margin-top: 24px; font-size: 14px; color: var(--ink-3); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; gap: 16px; }
  .contents { position: static; max-height: none; }
  .contents ol { columns: 2; column-gap: 12px; }
  .contents li { break-inside: avoid; }
}
@media (max-width: 720px) {
  .doc-hero { padding-top: 104px; }
  .doc-tabs { margin-bottom: 20px; }
  .doc-tabs a { padding: 7px 14px; font-size: 14px; }
  .effective { margin-top: 18px; font-size: 13px; }
  /* Table of contents becomes one scrollable row of section chips. */
  .contents { margin-inline: calc(-1 * var(--gutter)); padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .contents summary { display: none; }
  .contents ol { display: flex; gap: 8px; margin: 0; padding: 2px var(--gutter) 6px; overflow-x: auto; columns: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .contents ol::-webkit-scrollbar { display: none; }
  .contents a { padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); font-size: 13.5px; white-space: nowrap; }
  .document { padding: 22px 18px; border-radius: 22px; }
  .document section + section { margin-top: 28px; padding-top: 26px; }
  .document h2 { font-size: 20px; }
  .document p, .document li { font-size: 15.5px; }
  .doc-cards, .contact-list { grid-template-columns: 1fr; gap: 10px; }
  .doc-card { min-height: 180px; padding: 22px; border-radius: 22px; }
  .contact-list { margin-top: 10px; }
}
@media (hover: none) {
  .doc-card:hover { transform: none; }
}

@media print {
  .nav-wrap, .skip, .footer, .contents, .doc-tabs, .blobs { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .doc-hero { padding: 0 0 12pt; }
  .doc-layout { display: block; }
  .document { max-width: none; padding: 0; box-shadow: none; }
  .document p, .document li { color: #000; line-height: 1.5; }
  .document h2 { break-after: avoid; }
}
