/* =============================================================================
   EINSTIEG der Startseite: der Test als Tafel (portal.js)

   Farben und alle Sektionen bleiben wie in style.css (cremeweißer Grund).

   Ab 1200 px Breite ist der Einstieg eine Bühne, angeordnet wie der MWOS-Eingang:
   Abzeichen, große Überschrift und ein kurzer Satz unten links, Kennzahlen als
   Pillen und der Haupt-Knopf unten rechts. Der echte SEO- und GEO-Test steht als
   gläserne Tafel in der Bühne und ist dort direkt benutzbar.

   Beim Scrollen gibt es eine einzige ruhige Bewegung: Die Tafel leuchtet auf,
   füllt sich cremeweiß und wächst über den Bildschirm. Dahinter stehen die Leistungen.

   Läuft ein Test (Messung oder Ergebnis), löst sich die Bühne und die Tafel bekommt
   den Platz, den das Ergebnis braucht.

   Ohne JavaScript, auf schmaleren Bildschirmen und bei „Bewegung reduzieren“ bleibt
   der Einstieg wie bisher.
   ============================================================================= */

/* ---------- Beispiel-Ergebnis im Test (alle Bildschirmgrößen) ---------- */
.vis-preview { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-dark); }
.vis-preview-title { margin: 0 0 8px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--copper-pale); }
.vis-preview ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.vis-preview li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; font-size: .82rem; font-weight: 600; color: var(--text-on-dark); }
.vis-preview li em { font-style: normal; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 100px; white-space: nowrap; }
.vis-preview .pv-good { background: rgba(93, 187, 99, .2); color: #A7E3AB; }
.vis-preview .pv-warn { background: rgba(223, 154, 103, .24); color: var(--copper-pale); }
.vis-preview li:not(.is-open) span { color: rgba(244, 240, 232, .5); filter: blur(3.5px); }
.vis-preview li:not(.is-open) em { padding: 0; }
.vis-preview svg { display: block; width: 15px; height: 15px; fill: none; stroke: var(--copper-pale); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 420px) { .vis-preview ul { grid-template-columns: 1fr; } }

/* ---------- Grundzustand: Bühne unsichtbar, alles wie in style.css ---------- */
.portal-stage { display: contents; }
.portal-slot, .portal-over { display: none; }

/* ---------- Bühne ---------- */
.hero.portal-on {
    padding: 0;
    overflow: visible;                 /* die Bühne klebt per position: sticky */
}
/* Scrollweg der Bewegung: danach folgen nahtlos die Leistungen */
.hero.portal-on::after { content: ""; display: block; height: calc(var(--portal-d, 120vh) * .86); background: var(--bg-main); }
.hero.portal-on .hero-grid { display: none; }
.hero.portal-on .portal-stage {
    display: block;
    position: sticky;
    top: 0;
    height: 100svh;
    overflow: hidden;
    background: var(--obsidian);
}
.hero.portal-on .hero-gl {
    will-change: transform;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 52%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 52%);
}
/* Schatten oben und unten, damit Navigation und Text ruhig stehen */
.hero.portal-on .portal-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(18, 15, 13, .78) 4%, transparent 32%),
        linear-gradient(to top, rgba(18, 15, 13, .94) 10%, transparent 62%);
}

/* ---------- Schrift, angeordnet wie im MWOS-Eingang ---------- */
.hero.portal-on .portal-slot {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    will-change: transform;
}
.hero.portal-on .portal-slot > .hero-copy {
    position: absolute;
    left: var(--gutter);
    right: calc(var(--gutter) + min(440px, 35vw) + clamp(32px, 5vw, 80px));
    bottom: clamp(28px, 5vh, 52px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(12px, 2vh, 20px);
    pointer-events: none;              /* die Tafel bleibt bedienbar */
}
.hero.portal-on .portal-slot > .hero-copy > * { pointer-events: auto; }

/* Abzeichen */
.hero.portal-on .eyebrow {
    order: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    max-width: 560px;
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .22em;
    color: var(--copper-gold);
}
.hero.portal-on .eyebrow::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--copper-gold); }

/* Große Überschrift, darunter der kurze Satz */
.hero.portal-on .hero-title {
    order: 2;
    margin: 0;
    font-size: clamp(3rem, 1rem + 4.6vw, 5.4rem);
    font-weight: 500;
    font-stretch: 100%;
    line-height: .96;
    letter-spacing: -.02em;
}
.hero.portal-on .hero-title-metal {
    display: block;
    margin-top: .5em;
    padding: 0;
    border: 0;
    font-family: var(--font-body);
    font-size: clamp(1.1rem, .8rem + .8vw, 1.7rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-on-dark);
    background: none;
    -webkit-text-fill-color: currentColor;
}
.hero.portal-on .hero-lead { order: 3; margin: 0; max-width: 62ch; font-size: .95rem; line-height: 1.5; color: var(--text-on-dark-muted); }

