/* TREVOLINA – coming soon */

/* Self-hosted EB Garamond and Manrope (SIL Open Font License, see /assets/fonts),
   split by script so a browser only downloads what a phrase needs. */

@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-italic-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-italic-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-italic-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-regular-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-regular-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-regular-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-regular-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ebgaramond-regular-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 600;
  font-display: swap;
  src: url(/assets/fonts/manrope-variable-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 600;
  font-display: swap;
  src: url(/assets/fonts/manrope-variable-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 600;
  font-display: swap;
  src: url(/assets/fonts/manrope-variable-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 600;
  font-display: swap;
  src: url(/assets/fonts/manrope-variable-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 600;
  font-display: swap;
  src: url(/assets/fonts/manrope-variable-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --night: #04120c;
  --ink: #e6f6ec;
  --muted: #8fbca1;

  /* the green tones the claim and translations cycle through */
  --g1: #d8f3dc;
  --g2: #95d5b2;
  --g3: #a7c957;
  --g4: #57cc99;
  --g5: #b7e4c7;
  --g6: #74c69d;
  --g7: #99d98c;
  --g8: #52b788;

  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  /* distance of the planet's horizon from the bottom edge of the background */
  --horizon: max(28.7svh, 16.14vw);
  --interval: 3600ms;

  color-scheme: dark;
}

@media (max-aspect-ratio: 1/1) {
  :root { --horizon: max(27.6svh, 49.1vw); }
}

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

html { background: var(--night); }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(calc(100svh - var(--horizon)), auto) 1fr auto;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- background ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--night);
  background-image: url("../img/background-landscape.jpg");
  background-image: image-set(
    url("../img/background-landscape.webp") type("image/webp"),
    url("../img/background-landscape.jpg") type("image/jpeg"));
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
  transform-origin: 50% 100%;
  animation: breathe 40s ease-in-out infinite alternate;
}

@media (max-aspect-ratio: 1/1) {
  .backdrop {
    background-image: url("../img/background-portrait.jpg");
    background-image: image-set(
      url("../img/background-portrait.webp") type("image/webp"),
      url("../img/background-portrait.jpg") type("image/jpeg"));
  }
}

@keyframes breathe {
  to { transform: scale(1.04); }
}

.motes {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.mote {
  position: absolute;
  left: var(--x);
  bottom: calc(var(--horizon) - 2px);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 calc(var(--s) * 3) var(--tone);
  opacity: 0;
  animation: rise var(--d) linear var(--delay) infinite;
}

@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: var(--o); }
  100% { transform: translate(var(--dx), calc(-1 * var(--h))); opacity: 0; }
}

/* ---------- hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2.5rem, 7vh, 5rem) 1rem clamp(1.5rem, 5vh, 3.5rem);
  text-align: center;
}

.hero__mark {
  width: clamp(52px, 5vw + 1rem, 80px);
  height: auto;
  margin-bottom: clamp(1rem, 2.5vh, 1.75rem);
  filter: drop-shadow(0 0 18px rgb(116 198 157 / 0.45));
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-6px); }
}

.wordmark {
  margin: 0 -0.34em 0 0; /* the tracking after the last letter would push the word off-centre */
  font: 200 clamp(2.1rem, 0.9rem + 5.4vw, 5.6rem) / 1 var(--sans);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  filter: drop-shadow(0 0 28px rgb(82 183 136 / 0.35));
}

/* "tre" means three – it carries the weight, like the three leaves of the mark */
.wordmark__tre,
.wordmark__rest {
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 14s ease-in-out infinite alternate;
}

.wordmark__tre {
  font-weight: 600;
  background-image: linear-gradient(100deg, var(--g1), var(--g3) 50%, var(--g1));
}

.wordmark__rest {
  background-image: linear-gradient(100deg, var(--g2), var(--g8) 35%, var(--g5) 70%, var(--g2));
}

@keyframes shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.claim {
  display: grid;
  align-content: center;
  width: min(100%, 62rem);
  min-height: 2.3em;
  margin-top: clamp(1.25rem, 4vh, 2.75rem);
  font: italic 400 clamp(1.7rem, 1rem + 3vw, 3.6rem) / 1.15 var(--serif);
}

