/* hero-app.css — the app-led hero, shared by the home page and /nis2-app.

   Until 28.11.2026 every rule below lived in index.css, which only the home
   page loads. /nis2-app then took the same hero — the offer left, a moving
   picture right — because its own, a centred column over a large screenshot,
   read as crowded beside the home page (owner, 28.11.2026). The rules moved
   here unchanged rather than being copied, so the two heroes cannot drift
   apart. The drawn path („Hero flow“) is the home page's picture only;
   /nis2-app's is a scene with Nissy, in nis2-app.css.

   The base `.hero-modern*`, `.hero-cta-*` and `.hero-trust-*` rules are still
   in styles.css, which every page loads. Everything here hangs off `.hero-app`
   or `.hero-flow`, so a page that does not use them is untouched. What only
   /nis2-app needs on top (the price line, the „Preise ansehen“ link, the
   scene, the row of sectors) is in nis2-app.css. */

/* A route that is not a button: from the hero to the video, and from under the
   video on to /nis2-app. Quieter than the buttons it sits below. */
.hero-video-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brand-teal-link);
    text-decoration: none;
}
.hero-video-link:hover {
    text-decoration: underline;
}

/* „Schon Kunde? Anmelden“ under the hero's note. It borrows the film link's
   box and takes its own colour: this is the customers' way in, and it has to be
   found by somebody who is not reading the page. */
