/* ==========================================================================
   Praxis-Webdesign Schweiz — Bento-Grid Design-System
   Warmes Editorial-Bento: Cream / Orange / Lachs / Petrol / Rost.
   Jede Seite füllt auf Desktop exakt einen Screen (100svh).
   ========================================================================== */

/* ---------- Fonts (selbst gehostet, nDSG/DSGVO-konform) ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/fraunces-var-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-500-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --paper: #f1e8d8;        /* Seitenhintergrund */
  --cream: #fbf4e6;        /* helle Kachel */
  --cream-soft: #f7efdf;
  --orange: #f0af62;
  --salmon: #f3bca6;
  --salmon-soft: #f6c9b6;
  --rust: #bd4015; /* dunkel genug für weissen Kleintext (≥4.5:1) */
  --rust-text: #a83a13; /* Text-taugliche Stufe (≥4.5:1 auf Cream) */
  --teal: #12404a;
  --teal-deep: #0e343d;
  --mint: #e8f2f4;         /* Referenz Zahnarztpraxis */
  --night: #0b0b0d;        /* Referenz Urban Revolution */
  --ink: #17343b;
  --ink-soft: rgba(23, 52, 59, 0.74);
  --on-dark: #fbf1e2;
  --on-dark-soft: rgba(251, 241, 226, 0.78);
  --on-rust: #fff9f2;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Poppins", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  --radius: clamp(18px, 1.8vw, 26px);
  --gap: clamp(12px, 1.2vw, 20px);
  --pad: clamp(12px, 1.4vw, 20px);
  --tile-pad: clamp(20px, 2.2vw, 40px);

  --shadow-hover: 0 20px 44px rgba(23, 52, 59, 0.16);
  --ease-out: cubic-bezier(0.22, 0.68, 0.3, 1);
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(0.9rem, 0.82rem + 0.35vw, 1.02rem);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  min-height: 100svh;
  padding: var(--pad);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

/* Sanfte Seitenwechsel (progressive enhancement) */
@view-transition {
  navigation: auto;
}
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.24s;
  }
}

/* ---------- A11y-Helfer ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--teal);
  color: var(--on-dark);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus {
  left: 12px;
}

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

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

/* ==========================================================================
   Seiten-Grid — ein Screen pro Seite (Desktop)
   ========================================================================== */
.page {
  display: grid;
  gap: var(--gap);
  height: calc(100svh - 2 * var(--pad));
}

/* Home */
.page--home {
  grid-template-columns: 1.02fr 1fr 1.02fr 1.02fr;
  grid-template-rows: 1.06fr 1fr;
}
.page--home .tile--rail    { grid-row: 1 / 3; }
.page--home .tile--wide    { grid-column: 3 / 5; }

/* Über uns */
.page--about {
  grid-template-columns: 1.02fr 0.92fr 1.1fr 0.96fr;
  grid-template-rows: 1.12fr 1fr;
}
.page--about .tile--rail      { grid-row: 1 / 3; }
.page--about .tile--statement { grid-column: 2 / 4; }
.page--about .tile--values    { grid-column: 3 / 5; }

/* Leistungen — Rail + drei Pakete oben, Versprechen und Vergleich unten */
.page--services {
  grid-template-columns: 1.02fr 1fr 1fr 1fr;
  grid-template-rows: 1.2fr 1fr;
}
.page--services .tile--rail  { grid-row: 1 / 3; }
.page--services .tile--versprechen { grid-column: 2 / 4; }

/* Referenzen */
.page--work {
  grid-template-columns: 1.02fr 1fr 1.02fr 1fr;
  grid-template-rows: 1.05fr 1fr;
}
.page--work .tile--rail { grid-row: 1 / 3; }
.page--work .tile--ur   { grid-column: 2 / 5; }
.page--work .tile--zahn { grid-column: 2 / 4; }

/* Termin */
.page--contact {
  grid-template-columns: 1.02fr 1.55fr 1fr;
  grid-template-rows: 1fr;
}

/* Rechtsseiten (Impressum, Datenschutz) — Rail + scrollender Fliesstext */
.page--legal {
  grid-template-columns: 1.02fr 2.5fr;
  grid-template-rows: 1fr;
}

/* ==========================================================================
   Kacheln
   ========================================================================== */
