/* ============================================================
   ARECH Hero — Impact block — front-end styles.
   S69 prototype-fidelity pass — non-dot values restored to the
   homepage prototype (prototypes/homepage/index.html L651-848)
   as the source of truth, with Concrete-platform necessities
   preserved (sticky-header offset, edit-mode, container name).
   LED dot matrix kept EXACTLY as the current live block per the
   client's instruction ("rămân exact așa").
   Token references resolve to the theme's :root in main.css.
   ============================================================ */

.arech-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Prototype L655 — content anchored to the bottom of the 100vh hero. */
    justify-content: flex-end;
    /* Prototype L656-657: 80px top / 96px bottom. Top keeps the sticky
       theme-header offset (prototype had no sticky header). */
    padding: calc(var(--space-9) + var(--header-height, 72px)) var(--container-px) var(--space-9);
    overflow: hidden;
    background: var(--dark);
    color: var(--off-white);
    /* S55 D5 — inline-size container so the LED matrix can step-down via
       @container queries rather than viewport media queries. */
    container-type: inline-size;
    container-name: arech-hero;
}
@media (min-width: 1024px) {
    .arech-hero {
        /* Prototype L661 — 160px bottom padding on desktop. */
        padding: calc(var(--space-11) + var(--header-height, 80px)) var(--container-px) var(--space-11);
    }
}

/* ---- Layer 1 — animated orange grid drift ---- */
/* Prototype L730-734 — fainter grid lines on phones so they don't compete
   with the H1; stronger from SM up. Mobile-first / min-width per
   responsive_manual_en_0.1 §1 (no max-width media queries). */
.arech-hero__grid {
    position: absolute;
    inset: -80px 0 0 0;
    background-image:
        linear-gradient(color-mix(in oklch, var(--orange) 4%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in oklch, var(--orange) 4%, transparent) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: arechGridMove var(--motion-ambient-fast) var(--ease-linear) infinite;
    z-index: 1;
}
@media (min-width: 480px) {
    .arech-hero__grid {
        background-image:
            linear-gradient(color-mix(in oklch, var(--orange) 7%, transparent) 1px, transparent 1px),
            linear-gradient(90deg, color-mix(in oklch, var(--orange) 7%, transparent) 1px, transparent 1px);
    }
}
@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) ----
   KEPT EXACTLY AS THE CURRENT LIVE BLOCK per client instruction
   "rămân exact așa" — opacity ladder, gap, flicker timing unchanged. */
.arech-hero__led {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30%;
    height: 100%;
    display: none;
    grid-template-columns: repeat(28, 1fr);
    gap: 4px;
    opacity: 0.40;
    pointer-events: none;
    transform: perspective(800px) rotateY(-8deg);
    transform-origin: right center;
    padding: var(--space-2);
    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;
}
@container arech-hero (min-width: 480px) {
    .arech-hero__led { display: grid; width: 30%; opacity: 0.55; }
}
@container arech-hero (min-width: 768px) {
    .arech-hero__led { width: 45%; opacity: 0.70; }
}
@container arech-hero (min-width: 1024px) {
    .arech-hero__led { width: 55%; opacity: 0.85; }
}
@supports not (container-type: inline-size) {
    @media (min-width: 480px) {
        .arech-hero__led { display: grid; width: 30%; opacity: 0.55; }
    }
    @media (min-width: 768px) {
        .arech-hero__led { width: 45%; opacity: 0.70; }
    }
    @media (min-width: 1024px) {
        .arech-hero__led { width: 55%; opacity: 0.85; }
    }
}
.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%, color-mix(in oklch, var(--orange) 12%, transparent) 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 — prototype L754-758: max-width 720px, left-aligned
   (NOT centered). The hero's padding-inline provides the left gutter.
   ============================================================ */
.arech-hero__content {
    position: relative;
    z-index: 6;
    width: 100%;
    /* S69 — hero content shares the single site container (1200) and centres,
       so the hero starts at the SAME left edge as every other section.
       (Was --container-narrow 720 left-anchored, which broke alignment.) */
    max-width: var(--container);
    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.
   Prototype L766-806: font/size live on the spans; uppercase; lh 0.92. */
.arech-hero__h1 {
    margin: var(--space-7) 0 0;
}
.arech-hero__line {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(72px, 9vw, 136px);
    line-height: 0.92;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--off-white);
}
.arech-hero__line--2 {
    color: var(--orange);
    white-space: nowrap;
    /* Prototype L790-794 — 4-layer bloom from sharp inner halo to wide ambient. */
    text-shadow:
        0 0 24px color-mix(in oklch, var(--orange) 55%, transparent),
        0 0 56px color-mix(in oklch, var(--orange) 35%, transparent),
        0 0 96px color-mix(in oklch, var(--orange) 18%, transparent),
        0 0 160px color-mix(in oklch, var(--orange) 8%, transparent);
}
.arech-hero__line--3 {
    /* General Sans (var(--font-headline)) for outline-only text per
       arech-font-outline-rule — Geist Black artifacts under text-stroke.
       Mobile-first: thinner stroke on phones, full 1px from SM up
       (responsive_manual_en_0.1 §1 — no max-width media queries). */
    font-family: var(--font-headline);
    font-weight: 700;
    display: inline-block;
    line-height: 1.05;
    padding-bottom: 0.08em;
    letter-spacing: 0.03em;
    -webkit-text-stroke: 0.75px var(--off-white);
    color: transparent;
}
@media (min-width: 480px) {
    .arech-hero__line--3 {
        -webkit-text-stroke-width: 1px;
        letter-spacing: 0.04em;
    }
}

/* Divider — prototype L807-811: 1px tall, space-6 margin. */
.arech-hero__divider {
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, var(--orange), transparent);
    margin: var(--space-6) 0;
}

/* Subtitle — prototype L818-826: 18px, italic 300, max-width 520px. */
.arech-hero__sub {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.7;
    color: var(--light);
    max-width: 520px;
    margin: 0 0 var(--space-7);
}

/* CTAs — prototype L833-836: space-4 gap. */
.arech-hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}
.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: var(--radius-xs);
    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 color-mix(in oklch, var(--orange) 35%, transparent);
    color: #fff;
}
.arech-hero__btn--ghost {
    background: transparent;
    color: var(--light);
    border-color: color-mix(in oklch, var(--off-white) 18%, transparent);
}
.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 (block-only — not present in prototype hero; kept). */
.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 color-mix(in oklch, var(--orange) 18%, transparent);
    max-width: var(--measure-hero);
}
@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;
    font-variant-numeric: tabular-nums;
}
.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;
}
