/* Navoryx: nur die Startseiten (/de, /en). Baut auf site.css auf (Farben, Schrift, Kopfleiste, Knöpfe, Fuß).
   Hier: Start mit zwei Produktfenstern, Leistungen, Produkte, Ablauf, Über mich, Kontakt und deren Bewegung.
   Nach Änderungen V in deploy/tools/build-home.py hochzählen und das Skript laufen lassen. */

/* ---------- Start ---------- */
.hero { position: relative; padding: calc(var(--bar) + clamp(40px, 5vw, 72px)) var(--side) clamp(40px, 5vw, 64px); }
.hero-copy { grid-column: 1 / 7; align-self: center; }
.hero-fig { grid-column: 7 / 13; }
.ln-2 { color: var(--t3); }
.hero .lead { max-width: 46ch; margin: 24px 0 32px; }
.hero-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hero-act .small { color: var(--t3); }
.hero-fig figcaption { margin-top: 12px; color: var(--t3); }
.credit { display: block; }

/* Zwei Browserfenster, versetzt übereinander: hinten Streamline, vorne Navoryx Hosting */
.stack { position: relative; display: block; aspect-ratio: 5 / 4; text-decoration: none; }
.win { position: absolute; width: 84%; border-radius: 12px; overflow: hidden; background: var(--ink); box-shadow: 0 0 0 1px var(--hair-2), 0 32px 64px -24px rgb(0 0 0 / .8); transition: transform .45s var(--out); }
.win img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: 0 0; }
.win-back { top: 0; right: 0; }
.win-back img { filter: brightness(.72); transition: filter .45s var(--out); }
.win-front { bottom: 0; left: 0; }
.win-bar { display: flex; align-items: center; justify-content: center; height: 26px; padding: 0 12px; background: #17181c; box-shadow: inset 0 -1px 0 var(--hair); }
.win-url { padding: 3px 12px; border-radius: 6px; background: rgb(255 255 255 / .05); color: var(--t3); font-size: 11px; line-height: 1; letter-spacing: .01em; }
.stack:hover .win-front { transform: translate(-6px, 6px); }
.stack:hover .win-back { transform: translate(6px, -6px); }
.stack:hover .win-back img { filter: brightness(.9); }
.stack:focus-visible { outline: 2px solid var(--t1); outline-offset: 6px; border-radius: 14px; }

.strip { position: relative; margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); }
.strip::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--hair-2); transform-origin: 0 50%; }
.strip > div { padding: 24px 24px 0 0; }
.strip > div + div { padding-left: 24px; box-shadow: inset 1px 0 0 var(--hair); }
.strip dt { display: flex; align-items: center; font-size: var(--small); font-weight: 600; color: var(--t1); margin-bottom: 6px; }
.strip dd { color: var(--t2); }
.strip > div:nth-child(2) dd { min-height: 4lh; }
.dot { position: relative; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--live); }
.live { font-variant-numeric: tabular-nums; }
.live b { font-weight: 600; color: var(--t1); }

@media (max-width: 999px) {
  .hero-copy, .hero-fig { grid-column: 1 / -1; }
  .hero-fig { margin-top: 40px; }
  .stack { aspect-ratio: 4 / 3; max-width: 640px; }
}
@media (max-width: 699px) {
  .hero-act .btn { width: 100%; }
  .strip { grid-template-columns: 1fr; }
  .strip > div, .strip > div + div { padding: 20px 0; box-shadow: none; }
  .strip > div + div { box-shadow: inset 0 1px 0 var(--hair); }
  .strip > div:last-child { padding-bottom: 0; }
}
/* Platz für den gemessenen Satz, damit die Zeile beim Austausch nicht springt */
@media (max-width: 989px) { .strip > div:nth-child(2) dd { min-height: 5lh; } }
@media (max-width: 839px) { .strip > div:nth-child(2) dd { min-height: 6lh; } }
@media (max-width: 799px) { .strip > div:nth-child(2) dd { min-height: 7lh; } }
@media (max-width: 699px) { .strip > div:nth-child(2) dd { min-height: 2lh; } }
@media (max-width: 519px) { .strip > div:nth-child(2) dd { min-height: 3lh; } }
@media (max-width: 359px) { .strip > div:nth-child(2) dd { min-height: 4lh; } }


.head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 12px; align-items: end; margin-bottom: 48px; }
.head h2 { grid-column: 1 / 6; }
.head p { grid-column: 7 / 13; font-size: var(--lead); line-height: 1.5; color: var(--t2); }
@media (max-width: 999px) { .head h2, .head p { grid-column: 1 / -1; } .head { margin-bottom: 36px; } }