.tile {
  position: relative;
  border-radius: var(--radius);
  padding: var(--tile-pad);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  /* Kachel als Grössen-Kontext: Titel skalieren mit der Kachel, nicht dem
     Viewport — sonst läuft ein langes Wort in einer schmalen Kachel in den Pfeil. */
  container-type: inline-size;
}

.tile--cream  { background: var(--cream); }
.tile--orange { background: var(--orange); }
.tile--salmon { background: var(--salmon); }
.tile--rust   { background: var(--rust); color: var(--on-rust); }
.tile--teal   { background: var(--teal); color: var(--on-dark); }
.tile--night  { background: var(--night); color: var(--on-dark); }
.tile--mint   { background: var(--mint); }

/* Einstiegs-Animation (rein CSS, ohne JS sicher).
   fill-mode backwards statt forwards: nach Animationsende gilt wieder das
   normale CSS, sonst überschreibt der Keyframe-Fill den :hover-Transform. */
@media (prefers-reduced-motion: no-preference) {
  .tile {
    animation: tile-in 0.62s var(--ease-out) backwards;
  }
  .tile:nth-child(1) { animation-delay: 0.02s; }
  .tile:nth-child(2) { animation-delay: 0.08s; }
  .tile:nth-child(3) { animation-delay: 0.14s; }
  .tile:nth-child(4) { animation-delay: 0.2s; }
  .tile:nth-child(5) { animation-delay: 0.26s; }
  .tile:nth-child(6) { animation-delay: 0.32s; }
  .tile:nth-child(7) { animation-delay: 0.38s; }
}
@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* Klickbare Kacheln (Home) */
a.tile {
  text-decoration: none;
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
  will-change: transform;
}
a.tile:hover,
a.tile:focus-visible {
  transform: translateY(-7px);
  box-shadow: var(--shadow-hover);
}
a.tile:active {
  transform: translateY(-2px) scale(0.99);
}
a.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(23, 52, 59, 0.05);
  opacity: 0;
  transition: opacity 0.28s var(--ease-out);
  pointer-events: none;
}
a.tile:hover::after {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  a.tile,
  a.tile::after {
    transition: none;
  }
  a.tile:hover {
    transform: none;
    box-shadow: var(--shadow-hover);
  }
}

