/* =========================================================================
   any2md — Apple-Style Landing
   Light + Dark (prefers-color-scheme), responsive, reduced-motion-aware.
   ========================================================================= */

/* Light tokens — Standard und bei manueller Wahl "light". */
:root {
  color-scheme: light;
  --bg:        #ffffff;
  --bg-alt:    #f5f5f7;
  --surface:   #ffffff;
  --text:      #1d1d1f;
  --muted:     #6e6e73;
  --border:    #d2d2d7;
  --border-2:  #e8e8ed;
  --accent:    #0071e3;
  --accent-2:  #8b5cf6;
  --grad:      linear-gradient(135deg, #2997ff 0%, #8b5cf6 100%);
  --shadow:    0 10px 40px rgba(0, 0, 0, .08);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .14);
  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1080px;
}

/* Dark tokens — identisch in beiden Selektoren unten gepflegt. */

/* 1) System ist dunkel UND keine feste Wahl "light". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #000000;
    --bg-alt:    #0c0c0e;
    --surface:   #161618;
    --text:      #f5f5f7;
    --muted:     #a1a1a6;
    --border:    #2a2a2d;
    --border-2:  #242427;
    --accent:    #2997ff;
    --shadow:    0 10px 40px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, .6);
  }
}

/* 2) Manuelle Wahl "dark" — überstimmt das System immer. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #000000;
  --bg-alt:    #0c0c0e;
  --surface:   #161618;
  --text:      #f5f5f7;
  --muted:     #a1a1a6;
  --border:    #2a2a2d;
  --border-2:  #242427;
  --accent:    #2997ff;
  --shadow:    0 10px 40px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { letter-spacing: -0.022em; line-height: 1.08; margin: 0; }
code {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em; background: var(--bg-alt); padding: .12em .4em;
  border-radius: 6px; border: 1px solid var(--border-2);
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 26px; border-radius: 980px;
  font-size: 17px; font-weight: 500; line-height: 1;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .18s ease, background-color .18s ease,
              border-color .18s ease, opacity .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn__icon { width: 19px; height: 19px; flex: none; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #0077ed; }
@media (prefers-color-scheme: dark) { .btn--primary:hover { background: #36a3ff; } }

.btn--secondary {
  background: var(--bg-alt); color: var(--text); border-color: var(--border);
}
.btn--secondary:hover { background: var(--border-2); }

.btn--small { padding: 8px 17px; font-size: 14px; border-radius: 980px; }

.cta-row {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin: 14px 0;
}

/* ---------- Flip-Button (Windows · Coming soon) ---------- */
.btn-flip { display: inline-block; perspective: 1000px; cursor: default; outline: none; }
.btn-flip__inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.2, .7, .2, 1);
}
.btn-flip:hover .btn-flip__inner,
.btn-flip:focus-visible .btn-flip__inner,
.btn-flip:focus .btn-flip__inner { transform: rotateY(180deg); }

.btn-flip__face {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: 980px;
  font-size: 17px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid var(--border); background: var(--bg-alt); color: var(--text);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.btn-flip__front { position: relative; }
.btn-flip__back {
  position: absolute; inset: 0;
  transform: rotateY(180deg);
  color: var(--muted);
  border-style: dashed;
}
.btn-flip:focus-visible .btn-flip__front { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-2);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 0 22px; height: 52px;
}
.nav__brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; }
.nav__name { font-size: 18px; letter-spacing: -.02em; }
.nav__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 13px;
}
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { color: var(--muted); font-size: 14px; font-weight: 400; }
.nav__links a:hover { color: var(--text); }
.nav .btn--small { margin-left: 4px; }