.claim__text {
  margin: 0;
  color: var(--tone, var(--g1));
  text-wrap: balance;
  text-shadow: 0 0 32px rgb(4 18 12 / 0.9), 0 0 22px color-mix(in srgb, var(--tone, var(--g1)) 35%, transparent);
  transition: opacity 0.55s ease, transform 0.55s ease, filter 0.55s ease, color 0.55s ease;
}

.claim__text.is-leaving {
  opacity: 0;
  transform: translateY(-0.25em);
  filter: blur(6px);
}

.claim__text.is-entering {
  opacity: 0;
  transform: translateY(0.25em);
  filter: blur(6px);
  transition: none;
}

.claim__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: clamp(0.9rem, 2.5vh, 1.5rem) 0 0;
  font: 500 clamp(0.7rem, 0.6rem + 0.25vw, 0.85rem) / 1.4 var(--sans);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.claim__name { color: var(--tone, var(--g2)); transition: color 0.55s ease; }
.claim__de { color: var(--muted); }
.claim__de:empty { display: none; }
.claim__de::before { content: "·"; margin-right: 0.9rem; }

.claim__progress {
  display: block;
  width: 3.5rem;
  height: 1px;
  margin-top: 0.85rem;
  background: rgb(149 213 178 / 0.18);
  overflow: hidden;
}

.claim__progress::after {
  content: "";
  display: block;
  height: 100%;
  background: var(--g2);
  transform: scaleX(0);
  transform-origin: left;
}

.claim__progress.is-running::after {
  animation: progress var(--interval) linear forwards;
}

@keyframes progress {
  to { transform: scaleX(1); }
}

/* ---------- all the languages ---------- */

.voices {
  display: grid;
  align-content: center;
  padding: clamp(1.25rem, 4vh, 2.5rem) 0 0.5rem; /* clear of the bright rim of the planet */
  min-width: 0;
  text-shadow: 0 1px 14px rgb(2 10 6 / 0.95), 0 0 4px rgb(2 10 6 / 0.6);
}

.voices__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  list-style: none;
  font: italic 400 clamp(1rem, 0.9rem + 0.3vw, 1.2rem) / 1.4 var(--serif);
}

.voices__list li:nth-child(8n + 1) { color: var(--g1); }
.voices__list li:nth-child(8n + 2) { color: var(--g2); }
.voices__list li:nth-child(8n + 3) { color: var(--g3); }
.voices__list li:nth-child(8n + 4) { color: var(--g4); }
.voices__list li:nth-child(8n + 5) { color: var(--g5); }
.voices__list li:nth-child(8n + 6) { color: var(--g6); }
.voices__list li:nth-child(8n + 7) { color: var(--g7); }
.voices__list li:nth-child(8n + 8) { color: var(--g8); }

.marquee { display: none; }

.has-marquee .voices__list {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.has-marquee .marquee {
  display: grid;
  gap: clamp(0.3rem, 1.2vh, 0.8rem);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee__row { overflow: hidden; }

.marquee__track {
  display: flex;
  width: max-content;
  animation: scroll var(--dur, 140s) linear infinite;
}

.marquee__row:nth-child(even) .marquee__track { animation-direction: reverse; }
.marquee__row:hover .marquee__track { animation-play-state: paused; }

@keyframes scroll {
  to { transform: translateX(-50%); }
}

.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 1.6em;
  padding-right: 1.6em;
  white-space: nowrap;
  color: var(--tone);
  opacity: 0.78;
  transition: opacity 0.6s ease, text-shadow 0.6s ease;
}

/* a small leaf between the phrases */
.marquee__item::after {
  content: "";
  width: 0.38em;
  height: 0.38em;
  border-radius: 0 100% 0 100%;
  background: currentColor;
  opacity: 0.45;
}

.marquee__item.is-current {
  opacity: 1;
  text-shadow: 0 1px 14px rgb(2 10 6 / 0.95), 0 0 18px color-mix(in srgb, var(--tone) 70%, transparent);
}

.marquee__row:nth-child(1) { font: italic 400 clamp(1.3rem, 0.95rem + 1.2vw, 2.1rem) / 1.3 var(--serif); }
.marquee__row:nth-child(2) { font: 300 clamp(0.82rem, 0.75rem + 0.3vw, 1.05rem) / 1.6 var(--sans); letter-spacing: 0.12em; }
.marquee__row:nth-child(3) { font: 400 clamp(1.05rem, 0.85rem + 0.7vw, 1.55rem) / 1.35 var(--serif); }

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

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem 1.25rem;
  padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom));
  font: 400 0.72rem / 1.4 var(--sans);
  letter-spacing: 0.08em;
  color: var(--muted);
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgb(149 213 178 / 0.28);
  border-radius: 999px;
  background: rgb(4 18 12 / 0.45);
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.motion-toggle:hover { border-color: var(--g2); color: var(--g1); }
.motion-toggle:focus-visible { outline: 2px solid var(--g2); outline-offset: 3px; }

