/* ==========================================================================
   LENDOLINO – responsive.css
   style.css beschreibt das Smartphone-Layout. Hier kommen die größeren
   Bildschirme dazu:

     600px   große Smartphones, kleine Tablets
     760px   Tablets
     960px   Laptops – ab hier Desktop-Navigation und zweispaltige Layouts
     1280px  Desktop
     1800px  Ultrawide
   ========================================================================== */

/* --- sehr schmale Geräte --------------------------------------------------- */

@media (max-width: 359px) {
  :root {
    --gutter: 16px;
  }

  .logo__word {
    letter-spacing: 0.14em;
  }

  .stack__techs {
    grid-template-columns: 1fr;
  }
}

/* --- ab 600px -------------------------------------------------------------- */

@media (min-width: 600px) {
  .hero__actions .btn {
    flex: 0 0 auto;
  }

  .form__row {
    grid-template-columns: 1fr 1fr;
  }

  .form__actions {
    grid-template-columns: auto 1fr;
    gap: 22px;
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }

  .system__stage {
    aspect-ratio: 16 / 7;
  }
}

/* --- ab 760px -------------------------------------------------------------- */

@media (min-width: 760px) {
  :root {
    --header-h: 76px;
    --core-size: min(64vw, 500px);
  }

  .section-head {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 48px;
    align-items: end;
  }

  .section-head--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .core-chips {
    display: block;
  }

  /* Solange der Kern über der Headline steht, rückt das untere Fragment höher. */
  .code-chip--c {
    right: -6%;
    bottom: 26%;
  }

  .svc-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .system__tab {
    min-height: 62px;
    font-size: 1.0625rem;
  }

  .stack__row {
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
    gap: 32px;
    padding: 32px 0;
  }

  .fact {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 32px;
  }

  .principle {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 32px;
  }

  .faq {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }

  /* Unterseiten: Der Kern sitzt als Akzent oben rechts. Die Überschrift
     bricht früher um und bleibt links davon frei. */
  .page-head {
    --core-x: 86%;
    --core-y: 22%;
    --core-size: min(44vw, 400px);
  }

  .page-head:not(.page-head--plain) h1 {
    max-width: 10em;
  }
}

/* --- ab 960px: Desktop-Navigation, zweispaltige Layouts -------------------- */

@media (min-width: 960px) {
  :root {
    --core-x: 73%;
    --core-x-vw: 73vw;                 /* derselbe Wert wie --core-x, zum Rechnen */
    --core-y: 50%;
    --core-size: min(47vw, 80vh, 720px);

    /* Abstand des Seiteninhalts vom linken Fensterrand */
    --page-left: max(var(--gutter), (100vw - var(--container)) / 2);
  }

  /* Navigation in der Kopfzeile */
  .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    margin-left: auto;
    padding: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    transition: none;
  }

  .site-nav__list {
    display: flex;
    gap: 2px;
  }

  .site-nav__list a {
    position: relative;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--r-pill);
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1;
    opacity: 1;
    transform: none;
    transition: color 0.25s;
  }

  .site-nav__list a:hover {
    color: var(--text);
  }

  .site-nav__list a[aria-current="page"] {
    color: var(--text);
  }

  /* Leuchtpunkt unter der aktiven Seite */
  .site-nav__list a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
  }

  .site-nav__extra,
  .nav-toggle {
    display: none;
  }

  .site-header .site-header__cta {
    display: inline-flex;
  }

  .site-header__inner {
    gap: 20px;
  }

  /* Hero: Text links, Kern rechts.
     --text-max ist der Platz von der linken Kante des Inhalts bis zum Kern.
     Reicht er für die volle Schriftgröße nicht aus, wird die Headline
     kleiner, statt in das 3D-Objekt zu laufen. */
  .hero {
    --text-max: calc(var(--core-x-vw) - var(--core-size) * 0.3 - var(--page-left) - 12px);
    align-items: center;
    min-height: max(100vh, 700px);
    min-height: max(100svh, 700px);
    padding: calc(var(--header-h) + 48px) 0 72px;
  }

  .hero__visual::after {
    height: 26%;
  }

  .hero__title {
    max-width: 9.7em;
    font-size: min(var(--fs-h1), var(--text-max) / 8.4);
  }

  .code-chip--c {
    right: 6%;
    bottom: 9%;
  }

  .hero__lead {
    max-width: min(30em, var(--text-max));
  }

  .hero__place {
    max-width: min(30em, var(--text-max));
  }

  /* Leistungskarten: Text links, Szene rechts */
  .svc-card {
    grid-template-columns: minmax(0, 1fr) 270px;
    align-items: stretch;
  }

  .svc-card__body {
    padding: 36px 0 36px 36px;
  }

  .svc-scene {
    order: 0;
    height: auto;
    min-height: 300px;
  }

  .svc-scene__stage {
    scale: 1.06;
  }

  /* Warum Lendolino? */
  .why {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 72px;
  }

  .why__intro {
    position: sticky;
    top: calc(var(--header-h) + 40px);
  }

  .why__item {
    grid-template-columns: 52px 1fr;
    gap: 6px 24px;
    padding: 30px 0;
  }

  .why__icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
  }

  /* Systemansicht */
  .system__stage {
    aspect-ratio: 21 / 8;
  }

  .system__tabs {
    gap: 16px;
  }

  /* Prozess: fünf Schritte nebeneinander auf einer Linie */
  .process {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 28px;
  }

  .process::before,
  .process::after {
    left: 0;
    right: 0;
    top: 26px;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .process::after {
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    transform: scaleX(var(--progress, 0));
    transform-origin: left;
  }

  .process__step {
    grid-template-columns: 1fr;
    gap: 12px;
    align-content: start;
    padding-bottom: 0;
  }

  /* Zwei Zeilen Platz, damit die Texte aller Schritte auf einer Höhe beginnen */
  .process__step h3 {
    align-self: start;
    min-height: 2.4em;
  }

  .process__num {
    grid-row: auto;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    font-size: 1rem;
  }

  .process__step p {
    grid-column: 1;
  }

  /* Region */
  .region {
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    gap: 72px;
  }

  /* Leistungen-Seite */
  .service {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 72px;
  }

  .service__intro {
    position: sticky;
    top: calc(var(--header-h) + 84px);
  }

  .service__visual {
    height: 280px;
  }

  /* Über mich & Kontakt */
  .about {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 72px;
    align-items: start;
  }

  .id-card {
    position: sticky;
    top: calc(var(--header-h) + 40px);
    min-height: 380px;
  }

  .contact {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
    align-items: start;
  }

  .contact__aside {
    position: sticky;
    top: calc(var(--header-h) + 40px);
  }

  .contact__block {
    grid-template-columns: 52px 1fr;
    gap: 4px 18px;
  }

  /* Unterseiten: Text links, Kern rechts. --text-max ist der Platz von der
     linken Kante des Inhalts bis kurz vor den Kern. So läuft bei keiner
     Fensterbreite eine Zeile in das 3D-Objekt. */
  .page-head {
    --core-x: 84%;
    --core-x-vw: 84vw;
    --core-y: 50%;
    --core-size: clamp(320px, 33vw, 520px);
    --text-max: calc(var(--core-x-vw) - var(--core-size) * 0.47 - var(--page-left) - 16px);
  }

  .page-head:not(.page-head--plain) h1 {
    max-width: min(13em, var(--text-max));
  }

  .page-head:not(.page-head--plain) .lead {
    max-width: min(38em, var(--text-max));
  }

  .notfound {
    --core-x: 74%;
    --core-x-vw: 74vw;
    --core-y: 50%;
    --core-size: min(46vw, 640px);
    --text-max: calc(var(--core-x-vw) - var(--core-size) * 0.22 - var(--page-left) - 16px);
  }

  .notfound h1 {
    max-width: var(--text-max);
  }

  .notfound p {
    max-width: min(44ch, var(--text-max));
  }

  /* Footer */
  .site-footer__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 2fr) minmax(0, 2.5fr) minmax(0, 3fr);
    gap: 48px;
  }

  .site-footer__brand {
    grid-column: auto;
  }
}

