/* ============================================================
   ARECH Hero — Impact block — front-end styles.
   Verbatim port of `site/src/components/home/HomeHero.astro`
   lines 107-418, BEM-renamed to `arech-hero__*` to avoid
   collision with theme-level chrome and other block selectors.
   Token references resolve to the theme's :root in main.css.
   ============================================================ */

.arech-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-9) var(--container-px) var(--space-8);
    /* Theme header is sticky, height ~72-80px; nudge content below it. */
    padding-top: calc(var(--space-9) + var(--header-height, 72px));
    overflow: hidden;
    background: var(--dark);
    color: var(--off-white);
    margin-left: calc(-1 * var(--container-px));
    margin-right: calc(-1 * var(--container-px));
}
@media (min-width: 1024px) {
    .arech-hero {
        padding: var(--space-11) var(--container-px) var(--space-9);
        padding-top: calc(var(--space-11) + var(--header-height, 80px));
    }
}

/* ---- Layer 1 — animated orange grid drift ---- */
.arech-hero__grid {
    position: absolute;
    inset: -80px 0 0 0;
    background-image:
        linear-gradient(rgba(232, 101, 26, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 101, 26, 0.07) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: arechGridMove var(--motion-ambient-fast) var(--ease-linear) infinite;
    z-index: 1;
}
@keyframes arechGridMove {
    0%   { transform: translateY(0); }
    100% { transform: translateY(80px); }
}

/* ---- Layer 2 — dot-wave canvas scan ---- */
.arech-hero__dotwave {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    -webkit-mask-image: linear-gradient(to right, black 0%, black 45%, transparent 80%);
    mask-image: linear-gradient(to right, black 0%, black 45%, transparent 80%);
}

/* ---- Layer 3 — LED dot matrix (right-side perspective) ---- */
.arech-hero__led {
    position: absolute;
    top: 0;
    right: -5%;
    width: 70%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(28, 1fr);
    gap: 4px;
    opacity: 0.85;
    pointer-events: none;
    transform: perspective(800px) rotateY(-8deg);
    padding: 60px 0;
    z-index: 3;
    -webkit-mask-image:
        linear-gradient(to left, black 50%, transparent 100%),
        linear-gradient(to top, black 60%, transparent 100%);
    mask-image:
        linear-gradient(to left, black 50%, transparent 100%),
        linear-gradient(to top, black 60%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}
@media (min-width: 1024px) {
    .arech-hero__led { width: 55%; right: -3%; }
}
.arech-hero__led .arech-led-dot {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: var(--orange);
    opacity: var(--base, 0.2);
    animation: arechLedFlicker var(--d, 3s) var(--ease-standard) var(--delay, 0s) infinite;
}
@keyframes arechLedFlicker {
    0%, 100% { opacity: var(--base, 0.2); }
    50%      { opacity: var(--peak, 0.8); }
}

/* ---- Layer 4 — radial orange glow ---- */
.arech-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 60% 40%, rgba(232, 101, 26, 0.12) 0%, transparent 60%);
    pointer-events: none;
    z-index: 4;
}

/* ---- Layer 5 — bottom fade-out into next section ---- */
.arech-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, var(--dark) 100%);
    pointer-events: none;
    z-index: 5;
}

/* ============================================================
   Content layer
   ============================================================ */
.arech-hero__content {
    position: relative;
    z-index: 6;
    width: 100%;
    max-width: var(--container-wide, 1440px);
    margin-inline: auto;
}

/* Eyebrow */
.arech-hero__eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--off-white);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-5);
}
.arech-hero__eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--off-white);
    flex-shrink: 0;
}

/* H1 — 3-line stacked, filled / accent / outline */
.arech-hero__h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(44px, 7vw, 116px);
    line-height: 0.92;
    letter-spacing: -0.02em;
    color: var(--off-white);
    margin: 0;
}
.arech-hero__line {
    display: block;
    white-space: nowrap;
}
.arech-hero__line--2 {
    color: var(--orange);
    text-shadow:
        0 0 18px rgba(232, 101, 26, 0.55),
        0 0 48px rgba(232, 101, 26, 0.30),
        0 0 90px rgba(232, 101, 26, 0.18);
}
.arech-hero__line--3 {
    font-family: var(--font-headline);
    font-weight: 700;
    -webkit-text-stroke: 1.5px var(--off-white);
    color: transparent;
}

