:root {
  /* Ruhrpott: Beton, Kohle, Grubenlampe */
  --paper: #ecedea;
  --paper-deep: #d9dbd6;
  --ink: #16171a;
  --ink-soft: #4a4d52;
  --ink-on-dark: #b9bcc0;
  --accent: #ffc20e;
  --accent-deep: #e0a800;
  --on-accent: #16171a;
  --envelope: #ffc20e;
  --envelope-flap: #16171a;
  --margin: clamp(16px, 4vw, 48px);
  --gap-section: clamp(96px, 14vw, 200px);
}

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }

.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--paper); text-decoration: none;
}
.skip-link:focus { top: 16px; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--margin); }

/* Bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 24px; padding-bottom: 24px; }
.bar a.mark { font-weight: 700; font-size: 1.125rem; text-decoration: none; letter-spacing: -0.01em; }
.bar nav { display: flex; align-items: center; gap: 28px; }
.bar nav a { text-decoration: none; font-size: 1rem; color: var(--ink-soft); }
.bar nav a:hover { color: var(--ink); }
.bar nav a.btn, .bar nav a.btn:hover { color: var(--on-accent); }

/* Buttons: flat, one fill, square corners */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px; font: inherit; font-weight: 600; font-size: 1rem;
  background: var(--accent); color: var(--on-accent); border: 0; text-decoration: none; cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}
.btn:hover { background: var(--accent-deep); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-plain { background: transparent; color: var(--ink); padding-left: 0; padding-right: 0; }
.btn-plain:hover { background: transparent; color: var(--accent); }

/* Hero */
.hero { padding-top: clamp(40px, 8vw, 96px); padding-bottom: var(--gap-section); }
.hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.hero .lede {
  margin-top: 36px; max-width: 34ch;
  font-size: clamp(1.125rem, 1.6vw, 1.35rem); color: var(--ink-soft);
}
.hero .actions { margin-top: 44px; }

/* The envelope: the page is the letter */
.envelope { position: relative; aspect-ratio: 4 / 3; background: var(--envelope); }
.envelope .flap {
  position: absolute; inset: 0; background: var(--envelope-flap);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
}
.envelope .seal {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 26%; aspect-ratio: 1; border-radius: 50%;
  background: var(--paper); color: var(--ink);
  display: grid; place-items: center; font-size: clamp(1.5rem, 3.4vw, 2.6rem);
}
.envelope .address {
  position: absolute; left: 10%; bottom: 9%; right: 10%;
  color: var(--on-accent); font-size: clamp(0.9rem, 1.4vw, 1.05rem); line-height: 1.5;
}
.envelope .address strong { display: block; font-size: clamp(1.1rem, 2vw, 1.5rem); letter-spacing: -0.01em; }

/* Sections */
section { padding-bottom: var(--gap-section); }
h2 { font-size: clamp(2.1rem, 5vw, 4.25rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; max-width: 18ch; }
.statement { font-size: clamp(1.4rem, 2.6vw, 2.1rem); line-height: 1.3; letter-spacing: -0.01em; max-width: 30ch; }
.prose { max-width: 60ch; color: var(--ink-soft); }
.prose + .prose { margin-top: 1em; }

.field { background: var(--ink); color: var(--paper); padding-top: var(--gap-section); padding-bottom: var(--gap-section); }
.field h2 { color: var(--paper); }
.field .statement { color: var(--paper); }
.field .prose { color: var(--ink-on-dark); }

/* Features: one large row each, no cards */
.features { display: grid; gap: clamp(56px, 8vw, 110px); }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.feature h3 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); line-height: 1.05; letter-spacing: -0.02em; font-weight: 700; }
.feature p { font-size: clamp(1.125rem, 1.5vw, 1.3rem); color: var(--ink-soft); max-width: 46ch; }
.feature .glyph {
  font-size: clamp(3rem, 6vw, 5rem); color: var(--ink); line-height: 1; margin-bottom: 28px;
}