/* Unten rechts: Pillen und der Haupt-Knopf */
.hero.portal-on .hero-trust {
    order: 6;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: .74rem;
    font-weight: 500;
    color: var(--text-on-dark-muted);
}
.hero.portal-on .hero-trust li, .hero.portal-on .hero-trust li + li { padding: 0; border: 0; }
.hero.portal-on .hero-stats {
    order: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    border: 0;
}
.hero.portal-on .hero-stats > div,
.hero.portal-on .hero-stats > div + div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(240, 201, 166, .2);
    border-radius: 100px;
    background: rgba(18, 15, 13, .66);
}
.hero.portal-on .hero-stats dt { font-family: var(--font-body); font-size: .92rem; font-weight: 700; line-height: 1.2; letter-spacing: 0; color: #fff; }
.hero.portal-on .hero-stats dd { margin: 0; font-size: .78rem; line-height: 1.2; color: var(--text-on-dark-muted); }
.hero.portal-on .hero-actions { order: 4; align-items: center; gap: 22px; margin-top: 4px; }
.hero.portal-on .hero-actions .btn-copper {
    min-height: 60px;
    padding: 0 34px;
    border-radius: 100px;
    background: linear-gradient(180deg, #E0A878, #C88A58);
    color: #1A1108;
    font-size: 1rem;
    box-shadow: 0 0 0 4px rgba(200, 138, 88, .22), 0 14px 34px -14px rgba(200, 138, 88, .9);
}
.hero.portal-on .hero-actions .btn-copper:hover { background: linear-gradient(180deg, #EBB98C, #D49A6A); }
.hero.portal-on .hero-actions .btn-ghost-dark { min-height: 0; padding: 4px 0; border: 0; border-radius: 0; font-size: .82rem; font-weight: 500; color: var(--text-on-dark-muted); text-decoration: underline; text-underline-offset: 4px; }
@media (max-height: 800px) {
    .hero.portal-on .hero-lead, .hero.portal-on .hero-trust { display: none; }
    .hero.portal-on .hero-title { font-size: clamp(2.6rem, 1rem + 3.6vw, 4.4rem); }
}

/* Texte blenden beim Laden nacheinander ein */
.hero.portal-on .hero-copy > * { animation: portal-in .8s var(--ease) both; }
.hero.portal-on .hero-copy > .eyebrow { animation-delay: .35s; }
.hero.portal-on .hero-copy > .hero-title { animation-delay: .45s; }
.hero.portal-on .hero-copy > .hero-lead { animation-delay: .65s; }
.hero.portal-on .hero-copy > .hero-stats, .hero.portal-on .hero-copy > .hero-trust { animation-delay: .8s; }
.hero.portal-on .hero-copy > .hero-actions { animation-delay: .95s; }
@keyframes portal-in {
    from { opacity: 0; filter: blur(10px); transform: translateY(14px); }
    to   { opacity: 1; filter: blur(0); transform: none; }
}

/* ---------- Der echte Test als Tafel ---------- */
.hero.portal-on .hero-check {
    position: absolute;
    z-index: 2;
    top: 128px;                        /* portal.js mittelt die Tafel zwischen Navigation und Unterkante */
    right: calc(max(0px, (100% - 1280px) / 2) + var(--gutter));
    width: min(440px, 35vw);
    margin: 0;
    transform-origin: 50% 50%;
    will-change: transform, opacity;
    animation: portal-in .9s var(--ease) .2s backwards;   /* nicht „both“: danach steuert portal.js Größe und Deckkraft */
}
.hero.portal-on .vis-panel {
    padding: 24px 26px 20px;
    border: 2px solid var(--copper-pale);
    border-radius: 26px;
    background: linear-gradient(158deg, rgba(240, 201, 166, .15), rgba(18, 15, 13, .7) 52%, rgba(18, 15, 13, .52));
    backdrop-filter: blur(10px);
    box-shadow: 0 0 3px rgba(240, 201, 166, .7), 0 0 34px -4px rgba(200, 138, 88, .55), 0 40px 80px -40px #000;
}
.hero.portal-on .vis-head { margin-bottom: 14px; }
.hero.portal-on .vis-head h2 { font-size: clamp(1.45rem, 1rem + .9vw, 1.9rem); }
.hero.portal-on .vis-sub { font-size: .84rem; line-height: 1.45; }
.hero.portal-on .vis-fine { margin-top: 10px; font-size: .68rem; line-height: 1.4; }
.hero.portal-on .vis-preview { margin-top: 12px; padding-top: 10px; }
.hero.portal-on .vis-panel .btn { border-radius: 100px; }
@media (max-height: 800px) {
    .hero.portal-on .vis-sub { display: none; }
}

/* Rand und Füllung der Bewegung: liegen genau über der Tafel und wachsen von dort */
.portal-plane {
    position: absolute;
    left: 0;
    top: 0;
    width: 652px;
    height: 1024px;
    transform-origin: 0 0;
    will-change: transform;
}
.hero.portal-on .portal-over {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
}
.portal-fill, .portal-rim {
    position: absolute;
    inset: 0;
    border-radius: 34px;
    opacity: 0;
}
.portal-fill { background: var(--bg-main); }
.portal-rim {
    border: 14px solid var(--copper-pale);
    box-shadow: 0 0 36px 8px rgba(200, 138, 88, .8), inset 0 0 28px 6px rgba(200, 138, 88, .6);
}

/* ---------- Ein Test läuft: Die Bühne löst sich, die Tafel bekommt Platz ---------- */
.hero.portal-busy::after { display: none; }
.hero.portal-busy .portal-stage {
    position: relative;
    height: auto;
    min-height: 100svh;
    padding: clamp(128px, 16vh, 168px) var(--gutter) clamp(56px, 8vh, 96px);
}
.hero.portal-busy .portal-slot, .hero.portal-busy .portal-over { display: none; }
.hero.portal-busy .hero-check {
    position: relative;
    top: auto;
    right: auto;
    width: min(820px, 100%);
    margin: 0 auto;
    animation: none;
}
.hero.portal-busy .vis-sub { display: block; }

/* ---------- Das Angebot steht zwischen zwei Sektionen: ruhiger heller Grund ---------- */
.bf-section { background: var(--bg-main); padding-top: clamp(72px, 9vw, 128px); }

/* Die Sektion hinter dem Einstieg (Angebot, danach Leistungen) rückt nach, sobald die Füllung den Bildschirm bedeckt */
.hero.portal-on + section, .hero.portal-on + section[hidden] + section { margin-top: -16svh; }