/* Pfeil, der beim Hover einschwebt */
.tile-arrow {
  position: absolute;
  right: var(--tile-pad);
  bottom: var(--tile-pad);
  width: clamp(30px, 2.6vw, 40px);
  height: clamp(30px, 2.6vw, 40px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  opacity: 0.45; /* im Ruhezustand sichtbar: Klick-Affordanz auch auf Touch */
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
}
.tile-arrow svg {
  width: 45%;
  height: 45%;
}
a.tile:hover .tile-arrow,
a.tile:focus-visible .tile-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}
/* Der Pfeil sitzt unten rechts — die unterste Textzeile hält den Platz frei */
a.tile .tile-title,
a.tile .tile-h,
a.tile .price-sub {
  padding-right: clamp(2.8rem, 3.6vw, 3.8rem);
}
@media (prefers-reduced-motion: reduce) {
  .tile-arrow {
    transition: none;
    transform: none;
  }
  /* Seitenwechsel ohne Crossfade, Anker ohne Smooth-Scroll */
  html {
    scroll-behavior: auto;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* ---------- Kachel-Inhalte ---------- */
.tile-title {
  font-family: var(--font-display);
  font-weight: 360;
  font-optical-sizing: auto;
  font-size: clamp(1.8rem, 13cqi, 2.95rem);
  line-height: 1.04;
  letter-spacing: 0.005em;
  margin-top: auto;
}

.tile-kicker {
  font-weight: 600;
  font-size: clamp(0.68rem, 0.75vw, 0.78rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: 0.6rem;
}
.tile--rust .tile-kicker {
  opacity: 1; /* Kleintext auf Rost braucht vollen Kontrast */
}

.tile-copy {
  color: var(--ink-soft);
  max-width: 46ch;
}
.tile--teal .tile-copy,
.tile--night .tile-copy {
  color: var(--on-dark-soft);
}
.tile--rust .tile-copy {
  color: var(--on-rust);
  opacity: 0.92;
}
.tile--salmon .tile-copy,
.tile--orange .tile-copy {
  color: rgba(23, 52, 59, 0.92);
}

/* ---------- Rail (linke hohe Kachel) ---------- */
.tile--rail .brand {
  font-weight: 600;
  font-size: clamp(0.95rem, 1.05vw, 1.1rem);
  letter-spacing: 0.01em;
  text-decoration: none;
  line-height: 1.35;
}
.tile--rail .rail-title {
  font-family: var(--font-display);
  font-weight: 360;
  font-size: clamp(2.3rem, 1.2rem + 2.6vw, 3.6rem);
  line-height: 1.02;
  margin-top: clamp(1.6rem, 4vh, 3.2rem);
}
.tile--rail .rail-copy {
  margin-top: auto;
  padding-top: 1.2rem;
  max-width: 34ch;
}
.tile--rail .rail-cta {
  margin-top: clamp(1rem, 2.6vh, 1.8rem);
}
.rail-foot {
  margin-top: clamp(0.9rem, 2.4vh, 1.6rem);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(23, 52, 59, 0.8);
}
.rail-foot a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rail-foot a:hover {
  text-decoration-thickness: 2px;
}
.tile--teal .rail-foot {
  color: rgba(251, 241, 226, 0.85);
}
.tile--rust .rail-foot {
  color: rgba(255, 255, 255, 0.95);
}

/* ---------- Button (Pill) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  align-self: flex-start;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.62rem 1.35rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.22s var(--ease-out), color 0.22s var(--ease-out),
    transform 0.22s var(--ease-out);
}
.btn:hover,
.btn:focus-visible {
  background: var(--ink);
  color: var(--cream);
  transform: translateY(-2px);
}
.btn .btn-dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--rust);
  transition: background 0.22s var(--ease-out);
}
.btn:hover .btn-dot,
.btn:focus-visible .btn-dot {
  background: var(--orange);
}
.btn--light {
  color: var(--on-dark);
  border-color: var(--on-dark);
}
.btn--light:hover,
.btn--light:focus-visible {
  background: var(--on-dark);
  color: var(--teal);
}
.btn--solid {
  background: var(--ink);
  color: var(--cream);
}
.btn--solid:hover,
.btn--solid:focus-visible {
  background: var(--teal-deep);
  color: var(--on-dark);
}

/* ---------- Logo (P ⊞ W) ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.logo-letter {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.7rem, 2vw, 2.3rem);
  line-height: 1;
}
.logo-glyph {
  width: clamp(1.9rem, 2.2vw, 2.5rem);
  height: clamp(1.9rem, 2.2vw, 2.5rem);
  opacity: 0.9;
}
.tile .logo--corner {
  position: absolute;
  top: var(--tile-pad);
  right: var(--tile-pad);
}

/* ---------- Pills (Leistungslisten) ---------- */
.pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.55rem;
  margin-top: clamp(0.8rem, 1.8vh, 1.3rem);
}
.pills li {
  background: var(--salmon);
  color: var(--ink);
  font-weight: 500;
  font-size: clamp(0.78rem, 0.85vw, 0.92rem);
  padding: 0.38rem 0.85rem;
  border-radius: 10px;
  white-space: nowrap;
}
/* CSS-Häkchen (die Font-Subsets enthalten kein ✓-Glyph) */
.pills--check li {
  display: inline-flex;
  align-items: center;
}
.pills--check li::before {
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.3em;
  border-left: 2px solid var(--rust-text);
  border-bottom: 2px solid var(--rust-text);
  transform: rotate(-45deg) translateY(-15%);
  margin-right: 0.5rem;
}
.pills--cream li {
  background: var(--cream);
}

.tile-h {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(1.7rem, 1rem + 1.7vw, 2.7rem);
  line-height: 1.05;
  margin-bottom: 0.55rem;
}

/* ==========================================================================
   Navigation (Punkte-Button + Overlay oben rechts)
   ========================================================================== */
.nav-toggle {
  position: fixed;
  z-index: 60;
  top: calc(var(--pad) + clamp(12px, 1.4vw, 22px));
  right: calc(var(--pad) + clamp(12px, 1.4vw, 22px));
  width: clamp(46px, 4vw, 56px);
  height: clamp(46px, 4vw, 56px);
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: var(--on-dark);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(14, 52, 61, 0.25);
  transition: transform 0.22s var(--ease-out), background 0.22s var(--ease-out);
}
.nav-toggle:hover {
  transform: scale(1.07);
  background: var(--teal-deep);
}
.nav-toggle svg {
  width: 40%;
  height: 40%;
}
.nav-toggle .icon-close {
  display: none;
}
.nav-toggle[aria-expanded="true"] .icon-dots {
  display: none;
}
.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(23, 52, 59, 0.18);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.nav-overlay.is-open {
  display: block;
}
.nav-panel {
  position: absolute;
  top: calc(var(--pad) + 6px);
  right: calc(var(--pad) + 6px);
  background: var(--teal);
  color: var(--on-dark);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 3vw, 2.8rem) clamp(2rem, 3.4vw, 3.2rem);
  padding-right: clamp(4.5rem, 6vw, 6rem);
  box-shadow: 0 24px 60px rgba(10, 35, 42, 0.35);
  transform-origin: top right;
}
@media (prefers-reduced-motion: no-preference) {
  .nav-overlay.is-open .nav-panel {
    animation: nav-pop 0.24s var(--ease-out);
  }
}
@keyframes nav-pop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}
.nav-panel ul {
  list-style: none;
}
.nav-panel a {
  display: block;
  font-weight: 500;
  font-size: clamp(1.5rem, 2.3vw, 2.05rem);
  line-height: 1.65;
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s var(--ease-out);
}
.nav-panel a:hover,
.nav-panel a:focus-visible {
  color: var(--salmon);
  transform: translateX(6px);
}
.nav-panel a[aria-current="page"] {
  color: var(--salmon);
}