/* Chiffre demo */
.demo { display: grid; gap: 24px; margin-top: 48px; max-width: 760px; }
.demo label { font-weight: 600; }
.demo textarea {
  width: 100%; min-height: 120px; padding: 18px; font: inherit; font-size: 1.125rem;
  background: var(--paper); color: var(--ink); border: 0; resize: vertical;
}
.demo textarea:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.demo .out {
  background: var(--ink); color: var(--paper); padding: 22px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 0.95rem;
  word-break: break-all; min-height: 96px; white-space: pre-wrap;
}
.demo .note { font-size: 0.95rem; color: var(--ink-soft); }
.demo .out:empty::before { content: 'Hier erscheint die verschlüsselte Fassung.'; color: var(--paper-deep); opacity: 0.7; }

/* Privacy statement */
.private-line { display: grid; gap: 20px; }

/* Footer */
.foot { padding-top: 48px; padding-bottom: 56px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 18px 40px; }
.foot .name { font-size: clamp(2.2rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.foot nav { display: flex; gap: 26px; font-size: 1rem; }
.foot nav a { color: var(--ink-soft); }
.foot p { width: 100%; color: var(--ink-soft); font-size: 0.95rem; }

/* Legal pages share the shell; their content is unchanged */
.legal { padding-top: clamp(48px, 8vw, 96px); padding-bottom: var(--gap-section); }
.legal h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); line-height: 1; letter-spacing: -0.035em; font-weight: 700; margin-bottom: 48px; }
.legal .content-card { max-width: 72ch; color: var(--ink); }
.legal .content-card strong { display: block; margin-top: 2em; margin-bottom: 0.4em; font-size: 1.05rem; }
.legal .content-card p { color: var(--ink-soft); }
.legal .content-card a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.legal .content-card .info-grid { display: block; }
.legal h2, .legal h3 { font-size: 1.4rem; margin-top: 2em; margin-bottom: 0.5em; max-width: none; }

/* Motion: entrance on load, respects reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(24px); animation: rise 700ms cubic-bezier(.2,.7,.2,1) forwards; }
  .rise.d1 { animation-delay: 90ms; }
  .rise.d2 { animation-delay: 180ms; }
  .rise.d3 { animation-delay: 270ms; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* Phone */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .bar nav a:not(.keep) { display: none; }
  .envelope { aspect-ratio: 5 / 4; }
}
@media (max-width: 480px) {
  body { font-size: 1.0625rem; }
  .btn { width: 100%; justify-content: center; }
  .bar nav .keep { font-size: 0.95rem; }
}

/* Envelope: the letter slides out of the envelope on load, the flap opens on hover */
.envelope .letter {
  position: absolute; left: 14%; right: 14%; top: 16%; height: 46%;
  background: var(--paper); display: grid; align-content: start; gap: 12px; padding: 18% 9% 0;
  transform: translateY(0);
}
.envelope .letter span { display: block; height: 8px; background: var(--paper-deep); }
.envelope .letter span:nth-child(2) { width: 72%; }
.envelope .letter span:nth-child(3) { width: 48%; }
.envelope .flap { transform-origin: 50% 0; transition: transform 600ms cubic-bezier(.2,.7,.2,1); }
.envelope:hover .flap { transform: rotateX(160deg); }
.envelope .seal { transition: transform 400ms ease; }
.envelope:hover .seal { transform: translate(-50%, -50%) scale(1.08); }

/* Network diagram: nodes and links, data flows along the links */
.network { margin-top: clamp(56px, 8vw, 96px); max-width: 760px; }
.network svg { width: 100%; height: auto; }
.network line { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 12; opacity: 0.7; }
.network circle { fill: var(--ink); stroke: var(--accent); stroke-width: 3; }
.network circle.ours { fill: var(--accent); }
.network .label { fill: var(--paper); font-size: 18px; font-weight: 600; font-family: 'Inter', system-ui, sans-serif; }
.network.is-in line { animation: flow 1.6s linear infinite; }
.network.is-in circle.ours { animation: pulse 2.4s ease-in-out infinite; transform-origin: 320px 170px; transform-box: view-box; }
@keyframes flow { to { stroke-dashoffset: -28; } }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* Feature glyphs: small motion that tells what each feature does */
.glyph i { display: inline-block; }
.reveal .glyph-phone { transition: transform 500ms ease; }
.reveal.is-in .glyph-phone { animation: swap 3.2s ease-in-out infinite; }
.reveal.is-in .glyph-lock { animation: lock 3.2s ease-in-out infinite; }
.reveal.is-in .glyph-net { animation: wiggle 3.2s ease-in-out infinite; }
@keyframes swap { 0%, 40% { transform: translateX(0); } 50%, 90% { transform: translateX(10px); } 100% { transform: translateX(0); } }
@keyframes lock { 0%, 40% { transform: translateY(0) scale(1); } 55%, 85% { transform: translateY(-4px) scale(1.06); } 100% { transform: translateY(0) scale(1); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }

/* Scroll reveal for the feature rows */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.2,1); }
  .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .network.is-in line, .network.is-in circle.ours, .reveal.is-in .glyph i, .envelope .flap { animation: none; transition: none; }
  .envelope:hover .flap { transform: none; }
}

