/* RefineMe launch site. Tokens are lifted from the app (src/theme):
   the dark "aurora" palette, glass surfaces with a specular rim, Fraunces
   for headlines and Inter for everything else. Fonts are self-hosted so no
   visitor data goes to Google (DSGVO). */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/Inter_400Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/Inter_500Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/Inter_600SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 400; font-display: swap; src: url("fonts/Fraunces_400Regular.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 500; font-display: swap; src: url("fonts/Fraunces_500Medium.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #06080E;
  --aurora-blue: #2C6A93;
  --aurora-violet: #5A47A6;
  --aurora-warm: #B5704D;
  --text: #F3F1EC;
  --text-2: #A1A6B4;
  --text-3: #6A7080;
  --accent: #5FDC9C;
  --accent-2: #7FE3D4;
  --accent-pressed: #4CC487;
  --on-accent: #08100C;
  --danger: #FF6F64;
  --glass: rgba(255, 255, 255, 0.065);
  --glass-high: rgba(255, 255, 255, 0.10);
  --hairline: rgba(255, 255, 255, 0.09);
  --edge-top: rgba(255, 255, 255, 0.26);
  --edge-side: rgba(255, 255, 255, 0.09);
  --edge-bottom: rgba(255, 255, 255, 0.04);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
a:hover { color: var(--accent-2); }

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

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

/* ---------- Background: the app's three aurora glows, blurred ---------- */

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

.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.aurora .blue {
  width: 70vmax; height: 70vmax;
  left: -22vmax; top: -30vmax;
  background: radial-gradient(circle, rgba(44, 106, 147, 0.85), rgba(44, 106, 147, 0) 68%);
  animation: drift-a 38s ease-in-out infinite alternate;
}

.aurora .violet {
  width: 62vmax; height: 62vmax;
  right: -24vmax; top: -14vmax;
  background: radial-gradient(circle, rgba(90, 71, 166, 0.75), rgba(90, 71, 166, 0) 68%);
  animation: drift-b 46s ease-in-out infinite alternate;
}

.aurora .warm {
  width: 52vmax; height: 52vmax;
  right: -10vmax; bottom: -26vmax;
  background: radial-gradient(circle, rgba(181, 112, 77, 0.42), rgba(181, 112, 77, 0) 68%);
  animation: drift-c 52s ease-in-out infinite alternate;
}

/* a fine grain so the big gradients don't band */
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift-a { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@keyframes drift-b { to { transform: translate(-7vmax, 9vmax) scale(0.94); } }
@keyframes drift-c { to { transform: translate(-9vmax, -6vmax) scale(1.1); } }

/* ---------- Glass surface ---------- */

.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  border-radius: 28px;
  isolation: isolate;
}

/* specular edge: bright on top, fading down the sides, faint at the bottom */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, var(--edge-top), var(--edge-side) 35%, var(--edge-bottom));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* sheen: light falling on the face from the top left */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.025) 35%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  z-index: -1;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px var(--gutter) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 500 21px/1 var(--display);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; }

.lang-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
}

.lang-switch button {
  appearance: none;
  border: 0;
  margin: 0;
  min-width: 44px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.lang-switch button:hover { color: var(--text); }

.lang-switch button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* ---------- Hero ---------- */

main { flex: 1; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 28px;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px var(--gutter) 48px;
}

.hero-ring {
  position: relative;
  width: min(56vw, 232px);
  aspect-ratio: 1;
}

.hero-ring svg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; overflow: visible; }