/* Theme-Umschalter */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; flex: none; margin-left: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.theme-toggle:hover { background: var(--bg-alt); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle__sun  { display: none; }
.theme-toggle__moon { display: block; }
:root[data-theme="dark"] .theme-toggle__sun  { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun  { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
}

@media (max-width: 760px) {
  .nav__links { display: none; }
  .theme-toggle { margin-left: auto; }
  .nav .btn--small { margin-left: 10px; }
}

/* ---------- Layout helpers ---------- */
main { display: block; }
.section { max-width: var(--maxw); margin: 0 auto; padding: 96px 22px; }
.section--alt { max-width: none; background: var(--bg-alt); }
.section--alt > * { max-width: var(--maxw); margin-inline: auto; }
.section__head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section__head h2, .download h2, .privacy h2, .tokens h2 { font-size: clamp(28px, 4vw, 40px); }
.section__lead { color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); margin: 16px 0 0; }
.kicker, .formats__label, .hero__eyebrow {
  text-transform: uppercase; letter-spacing: .08em; font-size: 13px;
  font-weight: 600; color: var(--accent); margin: 0 0 12px;
}

/* ---------- Hero ---------- */
.hero { max-width: 920px; margin: 0 auto; padding: 84px 22px 60px; text-align: center; }
.hero__title { font-size: clamp(34px, 6.4vw, 60px); font-weight: 600; margin: 0 0 22px; }
.hero__sub {
  color: var(--muted); font-size: clamp(18px, 2.6vw, 22px);
  max-width: 640px; margin: 0 auto 28px; line-height: 1.45;
}
.hero__hint { color: var(--muted); font-size: 14px; margin: 16px 0 0; }

/* ---------- App-Window-Mockup ---------- */
.mockup {
  margin: 60px auto 0; max-width: 760px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.mockup__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px; border-bottom: 1px solid var(--border-2);
  background: var(--bg-alt);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot--r { background: #ff5f57; } .dot--y { background: #febc2e; } .dot--g { background: #28c840; }
.mockup__title { margin-left: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.mockup__body {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 0;
  text-align: left;
}
.drop {
  display: flex; align-items: center; gap: 10px;
  padding: 30px 22px; border-right: 1px solid var(--border-2);
}
.drop__zone {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 14px; border: 2px dashed var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
}
.drop__file { width: 40px; height: 40px; color: var(--accent); }
.drop__name { font-size: 14px; font-weight: 600; color: var(--text); }
.drop__meta { font-size: 12px; }
.drop__arrow { width: 26px; height: 26px; color: var(--muted); flex: none; }
.md {
  margin: 0; padding: 26px 24px; overflow-x: auto;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7; color: var(--text);
  background: var(--surface);
}
.md code { background: none; border: none; padding: 0; font-size: inherit; }
.md-h { color: var(--accent); font-weight: 700; }
.md-b { color: var(--text); }
.md-c { color: var(--muted); }

@media (max-width: 640px) {
  .mockup__body { grid-template-columns: 1fr; }
  .drop { border-right: none; border-bottom: 1px solid var(--border-2); }
}

/* ---------- Formats strip ---------- */
.formats { text-align: center; padding: 64px 22px 16px; max-width: var(--maxw); margin: 0 auto; }
.formats__list {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px 12px; padding: 0; margin: 0 0 16px;
}
.formats__list li {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 980px;
  font-size: 14px; font-weight: 500; color: var(--text); background: var(--surface);
}
.formats__note { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- Anzeigen (Desktop-Rectangle / Mobile-Square) ---------- */
.adbanner { max-width: var(--maxw); margin: 0 auto; padding: 32px 22px; text-align: center; }
.adbanner__label {
  display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.adbanner__slot { display: flex; align-items: center; justify-content: center; }
.adbanner__link {
  display: inline-block; line-height: 0; max-width: 100%;
  border-radius: var(--radius-sm); transition: opacity .18s ease;
}
.adbanner__link:hover { opacity: .9; }
.adbanner__link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.adbanner__slot img {
  display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm);
}

/* ---------- Feature cards ---------- */
.cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.card {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 30px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border); }
.card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 18px;
  background: var(--bg-alt); color: var(--accent);
}
.card__icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 19px; margin: 0 0 8px; }
.card p { color: var(--muted); font-size: 15px; margin: 0; line-height: 1.55; }

@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Tokens section ---------- */
.tokens { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.checks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 32px; font-size: 16px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--grad);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>") center/13px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>") center/13px no-repeat;
}
.tokens__viz {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow);
}
.bar__row { margin-bottom: 22px; }
.bar__label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.bar__track { background: var(--bg-alt); border-radius: 10px; overflow: hidden; }
.bar__fill {
  color: #fff; font-size: 13px; font-weight: 700; padding: 11px 14px;
  border-radius: 10px; white-space: nowrap;
  animation: grow 1s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes grow { from { width: 0; } }
.bar__fill--big   { width: 100%; background: linear-gradient(90deg, #ff8a5b, #ff5f57); }
.bar__fill--small { width: 34%;  background: var(--grad); }
.bar__caption { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

@media (max-width: 800px) { .tokens { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- Steps ---------- */
.steps {
  list-style: none; padding: 0; margin: 0 auto; max-width: 720px;
  display: grid; gap: 8px;
}
.steps li {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--border-2); background: var(--surface);
}
.steps__n {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 17px;
}
.steps h3 { font-size: 18px; margin: 4px 0 4px; }
.steps p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- Privacy band ---------- */
.privacy { background: var(--bg-alt); padding: 96px 22px; }
.privacy__inner { max-width: 680px; margin: 0 auto; text-align: center; }
.privacy__icon { width: 52px; height: 52px; color: var(--accent); margin-bottom: 22px; }
.privacy p { color: var(--muted); font-size: 18px; margin: 18px 0 24px; line-height: 1.5; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 17px; }
.link-arrow svg { width: 17px; height: 17px; transition: transform .18s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Download ---------- */
.download { text-align: center; padding: 100px 22px; max-width: var(--maxw); margin: 0 auto; }
.download .cta-row { margin-top: 28px; }
.download__req { color: var(--muted); font-size: 14px; margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.download__sep { opacity: .5; }
.download__ver { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border-2); background: var(--bg-alt); }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 22px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
}
.footer__brand { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.footer__brand .nav__logo { width: 26px; height: 26px; font-size: 11px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; margin: 0 auto; }
.footer__links a { color: var(--muted); font-size: 14px; }
.footer__links a:hover { color: var(--text); }
.footer__copy { color: var(--muted); font-size: 13px; margin: 0; }
.footer__tm {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 22px 28px;
  color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center;
  border-top: 1px solid var(--border-2);
}

@media (max-width: 620px) {
  .footer__inner { flex-direction: column; text-align: center; }
  .footer__links { margin: 0; }
}

/* =========================================================================
   404 – Seite nicht gefunden
   ========================================================================= */
.error404 {
  max-width: 640px; margin: 0 auto; padding: 80px 22px 110px;
  min-height: 56vh; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.error404__code {
  font-size: clamp(86px, 19vw, 168px); font-weight: 700; line-height: 1;
  letter-spacing: -0.04em; margin: 0 0 6px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.error404 h1 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 14px; }
.error404__lead {
  color: var(--muted); font-size: 18px; line-height: 1.5;
  max-width: 460px; margin: 0 0 30px;
}
.error404__actions {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 30px;
}
.error404__links {
  display: flex; gap: 12px 22px; flex-wrap: wrap; justify-content: center;
}
.error404__links a { color: var(--muted); font-size: 14px; }
.error404__links a:hover { color: var(--text); }

/* =========================================================================
   Legal pages (Impressum / Datenschutz)
   ========================================================================= */
.legal { max-width: 740px; margin: 0 auto; padding: 80px 22px 64px; }
.legal .back { color: var(--muted); font-size: 15px; display: inline-block; margin-bottom: 28px; }
.legal .back:hover { color: var(--text); }
.legal h1 { font-size: clamp(30px, 5vw, 42px); margin-bottom: 8px; }
.legal h2 { font-size: 20px; margin: 38px 0 10px; }
.legal p { color: var(--text); margin: 10px 0; }
.legal .muted { color: var(--muted); }
.legal .field { margin: 14px 0; }
.legal .field b { display: block; color: var(--muted); font-weight: 600; font-size: 13px; margin-bottom: 2px; }

/* Lizenz-Seite: Untertitel je Paket + umbrechende Lizenztexte */
.legal .sub { color: var(--muted); font-size: 14px; margin: 2px 0 10px; }
.legal pre {
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--bg-alt); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 28px;
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5; color: var(--text);
}