/* pause bars, or a play triangle once paused */
.motion-toggle__icon {
  width: 0.55rem;
  height: 0.6rem;
  border-inline: 0.17rem solid currentColor;
}

.is-paused .motion-toggle__icon {
  width: 0;
  height: 0;
  border-block: 0.32rem solid transparent;
  border-inline: 0.5rem solid currentColor;
  border-inline-end: 0;
}

.is-paused .backdrop,
.is-paused .mote,
.is-paused .hero__mark,
.is-paused .wordmark__tre,
.is-paused .wordmark__rest,
.is-paused .marquee__track,
.is-paused .claim__progress::after { animation-play-state: paused; }

.footer__links {
  display: inline-flex;
  gap: 1.25rem;
}

.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgb(149 213 178 / 0.3);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer a:hover { color: var(--g1); border-color: var(--g2); }
.footer a:focus-visible { outline: 2px solid var(--g2); outline-offset: 3px; }

/* ---------- legal pages (Impressum, Datenschutz) ---------- */

.page-legal { display: block; }
.page-legal .backdrop { animation: none; filter: brightness(0.6); }

.legal-header {
  display: flex;
  justify-content: center;
  padding: clamp(1.75rem, 5vh, 3rem) 1rem 1.25rem;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.legal-brand img { width: 40px; height: 40px; }
.legal-brand .wordmark { font-size: 1.35rem; }
.legal-brand:focus-visible { outline: 2px solid var(--g2); outline-offset: 6px; border-radius: 4px; }

.legal {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid rgb(149 213 178 / 0.14);
  border-radius: 1.25rem;
  background: rgb(3 14 9 / 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font: 400 1rem / 1.7 var(--sans);
  color: #d3eadb;
}

@media (max-width: 34rem) {
  .legal { margin-inline: 0.75rem; }
}

.legal h1 {
  margin: 0 0 0.4rem;
  font: italic 400 clamp(2.1rem, 1.5rem + 2vw, 2.9rem) / 1.1 var(--serif);
  color: var(--g1);
}

.legal h2 {
  margin: 2.25rem 0 0.6rem;
  font: 500 0.78rem / 1.4 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--g2);
}

.legal h3 {
  margin: 1.4rem 0 0.35rem;
  font: 600 1rem / 1.4 var(--sans);
  color: var(--g5);
}

.legal p, .legal ul, .legal address { margin: 0 0 0.9rem; }
.legal address { font-style: normal; }
.legal ul { padding-left: 1.2rem; }
.legal li::marker { color: var(--g8); }
.legal a { color: var(--g2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal a:hover { color: var(--g1); }
.legal a:focus-visible { outline: 2px solid var(--g2); outline-offset: 2px; }
.legal__lead { color: var(--muted); }
.legal__date { margin-top: 2.25rem; font-size: 0.85rem; color: var(--muted); }

.page-legal .footer { padding-top: 1.5rem; padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }

/* ---------- small screens ---------- */

@media (max-width: 34rem) {
  .claim { min-height: 3.45em; }
  .wordmark { letter-spacing: 0.26em; margin-right: -0.26em; }
}

@media (max-height: 30rem) and (orientation: landscape) {
  body { grid-template-rows: auto 1fr auto; }
  .hero { padding-top: 1.5rem; }
  .hero__mark { width: 44px; margin-bottom: 0.6rem; }
  .claim { margin-top: 0.8rem; }
}

/* ---------- less motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .backdrop, .hero__mark, .wordmark__tre, .wordmark__rest { animation: none; }
  .motes, .claim__progress { display: none; }
  .claim__text, .claim__text.is-leaving, .claim__text.is-entering { transform: none; filter: none; }

  .has-marquee .marquee { display: none; }
  .has-marquee .voices__list {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }
}