/* Leistungen: vier Zeilen, jede auf einen Blick */
.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 12px; padding: 28px 0; box-shadow: inset 0 1px 0 var(--hair); }
.row:last-child { box-shadow: inset 0 1px 0 var(--hair), inset 0 -1px 0 var(--hair); }
.row h3 { grid-column: 1 / 4; }
.row p { grid-column: 4 / 9; }
.row ul { grid-column: 9 / 13; columns: 2; column-gap: 24px; font-size: var(--small); line-height: 1.45; color: var(--t2); }
.row li { position: relative; padding: 0 0 6px 14px; break-inside: avoid; }
.row li::before { content: ""; position: absolute; left: 0; top: .5em; width: 5px; height: 5px; background: var(--t3); }
@media (max-width: 999px) {
  .row h3 { grid-column: 1 / 5; }
  .row p, .row ul { grid-column: 5 / 13; }
}
@media (max-width: 699px) {
  .row h3, .row p, .row ul { grid-column: 1 / -1; }
  .row ul { columns: 1; }
}

/* Eigene Produkte: zwei Räume nebeneinander */
.cases { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: var(--g); }
.case { display: flex; flex-direction: column; border-radius: var(--r-frame); overflow: hidden; }
.case-streamline { background: var(--petrol); }
.case-hosting { background: var(--umber); }
.shot { position: relative; aspect-ratio: 16 / 10; overflow: clip; box-shadow: 0 1px 0 var(--hair); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: 0 0; }
.case-body { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: clamp(20px, 2.4vw, 32px); }
.case-body h3 { margin-bottom: 10px; }
.case-note { margin-top: 12px; color: var(--t3); }
.case-body .link { margin-top: auto; position: relative; }
.case-body .link::after, .direct .link::after { content: ""; position: absolute; inset: -8px 0; }
.direct .link { position: relative; }
.case-body > :nth-last-child(2) { margin-bottom: 20px; }
.facts { margin-top: 16px; display: grid; gap: 6px; align-self: stretch; }
.facts div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); column-gap: 16px; align-items: baseline; }
.facts dt { font-size: var(--small); color: var(--t3); }
.facts dd { font-weight: 500; }
.edge { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.edge::before { content: ""; position: absolute; left: 0; bottom: 0; width: 3px; height: 100%; background: var(--orange); transform-origin: 0 100%; transform: skewX(var(--skew)); }
@media (max-width: 999px) { .cases { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .facts div { grid-template-columns: 1fr; } .facts div + div { margin-top: 6px; } }

/* Ablauf: eine Linie mit vier Halten */
.stages { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--g); padding-top: 28px; }
.stages::before { content: ""; position: absolute; top: 0; left: 0; right: calc(var(--side) * -1); height: 1px; background: var(--hair-2); }
.stage { position: relative; }
.stage::after { content: ""; position: absolute; top: -29px; left: 0; width: calc(100% + var(--g)); height: 2px; background: var(--orange); transform-origin: 0 50%; }
.stage:last-child::after { width: auto; right: calc(var(--side) * -1); }
.stage::before { content: ""; position: absolute; z-index: 1; top: -29px; left: -8px; width: 16px; height: 2px; background: var(--orange); transform: rotate(var(--blade)); }
.stage h3 { margin-bottom: 8px; }
.stage p { color: var(--t2); }
.stage .note { margin-top: 10px; color: var(--t1); font-weight: 500; }
@media (max-width: 999px) {
  .stages { grid-template-columns: 1fr; padding: 0 0 0 28px; }
  .stages::before { top: 0; bottom: calc(var(--gap) * -1); left: 0; right: auto; width: 1px; height: auto; }
  .stage { padding-bottom: 32px; }
  .stage:last-child { padding-bottom: 0; }
  .stage::after { top: 0; left: -29px; width: 2px; height: 100%; transform-origin: 50% 0; }
  .stage:last-child::after { right: auto; width: 2px; height: auto; bottom: calc(var(--gap) * -1); }
  .stage::before { top: .65em; left: -36px; }
}

/* Über mich */
.about-id { grid-column: 1 / 5; }
.sign { margin-top: 24px; display: grid; gap: 2px; }
.sign-name { font-size: var(--h3); font-weight: 600; letter-spacing: -.01em; }
.sign .small { color: var(--t3); }
.story { grid-column: 6 / 13; max-width: 62ch; font-size: var(--lead); line-height: 1.55; color: var(--t2); }
.story b { color: var(--t1); font-weight: 500; }
@media (max-width: 999px) { .about-id, .story { grid-column: 1 / -1; } .story { margin-top: 32px; } }

/* Kontakt */
.contact h2 { grid-column: 1 / 9; margin-bottom: 40px; }
.composer { grid-column: 1 / 7; display: grid; gap: 16px; align-content: start; }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--small); font-weight: 600; }
.field select { appearance: none; -webkit-appearance: none; width: 100%; height: 56px; padding: 0 44px 0 16px; border: 1px solid var(--control); border-radius: var(--r-field); background: linear-gradient(45deg, transparent 50%, var(--t2) 50%) calc(100% - 22px) 25px / 6px 6px no-repeat, linear-gradient(-45deg, transparent 50%, var(--t2) 50%) calc(100% - 16px) 25px / 6px 6px no-repeat, var(--ink); color: var(--t1); font-size: 1.0625rem; cursor: pointer; }
.field select:hover, .field select:focus { border-color: var(--t1); }
.composer .btn { margin-top: 8px; width: 100%; }
.composer .small { color: var(--t2); }
.preview { position: relative; grid-column: 7 / 13; align-self: start; padding: 24px; border-radius: var(--r-frame); background: var(--field); box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; }
.preview > * { position: relative; z-index: 2; }
.pv-row { display: flex; gap: 12px; padding: 10px 0; box-shadow: inset 0 -1px 0 var(--hair); overflow-wrap: anywhere; }
.pv-row:first-child { padding-top: 0; }
.pv-k { flex: none; width: 64px; font-size: var(--small); line-height: 1.9; color: var(--t3); }
.pv-body { padding-top: 16px; color: var(--t2); }
.pv-a { min-height: calc(1lh + 1px); margin-bottom: 14px; color: var(--t1); box-shadow: inset 0 -1px 0 var(--hair-2); }
.pv-a:last-child { margin-bottom: 0; }
.direct { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; color: var(--t2); }
.direct .btn { min-height: 44px; padding: 0 1em; font-size: 1rem; }
html:not(.js) [data-copy] { display: none; }
@media (max-width: 999px) {
  .contact h2, .composer, .preview { grid-column: 1 / -1; }
  .composer { grid-template-columns: 1fr 1fr; }
  .composer .btn, .composer .small { grid-column: 1 / -1; }
  .preview { margin-top: 32px; }
}
@media (max-width: 699px) { .composer { grid-template-columns: 1fr; } }

