/* formare.media – Platzhalterseite */

@font-face {
  font-family: "Cabin";
  src: url("../fonts/cabin-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cabin";
  src: url("../fonts/cabin-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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 {
  /* Farben exakt aus dem Logo */
  --red: #D01116;
  --red-deep: #A60D11;
  --ink: #1D1D1B;
  --ink-soft: #5C5C58;
  --line: #E4E3DF;
  --paper: #FFFFFF;

  /* Die Ellipse aus dem Logo: rx 48.54, ry 111.35, um 66° gedreht */
  --ellipse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-103.6 -63.4 207.2 126.8'%3E%3Cellipse rx='48.54' ry='111.35' transform='rotate(66)' fill='%23D01116'/%3E%3C/svg%3E");
  --ell-w: min(78vw, 1040px, calc((100svh - 18rem) * 1.63));
  --ell-size: var(--ell-w) auto;
  /* Linke Kante der Ellipse, am Textblock ausgerichtet */
  --ell-left: calc(max(0px, (100vw - 90rem) / 2) + min(29vw, 440px));
  --ell-y: 62%;
  --hero-min: calc(var(--ell-w) / 1.634 + 1rem);

  --gutter: clamp(1rem, 5vw, 4.5rem);
  --measure: 34rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Cabin", "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

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

.wrap {
  padding-inline: var(--gutter);
  max-width: 90rem;
  margin-inline: auto;
}

/* Kopf */
.site-header { padding-block: clamp(1rem, 2.2vw, 1.75rem); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-header img { display: block; width: clamp(150px, 18vw, 220px); height: auto; }
.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-size: 1.05rem;
}
.main-nav a { text-decoration: none; }

/* Pillenform: die Ellipse des Logos als Button */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.6em 1.25em;
  border-radius: 999px;
  background: var(--red);
  color: var(--paper);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.pill:hover { background: var(--red-deep); }
.pill svg { width: 1.05em; height: 1.05em; flex: none; }
.pill .short { display: none; }

/* Erster Bildschirm: Hero und Einleitung füllen zusammen mit dem Kopf genau das Fenster */
.first-screen {
  /* Kopfhöhe = Innenabstand + Logohöhe (Seitenverhältnis 400:127) */
  --header-h: calc(2 * clamp(1rem, 2.2vw, 1.75rem) + clamp(150px, 18vw, 220px) * 0.3175);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
}

/* Hero: Text wechselt beim Eintritt in die Ellipse von Schwarz zu Weiß – wie „media“ im Logo */
.hero {
  position: relative;
  isolation: isolate;
  flex: 1;
  display: flex;
  min-height: var(--hero-min);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ellipse) no-repeat;
  background-size: var(--ell-size);
  background-position: left var(--ell-x) top var(--ell-y);
}
.hero-layer {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: 1rem 2rem;
}
.hero-layer > .wrap { width: 100%; }
.hero-layer--white {
  position: absolute;
  inset: 0;
  color: var(--paper);
  pointer-events: none;
  -webkit-mask: var(--ellipse) no-repeat;
  mask: var(--ellipse) no-repeat;
  -webkit-mask-size: var(--ell-size);
  mask-size: var(--ell-size);
  -webkit-mask-position: left var(--ell-x) top var(--ell-y);
  mask-position: left var(--ell-x) top var(--ell-y);
}

.hero h1, .hero .h1-copy {
  margin: 0;
  font-weight: 700;
  /* Obergrenze: die längste Claim-Zeile („Online-Marketing“, 7 em) passt immer in die Breite */
  font-size: min(clamp(3rem, min(10.5vw, 15svh), 9.5rem), calc((min(100vw, 90rem) - 2 * var(--gutter)) / 7.2));
  line-height: 0.92;
  letter-spacing: -0.035em;
}
.hero h1 span, .hero .h1-copy span { display: block; }
.hero .light { font-weight: 400; letter-spacing: -0.03em; }

/* Claim-Wechsel: Zeilen gleiten versetzt nach oben hinaus und von unten herein */
.claim span {
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(.2, .7, .1, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.claim.is-out span { opacity: 0; transform: translateY(-0.22em); }
.claim.is-in span { opacity: 0; transform: translateY(0.22em); transition: none; }

/* Einleitung am unteren Rand des ersten Bildschirms */
.intro-bar { padding-block: 1.25rem clamp(1.5rem, 4svh, 2.75rem); }
.intro-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 3rem;
}
.intro-bar .lead {
  margin: 0;
  max-width: 26rem;
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  line-height: 1.4;
}
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  font-weight: 700;
}
.scroll-cue .ring {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.scroll-cue svg { width: 1.25rem; height: 1.25rem; }
.scroll-cue:hover .ring { background: var(--red); border-color: var(--red); color: var(--paper); }

/* Kontakt: das Innere der Ellipse – rote Fläche, weiße Schrift */
.contact {
  background: var(--red);
  color: var(--paper);
  border-top-left-radius: 100% clamp(3rem, 9vw, 9rem);
  padding-block: clamp(6rem, 13vw, 12rem) clamp(3rem, 7vw, 6rem);
  scroll-margin-top: -4rem;
}
.contact h2 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(2.4rem, 6vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.contact .note {
  margin: clamp(1.25rem, 2.5vw, 2rem) 0 clamp(2.5rem, 5vw, 4.5rem);
  max-width: var(--measure);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
}
.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem clamp(2rem, 4vw, 4rem);
  margin: 0;
  padding-top: clamp(1.75rem, 3vw, 2.5rem);
  border-top: 1px solid rgb(255 255 255 / 0.35);
}
.contact-list div { display: grid; gap: 0.35rem; align-content: start; }
.contact-list dt { font-size: 1rem; }
.contact-list dd {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  line-height: 1.25;
  font-weight: 700;
}
.contact-list dd address { font-style: normal; }
.contact-list a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat left bottom / 0 2px;
  padding-bottom: 3px;
  transition: background-size 0.2s ease;
}
.contact-list a:hover { background-size: 100% 2px; }

/* Fuß: setzt die rote Fläche fort */
.site-footer {
  background: var(--red);
  color: var(--paper);
  font-size: 0.95rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.5rem 2rem;
}
.site-footer p { margin: 0; }
.site-footer i { font-style: italic; }
.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover,
.site-footer nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

.contact :focus-visible,
.site-footer :focus-visible { outline-color: var(--paper); }

/* Heller Button auf roter Fläche */
.pill--light { background: var(--paper); color: var(--red); }
.pill--light:hover { background: var(--ink); color: var(--paper); }
.contact-action { margin: clamp(1.75rem, 3vw, 2.5rem) 0 clamp(2.5rem, 5vw, 4.5rem); }

/* Kontakt-Pop-up: roter Kopf mit ansteigendem Bogen, abgerundete Felder */
.contact-dialog {
  width: min(40rem, 100% - 2rem);
  max-height: calc(100svh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 2rem;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 2rem 5rem rgb(29 29 27 / 0.35);
}
.contact-dialog::backdrop {
  background: rgb(29 29 27 / 0.55);
  backdrop-filter: blur(4px);
}
.dialog-head {
  position: relative;
  padding: 2rem 4.5rem 3.75rem clamp(1.5rem, 5vw, 2.5rem);
  background: var(--red);
  color: var(--paper);
  border-bottom-right-radius: 100% 3rem;
}
.dialog-head h2 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.dialog-head p { margin: 0.6rem 0 0; }
.dialog-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.dialog-close svg { width: 1.2rem; height: 1.2rem; }
.dialog-close:hover { background: var(--paper); color: var(--red); }
.dialog-close:focus-visible { outline-color: var(--paper); }

.dialog-body {
  display: grid;
  gap: 1.1rem;
  padding: 1.5rem clamp(1.5rem, 5vw, 2.5rem) 2rem;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.1rem;
}
.field { display: grid; gap: 0.4rem; font-size: 1rem; font-weight: 700; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-soft); }
.field input,
.field textarea {
  width: 100%;
  padding: 0.75rem 1.2rem;
  border: 1.5px solid #C9C8C3;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  font-size: 1.05rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea {
  min-height: 8.5rem;
  border-radius: 1.5rem;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgb(208 17 22 / 0.15);
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.privacy-note { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.privacy-note a { color: var(--red-deep); }
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem 1.5rem;
  margin-top: 0.25rem;
}
.dialog-actions .pill { border: 0; font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.dialog-actions .pill:disabled { opacity: 0.6; cursor: progress; }
.form-status { flex: 1 1 14rem; margin: 0; font-size: 0.98rem; }
.form-status:empty { display: none; }
.form-status.is-ok { color: #1E7A3C; font-weight: 700; }
.form-status.is-err { color: var(--red-deep); font-weight: 700; }

@media (prefers-reduced-motion: no-preference) {
  .contact-dialog[open] { animation: dialog-in 0.35s cubic-bezier(.2, .7, .1, 1); }
  .contact-dialog[open]::backdrop { animation: fade-in 0.35s ease; }
  @keyframes dialog-in {
    from { opacity: 0; transform: translateY(1.5rem) scale(0.97); }
  }
  @keyframes fade-in { from { opacity: 0; } }
}

/* Umrandeter Button */
.pill--outline {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.pill--outline:hover { background: var(--ink); color: var(--paper); }

/* 404: die Ellipse ist aus der Form geraten – falsch herum gekippt und herabgefallen */
@property --drop {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 50%;
}
.hero.hero--404 {
  --ellipse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-103.6 -63.4 207.2 126.8'%3E%3Cellipse rx='48.54' ry='111.35' transform='rotate(-66)' fill='%23D01116'/%3E%3C/svg%3E");
  --ell-w: min(64vw, 860px, 70svh);
  --ell-size: var(--ell-w) auto;
  --ell-left: calc(max(0px, (100vw - 90rem) / 2) + min(24vw, 360px));
  --ell-x: var(--ell-left);
  --ell-y: var(--drop);
  --hero-min: calc(var(--ell-w) / 1.634 + 2rem);
  animation: none;
}
.hero.hero--404 .hero-layer { padding-block: 0; }
.big-404 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(9rem, min(34vw, 36svh), 27rem);
  line-height: 0.8;
  letter-spacing: -0.06em;
}
.lost {
  padding-block: clamp(1rem, 2.5vw, 2rem) clamp(4rem, 9vw, 7rem);
}
.lost h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.lost p { margin: 1.25rem 0 0; max-width: var(--measure); font-size: clamp(1.1rem, 1.6vw, 1.3rem); }
.lost .actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }
@media (prefers-reduced-motion: no-preference) {
  .hero.hero--404 { animation: drop-in 1.3s cubic-bezier(.3, 0, .2, 1) both; }
  @keyframes drop-in {
    0%   { --drop: -120%; }
    55%  { --drop: 56%; }
    70%  { --drop: 44%; }
    85%  { --drop: 52%; }
    100% { --drop: 50%; }
  }
}
@media (max-width: 700px) {
  .hero.hero--404 {
    --ell-w: 100vw;
    --ell-left: 28vw;
  }
}

/* Rechtstexte */
.legal {
  max-width: 42rem;
  padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem);
  font-size: 1.05rem;
}
.legal h1 {
  margin: 0 0 2rem;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.legal h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.3rem;
  line-height: 1.3;
}
.legal h3 {
  margin: 1.75rem 0 0.4rem;
  font-size: 1.05rem;
}
.legal p, .legal ul { margin: 0 0 1rem; }
.legal a:not(.pill) { color: var(--red-deep); }
.legal .stand { margin-top: 2.5rem; color: var(--ink-soft); }
.back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.back:hover { color: var(--red); }

/* Einmaliger Auftritt: die Ellipse gleitet beim Laden an ihren Platz */
@property --ell-x {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 0px;
}
.hero { --ell-x: var(--ell-left); }
@media (prefers-reduced-motion: no-preference) {
  .hero { animation: ellipse-in 1.1s cubic-bezier(.2, .7, .1, 1) both; }
  .scroll-cue svg { animation: nudge 2.6s ease-in-out 1.6s infinite; }
  @keyframes nudge {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(5px); }
  }
  @keyframes ellipse-in {
    from { --ell-x: calc(var(--ell-left) + 50vw); }
    to { --ell-x: var(--ell-left); }
  }
}

@media (max-width: 700px) {
  :root {
    --ell-w: 118vw;
    --ell-left: calc(8vw + 6rem);
    --ell-y: 30%;
    --hero-min: 80vw;
  }
  .pill .full { display: none; }
  .pill .short { display: inline; }
  .contact { border-top-left-radius: 100% 3.5rem; }
}
