/*
 * Legal & company pages (static, no JS). Same look as the cinematic site: the purple backdrop with a lavender
 * centre light, the stage beam and gold halo, drifting gifts, Instrument Serif titles with a gold italic accent and
 * Manrope text. Long legal text sits on a solid translucent violet panel (no live blur) so it stays readable.
 * Tokens mirror src/styles/index.css.
 */
:root {
  --ink: #5b21c8;
  --deep: #2e1065;
  --mist: #f6f1ff;
  --haze: #e6dcff;
  --ember: #ffc983;
  --panel: linear-gradient(rgb(255 255 255 / 0.08), rgb(255 255 255 / 0.04)), rgb(62 18 160 / 0.9);
  --line: rgb(255 255 255 / 0.14);
  --display: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; background: var(--ink); }
body { margin: 0; min-height: 100dvh; background: var(--ink); color: var(--haze); font: 400 1.0625rem/1.75 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; position: relative; isolation: isolate; }
/* the site's ambient backdrop */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 34% at 50% 30%, rgb(244 236 255 / 0.36), rgb(196 170 255 / 0.16) 55%, transparent 100%),
    radial-gradient(55% 45% at 100% 100%, rgb(255 107 107 / 0.14), transparent 70%),
    radial-gradient(50% 40% at 0% 75%, rgb(255 182 193 / 0.12), transparent 70%),
    linear-gradient(100deg, #5121c4, var(--ink) 45%, #6f27cf);
}
::selection { background: rgb(255 201 131 / 0.45); color: var(--deep); }
a { color: var(--ember); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .wrap { padding: 0 2rem; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--mist); color: var(--deep); padding: .5rem 1rem; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ambient stage: light beam, gold halo, drifting gifts ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.beam {
  position: absolute; left: 50%; top: -10%; width: min(90vw, 620px); height: 62%; transform: translateX(-50%);
  background: linear-gradient(to bottom, rgb(255 196 130 / 0.5), rgb(255 180 94 / 0.05) 85%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); filter: blur(24px); opacity: .55;
}
.halo { position: absolute; left: 50%; top: 13rem; width: min(78vw, 460px); aspect-ratio: 1; translate: -50% -50%; animation: halo-breathe 8s ease-in-out infinite; }
@media (min-width: 1024px) { .halo { left: 72%; top: 15rem; } .beam { left: 72%; } }
/* the homepage's 3D (src/legal/scene.tsx) when the device can run it; the CSS ring and gifts are the fallback */
.scene3d { position: absolute; inset: 0; opacity: calc(var(--fade, 1) * 0.95); transition: opacity .4s; }
.scene3d canvas { display: block; }
html.has-scene .halo, html.has-scene .gift { display: none; }
html.has-scene .beam { opacity: .4; }
/* phones: room above the title for the ring and stage (the scene fits them into the top ~40% of the screen) */
@media (max-aspect-ratio: 1/1) { html.has-scene .hero { padding-top: calc(42svh - 4rem); } }
.gift { position: absolute; bottom: -8%; width: 1.9rem; height: 1.9rem; opacity: .55; animation: drift-up linear infinite; }
.gift svg { width: 100%; height: 100%; display: block; }

/* ---------- header: the site's bar ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgb(91 33 200 / 0.95); box-shadow: 0 8px 30px -12px rgb(46 16 101 / 0.6); color: var(--mist); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.logo { display: inline-flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
.logo img { width: auto; height: 32px; }
.logo img.word { height: 20px; transform: translateY(2px); }
.get {
  color: var(--mist); text-decoration: none; font-weight: 600; font-size: .875rem; padding: .5rem 1rem; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); transition: background-color .3s;
}
.get:hover { background: rgb(255 255 255 / 0.14); text-decoration: none; }

/* ---------- page title: eyebrow + display title with a gold italic accent ---------- */
.hero { padding-top: 4rem; padding-bottom: 2.25rem; }
@media (min-width: 640px) { .hero { padding-top: 6rem; } }
/* a soft violet glow behind the title: gifts drifting through it fade back, so the title always reads clearly */
.title-block { position: relative; width: fit-content; max-width: 100%; }
.title-block::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: -3rem -4rem;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgb(88 30 196 / 0.94) 55%, rgb(88 30 196 / 0) 100%);
}
.eyebrow { margin: 0 0 1rem; color: var(--ember); font: 700 .75rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.hero h1 {
  margin: 0; max-width: 18ch; color: var(--mist); font: 400 clamp(2.75rem, 9vw, 5.25rem)/.98 var(--display); letter-spacing: -.01em;
  text-shadow: 0 1px 2px rgb(46 16 101 / 0.6), 0 2px 22px rgb(46 16 101 / 0.75);
}
.hero h1 em { color: var(--ember); font-style: italic; }
.hero .sub { margin: 1.25rem 0 0; max-width: 38rem; color: var(--haze); font-size: 1.0625rem; text-shadow: 0 1px 2px rgb(46 16 101 / 0.6); }

/* ---------- document panel ---------- */
.doc { padding-bottom: 5rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: 1.5rem 1.25rem; box-shadow: 0 30px 80px -40px rgb(46 16 101 / 0.8); }
@media (min-width: 640px) { .panel { padding: 2.5rem 2.75rem; } }
article { max-width: 68ch; }
article > :first-child { margin-top: 0; }
article h2 { color: var(--mist); font: 700 1.3rem/1.35 var(--sans); margin: 2.75rem 0 .75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
article > h2:first-child { padding-top: 0; border-top: 0; }
article h3 { color: var(--mist); font: 700 1.075rem/1.4 var(--sans); margin: 1.75rem 0 .5rem; }
article p { margin: 0 0 1rem; }
article p.meta { display: inline-block; color: var(--ember); font-size: .875rem; font-weight: 600; letter-spacing: .02em; padding: .3rem .8rem; border: 1px solid rgb(255 201 131 / 0.35); border-radius: 999px; }
article p.caps { font-size: .95rem; letter-spacing: .01em; }
article ul { margin: 0 0 1.25rem; padding-left: 1.25rem; }
article ul.marked { list-style: none; padding-left: 0; }
article li { margin: .35rem 0; }
article li::marker { color: var(--ember); }

/* pages without a contents list (About, Contact): the panel keeps to the left so the ring on the right stays clear */
@media (min-width: 1024px) { .doc:not(.has-toc) .panel { max-width: 46rem; } }

/* table of contents: a matching card, sticky on desktop and folded away on phones */
.toc { margin: 0 0 1.5rem; font-size: .9375rem; }
.toc details, .toc .toc-desktop { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: .9rem 1.1rem; }
.toc summary { cursor: pointer; color: var(--mist); font-weight: 700; }
.toc ul { margin: .5rem 0 0; padding: 0; list-style: none; }
.toc li { margin: .3rem 0; line-height: 1.45; }
.toc a { color: var(--haze); text-decoration: none; }
.toc a:hover { color: var(--ember); text-decoration: underline; }
.toc-desktop { display: none; }
.toc-label { margin: 0 0 .5rem; color: var(--ember); font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
@media (min-width: 1024px) {
  .doc.has-toc { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; column-gap: 2.5rem; align-items: start; }
  .doc.has-toc .panel { grid-column: 1; grid-row: 1; }
  .doc.has-toc .toc { grid-column: 2; grid-row: 1; position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow: auto; margin: 0; }
  .toc-mobile { display: none; }
  .toc .toc-desktop { display: block; }
}

/* FAQ + contact (About / Contact pages) */
.faq details { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.faq summary { cursor: pointer; color: var(--mist); font-weight: 700; }
.faq details p { margin: .6rem 0 0; }
.contact dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0; }
.contact dt { color: var(--ember); font-weight: 600; }
.contact dd { margin: 0; color: var(--mist); }
@media (max-width: 480px) { .contact dl { grid-template-columns: 1fr; gap: .15rem; } .contact dd { margin-bottom: .75rem; } }

/* footer: the site's footer */
.site-footer { position: relative; background: var(--ink); color: var(--haze); font-size: .9375rem; padding: 4rem 0 0; }
.site-footer .grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.site-footer .logo { color: var(--mist); }
.site-footer .brand p { margin: .75rem 0 0; max-width: 20rem; }
.site-footer h2 { color: var(--mist); font: 700 .75rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; margin: 0 0 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .6rem 0; }
.site-footer a { color: var(--mist); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer address { font-style: normal; line-height: 1.6; }
.site-footer .copy { margin-top: 2.5rem; padding-top: 1.5rem; padding-bottom: 1.5rem; border-top: 1px solid rgb(255 255 255 / 0.1); font-size: .8125rem; }

/* ---------- motion (the site's easing); none for visitors who ask for reduced motion ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(0.35em); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes halo-breathe { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.03); } }
@keyframes drift-up { from { transform: translate3d(0, 0, 0) rotate(0deg); } to { transform: translate3d(var(--dx, 0px), -115vh, 0) rotate(var(--rot, 180deg)); } }
.eyebrow { animation: fade-up .9s var(--ease) .1s both; }
.hero h1 { animation: rise-in 1.2s var(--ease) .2s both; }
.hero .sub { animation: fade-up .9s var(--ease) .4s both; }
.doc { animation: fade-up 1s var(--ease) .55s both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .gift { display: none; }
}