.hero-app .hero-login-link {
    color: var(--brand-navy);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Hero, app-led (13.11.2026) ──
   The alert banner and the statistics card went, and the hero now sets the
   offer beside the product: text left, the way through it right — a
   screenshot of the start plan until 14.11.2026, a drawing since („Hero
   flow“ below).

   The base rules are still `.hero-modern*` in styles.css, shared with nothing
   else but written for a centred column beside a 380px card. Everything here
   hangs off `.hero-app`, so it outranks those without `!important` and without
   touching a stylesheet every other page loads — including the phone rules at
   768px there, which this has to restate below for the same reason. */
.hero-app .hero-modern-container {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 56px;
}
.hero-app .hero-text-column {
    text-align: left;
}
/* The line breaks are in the copy, per language: the German second sentence is
   one word too long for the column and left „bleiben.“ on a line of its own,
   and `text-wrap: balance` does not rebalance a block that has a <br> in it. */
/* The text starts on the site's line. The container centres its two columns
   on each other, so the label's distance from the header was the site's
   measure plus half of however much taller the right column happened to be.
   (The drawing centres ITSELF on the text — `align-self` in „Hero flow“ —
   which moves the drawing and never the label.) */
.hero-app .hero-modern-container {
    align-items: start;
}
.hero-app .hero-headline {
    font-size: 3rem;
}
.hero-app .hero-subheadline {
    max-width: 34em;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 28px;
}
/* Both ways in on one line: the trial for a visitor, the login for a customer.
   They wrap rather than shrink — a button whose label breaks in two reads as
   two buttons. */
.hero-app__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.hero-app .hero-cta-note {
    max-width: 36em;
    margin-bottom: 14px;
    line-height: 1.55;
}
.hero-app .hero-video-link {
    margin-bottom: 30px;
}
.hero-app .hero-trust-row {
    justify-content: flex-start;
    gap: 10px 22px;
}

/* One column from where the two no longer both fit a readable line. Centred
   again, as the stacked hero always was, with the picture under the text —
   the offer first, the proof second. */
@media (max-width: 980px) {
    .hero-app .hero-modern-container {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }
    .hero-app .hero-text-column {
        text-align: center;
    }
    .hero-app .hero-subheadline,
    .hero-app .hero-cta-note {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-app__actions,
    .hero-app .hero-trust-row {
        justify-content: center;
    }
}
@media (max-width: 768px) {
    .hero-app .hero-headline {
        font-size: 2.1rem;
    }
    /* Full-width, like the primary button beside it becomes at this width in
       styles.css: two buttons of different widths stacked read as a mistake. */
    .hero-app__actions .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 1rem;
    }
}

/* ── Hero flow (14.11.2026) ──
   The hero's right column: the way through NIS2 as four cards on a drawn
   line, in the manner of the film (`tools/marketing/video/storyboard.css`) —
   white cards on a hairline with a long soft shadow, line icons, no capsules.
   It replaced a screenshot of the start plan; the owner wanted the flow,
   simplified, and the screenshots are on /nis2-app.

   EVERY RULE'S BASE STATE IS THE FINISHED PICTURE. The movement is keyframes
   that only say where a thing comes FROM, filled backwards over its delay. So
   with animations off — `prefers-reduced-motion`, a browser without them, the
   moment before a stylesheet has parsed — what stands there is the whole
   illustration, not an empty column. Do not move the hidden state into the
   base rule to "simplify" it: that is the version that ships blank.

   NOTHING HERE CHANGES LAYOUT. The keyframes touch opacity, transform,
   clip-path and outline only, so the box the column takes is the same before,
   during and after, and nothing under it moves. */

.hero-flow {
    --hf-line: color-mix(in srgb, var(--brand-navy-dark) 13%, transparent);
    --hf-shade:
        0 22px 40px -26px color-mix(in srgb, var(--brand-navy-dark) 42%, transparent),
        0 2px 6px color-mix(in srgb, var(--brand-navy-dark) 5%, transparent);
    --hf-wire: var(--brand-teal-light);
    --hf-gap: 34px;
    /* How far the line swings out past a card before it turns down — a share
       of the CARD's width, because the pseudo-element that draws it is sized
       against the card. 14 % of the column over a card 72 % of it wide. */
    --hf-swing: 19.444%;
    position: relative;
    min-width: 0;
    margin: 0;
    /* Centred on the text beside it: four cards are shorter than the offer,
       and hung from the top they left the column's lower third empty. The
       label and the heading are measured on the text column, not here. */
    align-self: center;
    text-align: left;
}
/* The film's daylight: two soft tints, far larger than the cards and far too
   faint to read as shapes. Each ellipse ends INSIDE this box — centre plus
   radius stays under 100 % — because a gradient that is still visible where
   its box stops draws the box: the first version had a faint green rectangle
   with a straight edge behind the cards. */
.hero-flow::before {
    content: "";
    position: absolute;
    inset: -14% -12%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(32% 34% at 32% 66%, color-mix(in srgb, var(--medium-amber) 12%, transparent) 0%, transparent 100%),
        radial-gradient(30% 28% at 70% 28%, color-mix(in srgb, var(--brand-teal) 22%, transparent) 0%, transparent 100%);
}
.hero-flow__path {
    position: relative;
    z-index: 1;
    display: grid;
    gap: var(--hf-gap);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* One step: icon, words, tick. Left, right, left, right — a path rather than
   a list, which is the difference between this and four rows. */
.hero-flow__step {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 16px;
    width: 72%;
    padding: 20px 22px;
    border-radius: 18px;
    border: 1px solid var(--hf-line);
    background: var(--white);
    box-shadow: var(--hf-shade);
    outline: 2px solid transparent;
    outline-offset: 4px;
    animation:
        hf-rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) var(--hf-in) backwards,
        hf-focus 0.8s ease-in-out var(--hf-at) backwards;
}
.hero-flow__step:nth-child(even) {
    margin-left: auto;
}
/* When each step arrives (`--hf-in`) and when the eye is led to it
   (`--hf-at`): everything inside a card is timed from the second. */
.hero-flow__step:nth-child(1) { --hf-in: 0.10s; --hf-at: 0.80s; }
.hero-flow__step:nth-child(2) { --hf-in: 0.22s; --hf-at: 1.55s; }
.hero-flow__step:nth-child(3) { --hf-in: 0.34s; --hf-at: 2.30s; }
.hero-flow__step:nth-child(4) { --hf-in: 0.46s; --hf-at: 3.05s; }

.hero-flow__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--brand-teal-bg);
    color: var(--brand-teal-link);
}
.hero-flow__icon svg,
.hero-flow__tick svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.hero-flow__icon svg {
    width: 26px;
    height: 26px;
}
.hero-flow__text {
    min-width: 0;
}
.hero-flow__label {
    display: block;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--brand-navy-dark);
    text-wrap: balance;
}
.hero-flow__meta {
    display: block;
    margin-top: 4px;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--brand-navy-soft);
    /* „… die nächsten / Wochen“ otherwise: one word alone on the second line. */
    text-wrap: balance;
}
/* What the proposal consists of. Rectangles with a small radius: the owner's
   word for a capsule was that it looks generated (14.11.2026). */
.hero-flow__chips {
    /* A row of its own under the words AND the tick: inside the text column
       the three did not fit beside a tick on a phone, and the third wrapped
       onto a line by itself. */
    grid-column: 2 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
/* …which makes that card two rows, with the icon centred on both. */
.hero-flow__step--set {
    row-gap: 0;
}
.hero-flow__step--set .hero-flow__icon {
    grid-row: 1 / span 2;
}
.hero-flow__chip {
    padding: 3px 9px;
    border-radius: 7px;
    border: 1px solid color-mix(in srgb, var(--brand-teal) 34%, transparent);
    background: var(--brand-teal-bg);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--brand-navy);
    /* Until its turn each one is the empty form the label speaks of: a dashed
       box with nothing in it. Then it is filled in. */
    animation: hf-fill 0.4s ease-out calc(var(--hf-at) + 0.08s) backwards;
}
.hero-flow__chip:nth-child(2) { animation-delay: calc(var(--hf-at) + 0.2s); }
.hero-flow__chip:nth-child(3) { animation-delay: calc(var(--hf-at) + 0.32s); }