/* Abstand oberhalb des Features-Abschnitts, nach der farbigen Fläche */
.features-sec { padding-top: var(--gap-section); padding-bottom: var(--gap-section); }

/* Logo in der Kopfzeile */
.bar a.mark { display: inline-flex; align-items: center; gap: 12px; }
.bar a.mark img { width: 34px; height: 34px; }

/* Footer: dark band across the full width, like the Matrix section */
.site-foot { background: var(--ink); color: var(--paper); }
.site-foot .foot { padding-top: clamp(64px, 9vw, 110px); padding-bottom: clamp(56px, 8vw, 96px); }
.site-foot .foot .name { color: var(--paper); }
.site-foot .foot nav a, .site-foot .foot p { color: var(--ink-on-dark); }
.site-foot .foot nav a:hover { color: var(--accent); }
.site-foot .foot p a { color: var(--accent); text-decoration-color: var(--accent); }

/* Rechtsseiten: Impressum und Datenschutz */
.legal-head { max-width: 22ch; }
.legal-lede { font-size: clamp(1.125rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 60ch; margin-top: 28px; }
.legal-meta { margin-top: 18px; color: var(--ink-soft); font-size: 0.95rem; }

.legal .block { margin-top: clamp(56px, 7vw, 88px); max-width: 72ch; }
.legal .block h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 20px; max-width: none; }
.legal .block h3 { font-size: 1.15rem; margin-top: 1.6em; margin-bottom: 0.4em; font-weight: 700; }
.legal .block p, .legal .block li { color: var(--ink-soft); }
.legal .block p + p { margin-top: 0.9em; }
.legal .block ul { margin-top: 0.8em; padding-left: 1.2em; display: grid; gap: 0.45em; }
.legal .block ul li::marker { color: var(--ink); }
.legal .block a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 3px; }

.legal .summary { background: var(--paper-deep); padding: clamp(24px, 4vw, 40px); margin-top: clamp(40px, 6vw, 64px); max-width: 72ch; }
.legal .summary h2 { font-size: 1.3rem; margin-bottom: 14px; max-width: none; }
.legal .summary ul { margin-top: 0; }

/* Impressum: Angaben als Liste mit Bezeichnung links und Wert rechts */
.facts { display: grid; grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr); gap: 0; margin-top: 8px; }
.facts dt, .facts dd { padding: 18px 0; }
.facts dt { font-weight: 600; color: var(--ink); }
.facts dd { color: var(--ink); }
.facts dt + dd, .facts dd + dt { border-top: 0; }
.facts > *:nth-child(n+3) { background: none; }
.facts .wide { grid-column: 1 / -1; }
.facts .stack { display: grid; gap: 2px; }
.facts a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 3px; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } .facts dt { padding-bottom: 0; } .facts dd { padding-top: 6px; } }

/* Platzhalter: vor der Veröffentlichung ausfüllen oder bestätigen */
.todo { background: var(--accent); color: var(--ink); padding: 0 0.3em; font-weight: 600; }

/* Rechtsseiten: Abstand zwischen den Abschnitten enger */
.legal section { padding-bottom: 0; }
.legal .block { margin-top: clamp(40px, 5vw, 60px); }
.legal .legal-head + .legal-lede { margin-bottom: 0; }
