/* TimeWarden legal library — aligned with the public editorial design system. */
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk-400.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk-500.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk-600.ttf") format("truetype"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk-700.ttf") format("truetype"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk-800.ttf") format("truetype"); font-style: normal; font-weight: 800; font-display: swap; }

:root {
  --cream: #fbf4e9;
  --cream-deep: #f4e3cf;
  --paper: #fffaf2;
  --card: #fffefb;
  --ink: #221b16;
  --ink-soft: #6f6258;
  --ink-faint: #8d7f73;
  --espresso: #26201a;
  --espresso-deep: #1e1913;
  --amber: #f2c477;
  --amber-soft: #fbe7c1;
  --gold: #e9b55b;
  --caramel: #9a571f;
  --caramel-deep: #7f4519;
  --line: #e7d4be;
  --line-soft: #f1e4d4;
  --line-dark: rgba(242, 196, 119, 0.17);
  --shadow-card: 0 24px 64px rgba(93, 62, 31, 0.13);
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(760px 520px at 100% 0%, rgba(242, 196, 119, 0.24), transparent 66%),
    var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.27;
  background-image: radial-gradient(circle at 1px 1px, rgba(105, 75, 43, 0.14) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: linear-gradient(135deg, #000, transparent 56%);
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 56%);
}

a { color: var(--caramel-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--caramel); }
strong { color: var(--ink); }
::selection { background: var(--amber); color: var(--ink); }
:focus-visible { outline: 3px solid var(--caramel); outline-offset: 4px; border-radius: 4px; }

.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.skip-link {
  position: fixed;
  z-index: 500;
  left: 16px;
  top: 12px;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff8ee;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { transform: none; }

/* Header */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(231, 212, 190, 0.88);
  background: rgba(251, 244, 233, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav-shell {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1.16rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.brand small {
  margin-left: 3px;
  padding-left: 13px;
  border-left: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.legal-nav { display: flex; align-items: center; gap: 8px; }
.legal-nav a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.legal-nav a:hover { border-color: var(--line); background: var(--paper); color: var(--caramel); }
.legal-nav a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff8ee;
}

/* Masthead */
.legal-page { padding-bottom: 88px; }
.legal-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 390px;
  background:
    radial-gradient(660px 420px at 82% 44%, rgba(233, 181, 91, 0.2), transparent 66%),
    linear-gradient(165deg, var(--espresso) 0%, var(--espresso-deep) 100%);
  color: #f4ead9;
}
.legal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.34;
  background-image: linear-gradient(90deg, transparent 49.9%, var(--line-dark) 50%, transparent 50.1%);
  background-size: 112px 100%;
  mask-image: linear-gradient(90deg, transparent, #000 66%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 66%);
}
.hero-shell {
  min-height: 390px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: 84px;
  padding-block: 64px;
}
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 44px; height: 1px; background: currentColor; opacity: 0.65; }
.hero-copy h1 {
  max-width: 840px;
  margin: 0;
  color: #fff8ee;
  font-size: clamp(2.7rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.98;
}
.hero-copy h1 em { color: var(--amber); font-style: normal; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin: 25px 0 0;
  color: #b9aa98;
  font-size: 0.84rem;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 9px; }
.hero-meta span::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid var(--gold);
  border-radius: 50%;
}
.hero-dial {
  position: relative;
  width: 300px;
  height: 300px;
  justify-self: end;
  border: 1px solid rgba(242, 196, 119, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 0 36%, rgba(242, 196, 119, 0.09) 36.5% 37%, transparent 37.5%),
    repeating-conic-gradient(from -1deg, rgba(242, 196, 119, 0.44) 0 1deg, transparent 1deg 15deg);
  opacity: 0.76;
}
.hero-dial::before {
  content: "";
  position: absolute;
  inset: 33px;
  border: 1px solid rgba(242, 196, 119, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold) 0 5px, transparent 6px);
}
.hero-dial::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 92px;
  border-radius: 999px;
  background: linear-gradient(to top, var(--amber) 0 57%, transparent 57%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  transform: translate(-50%, -50%) rotate(38deg);
}
.dial-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82px;
  height: 4px;
  border-radius: 999px;
  background: #f8e7c4;
  transform: translateY(-50%) rotate(-35deg);
  transform-origin: left center;
}

/* Document layout */
.legal-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  margin-top: -62px;
  position: relative;
  z-index: 3;
}
.legal-sidebar { position: sticky; top: 104px; }
.sidebar-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.96);
  box-shadow: 0 16px 44px rgba(93, 62, 31, 0.09);
}
.sidebar-label {
  margin: 0 0 14px;
  color: var(--caramel);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.document-nav { display: grid; gap: 4px; }
.document-nav a {
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}
.document-nav a:hover { background: var(--amber-soft); color: var(--caramel-deep); }
.document-nav a[aria-current="page"] { background: var(--ink); color: #fff8ee; }
.sidebar-rule { height: 1px; margin: 18px 0; background: var(--line); }
.sidebar-note { margin: 0; color: var(--ink-faint); font-size: 0.75rem; line-height: 1.55; }
.sidebar-note a { font-weight: 700; }

.legal-document {
  min-width: 0;
  max-width: 100%;
  padding: clamp(34px, 5vw, 66px);
  border: 1px solid var(--line-soft);
  border-radius: 30px;
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.legal-document > :first-child { margin-top: 0; }
.legal-document p { margin: 0 0 1.05em; color: var(--ink-soft); }
.legal-document > p:first-child,
.legal-document .lede {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.75;
}
.legal-document h2 {
  position: relative;
  margin: 48px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.legal-document h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 58px;
  height: 2px;
  background: var(--gold);
}
.legal-document h2:first-of-type { margin-top: 34px; }
.legal-document ul,
.legal-document ol { margin: 10px 0 22px; padding-left: 1.35rem; color: var(--ink-soft); }
.legal-document li { margin: 8px 0; padding-left: 0.25rem; }
.legal-document li::marker { color: var(--caramel); font-weight: 800; }
.legal-document code { padding: 2px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--cream); }
.legal-document .caps {
  padding: 18px 20px;
  border-left: 3px solid var(--gold);
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 18px 0 26px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  border-spacing: 0;
  border-collapse: separate;
  background: var(--paper);
  font-size: 0.88rem;
}
thead, tbody { display: table; width: 100%; table-layout: fixed; }
tr + tr td { border-top: 1px solid var(--line); }
th, td { min-width: 145px; padding: 14px 16px; text-align: left; vertical-align: top; }
th {
  background: var(--espresso);
  color: #f4ead9;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
th + th, td + td { border-left: 1px solid var(--line); }
td { color: var(--ink-soft); }
td strong { color: var(--ink); }

.card {
  margin: 22px 0 30px;
  padding: 24px;
  border: 1px solid rgba(154, 87, 31, 0.24);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--amber-soft), #fff6e8);
  box-shadow: 0 14px 36px rgba(120, 75, 29, 0.1);
}
.card p:last-child { margin-bottom: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 8px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff8ee;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(40, 34, 29, 0.18);
}
.btn:hover { background: #3d332b; color: #fff8ee; transform: translateY(-1px); }
.document-footer {
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.78rem;
}

/* Site footer */
.legal-footer { border-top: 1px solid var(--line); background: var(--cream-deep); }
.footer-shell {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 24px;
}
.footer-brand { color: var(--ink-soft); font-size: 0.82rem; }
.footer-brand strong { display: block; margin-bottom: 2px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 20px; }
.footer-links a { color: var(--ink-soft); font-size: 0.78rem; font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--caramel); }

@media (max-width: 920px) {
  .nav-shell { min-height: 72px; flex-wrap: wrap; gap: 10px; padding-block: 10px; }
  .legal-nav { width: 100%; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
  .legal-nav::-webkit-scrollbar { display: none; }
  .hero-shell { min-height: 340px; grid-template-columns: 1fr 220px; gap: 28px; }
  .hero-dial { width: 220px; height: 220px; }
  .legal-grid { grid-template-columns: minmax(0, 1fr); margin-top: -42px; }
  .legal-sidebar { position: static; }
  .sidebar-card { padding: 18px; }
  .document-nav { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .document-nav a { display: grid; place-items: center; text-align: center; }
  .sidebar-rule, .sidebar-note { display: none; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 28px, 1180px); }
  .brand small { display: none; }
  .legal-nav a { padding: 7px 10px; font-size: 0.74rem; }
  .legal-hero { min-height: 322px; }
  .hero-shell { min-height: 322px; display: block; padding-block: 52px 70px; }
  .hero-copy { max-width: 92%; }
  .hero-copy h1 { font-size: clamp(2.55rem, 13vw, 4rem); }
  .hero-meta { display: grid; gap: 7px; }
  .hero-dial { position: absolute; right: -88px; bottom: -82px; width: 250px; height: 250px; opacity: 0.36; }
  .legal-grid { gap: 16px; }
  .document-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-document { padding: 28px 21px 36px; border-radius: 24px; }
  .legal-document > p:first-child, .legal-document .lede { font-size: 1rem; }
  .legal-document h2 { margin-top: 40px; }
  th, td { min-width: 170px; padding: 12px 13px; }
  .card { padding: 20px; }
  .btn { width: 100%; text-align: center; }
  .footer-shell { align-items: flex-start; flex-direction: column; }
  .footer-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