/* Done. A calmer green than --low-green alone, which on white is the green of
   a status light; mixed towards the ink it is the film's tick. */
.hero-flow__tick {
    width: 26px;
    height: 26px;
    color: color-mix(in srgb, var(--low-green) 72%, var(--brand-navy-dark));
    animation: hf-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.5) calc(var(--hf-at) + 0.42s) backwards;
}
.hero-flow__tick svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.9;
}

/* The line from one card to the next: out of the card's side, round a corner
   and down onto the next one. Two borders and one radius, so the corner is a
   true quarter circle at every width — an SVG stretched to fit would flatten
   it. `clip-path` is what draws it: first along, then down. */
.hero-flow__step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    /* From the card's outer edge, which is a border's width past its padding
       box, to the next card's outer edge, which is another one down. */
    left: calc(100% + 1px);
    width: calc(var(--hf-swing) + 1px);
    height: calc(50% + var(--hf-gap) + 1px);
    border-top: 2px solid var(--hf-wire);
    border-right: 2px solid var(--hf-wire);
    border-top-right-radius: 20px;
    pointer-events: none;
    animation: hf-draw-right 0.5s ease-in-out calc(var(--hf-at) + 0.3s) backwards;
}
.hero-flow__step:nth-child(even):not(:last-child)::after {
    left: auto;
    right: calc(100% + 1px);
    border-right: 0;
    border-left: 2px solid var(--hf-wire);
    border-top-right-radius: 0;
    border-top-left-radius: 20px;
    animation-name: hf-draw-left;
}
/* Where the line lands: a dot on the next card's top edge, under the corner
   the line came round. The line is two pixels wide and sits just inside the
   swing, hence the odd pixel either way. */
.hero-flow__step + .hero-flow__step::before {
    content: "";
    position: absolute;
    top: -5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-teal-dark);
    box-shadow: 0 0 0 3px var(--white);
    pointer-events: none;
    animation: hf-pop 0.3s ease-out calc(var(--hf-at) - 0.02s) backwards;
}
/* After a card on the left the line comes down on this card's right… */
.hero-flow__step:nth-child(odd) + .hero-flow__step::before {
    left: calc(100% - var(--hf-swing) - 4px);
}
/* …and after one on the right, on its left. */
.hero-flow__step:nth-child(even) + .hero-flow__step::before {
    left: calc(var(--hf-swing) - 4px);
}

/* Where the path ends. The film's last card of a scene is the dark one —
   „Melden“ — and so is this: the thing the other three were for. */
.hero-flow__step--goal {
    grid-template-columns: 52px minmax(0, 1fr);
    border-color: var(--brand-navy-dark);
    background: var(--brand-navy-dark);
}
.hero-flow__step--goal .hero-flow__label {
    color: var(--white);
}
.hero-flow__step--goal .hero-flow__meta {
    color: var(--brand-teal-light);
}
.hero-flow__step--goal .hero-flow__icon {
    background: color-mix(in srgb, var(--white) 10%, transparent);
    color: var(--white);
}
/* The tick inside the shield is written, not shown: `pathLength="1"` on the
   path makes the dash arithmetic independent of its real length. */
.hero-flow__proof {
    stroke: color-mix(in srgb, var(--low-green) 78%, var(--white));
    stroke-width: 2.2;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: hf-write 0.5s ease-out calc(var(--hf-at) + 0.35s) backwards;
}
/* The only thing that keeps moving once the picture has arrived: a ring off
   the shield, every six seconds, at a strength that is noticed once and then
   not again. Anything livelier would compete with the button beside it. */
.hero-flow__step--goal .hero-flow__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid color-mix(in srgb, var(--white) 55%, transparent);
    opacity: 0;
    pointer-events: none;
    animation: hf-ring 6s ease-out calc(var(--hf-at) + 0.7s) infinite;
}

