/* =========================================================================
   Halfbit GmbH — landing page (index.html)
   Loads after common.css, which holds every @font-face (Bebas Neue is not
   declared here — keep it that way).
   ========================================================================= */

:root {
    --reel-duration: 5s;
    --reel-size: clamp(200px, 60vw, 256px);
}

body {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---- animated logo: the binary reel -------------------------------- *
 * The reel alternates 1 and 0; motion is in percentages so the loop
 * scales with the logo at any viewport width. */
.logo { position: relative; width: var(--reel-size); height: var(--reel-size); flex: none; }
.logo__square {
    position: absolute; inset: 0;
    background: var(--color-link);
    border-radius: 16%;
    overflow: hidden;
    box-shadow:
        0 16px 44px -20px color-mix(in srgb, var(--color-link) 40%, transparent),
        inset 0 0 0 1px rgba(255, 255, 255, .06),
        inset 0 0 70px rgba(0, 0, 0, .28);
}
.logo__reel {
    position: absolute; inset: 0;
    color: #fff;                              /* light: white mark on red */
    animation: reel var(--reel-duration) infinite;
    will-change: transform;
}
@media (prefers-color-scheme: dark) {
    .logo__reel { color: var(--color-text); } /* dark: grayish, like the wordmark */
}
.logo__glyph {
    position: absolute; left: 0; width: 100%; height: 100%;
    top: calc((var(--i) - .5) * 100%);
    color: inherit; /* pass the reel's color to the SVG currentColor (override body,div) */
}
.logo__glyph svg { display: block; width: 100%; height: 100%; }
/* Override common.css `body, div { background-color }` so the red square shows
   through and the hero containers stay transparent. */
.logo__reel, .logo__glyph, .hero-stack, .title-block { background-color: transparent; }
@keyframes reel {
    0%   { transform: translateY(0);     animation-timing-function: linear; }
    44%  { transform: translateY(0);     animation-timing-function: cubic-bezier(.7, .04, .3, .96); }
    50%  { transform: translateY(-100%); animation-timing-function: linear; }
    94%  { transform: translateY(-100%); animation-timing-function: cubic-bezier(.7, .04, .3, .96); }
    100% { transform: translateY(-200%); }
}

/* ---- pinned hero stack ---------------------------------------------- *
 * Stays centered between the screen top and the footer divider, gliding up
 * as you scroll (JS sets `top`). The hero section below is just a spacer so
 * the footer begins below the fold, and carries the scroll hint. */
.hero-stack {
    position: fixed; top: 0; left: 50%;
    transform: translate(-50%, 0);
    z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 30px;
    will-change: transform;
}
.title-block { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wordmark {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(80px, 26vw, 98px);
    line-height: .82;
    letter-spacing: .04em;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    color: var(--color-text);
}
.wordmark .wdot {
    display: inline-block;
    width: .11em; height: .11em;
    margin-left: .03em;
    background: var(--color-link);
    vertical-align: baseline;
}
.tagline--quiet {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: .04em;
    color: color-mix(in srgb, var(--color-text) 50%, transparent);
    margin: 0;
    white-space: nowrap;
}

/* ---- hero spacer + scroll hint -------------------------------------- */
.hero { position: relative; min-height: 100svh; overflow: hidden; }
/* The shared 80px footer gap is dead scroll space on the landing hero. */
.site-footer { margin-top: 0; }
.scroll-hint {
    position: absolute; left: 50%; bottom: 30px;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
    color: var(--color-text-faint);
    opacity: .5;
    animation: hint-bob 2.6s ease-in-out infinite;
    z-index: 2;
}
.scroll-hint:focus-visible { outline: 2px solid var(--color-link); outline-offset: 6px; border-radius: 6px; }
.scroll-hint svg { width: 26px; height: 26px; display: block; }
@keyframes hint-bob {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 7px); }
}

/* ---- entrance choreography ------------------------------------------ */
@keyframes hb-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes hb-pop  { from { opacity: 0; transform: scale(.92); }      to { opacity: 1; transform: none; } }
.logo           { animation: hb-pop .8s cubic-bezier(.2, .7, .2, 1) both; animation-delay: .05s; }
.wordmark       { animation: hb-rise .8s ease both; animation-delay: .22s; }
.tagline--quiet { animation: hb-rise .8s ease both; animation-delay: .34s; }

@media (prefers-reduced-motion: reduce) {
    .logo__reel, .scroll-hint { animation: none; }
    .logo, .wordmark, .tagline--quiet { animation: none; }
}
