/* ============ Tera Labor — legal pages ============ */

:root {
  --bg: #ffffff;
  --ink: #1d1d1f;
  --ink-2: rgba(29, 29, 31, 0.62);
  --ink-3: rgba(29, 29, 31, 0.42);
  --hairline: rgba(0, 0, 0, 0.08);
  --rh: #2f6fd0;
  --edge: clamp(16px, 4vw, 56px);
  --wrap: 1280px;
  --head-h: 72px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 16px); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
a { color: inherit; }

/* ---------- masthead ---------- */

.masthead {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 50; height: var(--head-h);
  display: flex; align-items: center; padding-inline: var(--edge); padding-top: env(safe-area-inset-top);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}
.masthead.scrolled {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 1px 0 var(--hairline);
}
.masthead-inner { width: min(var(--wrap), 100%); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { display: inline-flex; flex-direction: column-reverse; gap: 2.5px; }
.brand-mark i { height: 3.5px; border-radius: 2px; background: var(--ink); }
.brand-mark i:nth-child(1) { width: 22px; }
.brand-mark i:nth-child(2) { width: 15px; opacity: 0.55; }
.brand-mark i:nth-child(3) { width: 9px; opacity: 0.28; }
.brand-name { font-size: 13px; font-weight: 600; letter-spacing: 0.22em; }
.brand-crumb { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.brand-crumb em { font-style: normal; color: var(--ink-3); font-weight: 300; }
.contact-btn {
  margin-left: auto; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border: 1px solid var(--hairline); border-radius: 999px; background: rgba(0, 0, 0, 0.04);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; color: var(--ink);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.contact-btn svg { width: 13px; height: 13px; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; transition: transform 0.25s ease; }
.contact-btn:hover { background: rgba(0, 0, 0, 0.07); transform: translateY(-0.5px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.contact-btn:hover svg { transform: translateX(2px); }

/* ---------- document ---------- */

.doc { padding: calc(var(--head-h) + clamp(40px, 6vw, 88px)) var(--edge) clamp(72px, 9vw, 140px); }
.doc-inner { width: min(var(--wrap), 100%); margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(40px, 6vw, 120px); align-items: start; }

.doc-toc { position: sticky; top: calc(var(--head-h) + 24px); }
.doc-toc-head { font-size: 10.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.doc-toc ol { list-style: none; display: grid; gap: 2px; }
.doc-toc a {
  display: block; padding: 7px 10px; margin-left: -10px; border-radius: 8px;
  font-size: 13px; color: var(--ink-2); text-decoration: none; line-height: 1.35;
  transition: background 0.2s ease, color 0.2s ease;
}
.doc-toc a:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.doc-toc a.on { color: var(--ink); font-weight: 600; }
.doc-toc-sibling { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.doc-toc-sibling a { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.doc-toc-sibling a:hover { color: var(--ink); }
.doc-toc-sibling svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; }

.doc-body { max-width: 720px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rh); }
.doc-title {
  margin-top: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(36px, 5vw, 60px); font-weight: 300; letter-spacing: -0.045em; line-height: 1.02; text-wrap: balance;
}
.doc-meta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 12px; color: var(--ink-3); }
.doc-lede { margin-top: 32px; padding: 20px 22px; border-radius: 14px; background: #f6f6f8; font-size: 15px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.doc-lede b { color: var(--ink); font-weight: 600; }

.doc-body section { margin-top: clamp(40px, 5vw, 56px); scroll-margin-top: calc(var(--head-h) + 24px); }
.doc-body h2 {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: baseline;
  font-size: clamp(20px, 2vw, 24px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2;
  padding-bottom: 14px; border-bottom: 1px solid var(--hairline);
}
.doc-body h2 .n { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-3); }
.doc-body h3 { margin-top: 26px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.doc-body p, .doc-body li { font-size: 15.5px; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }
.doc-body p { margin-top: 14px; }
.doc-body h3 + p { margin-top: 8px; }
.doc-body p b, .doc-body li b { color: var(--ink); font-weight: 600; }
.doc-body ul, .doc-body ol { margin-top: 12px; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.doc-body li { position: relative; padding-left: 22px; }
.doc-body ul li::before { content: ""; position: absolute; left: 6px; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.doc-body ol { counter-reset: item; }
.doc-body ol li { padding-left: 34px; counter-increment: item; }
.doc-body ol li::before { content: "(" counter(item, lower-alpha) ")"; position: absolute; left: 0; top: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; color: var(--ink-3); line-height: 1.9; }
.doc-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(29,29,31,0.3); transition: text-decoration-color 0.2s ease; }
.doc-body a:hover { text-decoration-color: var(--ink); }
.doc-body .caps { text-transform: uppercase; font-size: 13.5px; letter-spacing: 0.01em; line-height: 1.7; }
.doc-body table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.doc-body th, .doc-body td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hairline); line-height: 1.5; }
.doc-body th { font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.doc-body td { color: var(--ink-2); }
.doc-body td:first-child { color: var(--ink); font-weight: 500; width: 32%; }
.doc-contact { margin-top: 14px; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--hairline); background: rgba(0,0,0,0.03); text-decoration: none !important; font-size: 14px; font-weight: 600; color: var(--ink); }
.doc-contact:hover { background: rgba(0,0,0,0.06); }

/* ---------- footer ---------- */

.foot { padding: 36px var(--edge) calc(36px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline); }
.foot-inner { width: min(var(--wrap), 100%); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; }
.foot-links a { color: var(--ink-2); text-decoration: none; transition: color 0.2s ease; }
.foot-links a:hover, .foot-links a[aria-current="page"] { color: var(--ink); }
.foot-copy { font-size: 11.5px; color: var(--ink-3); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .doc-inner { grid-template-columns: 1fr; gap: 36px; }
  .doc-toc { position: static; }
  .doc-toc ol { display: none; }
  .doc-toc-head { display: none; }
  .doc-toc-sibling { margin-top: 0; padding-top: 0; border-top: none; }
  .doc-toc { order: 2; padding-top: 32px; border-top: 1px solid var(--hairline); }
}
@media (max-width: 720px) {
  :root { --head-h: 60px; }
  .brand-crumb { display: none; }
  .contact-btn { padding: 8px 14px; }
  .contact-btn svg { display: none; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
  .doc-body td:first-child { width: 40%; }
}
@media print {
  .masthead, .doc-toc, .foot, .contact-btn { display: none; }
  .doc { padding-top: 0; }
  .doc-body p, .doc-body li { color: #000; }
}
