/* =============================================================================
   AntiGravity — placeholder site
   Static, no build step. One stylesheet for all six pages.
   Palette: maplered #AE2012 · deepsea #001219 · icygrey #F0F0EF · stonegrey #808080
   Type:    EB Garamond (serif, display/headings) · IBM Plex Sans (UI/body)
   ========================================================================== */

/* ---------- Fonts (self-hosted, DSGVO-compliant, no Google request) -------- */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-600.woff2") format("woff2");
}

/* ---------- Design tokens -------------------------------------------------- */
:root {
  /* Brand colours */
  --maplered: #ae2012;
  --deepsea: #001219;
  --icygrey: #f0f0ef;
  --stonegrey: #808080;

  /* Derived */
  --deepsea-veil: rgba(0, 18, 25, 0.92);
  --deepsea-line: rgba(240, 240, 239, 0.14);
  --icygrey-dim: rgba(240, 240, 239, 0.72);
  --maplered-hover: #cf3222;

  /* Type families */
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Fluid type scale — rem so it respects the user's browser font size.
     Root font-size is intentionally NOT set. */
  --fs-hero: clamp(2rem, 1rem + 6vw, 4.5rem);      /* up to 72px */
  --fs-h1:   clamp(1.9rem, 1.1rem + 3vw, 3rem);     /* up to 48px */
  --fs-h2:   clamp(1.55rem, 1rem + 2vw, 2.25rem);   /* up to 36px */
  --fs-h3:   clamp(1.4rem, 1.05rem + 1.2vw, 1.75rem);/* up to 28px */
  --fs-h4:   1.5rem;   /* 24px */
  --fs-h5:   1.25rem;  /* 20px */
  --fs-h6:   1.0625rem;/* 17px */
  --fs-body: 1.125rem; /* 18px */
  --fs-small: 0.9375rem;/* 15px */
  --fs-nav:  0.875rem; /* 14px */

  /* Line heights */
  --lh-hero: 1.5;      /* generous so the per-line hero boxes gap apart */
  --lh-tight: 1.15;
  --lh-heading: 1.25;
  --lh-body: 1.65;

  /* Spacing */
  --nav-h: 4.5rem;
  --space-page: clamp(1.25rem, 4vw, 3rem);
  --measure: 44rem;    /* ~66ch reading measure for legal prose */

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset / base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--deepsea);
  color: var(--icygrey);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; }

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

/* Accessible skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--icygrey);
  color: var(--deepsea);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

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

/* ---------- Typography ----------------------------------------------------- */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); font-weight: 400; margin: 0 0 0.5em; }
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-heading); margin-top: 2.25rem; }
h3 { font-size: var(--fs-h3); line-height: var(--lh-heading); margin-top: 1.75rem; }
h4 { font-size: var(--fs-h4); line-height: var(--lh-heading); }
h5 { font-size: var(--fs-h5); line-height: var(--lh-heading); }
h6 {
  font-family: var(--font-sans);
  font-size: var(--fs-h6);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: var(--lh-heading);
}
p { margin: 0 0 1.1em; }
strong, b { font-weight: 600; }

.prose a { color: var(--icygrey); text-decoration: underline; text-decoration-color: var(--maplered); text-underline-offset: 3px; text-decoration-thickness: 1.5px; transition: text-decoration-color 0.2s var(--ease); }
.prose a:hover { text-decoration-color: var(--maplered-hover); }

/* ---------- Fixed parallax backdrop --------------------------------------- */
/* position:fixed on an element works on iOS, unlike background-attachment:fixed. */
.bg-sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--deepsea) url("/assets/img/sky.webp") center center / cover no-repeat;
  pointer-events: none;
}
.bg-sky::after { /* subtle darkening for text legibility over the sky */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,18,25,0.35) 0%, rgba(0,18,25,0.15) 40%, rgba(0,18,25,0.55) 100%);
}