/* ==========================================================================
   Home-spezifisch
   ========================================================================== */
.price-figure {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 1rem + 1.9vw, 3.1rem);
  line-height: 1;
  margin-top: auto;
  white-space: nowrap;
}
.price-sub {
  margin-top: 0.5rem;
  color: var(--on-dark-soft);
  font-size: clamp(0.82rem, 0.9vw, 0.95rem);
}
.price-strike {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--salmon);
  white-space: nowrap;
}

/* Referenz-Kachel (Home): Dot-Sphere-Kunst */
.tile--art {
  justify-content: flex-end;
}
.tile--art .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.tile--art .tile-title,
.tile--art .tile-kicker {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Über uns
   ========================================================================== */
.statement {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(1.25rem, 0.85rem + 1.25vw, 2.05rem);
  line-height: 1.38;
  max-width: 32em;
  color: var(--teal);
}
.statement em {
  font-style: normal;
  color: var(--rust-text);
}
.statement-foot {
  margin-top: auto;
  padding-top: 1rem;
  font-weight: 600;
  font-size: clamp(0.8rem, 0.9vw, 0.95rem);
}

.portrait {
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 0.3rem;
}
.portrait-circle {
  width: clamp(88px, 9vw, 128px);
  height: clamp(88px, 9vw, 128px);
  border-radius: 50%;
  background: var(--cream);
  color: var(--rust);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  letter-spacing: 0.02em;
  margin-bottom: clamp(0.7rem, 1.6vh, 1.2rem);
  border: 1.5px solid rgba(23, 52, 59, 0.18);
}
.portrait-name {
  font-weight: 600;
  font-size: clamp(1rem, 1.15vw, 1.2rem);
}
.portrait-role {
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: 0.55rem;
}
.portrait .tile-copy {
  font-size: clamp(0.82rem, 0.9vw, 0.95rem);
  max-width: 30ch;
}

.tile--audience {
  justify-content: center;
  text-align: center;
  align-items: center;
}
.tile--audience p {
  font-weight: 500;
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  max-width: 24ch;
}

.values {
  text-align: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.values-kicker {
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
/* Desktop: editoriales Dreispalten-Band statt Einspalten-Stack */
.values dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: center;
  align-items: start;
  flex: 1;
  gap: clamp(0.8rem, 1.6vw, 1.6rem);
}
.values dt {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(1.2rem, 1.5vw, 1.65rem);
  color: var(--teal);
}
.values dd {
  color: var(--ink-soft);
  font-size: clamp(0.8rem, 0.9vw, 0.94rem);
  max-width: 52ch;
  margin: 0.1rem auto 0;
}

/* ==========================================================================
   Leistungen
   ========================================================================== */
.tile--versprechen {
  justify-content: center;
}

/* ---------- Preis-Pakete ---------- */
.pack {
  gap: 0;
}
.pack-name {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(1.15rem, 0.9rem + 0.7vw, 1.6rem);
  line-height: 1.1;
}
.pack-price {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 0.95rem + 1.15vw, 2.1rem);
  line-height: 1.05;
  margin-top: 0.15rem;
  white-space: nowrap;
}
.pack-for {
  font-size: clamp(0.74rem, 0.7rem + 0.14vw, 0.84rem);
  line-height: 1.35;
  opacity: 0.8;
  margin-top: 0.4rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 22%, transparent);
}
.pack ul {
  list-style: none;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.pack li {
  position: relative;
  padding-left: 1.05rem;
  font-size: clamp(0.76rem, 0.72rem + 0.16vw, 0.88rem);
  line-height: 1.35;
}
/* CSS-Häkchen — die Font-Subsets enthalten kein ✓-Glyph */
.pack li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.34em;
  width: 0.45em;
  height: 0.24em;
  border-left: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.75;
}
.pack li.pack-base::before {
  /* „Alles aus …“ trägt einen Pfeil statt eines Hakens */
  content: "";
  border: none;
  border-top: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  width: 0.34em;
  height: 0.34em;
  top: 0.4em;
  transform: rotate(45deg);
}
.pack-badge {
  position: absolute;
  top: var(--tile-pad);
  right: var(--tile-pad);
  font-weight: 600;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.52rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
}
/* Preis der hervorgehobenen Karte hält Abstand zum Badge */
.pack--featured .pack-name,
.pack--featured .pack-price {
  padding-right: 5rem;
}
/* Das empfohlene Paket steht optisch vorn */
.pack--featured {
  box-shadow: 0 14px 34px rgba(23, 52, 59, 0.14);
}
.pack-note {
  margin-top: auto;
  padding-top: 0.7rem;
  font-size: 0.72rem;
  line-height: 1.4;
  opacity: 0.75;
}

