/* ============================================================
   Technobi, shared stylesheet for legal pages
   (Privacy Policy, Terms & Conditions).
   Reusable across apps. Dark-first brand theme with an
   automatic light theme, print styling, sticky desktop TOC,
   and copy-link heading anchors.
   ============================================================ */

:root {
  --midnight: #0B1020;
  --surface: #121A30;
  --surface-2: #18223D;
  --hairline: rgba(255, 255, 255, 0.10);
  --text: #EAEEF7;
  --text-soft: #D5DCEC;
  --text-muted: #9AA6C0;
  --accent: #FF7A45;
  --accent-2: #34E0D0;

  --content: 850px;   /* readable article measure */
  --toc-w: 250px;     /* sticky sidebar width */
  --gap: clamp(2rem, 4vw, 3.5rem);
  --pad-x: clamp(1.25rem, 5vw, 3rem);
  --radius: 16px;
  --radius-lg: 24px;

  --display: "Sora", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --sticky-top: 84px;
}

/* Automatic light theme for users who prefer it */
@media (prefers-color-scheme: light) {
  :root {
    --midnight: #F6F8FC;
    --surface: #FFFFFF;
    --surface-2: #FFFFFF;
    --hairline: rgba(11, 16, 32, 0.12);
    --text: #10192E;
    --text-soft: #2A3450;
    --text-muted: #566280;
    --accent: #E85A22;
    --accent-2: #0FA294;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--midnight);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(1rem, 0.3vw + 0.95rem, 1.0625rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { color: var(--text); font-weight: 600; }
img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--pad-x); }

.skip {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #1a0c04;
  padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0; font-weight: 600; z-index: 100;
}
.skip:focus { left: 0; }

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--midnight) 80%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-back { font-size: .95rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; }
.nav-back:hover { color: var(--text); text-decoration: none; }

/* ---- Header band ---- */
.header { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--hairline); position: relative; }
.header::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 120% at 15% 0%, rgba(255, 122, 69, 0.10), transparent 60%);
}
.crumb { font-family: var(--mono); font-size: .72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1.4rem; }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--accent-2); }
.crumb .sep { color: color-mix(in srgb, var(--text-muted) 55%, transparent); }
.header h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.25rem, 4vw + 1rem, 3.5rem); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 .9rem; }
.lead { color: var(--text-muted); font-size: clamp(1.05rem, 0.5vw + 1rem, 1.2rem); max-width: 60ch; margin: 0 0 1.5rem; }
.meta { font-family: var(--mono); font-size: .75rem; letter-spacing: 0.06em; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.meta .pill { display: inline-flex; align-items: center; gap: .45rem; }
.meta .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }

/* ---- Layout: article + sticky TOC ---- */
main { padding-top: clamp(2.25rem, 5vw, 3.25rem); padding-bottom: clamp(3.5rem, 7vw, 6rem); }
.layout { display: block; }
.article { max-width: var(--content); min-width: 0; }

/* Mobile / tablet: TOC is a collapsible box above the content */
.toc {
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem); margin-bottom: clamp(2rem, 5vw, 3rem);
}
.toc > summary, .toc-title {
  font-family: var(--mono); font-size: .72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 500; margin: 0;
}
.toc > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary::after { content: "＋"; font-size: 1rem; color: var(--text-muted); }
.toc[open] > summary::after { content: "－"; }
.toc ol { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: .35rem; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: .7rem; align-items: baseline; color: var(--text); padding: .2rem .4rem; border-radius: 8px; }
.toc a:hover { color: var(--accent-2); text-decoration: none; background: color-mix(in srgb, var(--accent-2) 8%, transparent); }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: .72rem; color: var(--accent); min-width: 1.7rem; }
.toc a.is-active { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
@media (min-width: 560px) { .toc ol { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; } }

/* Desktop: two columns, TOC sticky in the left rail */
@media (min-width: 1080px) {
  .layout {
    display: grid;
    grid-template-columns: var(--toc-w) minmax(0, var(--content));
    gap: var(--gap);
    justify-content: center;
    align-items: start;
  }
  .toc {
    position: sticky; top: var(--sticky-top);
    order: -1; margin-bottom: 0; max-height: calc(100vh - var(--sticky-top) - 2rem); overflow-y: auto;
  }
  .toc > summary::after { content: none; }   /* always expanded on desktop */
  .toc ol { grid-template-columns: 1fr; }
  .article { grid-column: 2; }
}

/* ---- Sections ---- */
section.policy { scroll-margin-top: var(--sticky-top); margin-bottom: clamp(2.5rem, 5vw, 3.25rem); }
.sec-head { display: flex; align-items: baseline; gap: .55rem; margin: 0 0 1rem; }
section.policy h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 1.2vw + 1.1rem, 1.85rem); line-height: 1.2; letter-spacing: -0.01em; margin: 0; display: flex; align-items: baseline; gap: .8rem; flex: 1 1 auto; }
section.policy h2 .num { font-family: var(--mono); font-size: .85rem; color: var(--accent); flex: none; }
section.policy h3 { font-family: var(--display); font-weight: 600; font-size: 1.1rem; margin: 1.75rem 0 .75rem; color: var(--text); }
section.policy p { margin: 0 0 1rem; color: var(--text-soft); }
section.policy ul { margin: 0 0 1rem; padding: 0; list-style: none; }
section.policy ul li { position: relative; padding-left: 1.5rem; margin-bottom: .55rem; color: var(--text-soft); }
section.policy ul li::before { content: ""; position: absolute; left: .15rem; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }

/* Copy-link button next to headings */
.anchor-link {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--hairline);
  background: transparent; color: var(--text-muted); cursor: pointer;
  opacity: 0; transition: opacity .15s ease, color .15s ease, border-color .15s ease;
  font-size: .95rem; line-height: 1;
}
.sec-head:hover .anchor-link, .anchor-link:focus-visible { opacity: 1; }
.anchor-link:hover { color: var(--accent-2); border-color: var(--accent-2); }
.anchor-link.copied { color: var(--accent-2); border-color: var(--accent-2); }
@media (hover: none) { .anchor-link { opacity: 1; } }

/* ---- Callouts ---- */
.callout { border-radius: var(--radius); padding: 1.1rem 1.35rem; margin: 0 0 1.25rem; font-weight: 500; }
.callout.warn { background: rgba(255, 122, 69, 0.08); border: 1px solid rgba(255, 122, 69, 0.3); border-left: 3px solid var(--accent); color: var(--text); }
.callout.note { background: rgba(52, 224, 208, 0.06); border: 1px solid rgba(52, 224, 208, 0.25); border-left: 3px solid var(--accent-2); color: var(--text-soft); }
.callout.note h3 { margin-top: 0; }
.callout.note ul, .callout.warn ul { margin-bottom: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---- Contact card ---- */
.contact-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2rem); }
.contact-card p { margin: .35rem 0; }
.contact-card .who { font-family: var(--display); font-weight: 600; color: var(--text); font-size: 1.05rem; margin-bottom: .9rem; }
.contact-card .row { display: flex; gap: .6rem; flex-wrap: wrap; }
.contact-card .row .k { font-family: var(--mono); font-size: .72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); min-width: 5.5rem; padding-top: .15rem; }

.seealso { border-top: 1px solid var(--hairline); margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.75rem; font-size: .95rem; color: var(--text-muted); }

/* ---- Footer ---- */
footer { border-top: 1px solid var(--hairline); background: var(--midnight); padding: clamp(2.5rem, 5vw, 3.5rem) 0; }
.foot-inner { display: flex; flex-direction: column; gap: 1.25rem; }
.foot-brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; color: var(--text); }
.foot-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); display: inline-block; }
.foot-tag { font-family: var(--mono); font-size: .72rem; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; margin-top: .5rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.foot-links a { color: var(--text-muted); font-size: .92rem; }
.foot-links a:hover { color: var(--text); text-decoration: none; }
.foot-copy { font-size: .85rem; color: var(--text-muted); }
@media (min-width: 768px) {
  .foot-inner { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
}

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- Print ---- */
@media print {
  :root { --midnight: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --text-soft: #1a1a1a; --text-muted: #444; --hairline: #ccc; --accent: #b8461a; --accent-2: #0a6b61; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
  .nav, .skip, .nav-back, .anchor-link, .toc, .seealso, footer .foot-links { display: none !important; }
  .header::before { display: none; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; word-break: break-all; }
  .layout { display: block; }
  .article { max-width: none; }
  section.policy { break-inside: avoid; margin-bottom: 1.25rem; }
  section.policy h2, section.policy h3 { break-after: avoid; }
  .callout, .contact-card { border: 1px solid #ccc; }
}
