/* =========================================================
   Finiti — base
   Design tokens, reset, header, footer, shared utilities.
   Loaded by every page (index.html, terms.html, privacy.html).
   ========================================================= */

:root {
  /* Color */
  --bg: #3D3CDB;
  --bg-deep: #1F1B85;
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.82);
  --muted: rgba(255, 255, 255, 0.62);
  --accent: #FF781E;
  --accent-hot: #FF8A3D;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.10);
  --card-solid: #ffffff;
  --border: rgba(255, 255, 255, 0.18);
  --border-strong: rgba(255, 255, 255, 0.32);
  --shadow-md: 0 12px 24px rgba(15, 12, 70, 0.25);
  --shadow-lg: 0 18px 40px rgba(15, 12, 70, 0.45);
  --shadow-xl: 0 30px 60px rgba(15, 12, 70, 0.50);

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Radii */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-pill: 999px;

  /* Type */
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Garamond", "Georgia", serif;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-med: 360ms;
  --t-slow: 600ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Paint the brand color on the root so iOS Safari's overscroll, status-bar
     zone and URL-bar overlap zone all stay indigo instead of leaking white. */
  background:
    radial-gradient(1200px 800px at 100% -10%, rgba(255, 138, 61, 0.18), transparent 60%),
    radial-gradient(circle at top left, #4D47E8 0%, #3D3CDB 50%, #2C2999 100%);
  background-color: var(--bg-deep);
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  background: var(--accent);
  color: #1b1a17;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-pill);
  font-weight: 700;
  z-index: 100;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus-visible {
  top: var(--sp-4);
}

/* Layout */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-7);
}

/* Header */
.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  background: var(--card);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  letter-spacing: 0.6px;
  font-size: 1.05rem;
  color: var(--ink);
}
.brand__mark {
  width: 22px;
  height: 22px;
  display: block;
}
.site-nav {
  display: flex;
  justify-content: center;
  gap: var(--sp-3);
  font-size: 0.95rem;
}
.site-nav a {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  color: var(--muted);
  transition:
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}
.site-nav a:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}
.site-nav a[aria-current="page"] {
  border-color: rgba(255, 120, 30, 0.55);
  color: var(--ink);
  background: rgba(255, 120, 30, 0.18);
}
.header-cta {
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 120, 30, 0.18);
  border: 1px solid rgba(255, 120, 30, 0.35);
  white-space: nowrap;
}

/* Card surface — used by hero, gallery items, features, legal cards */
.card {
  background: var(--card);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  box-shadow: var(--shadow-md);
}

/* Footer */
.site-footer {
  margin-top: var(--sp-7);
  padding-top: var(--sp-6);
  display: grid;
  gap: var(--sp-3);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}
.site-footer__nav {
  display: flex;
  justify-content: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.site-footer__nav a {
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color var(--t-fast) var(--ease);
}
.site-footer__nav a:hover {
  border-color: var(--border-strong);
}
.site-footer__legal {
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 60ch;
  margin: 0 auto;
  line-height: 1.55;
}

/* Reveal-on-scroll utility */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Reduced-motion: kill the dance */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Mobile shared */
@media (max-width: 720px) {
  .page {
    padding: var(--sp-4) var(--sp-4) var(--sp-6);
  }
  .site-header {
    grid-template-columns: 1fr;
    text-align: center;
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-2);
  }
  .brand {
    justify-content: center;
  }
  .site-nav {
    font-size: 0.9rem;
    gap: var(--sp-2);
  }
  .site-nav a {
    padding: 4px 10px;
  }
  .header-cta {
    display: none;
  }
}