/* Eigener CTA je Paket — füllt den Fuss und verkürzt den Weg zur Anfrage */
.pack-cta {
  margin-top: auto;
  padding-top: 1rem;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  font-size: clamp(0.78rem, 0.74rem + 0.14vw, 0.88rem);
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 1px;
  transition: gap 0.22s var(--ease-out), opacity 0.22s var(--ease-out);
}
.pack-cta svg {
  width: 0.75em;
  height: 0.75em;
  flex: none;
}
.pack-cta:hover,
.pack-cta:focus-visible {
  gap: 0.65rem;
  opacity: 0.78;
}
@media (prefers-reduced-motion: reduce) {
  .pack-cta {
    transition: none;
  }
}

/* Letzte Paket-Kachel liegt unter dem fixen Menü-Button */
.pack--last .pack-name,
.pack--last .pack-price,
.pack--last .pack-for {
  padding-right: clamp(2.6rem, 3.6vw, 3.4rem);
}

.compare {
  gap: 0.2rem;
}
.compare-body {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
/* Begründung des Preisunterschieds */
.compare-why {
  margin-top: clamp(0.6rem, 1.6vh, 1rem);
  padding-top: clamp(0.5rem, 1.4vh, 0.9rem);
  border-top: 1px solid rgba(23, 52, 59, 0.16);
  font-size: clamp(0.74rem, 0.7rem + 0.14vw, 0.84rem);
  line-height: 1.45;
  color: var(--ink-soft);
}
.compare-why strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

/* Flache Laptop-Screens (z. B. 1280×720): Vergleichs-Kachel kompakter setzen,
   sonst wird die Begründung von der Kachelkante abgeschnitten. */
@media (min-width: 961px) and (max-height: 860px) {
  .compare-agency {
    font-size: clamp(1.05rem, 1.25vw, 1.45rem);
    margin-bottom: clamp(0.3rem, 0.9vh, 0.6rem);
  }
  .compare-ours {
    font-size: clamp(1.75rem, 2vw, 2.5rem);
  }
  .compare-why {
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    font-size: 0.73rem;
    line-height: 1.4;
  }
  .compare .tile-kicker {
    margin-bottom: 0.35rem;
  }
}
.compare-label {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.compare-agency {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(1.3rem, 1.6vw, 1.9rem);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--rust);
  color: var(--ink-soft);
  margin-bottom: clamp(0.5rem, 1.6vh, 1.1rem);
}
.compare-ours {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(2.2rem, 1.2rem + 2.1vw, 3.4rem);
  line-height: 1;
  color: var(--rust);
  white-space: nowrap;
}

.tile--deco {
  padding: 0;
}
.tile--deco svg {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Referenzen
   ========================================================================== */
.ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  margin-bottom: 1rem;
}
.ref-badge::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: #4ade80;
}
.tile--mint .ref-badge::before {
  background: #16a34a;
}

