/* MyReflect website – Slate Calm palette.
   Colours live in the :root block. Change them there and everything follows. */

:root {
  --bg: #F5F8FB;
  --surface: #FFFFFF;
  --tint: #E9F0F6;
  --ink: #0D2B42;
  --muted: #475F74;
  --primary: #2B5278;
  --on-primary: #FFFFFF;
  --container: #6A9ABD;
  --soft: #A8C8E0;
  --line: #D2DFEA;
  --error: #9B2C2C;
  --ok: #1F6B4A;

  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --wrap: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1620;
    --surface: #13212E;
    --tint: #101C28;
    --ink: #E4EDF5;
    --muted: #9DB3C5;
    --primary: #9AC6EE;
    --on-primary: #0D2B42;
    --container: #6A9ABD;
    --soft: #2B5278;
    --line: #243747;
    --error: #F1A3A3;
    --ok: #8ED1AE;
  }
}

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

html {
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}
.narrow { max-width: 760px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.7rem); font-weight: 650; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 650; margin-bottom: 28px; }
h3 { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }

/* ------------------------------------------------------------ header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.2rem;
  margin-right: auto;
}
.brand img { border-radius: 10px; }
.main-nav { display: flex; gap: 26px; }
.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.98rem;
  padding: 6px 0;
}
.main-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }

/* ----------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--primary);
  color: var(--on-primary);
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-small { padding: 8px 16px; font-size: 0.95rem; }
.btn-quiet {
  background: transparent;
  color: var(--primary);
  box-shadow: inset 0 0 0 2px var(--container);
}
.btn-quiet:hover { filter: none; background: var(--tint); }
.btn-play { padding: 10px 24px 10px 18px; text-align: left; }
.btn-play span { display: flex; flex-direction: column; line-height: 1.1; }
.btn-play small { font-size: 0.72rem; font-weight: 500; opacity: 0.9; }
.btn-play strong { font-size: 1.15rem; }
.btn-primary { width: fit-content; padding: 13px 28px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* -------------------------------------------------------------- hero --- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px); }
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.hero-text h1 { max-width: 15ch; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 52ch; margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 30px; }
.hero-note { margin: 18px 0 0; color: var(--muted); font-size: 0.95rem; }

.hero-visual {
  display: flex;
  justify-content: center;
  background: var(--tint);
  border-radius: 32px;
  padding: 40px 24px 0;
  overflow: hidden;
  align-self: stretch;
  align-items: flex-end;
}
.phone {
  width: min(260px, 70%);
  border: 8px solid var(--ink);
  border-bottom: 0;
  border-radius: 34px 34px 0 0;
  overflow: hidden;
  background: var(--surface);
}
.phone img { width: 100%; }

/* ---------------------------------------------------------- sections --- */
.section { padding: clamp(52px, 8vw, 100px) 0; }
.tint { background: var(--tint); }
.section-lead { color: var(--muted); max-width: 52ch; margin-top: -12px; }

.rows { display: grid; }
.row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px 40px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.row:last-child { border-bottom: 1px solid var(--line); }
.row p { color: var(--muted); max-width: 62ch; }
.row ul { margin: 0; padding-left: 1.2em; max-width: 62ch; }
.row li { margin-bottom: 0.5em; }
.row li::marker { color: var(--container); }

.fit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}
.fit-item { border-left: 3px solid var(--container); padding-left: 18px; }
.fit-item h3 { margin-bottom: 8px; }
.fit-item p { color: var(--muted); margin: 0; }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 650;
}
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--muted); margin: 0; }

/* ------------------------------------------------------- screenshots --- */
/* Screenshot gallery. Shows 4, 3 or 2 screenshots per page depending on
   screen width (--per-page). Without JavaScript it is a simple wrapping grid. */
.gallery { --per-page: 4; --gap: 24px; margin-top: 32px; }
.gallery-viewport { overflow: hidden; padding: 4px; margin: -4px; touch-action: pan-y; }
.gallery-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--per-page), 1fr);
  gap: var(--gap);
}
/* Phone frame, same style as the one next to the headline */
.gallery-item img {
  width: 100%;
  border: 8px solid var(--ink);
  border-radius: 34px;
  background: var(--ink);
}

/* Paged mode, switched on by main.js */
.gallery.is-paged .gallery-track {
  display: flex;
  transform: translateX(calc(var(--page, 0) * -1 * (100% + var(--gap))));
}
.gallery.is-paged .gallery-item {
  flex: 0 0 calc((100% - (var(--per-page) - 1) * var(--gap)) / var(--per-page));
}
@media (prefers-reduced-motion: no-preference) {
  .gallery.is-paged .gallery-track { transition: transform 0.45s ease; }
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}
.gallery-controls[hidden] { display: none; }
.gallery-arrow {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  box-shadow: inset 0 0 0 2px var(--soft);
  cursor: pointer;
}
.gallery-arrow:hover:not(:disabled) { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.gallery-arrow:disabled { opacity: 0.35; cursor: default; }
.gallery-dots { display: flex; gap: 4px; }
.gallery-dot {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.gallery-dot::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--container);
}
.gallery-dot[aria-current="true"]::before { background: var(--primary); box-shadow: none; }
.gallery-dot:hover::before { background: var(--soft); }
.gallery-dot[aria-current="true"]:hover::before { background: var(--primary); }

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

/* --------------------------------------------------------------- faq --- */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: 0 0 10px;
  height: 10px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq details p { margin: 0 0 22px; color: var(--muted); max-width: 62ch; }
@media (prefers-reduced-motion: reduce) {
  .faq summary::after { transition: none; }
}

/* ----------------------------------------------------------- contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--container);
  border-radius: 10px;
  padding: 12px 14px;
}
.field textarea { resize: vertical; min-height: 140px; }
.field.check { grid-template-columns: 22px 1fr; align-items: start; gap: 12px; }
.field.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--primary); }
.field.check label { font-weight: 400; font-size: 0.92rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.6em; margin: 0; font-weight: 600; }
.form-status.ok { color: var(--ok); }
.form-status.error { color: var(--error); }

/* ------------------------------------------------------------- prose --- */
.prose { max-width: 760px; }
.prose h1 { margin-bottom: 8px; }
.prose h2 { font-size: 1.4rem; margin: 2em 0 0.6em; }
.prose h3 { font-size: 1.1rem; margin: 1.6em 0 0.5em; }
#imprint .prose h2:first-child, #imprint h2 { margin-top: 0; }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose a { word-break: break-word; }
.legal { padding: clamp(36px, 6vw, 72px) 0 clamp(52px, 8vw, 96px); }
.legal .prose > p:first-of-type { color: var(--muted); }
.back { margin-top: 3em; }

/* ------------------------------------------------------------ footer --- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 0.95rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--ink); }

/* -------------------------------------------------------- responsive --- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { padding-top: 32px; }
  .row { grid-template-columns: 1fr; }
  .fit-grid, .steps { grid-template-columns: 1fr; gap: 28px; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery { --per-page: 3; --gap: 18px; }
}
@media (max-width: 600px) {
  .gallery { --per-page: 2; --gap: 14px; }
  .gallery-item img { border-width: 5px; border-radius: 22px; }
}
@media (max-width: 760px) {
  .main-nav { display: none; }
}
@media (max-width: 480px) {
  body { font-size: 1rem; }
  .btn-play { width: 100%; justify-content: center; }
  .hero-actions .btn { width: 100%; }
}