/* the real blur behind the glass disc */
.hero-ring::before {
  content: "";
  position: absolute;
  inset: 3.5%;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

/* the one orchestrated moment: the ring fills to three fifths on load */
.hero-ring .rm-arc,
.hero-ring .rm-arc-glow {
  stroke-dasharray: 100 110;
  stroke-dashoffset: 0;
  animation: fill-ring 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

@keyframes fill-ring { from { stroke-dashoffset: 101; } to { stroke-dashoffset: 0; } }

.hero-copy {
  width: 100%;
  max-width: 34rem;
  text-align: center;
}

h1 {
  margin: 0 0 16px;
  font: 400 clamp(38px, 9.5vw, 66px)/1.04 var(--display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lead {
  margin: 0 auto 26px;
  max-width: 31rem;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.6;
  text-wrap: pretty;
}

.features {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: grid;
  gap: 12px;
  text-align: left;
  max-width: 26rem;
  margin-inline: auto;
}

.features li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

/* small rings, each a little fuller, as list markers */
.features svg { width: 22px; height: 22px; margin-top: -1px; }

/* ---------- Signup card ---------- */

.signup {
  padding: 22px;
  text-align: left;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signup input[type="email"] {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(4, 6, 10, 0.38);
  color: var(--text);
  font: 400 16px/1 var(--sans);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, background-color 0.2s;
}

.signup input[type="email"]::placeholder { color: var(--text-3); }

.signup input[type="email"]:focus {
  outline: none;
  border-color: rgba(95, 220, 156, 0.7);
  background: rgba(4, 6, 10, 0.5);
}

.signup input[type="email"][aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 111, 100, 0.18); }

.button {
  position: relative;
  appearance: none;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%), linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font: 600 16px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(95, 220, 156, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.button:hover { filter: brightness(1.05); box-shadow: 0 10px 34px rgba(95, 220, 156, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.button:active { transform: scale(0.98); filter: brightness(0.95); }
.button[disabled] { cursor: progress; opacity: 0.7; }

.consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 16px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.5;
  cursor: pointer;
}

.consent input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.consent input::after {
  content: "";
  width: 11px;
  height: 6px;
  margin-top: -2px;
  border: solid var(--on-accent);
  border-width: 0 0 2.5px 2.5px;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.15s;
}

.consent input:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(255, 255, 255, 0.35);
}
.consent input:checked::after { transform: rotate(-45deg) scale(1); }
.consent input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 111, 100, 0.2); }

.consent a { color: var(--text); text-underline-offset: 2px; }

.form-note {
  margin: 14px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
}

.status {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.45;
}
.status:empty { display: none; }
.status.error { color: var(--danger); }

/* the honeypot: real people never see or fill it */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* success state replaces the form */
.done {
  display: none;
  align-items: center;
  gap: 14px;
}
.done svg { flex: none; width: 44px; height: 44px; }
.done p { margin: 0; font-size: 15.5px; line-height: 1.5; }
.done strong { display: block; font: 500 20px/1.25 var(--display); margin-bottom: 2px; }
.signup.is-done form { display: none; }
.signup.is-done .done { display: flex; }
.done:focus { outline: none; }

/* ---------- Footer ---------- */

.site-footer {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px var(--gutter) 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: center;
  color: var(--text-3);
  font-size: 12.5px;
}

.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Legal pages ---------- */

.legal {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
}

.legal article {
  padding: clamp(22px, 5vw, 48px);
}

.legal h1 { font-size: clamp(34px, 7vw, 48px); margin-bottom: 8px; text-align: left; }
.legal .updated { margin: 0 0 28px; color: var(--text-2); font-size: 13.5px; opacity: .85; }
.legal code { font: 500 0.92em/1 var(--sans); color: var(--text); white-space: nowrap; }
.legal h2 { margin: 32px 0 8px; font: 500 21px/1.3 var(--display); letter-spacing: -0.01em; }
.legal h3 { margin: 20px 0 6px; font: 600 15px/1.4 var(--sans); }
.legal p, .legal li { color: var(--text-2); font-size: 15.5px; line-height: 1.65; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal address { font-style: normal; color: var(--text); line-height: 1.65; margin-bottom: 12px; }
.legal .back { display: inline-block; margin-bottom: 18px; color: var(--text-2); font-size: 14px; text-decoration: none; }
.legal .back:hover { color: var(--text); }

/* Legal pages hold both languages; the inactive one is hidden. */
html[data-lang="en"] [data-only="de"],
html[data-lang="de"] [data-only="en"] { display: none !important; }

/* tall phone screens: the glows cover more of the page, so dim them */
@media (max-aspect-ratio: 3/4) {
  .aurora span { opacity: 0.62; }
}

/* ---------- Larger screens ---------- */

@media (min-width: 560px) {
  .field-row { flex-direction: row; }
  .signup input[type="email"] { flex: 1; }
  .signup { padding: 26px; }
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(40px, 6vw, 96px);
    padding-top: clamp(36px, 7vh, 88px);
  }
  .hero-ring { width: min(36vw, 430px); justify-self: center; }
  .hero-copy { text-align: left; max-width: 36rem; justify-self: start; }
  .lead { margin-inline: 0; }
  .features { margin-inline: 0; }
  .site-footer { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora span { animation: none; }
  .hero-ring .rm-arc, .hero-ring .rm-arc-glow { animation: none; }
  .button, .lang-switch button, .consent input, .consent input::after { transition: none; }
}

/* Older browsers without backdrop-filter: make glass a bit denser instead. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(22, 27, 40, 0.86); }
}