/* Marken-Glow der Urban-Revolution-Kachel (Thermal-Verlauf der Referenz) */
.tile--ur::before {
  content: "";
  position: absolute;
  right: -12%;
  top: -35%;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(143, 150, 232, 0.45),
    rgba(18, 163, 122, 0.26) 45%,
    rgba(126, 220, 46, 0.08) 62%,
    transparent 72%
  );
  filter: blur(14px);
  pointer-events: none;
}
.tile--ur > * {
  position: relative;
}

.ref-name {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(1.9rem, 1.1rem + 2vw, 3rem);
  line-height: 1.05;
}
.tile--ur .ref-name {
  background: linear-gradient(92deg, #8f96e8, #12a37a 55%, #7edc2e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}
.ref-meta {
  margin-top: 0.4rem;
  margin-bottom: clamp(0.7rem, 1.8vh, 1.2rem);
  max-width: 52ch;
}
.ref-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tile--next {
  justify-content: flex-end;
}
.tile--next .tile-h {
  color: var(--on-rust);
}

/* Zahnarztpraxis-Kachel: Ellipsen-Motiv als Visual-Echo (rechts verankert) */
.tile--zahn .art {
  position: absolute;
  right: -6%;
  top: -22%;
  width: 52%;
  pointer-events: none;
}
.tile--zahn > * {
  position: relative;
}

/* Pfeil in Buttons (SVG statt ↗-Glyphe — fehlt im Font-Subset) */
.btn .btn-arrow {
  width: 0.8em;
  height: 0.8em;
  flex: none;
}

/* ==========================================================================
   Termin
   ========================================================================== */
.form-tile {
  justify-content: center;
}
.form-grid {
  display: grid;
  gap: clamp(0.65rem, 1.6vh, 1.1rem);
}
.form-grid label {
  font-weight: 600;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.3rem;
}
.req {
  color: var(--rust-text);
}
.form-grid input,
.form-grid textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fffdf8;
  border: 1.5px solid rgba(23, 52, 59, 0.22);
  border-radius: 14px;
  padding: 0.6rem 0.9rem;
  transition: border-color 0.18s ease;
}
.form-grid input:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(18, 64, 74, 0.14);
}
.form-grid textarea {
  resize: none;
  min-height: clamp(70px, 14vh, 150px);
}
.form-note {
  font-size: 0.76rem;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-top: clamp(0.6rem, 1.4vh, 1rem);
}
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: clamp(0.5rem, 1.2vh, 0.9rem);
}
.form-alt {
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.form-alt a {
  font-weight: 500;
  color: var(--teal);
}

/* Schaltfläche, die wie ein Link aussieht (Kopier-Möglichkeit im Formular) */
.linkbtn {
  font: inherit;
  color: var(--teal);
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linkbtn:hover {
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   Rechtstexte (Impressum, Datenschutz)
   ========================================================================== */
.legal-body {
  /* scroll statt auto: die Leiste bleibt sichtbar und zeigt, dass Text folgt */
  overflow-y: scroll;
  overscroll-behavior: contain;
  padding-right: clamp(0.5rem, 1.2vw, 1.2rem);
  padding-bottom: calc(var(--tile-pad) + 2.4rem);
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 52, 59, 0.32) rgba(23, 52, 59, 0.08);
  /* weicher Auslauf am unteren Rand als zweiter Scroll-Hinweis */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.6rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 2.6rem), transparent);
}
.legal-body::-webkit-scrollbar {
  width: 9px;
}
.legal-body::-webkit-scrollbar-track {
  background: rgba(23, 52, 59, 0.08);
  border-radius: 99px;
}
.legal-body::-webkit-scrollbar-thumb {
  background: rgba(23, 52, 59, 0.3);
  border-radius: 99px;
}
.legal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(23, 52, 59, 0.45);
}
/* Fokus-Ring innen führen, damit er an der Kachelkante nicht abgeschnitten wird */
.legal-body:focus-visible {
  outline-offset: -4px;
}