/* Zeigerlicht auf den drei Flächen (nur mit Maus) */
.lit { position: relative; }
.lit::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1; opacity: 0; background: radial-gradient(420px circle at var(--x, 50%) var(--y, 0%), rgb(255 255 255 / .07), transparent 60%); }

/* ============================================================
   Bewegung. Alles hier gilt nur, wenn Bewegung erwünscht ist.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* Laden: Überschrift, Schnitt durch das Bild, Linie unter dem Start */
  .ln > span { animation: line-up .7s var(--out) 60ms backwards; }
  .ln-2 > span { animation-delay: 130ms; }
  .hero .lead { animation: nudge .6s var(--out) backwards; }
  .hero-act { animation: nudge .6s var(--out) 60ms backwards; }
  .win-back { animation: win-back .8s var(--out) 200ms backwards; }
  .win-front { animation: win-front .8s var(--out) 120ms backwards; }
  .strip::before { animation: draw-x .7s var(--out) 200ms backwards; }
  html.nvx-loading .ln > span, html.nvx-loading .hero .lead, html.nvx-loading .hero-act, html.nvx-loading .win, html.nvx-loading .strip::before { animation-play-state: paused; }

  /* Gemessene Zeile */
  .live.is-live { animation: live-in .2s ease backwards; }
  .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live); opacity: 0; }
  .dot.is-live::after { animation: pulse 1.6s ease-out 2; }

  /* Der Schnitt: Überschriften und die beiden Screenshots */
  html.nx-cut .cut:not(.in):not(.seen) { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
  .cut.in { animation: cut-h .52s var(--cut) backwards; }

  @media (min-width: 1000px) {
    html.nx-cut .cases:not(.in):not(.seen) .shot img { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
    .cases.in .case-streamline .shot img { animation: cut-1 1.1s var(--cut) backwards; }
    .cases.in .case-hosting .shot img { animation: cut-2 1.1s var(--cut) backwards; }
    .cases.in .case-streamline .edge { animation: edge-1 1.1s var(--cut) backwards; }
    .cases.in .case-hosting .edge { animation: edge-2 1.1s var(--cut) backwards; }
  }
  @media (max-width: 999px) {
    html.nx-cut .case:not(.in):not(.seen) .shot img { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
    .case.in .shot img { animation: cut-solo .8s var(--cut) backwards; }
    .case.in .edge { animation: edge-solo .8s var(--cut) backwards; }
  }

  @media (hover: hover) and (pointer: fine) {
    .lit::before { transition: opacity .2s; }
    .lit:hover::before { opacity: 1; }
  }

  /* An das Scrollen gebunden: die Linie im Ablauf */
  @supports (animation-timeline: view()) {

    @media (min-width: 1000px) {
      .stages { view-timeline: --proc block; }
      .stage::after { animation: seg-x linear both; animation-timeline: --proc; }
      .stage::before { animation: tick linear both; animation-timeline: --proc; }
      .stage:nth-child(1)::after { animation-range: cover 15% cover 23.75%; }
      .stage:nth-child(2)::after { animation-range: cover 23.75% cover 32.5%; }
      .stage:nth-child(3)::after { animation-range: cover 32.5% cover 41.25%; }
      .stage:nth-child(4)::after { animation-range: cover 41.25% cover 50%; }
      .stage:nth-child(1)::before { animation-range: cover 15% cover 16%; }
      .stage:nth-child(2)::before { animation-range: cover 23.75% cover 24.75%; }
      .stage:nth-child(3)::before { animation-range: cover 32.5% cover 33.5%; }
      .stage:nth-child(4)::before { animation-range: cover 41.25% cover 42.25%; }
    }
    @media (max-width: 999px) {
      .stage { view-timeline: --stop block; view-timeline-inset: 59% 40%; }
      .stage::after { animation: seg-y linear both; animation-timeline: --stop; animation-range: cover 0% cover 100%; }
      .stage::before { animation: tick linear both; animation-timeline: --stop; animation-range: cover 0% cover 4%; }
    }
  }
  /* Ohne Scroll-Zeitachsen: die Linie füllt sich, sobald der Ablauf im Bild ist */
  @supports not (animation-timeline: view()) {
    html.nx-cut .stages:not(.in):not(.seen) .stage::after { transform: scale(0); }
    html.nx-cut .stages:not(.in):not(.seen) .stage::before { background: var(--t3); }
    .stages.in .stage::after { animation: seg-x .28s linear backwards; }
    .stages.in .stage::before { animation: tick .01s linear backwards; }
    .stages.in .stage:nth-child(2)::after, .stages.in .stage:nth-child(2)::before { animation-delay: .28s; }
    .stages.in .stage:nth-child(3)::after, .stages.in .stage:nth-child(3)::before { animation-delay: .56s; }
    .stages.in .stage:nth-child(4)::after, .stages.in .stage:nth-child(4)::before { animation-delay: .84s; }
    @media (max-width: 999px) { .stages.in .stage::after { animation-name: seg-y; } }
  }
}
@keyframes nudge { from { transform: translateY(12px); } }
@keyframes draw-x { from { transform: scaleX(0); } }
@keyframes win-back { from { opacity: 0; transform: translate(24px, -16px); } }
@keyframes win-front { from { opacity: 0; transform: translate(-16px, 24px); } }
@keyframes live-in { from { opacity: .4; } }
@keyframes pulse { from { transform: scale(1); opacity: .5; } to { transform: scale(1.9); opacity: 0; } }
@keyframes cut-h { from { clip-path: polygon(0 0, 0 0, calc(var(--lean, 60px) * -1) 100%, 0 100%); } to { clip-path: polygon(0 0, calc(100% + var(--lean, 60px)) 0, 100% 100%, 0 100%); } }
@keyframes cut-1 { from { clip-path: polygon(0 0, 0 0, -63.9% 100%, 0 100%); } to { clip-path: polygon(0 0, 269.4% 0, 205.5% 100%, 0 100%); } }
@keyframes cut-2 { from { clip-path: polygon(0 0, -105.5% 0, -169.4% 100%, 0 100%); } to { clip-path: polygon(0 0, 163.9% 0, 100% 100%, 0 100%); } }
@keyframes edge-1 { from { transform: translateX(-63.9%); opacity: 1; } 85% { opacity: 1; } to { transform: translateX(205.5%); opacity: 0; } }
@keyframes edge-2 { from { transform: translateX(-169.4%); opacity: 1; } 85% { opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
@keyframes cut-solo { from { clip-path: polygon(0 0, 0 0, -63.9% 100%, 0 100%); } to { clip-path: polygon(0 0, 163.9% 0, 100% 100%, 0 100%); } }
@keyframes edge-solo { from { transform: translateX(-63.9%); opacity: 1; } 85% { opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
@keyframes seg-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes seg-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes tick { from { background: var(--t3); } to { background: var(--orange); } }

@media print {
  .hero { padding-top: 24px; }
  html.nx-cut .cut, html.nx-cut .shot img { clip-path: none !important; animation: none !important; }
  .stage::before, .stage::after { animation: none !important; }
  html.nx-cut .stage::after { transform: none !important; }
}