/* Divider */
.arech-hero__divider {
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, var(--orange), transparent);
    margin: var(--space-5) 0;
}

/* Subtitle */
.arech-hero__sub {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(15px, 1.4vw, 17px);
    line-height: 1.6;
    color: var(--light);
    max-width: 56ch;
    margin: 0 0 var(--space-7);
}

/* CTAs */
.arech-hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}
.arech-hero__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 12px 28px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    border: 1px solid transparent;
    transition:
        background var(--motion-normal) var(--ease-standard),
        transform var(--motion-normal) var(--ease-standard),
        box-shadow var(--motion-normal) var(--ease-standard),
        border-color var(--motion-normal) var(--ease-standard),
        color var(--motion-normal) var(--ease-standard);
}
.arech-hero__btn--primary {
    background: var(--orange);
    color: #fff;
}
.arech-hero__btn--primary:hover,
.arech-hero__btn--primary:focus-visible {
    background: var(--orange-bright);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(232, 101, 26, 0.35);
    color: #fff;
}
.arech-hero__btn--ghost {
    background: transparent;
    color: var(--light);
    border-color: rgba(255, 255, 255, 0.18);
}
.arech-hero__btn--ghost:hover,
.arech-hero__btn--ghost:focus-visible {
    border-color: var(--orange);
    color: var(--orange);
}
.arech-hero__btn:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

/* Stats row */
.arech-hero__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    margin-top: var(--space-9);
    padding-top: var(--space-7);
    border-top: 1px solid rgba(232, 101, 26, 0.18);
    max-width: 1100px;
}
@media (min-width: 768px) {
    .arech-hero__stats { grid-template-columns: repeat(4, 1fr); }
}
.arech-hero__stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.arech-hero__stat-num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(40px, 4.5vw, 64px);
    line-height: 1;
    color: var(--orange);
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: baseline;
}
.arech-hero__suffix {
    font-size: 0.45em;
    color: var(--orange-dim);
    margin-left: 4px;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.arech-hero__stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-accessible);
}

/* ============================================================
   Reveal stagger
   ============================================================ */
.arech-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity var(--motion-reveal) var(--ease-standard),
        transform var(--motion-reveal) var(--ease-standard);
}
.arech-reveal.is-in {
    opacity: 1;
    transform: translateY(0);
}
.arech-reveal--s1 { transition-delay: var(--stagger-1); }
.arech-reveal--s2 { transition-delay: var(--stagger-2); }
.arech-reveal--s3 { transition-delay: var(--stagger-3); }
.arech-reveal--s4 { transition-delay: var(--stagger-4); }
.arech-reveal--s5 { transition-delay: var(--stagger-5); }

/* ============================================================
   Reduced motion — WCAG 2.2 SC 2.3.3
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .arech-hero__led { display: none; }
    .arech-hero__grid { animation: none; }
    .arech-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .arech-hero__btn,
    .arech-hero__btn:hover {
        transform: none !important;
        transition: none;
    }
}

/* ============================================================
   Print — strip decorative layers, render plain document
   ============================================================ */
@media print {
    .arech-hero__grid,
    .arech-hero__dotwave,
    .arech-hero__led { display: none !important; }
    .arech-hero {
        min-height: auto;
        padding: 32px 24px;
        color: #000;
        background: #fff;
    }
    .arech-hero__line--2 {
        color: #000;
        text-shadow: none;
    }
    .arech-hero__line--3 {
        -webkit-text-stroke: 0;
        color: #000;
    }
}

/* ============================================================
   Concrete edit-mode tweaks: stop the sticky/fullscreen hero
   from hiding the editor toolbar.
   ============================================================ */
.ccm-edit-mode .arech-hero {
    min-height: 60vh;
    padding-top: var(--space-7);
}
.ccm-edit-mode .arech-hero__led,
.ccm-edit-mode .arech-hero__dotwave {
    opacity: 0.3;
}