.legal-lead {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(1.1rem, 0.8rem + 0.9vw, 1.55rem);
  line-height: 1.4;
  color: var(--teal);
  margin-bottom: clamp(1.2rem, 3vh, 2rem);
  max-width: 44ch;
}

.legal-body h2 {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.35rem);
  line-height: 1.2;
  color: var(--teal);
  margin-top: clamp(1.3rem, 3vh, 2rem);
  margin-bottom: 0.4rem;
}
.legal-body h2:first-of-type {
  margin-top: 0;
}
.legal-body h3 {
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 1rem;
  margin-bottom: 0.2rem;
}
.legal-body p,
.legal-body li {
  color: var(--ink-soft);
  font-size: clamp(0.85rem, 0.8rem + 0.15vw, 0.95rem);
  max-width: 68ch;
}
.legal-body p + p {
  margin-top: 0.6rem;
}
.legal-body ul {
  margin: 0.4rem 0 0 1.1rem;
}
.legal-body li + li {
  margin-top: 0.25rem;
}
.legal-body a {
  color: var(--teal);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-body strong {
  color: var(--ink);
  font-weight: 600;
}
.legal-updated {
  margin-top: clamp(1.5rem, 3.5vh, 2.4rem);
  padding-top: 0.9rem;
  border-top: 1px solid rgba(23, 52, 59, 0.16);
  font-size: 0.78rem;
}

/* Auszufüllende Angaben sichtbar markieren */
.legal-todo {
  background: var(--salmon);
  color: var(--ink);
  font-weight: 500;
  padding: 0.05em 0.4em;
  border-radius: 5px;
}

/* Buchstaben-Muster-Kachel */
.tile--pattern {
  padding: clamp(10px, 1vw, 18px);
  background: var(--salmon);
}
.pattern-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.2rem, 1fr));
  grid-auto-rows: 1fr;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  color: var(--ink);
}
.pattern-grid span {
  font-size: 1.05rem;
  line-height: 1;
}
.pattern-grid .g-serif {
  font-family: var(--font-display);
  font-weight: 500;
}
.pattern-grid .g-sans {
  font-weight: 600;
}
.pattern-grid .g-dim {
  opacity: 0.38;
}
.pattern-grid .g-faint {
  opacity: 0.16;
}
/* Ohne JS: grosses Logo statt Muster */
.pattern-grid:empty {
  display: grid;
  place-items: center;
}
.pattern-grid:empty::before {
  content: "P · W";
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

/* ==========================================================================
   Responsive — Tablet & Mobile: gestapelt, natürlicher Scroll
   ========================================================================== */
@media (max-width: 960px), (max-height: 600px) {
  .page,
  .page--home,
  .page--about,
  .page--services,
  .page--work,
  .page--contact,
  .page--legal {
    height: auto;
    min-height: calc(100svh - 2 * var(--pad));
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .page > * {
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .tile {
    min-height: 150px;
  }
  .tile--rail {
    min-height: auto;
  }
  .tile--rail .rail-copy {
    margin-top: clamp(1.6rem, 5vh, 3rem);
  }
  .tile-title {
    margin-top: 2.2rem;
  }
  .tile--deco {
    min-height: 180px;
    max-height: 220px;
  }
  .tile--art {
    min-height: 220px;
  }
  .tile--pattern {
    min-height: 220px;
    max-height: 260px;
  }
  .values dl {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.8rem 0;
  }
  .tile--zahn .art {
    width: 70%;
    top: -12%;
  }
  .form-grid textarea {
    min-height: 110px;
  }
  /* Rechtstexte: auf Mobile natürlich scrollen statt im Container */
  .legal-body {
    overflow-y: visible;
    padding-right: var(--tile-pad);
    padding-bottom: var(--tile-pad);
    -webkit-mask-image: none;
    mask-image: none;
  }
  .nav-panel {
    right: calc(var(--pad) + 2px);
    left: calc(var(--pad) + 2px);
    padding-right: clamp(2rem, 3.4vw, 3.2rem);
  }
}

/* Sehr kleine Screens */
@media (max-width: 420px) {
  :root {
    --tile-pad: 18px;
  }
  .pills li {
    white-space: normal;
  }
}