/* ---------- Site header / navigation -------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--space-page);
  background: var(--deepsea);
  border-bottom: 1px solid var(--deepsea-line);
}
.site-header__logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.site-header__logo img { height: 2.5rem; width: auto; }

.nav { display: flex; align-items: center; gap: clamp(1.25rem, 2.5vw, 3rem); }
.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 3rem);
  list-style: none;
  margin: 0; padding: 0;
}
.nav__link {
  font-family: var(--font-sans);
  font-size: var(--fs-nav);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  color: var(--icygrey);
  white-space: nowrap;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--maplered);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav__link:hover { color: var(--icygrey); }
.nav__link:hover::after { transform: scaleX(1); }

/* Language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: var(--fs-nav);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--icygrey);
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--deepsea-line);
  border-radius: 999px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.lang-switch:hover { border-color: var(--maplered); }
.lang-switch svg { width: 1rem; height: 1rem; }

/* Hamburger button (hidden on desktop) */
.nav-toggle {
  display: none;
  flex: 0 0 auto;
  width: 2.75rem; height: 2.75rem;
  background: transparent;
  border: 1px solid var(--deepsea-line);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  content: "";
  display: block;
  width: 1.25rem; height: 2px;
  background: var(--icygrey);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before { position: absolute; top: -6px; }
.nav-toggle__bars::after  { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Mobile navigation --------------------------------------------- */
@media (max-width: 48rem) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--deepsea-veil);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--deepsea-line);
    padding: 0.5rem var(--space-page) 1.5rem;
    transform: translateY(-120%);
    transition: transform 0.3s var(--ease), visibility 0.3s;
    visibility: hidden;
    max-height: calc(100svh - var(--nav-h));
    overflow-y: auto;
  }
  .nav.is-open { transform: translateY(0); visibility: visible; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav__link {
    display: block;
    padding: 1rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--deepsea-line);
  }
  .nav__link::after { display: none; }
  .lang-switch { align-self: flex-start; margin-top: 1.25rem; }
}

/* ---------- Home hero ------------------------------------------------------ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) var(--space-page) 0;
  overflow: hidden;
}
/* The sun: a textured maplered disc that rises on scroll */
.hero__sun {
  position: absolute;
  left: 50%;
  top: 57%;
  width: min(64vh, 42rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--maplered) url("/assets/img/sun-texture.webp") center center / cover;
  z-index: 1;
  will-change: transform;
}
.hero__sun-shift { /* inner element the JS translates, so the centering transform is untouched */
  width: 100%; height: 100%;
  border-radius: 50%;
  transform: translateY(var(--sun-rise, 70px));
  transition: transform 0.1s linear;
}
/* Foreground mountain range, pinned to the base of the hero.
   Height tracks width at the image's natural 4:1 ratio, so `cover` never has
   to crop the peaks on wide screens; a vh floor keeps it tall on narrow ones. */
.hero__mountains {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  aspect-ratio: 2560 / 640;
  height: auto;
  min-height: 38vh;
  max-height: 72vh;
  background: url("/assets/img/mountains.webp") center bottom / cover no-repeat;
  z-index: 2;
  pointer-events: none;
}
/* Headline — each line is its own self-hugging block, centred with auto
   margins. Centring is pure geometry, so it can't drift with font-load timing
   (the earlier shrink-to-fit approach was measured against whichever font was
   loaded that instant, which caused random off-centre / 3-line renders). */
.hero__headline {
  position: relative;
  z-index: 3;
  width: 100%;
  margin: 0;
  text-align: center;
}
.hero__line {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;            /* deterministic centring */
  white-space: nowrap;            /* each line stays on one line */
  font-family: var(--font-serif);
  font-size: var(--fs-hero);
  line-height: 1.28;
  color: var(--stonegrey);        /* intentional: 4.9:1 on deepsea, passes AA */
  background: var(--deepsea);
  padding: 0.1em 0.44em;
}
/* Transparent gap between the two plates so the sun shows through (mockup). */
.hero__line + .hero__line { margin-top: 0.22em; }
.hero__line-break { display: none; }
/* On phones, shrink the headline just enough that each line still fits on
   one line — keeping the two tidy plates instead of wrapping. */