/* --- ab 1280px ------------------------------------------------------------- */

@media (min-width: 1280px) {
  .svc-card {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .svc-card__body {
    padding: 44px 0 44px 44px;
  }

  /* Vier Kacheln in einer Reihe. Kommen weitere Technologien dazu, brechen
     sie automatisch in die nächste Reihe um. */
  .stack__techs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --- Ultrawide: mehr Raum, größere Schrift, breitere Spalte ---------------- */

@media (min-width: 1800px) {
  html {
    font-size: 112.5%;
  }

  :root {
    --container: 1480px;
    --core-x: 71%;
    --core-x-vw: 71vw;
    --core-size: min(40vw, 82vh, 900px);
  }
}

@media (min-width: 2560px) {
  html {
    font-size: 125%;
  }

  :root {
    --container: 1680px;
  }
}

/* --- niedrige Fenster (Querformat am Smartphone, kleine Laptops) ---------- */

@media (max-height: 560px) and (orientation: landscape) {
  .hero {
    min-height: 0;
    padding-top: calc(var(--header-h) + 32px);
  }

  .site-nav {
    padding-top: calc(var(--header-h) + 12px);
    gap: 16px;
  }

  .site-nav__list a {
    padding: 10px 0;
    font-size: 1.5rem;
  }
}

/* Smartphone im Querformat: wenig Höhe, aber genug Breite. Deshalb dieselbe
   Aufteilung wie am Desktop – Text links, Kern rechts –, nur kleiner. */
@media (max-height: 560px) and (orientation: landscape) and (max-width: 959px) {
  :root {
    --core-x: 77%;
    --core-x-vw: 77vw;
    --core-y: calc(var(--header-h) + (100vh - var(--header-h)) * 0.5);   /* Mitte des sichtbaren Bereichs */
    --core-size: min(42vw, 88vh);
    --page-left: var(--gutter);
  }

  .hero {
    --text-max: calc(var(--core-x-vw) - var(--core-size) * 0.3 - var(--page-left) - 12px);
    align-items: center;
    padding-top: calc(var(--header-h) + 24px);
  }

  .hero__title {
    max-width: 9.7em;
    font-size: min(var(--fs-h1), var(--text-max) / 8.4);
  }

  .hero__lead,
  .hero__place {
    max-width: var(--text-max);
  }

  .core-chips {
    display: none;
  }

  .notfound {
    --core-x: 84%;
    --core-y: 48%;
    --core-size: min(38vw, 84vh);
  }

  .notfound h1 {
    max-width: 6.5em;
  }

  .notfound p {
    max-width: 30ch;
  }
}

/* --- Zeiger ohne Hover (Touch): keine Hover-Zustände festhalten ----------- */

@media (hover: none) {
  .tech:hover {
    transform: none;
  }

  .why__item:hover::after {
    transform: scaleX(0);
  }
}

/* --- Druck ---------------------------------------------------------------- */

@media print {
  .site-header,
  .hero__visual,
  .page-head__visual,
  .cta__rings,
  .jump,
  .scene-canvas {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  h1,
  h2,
  h3,
  h4,
  p,
  li,
  address,
  .prose p,
  .prose li,
  .prose address {
    color: #000 !important;
    -webkit-text-fill-color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
