/* ==========================================================================
   Exyllion — shared design system
   Tokens, reset, typography, navigation, footer, utilities.
   Page-specific layout lives in each page's own <style> block.
   ========================================================================== */

:root {
  --purple: #5B3FD1;
  --purple-deep: #3E2A8C;
  --aubergine: #251A3A;
  --violet-muted: #7563C8;
  --bg: #F7F6F3;
  --surface: #EEECE7;
  --graphite: #18171C;
  --text-soft: #66636D;
  --white: #FFFFFF;

  --border: rgba(24, 23, 28, 0.10);
  --border-purple: rgba(91, 63, 209, 0.22);

  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;

  --max: 1160px;
  --gutter: clamp(24px, 5vw, 64px);

  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, li, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--graphite);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--graphite);
  color: var(--white);
  padding: 12px 20px;
  font-size: .85rem;
  z-index: 1000;
  transition: top .2s var(--ease);
  border-radius: 4px;
}
.skip-link:focus { top: 16px; }

/* ---------- typography ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: inherit;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--purple);
}

/* ---------- navigation ---------- */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 26px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-nav.is-scrolled {
  padding-top: 16px;
  padding-bottom: 16px;
  background: rgba(247, 246, 243, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--graphite);
}
.nav-logo:hover { color: var(--purple); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 40px);
}
.nav-links a {
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--graphite);
  position: relative;
  padding: 4px 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--purple);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease);
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-cta {
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--white);
  background: var(--purple);
  padding: 10px 22px;
  border-radius: 3px;
  transition: background-color .2s var(--ease);
}
.nav-cta:hover { background: var(--purple-deep); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 210;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px;
  height: 2px;
  background: var(--graphite);
  transition: transform .25s var(--ease), opacity .25s var(--ease), top .25s var(--ease);
}
.nav-toggle span { top: 19px; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

.nav-back {
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-soft);
  transition: color .2s;
}
.nav-back:hover { color: var(--purple); }

.nav-panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 190;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--gutter);
  transform: translateY(-100%);
  transition: transform .35s var(--ease);
  visibility: hidden;
}
.nav-panel.is-open { transform: translateY(0); visibility: visible; }
.nav-panel ul { display: flex; flex-direction: column; gap: 28px; margin-bottom: 40px; }
.nav-panel a {
  font-family: var(--font-display);
  font-size: 2rem;
  text-decoration: none;
  color: var(--graphite);
}
.nav-panel a.nav-cta {
  display: inline-block;
  width: fit-content;
  color: var(--white);
  font-size: .95rem;
  font-family: var(--font-body);
}

@media (max-width: 860px) {
  .nav-links-desktop, .nav-cta-desktop { display: none; }
  .nav-toggle { display: block; }
}
@media (min-width: 861px) {
  .nav-panel { display: none; }
}

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

.site-footer {
  background: var(--aubergine);
  color: var(--white);
  padding: 72px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.footer-tagline {
  color: rgba(255,255,255,.62);
  font-size: .92rem;
  line-height: 1.7;
  max-width: 280px;
}
.footer-col-title {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 18px;
}
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a {
  font-size: .92rem;
  text-decoration: none;
  color: rgba(255,255,255,.8);
  transition: color .2s;
}
.footer-links a:hover { color: var(--violet-muted); }

.footer-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { font-size: .85rem; color: rgba(255,255,255,.5); }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a {
  font-size: .85rem;
  text-decoration: none;
  color: rgba(255,255,255,.5);
  transition: color .2s;
}
.footer-legal a:hover { color: var(--white); }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px 24px; }
  .footer-brand-col { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- legal document pages ---------- */

.page-header {
  background: var(--aubergine);
  padding: 168px 0 72px;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 70% at 15% 30%, rgba(117,99,200,.2), transparent 65%);
  pointer-events: none;
}
.page-header-inner { position: relative; }
.page-label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--violet-muted);
  margin-bottom: 16px;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 14px;
}
.page-meta {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: rgba(255,255,255,.45);
}

.doc-body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px var(--gutter) 120px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}

.toc { position: sticky; top: 110px; }
.toc-title {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 18px;
}
.toc-list { display: flex; flex-direction: column; gap: 9px; }
.toc-list a {
  font-size: .85rem;
  color: var(--text-soft);
  text-decoration: none;
  line-height: 1.5;
  transition: color .2s;
}
.toc-list a:hover { color: var(--purple); }

.doc-content { border-left: 1px solid var(--border); padding-left: 64px; min-width: 0; }
.doc-section { padding: 44px 0; border-bottom: 1px solid var(--border); }
.doc-section:first-child { padding-top: 0; }
.doc-section:last-child { border-bottom: none; }
.section-num {
  display: block;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--purple);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.doc-content p { font-size: .96rem; color: var(--text-soft); line-height: 1.85; margin-bottom: 14px; }
.doc-content p:last-child { margin-bottom: 0; }
.doc-content ul, .doc-content ol { margin: 14px 0 14px 20px; }
.doc-content li { font-size: .96rem; color: var(--text-soft); line-height: 1.8; margin-bottom: 8px; list-style: disc; }
.doc-content ol li { list-style: decimal; }
.doc-content strong { color: var(--graphite); font-weight: 600; }
.doc-content a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }
.highlight-box {
  background: var(--surface);
  border-left: 3px solid var(--purple);
  padding: 18px 22px;
  margin: 20px 0;
  border-radius: 0 4px 4px 0;
}
.highlight-box p:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  .page-header { padding: 128px 0 56px; }
  .doc-body { grid-template-columns: 1fr; padding: 48px var(--gutter) 88px; gap: 40px; }
  .toc { position: static; }
  .doc-content { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 40px; }
}