@media (max-width: 48rem) {
  .hero__line { font-size: min(var(--fs-hero), 9vw); }
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%; bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 3;
  color: var(--icygrey-dim);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  animation: cue 2.4s var(--ease) infinite;
}
.scroll-cue svg { width: 1.1rem; height: 1.1rem; }
@keyframes cue { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* Temporarily hidden: the homepage currently has only a footer below the hero,
   so a scroll cue would over-promise content. Remove this rule (and it returns,
   markup is untouched) once there is real content to scroll to. */
.scroll-cue { display: none; }

/* ---------- Interior-page hero (legal pages) ------------------------------ */
.page-hero {
  position: relative;
  min-height: min(68vh, 40rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) var(--space-page) 3rem;
  overflow: hidden;
}
.page-hero__sun {
  position: absolute;
  left: 50%; top: 50%;
  width: min(52vh, 30rem);
  aspect-ratio: 1;
  transform: translate(-50%, -46%);
  border-radius: 50%;
  background: var(--maplered) url("/assets/img/sun-texture.webp") center center / cover;
  z-index: 1;
}
.page-hero__mountains {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  aspect-ratio: 2560 / 640;
  height: auto;
  min-height: 24vh;
  max-height: 52vh;
  background: url("/assets/img/mountains.webp") center bottom / cover no-repeat;
  z-index: 2;
  pointer-events: none;
}
.page-hero__title {
  position: relative;
  z-index: 3;
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: var(--fs-hero);
  line-height: var(--lh-hero);
  color: var(--stonegrey);
  background: var(--deepsea);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0.08em 0.4em;
}

/* ---------- Content sections ---------------------------------------------- */
.section {
  position: relative;
  z-index: 4;
  background: var(--deepsea);
  padding: clamp(2.5rem, 6vw, 5rem) var(--space-page);
}
.container { max-width: var(--measure); margin-inline: auto; }
.container--wide { max-width: 60rem; }

/* Legal prose */
.prose { color: var(--icygrey); }
.prose h1 { color: var(--icygrey); }
.prose h2 {
  font-size: var(--fs-h2);
  padding-top: 0.75rem;
  border-top: 1px solid var(--deepsea-line);
}
.prose h3 { color: var(--icygrey); }
.prose ul { padding-left: 1.25rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.4em; }
.prose .lead { font-size: 1.2rem; color: var(--icygrey); }
.prose .updated {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--stonegrey);
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
}
.prose address {
  font-style: normal;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--maplered);
  background: rgba(240,240,239,0.03);
  margin: 0 0 1.25rem;
}

/* Table of contents for legal pages */
.toc {
  margin: 1.5rem 0 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--deepsea-line);
  border-radius: 8px;
}
.toc h2 {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-h6);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.toc ol { margin: 0; padding-left: 1.4rem; }
.toc li { margin-bottom: 0.35em; }
.toc a { color: var(--icygrey-dim); text-decoration: none; }
.toc a:hover { color: var(--icygrey); text-decoration: underline; text-decoration-color: var(--maplered); text-underline-offset: 3px; }

/* Anchored headings clear the fixed header */
[id] { scroll-margin-top: calc(var(--nav-h) + 1rem); }

/* ---------- Footer --------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 4;
  background: var(--deepsea);
  border-top: 1px solid var(--deepsea-line);
  padding: 1.75rem var(--space-page);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  font-size: var(--fs-small);
  color: var(--icygrey-dim);
}
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--icygrey-dim); text-decoration: none; }
.site-footer a:hover { color: var(--icygrey); text-decoration: underline; text-decoration-color: var(--maplered); text-underline-offset: 3px; }
.site-footer__meta { display: flex; align-items: center; gap: 0.4rem; }

/* External-link glyph */
.ext::after {
  content: "";
  display: inline-block;
  width: 0.7em; height: 0.7em;
  margin-left: 0.35em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 3h7v7h-2V6.4l-9.3 9.3-1.4-1.4L17.6 5H14V3zM5 5h5v2H7v10h10v-3h2v5H5V5z'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 3h7v7h-2V6.4l-9.3 9.3-1.4-1.4L17.6 5H14V3zM5 5h5v2H7v10h10v-3h2v5H5V5z'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: 0.7;
}

/* ---------- Motion preferences -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .hero__sun-shift { transform: none; }
  .scroll-cue { animation: none; }
}

/* ---------- Print (legal pages) ------------------------------------------- */
@media print {
  .bg-sky, .site-header, .nav, .page-hero__sun, .page-hero__mountains,
  .scroll-cue, .site-footer__nav, .lang-switch { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page-hero { min-height: auto; padding: 0 0 1rem; }
  .page-hero__title { color: #000; background: none; padding: 0; font-size: 24pt; }
  .section { background: #fff; padding: 0; }
  .prose, .prose h1, .prose h2, .prose h3 { color: #000; }
  .prose h2 { border-color: #999; }
  .prose a { color: #000; text-decoration: underline; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  .toc { border-color: #999; }
  [id] { scroll-margin-top: 0; }
}