@keyframes hf-rise {
    from { opacity: 0; transform: translateY(22px) scale(0.97); }
}
@keyframes hf-pop {
    from { opacity: 0; transform: scale(0.3); }
}
@keyframes hf-fill {
    from {
        border-style: dashed;
        border-color: var(--gray-300);
        background-color: transparent;
        color: transparent;
    }
    50% {
        transform: scale(1.06);
    }
}
@keyframes hf-focus {
    0%, 100% { outline-color: transparent; }
    30%, 65% { outline-color: color-mix(in srgb, var(--brand-teal-dark) 60%, transparent); }
}
@keyframes hf-draw-right {
    0% { clip-path: inset(0 100% 100% 0); }
    45% { clip-path: inset(0 0 calc(100% - 22px) 0); }
    100% { clip-path: inset(0 0 0 0); }
}
@keyframes hf-draw-left {
    0% { clip-path: inset(0 0 100% 100%); }
    45% { clip-path: inset(0 0 calc(100% - 22px) 0); }
    100% { clip-path: inset(0 0 0 0); }
}
@keyframes hf-write {
    from { stroke-dashoffset: 1; }
}
@keyframes hf-ring {
    0% { opacity: 0.7; transform: scale(1); }
    22%, 100% { opacity: 0; transform: scale(1.75); }
}

/* Held until it is seen. `funnel.js` sets this on a figure that is below the
   fold when the page loads — the phone, where the column sits under the text
   — and takes it off when the figure scrolls in, which starts every animation
   above from its beginning. Above the fold nothing sets it and the keyframes
   simply run. Without the script it is never set, and the picture stands. */
.hero-flow[data-flow="wait"] .hero-flow__step,
.hero-flow[data-flow="wait"] .hero-flow__step::before,
.hero-flow[data-flow="wait"] .hero-flow__step::after,
.hero-flow[data-flow="wait"] .hero-flow__chip,
.hero-flow[data-flow="wait"] .hero-flow__tick,
.hero-flow[data-flow="wait"] .hero-flow__proof,
.hero-flow[data-flow="wait"] .hero-flow__icon::after {
    animation: none;
    opacity: 0;
}

/* One column from where the hero stacks (above, 980px): the figure is
   capped and centred as the picture was, and comes after the offer. */
@media (max-width: 980px) {
    /* `order`, because styles.css numbers the text column 1 at this width (it
       used to precede a statistics card numbered 2) and an unnumbered sibling
       sorts in front of it: the drawing came first and the offer second. */
    .hero-flow {
        order: 2;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Between the stacked hero and a wide one the column is at its narrowest
   (about 420px at 1024): wider cards and a shorter swing, or every label
   breaks in two. 10 % of the column over a card 80 % of it wide. */
@media (min-width: 981px) and (max-width: 1150px) {
    .hero-flow {
        --hf-swing: 12.5%;
    }
    .hero-flow__step {
        width: 80%;
        gap: 14px;
        padding: 18px 18px;
    }
}

/* A phone has no room to swing a line out to the side: the cards take the
   full width and the line runs straight down behind the icons. */
@media (max-width: 560px) {
    .hero-flow {
        --hf-gap: 26px;
    }
    .hero-flow__step,
    .hero-flow__step--goal {
        grid-template-columns: 46px minmax(0, 1fr) 24px;
        gap: 14px;
        width: 100%;
        padding: 16px 16px;
    }
    .hero-flow__step--goal {
        grid-template-columns: 46px minmax(0, 1fr);
    }
    .hero-flow__icon {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }
    .hero-flow__icon svg {
        width: 23px;
        height: 23px;
    }
    .hero-flow__label {
        font-size: 1rem;
    }
    /* Three chips on one row beside nothing: at 9px of padding „Risiken“ was
       the one that dropped to a second line on a 360px phone. */
    .hero-flow__chips {
        gap: 5px;
    }
    .hero-flow__chip {
        padding: 3px 7px;
    }
    .hero-flow__step:not(:last-child)::after,
    .hero-flow__step:nth-child(even):not(:last-child)::after {
        top: 100%;
        left: 38px;
        right: auto;
        width: 0;
        height: var(--hf-gap);
        border: 0;
        border-left: 2px solid var(--hf-wire);
        border-radius: 0;
        animation-name: hf-draw-down;
    }
    .hero-flow__step + .hero-flow__step::before,
    .hero-flow__step:nth-child(odd) + .hero-flow__step::before,
    .hero-flow__step:nth-child(even) + .hero-flow__step::before {
        left: 35px;
    }
}
@keyframes hf-draw-down {
    from { clip-path: inset(0 0 100% 0); }
}

/* No movement for whoever asked for none: the finished picture, at once. */
@media (prefers-reduced-motion: reduce) {
    .hero-flow__step,
    .hero-flow__step::before,
    .hero-flow__step::after,
    .hero-flow__chip,
    .hero-flow__tick,
    .hero-flow__proof,
    .hero-flow__icon::after {
        animation: none !important;
    }
}
