/* Radiant Airflows marketing site - landing-page entrance splash.
   Fully scoped and removable (see config('website.intro_enabled')). */

/* Hidden by default; the inline head script adds html.rw-intro-active
   before first paint when the splash should run, so there is no flash. */
#radiant-website .rw-intro { display: none; }

/* Lock the page behind the splash. Both the class and this lock are
   removed by rw/js/intro.js the moment the splash is dismissed. */
html.rw-intro-active,
html.rw-intro-active body { overflow: hidden; }

html.rw-intro-active #radiant-website .rw-intro {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    background: #ffffff;
    transition:
        opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.4s cubic-bezier(0.16, 1, 0.3, 1),
        filter 1.4s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Vaporize / dissolve on dismiss */
html.rw-intro-active #radiant-website .rw-intro.rw-is-out {
    opacity: 0;
    transform: scale(1.08) translateY(-15px);
    filter: blur(20px) contrast(1.1) brightness(1.05);
    visibility: hidden;
    pointer-events: none;
}

#radiant-website .rw-intro__defs { position: absolute; width: 0; height: 0; }

#radiant-website .rw-intro__stage {
    position: relative;
    width: min(1200px, 92%);
    display: grid;
    grid-template-columns: 40% 60%;
    align-items: center;
    gap: 4%;
}

/* ---- Text ---- */

#radiant-website .rw-intro__text { position: relative; z-index: 10; color: #1a2a33; }

#radiant-website .rw-intro__badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--rw-primary);
    font-weight: 700;
    margin-bottom: 1.75rem;
}
#radiant-website .rw-intro__badge::after {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--rw-secondary);
    border-radius: 50%;
}

#radiant-website .rw-intro__headline {
    font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.5rem);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -5.5px;
    margin-bottom: 1.25rem;
}
@media (max-width: 600px) {
    /* -5.5px overlaps at the smaller mobile font size */
    #radiant-website .rw-intro__headline { letter-spacing: -2.5px; }
}
#radiant-website .rw-intro__linewrap { display: inline-block; white-space: nowrap; }
#radiant-website .rw-intro__linewrap--cool { line-height: 1.4; }
#radiant-website .rw-intro__space { display: inline-block; width: 0.3em; }

#radiant-website .rw-intro__char {
    display: inline-block;
    will-change: transform;
}
#radiant-website .rw-intro__char--atmo {
    font-weight: 300;
    color: #1a2a33;
    transform-origin: center bottom;
    animation: rw-introAtmoWave 3.6s ease-in-out infinite alternate;
}
#radiant-website .rw-intro__char--cool {
    font-weight: 700;
    background: linear-gradient(135deg, #063A23 0%, #10633C 50%, #E5A93C 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transform-origin: bottom center;
    /* Negative letter-spacing clips the gradient fill of glyphs on their
       right edge. Widen the clip box, then pull it back so spacing is
       unchanged. */
    padding-right: 0.16em;
    margin-right: -0.16em;
    animation:
        rw-introCoolWave 2.2s ease-in-out infinite alternate,
        rw-introGradient 4s ease infinite alternate;
}
/* The final glyph has no following letter to bleed into, so give it real room. */
#radiant-website .rw-intro__char--cool:last-child { margin-right: 0; }

@keyframes rw-introAtmoWave {
    0%   { transform: translateY(0) rotate(0deg); }
    40%  { transform: translateY(-5px) rotate(2deg); }
    75%  { transform: translateY(3px) rotate(-1.5deg); }
    100% { transform: translateY(-3px) rotate(1deg); }
}
@keyframes rw-introCoolWave {
    0%   { transform: translateY(0) rotate(0deg) scale(1); filter: drop-shadow(0 0 0 rgba(6,58,35,0)); }
    30%  { transform: translateY(-8px) rotate(-5deg) scale(1.04); filter: drop-shadow(-3px 4px 5px rgba(6,58,35,0.28)); }
    60%  { transform: translateY(4px) rotate(3deg) scale(0.98); filter: drop-shadow(2px -2px 3px rgba(229,169,60,0.28)); }
    100% { transform: translateY(-5px) rotate(-3deg) scale(1.02); filter: drop-shadow(-2px 3px 4px rgba(6,58,35,0.2)); }
}
@keyframes rw-introGradient {
    0%   { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

#radiant-website .rw-intro__lead {
    font-size: 1.02rem;
    color: #51636c;
    line-height: 1.7;
    max-width: 420px;
    margin-bottom: 2.25rem;
}

#radiant-website .rw-intro__prompt {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rw-text);
    padding: 14px 30px;
    border-radius: 40px;
    background: var(--rw-secondary);
    border: 1px solid var(--rw-secondary);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
    animation: rw-introPromptGlow 3s infinite alternate;
}
#radiant-website .rw-intro__prompt:hover {
    background: var(--rw-secondary-dark);
    transform: translateY(-2px);
}
@keyframes rw-introPromptGlow {
    0%   { box-shadow: 0 0 0 0 rgba(229, 169, 60, 0.32); }
    100% { box-shadow: 0 0 26px 7px rgba(229, 169, 60, 0.5); }
}

/* ---- Right-side visual ---- */

#radiant-website .rw-intro__visual {
    position: relative;
    width: 100%;
    height: 420px;
}

#radiant-website .rw-intro__ac {
    position: absolute;
    z-index: 8;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7f8 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
#radiant-website .rw-intro__ac--daikin { top: 6%;  right: 6%;  width: 240px; height: 66px; }
#radiant-website .rw-intro__ac--modern { top: 42%; right: 26%; width: 210px; height: 58px; }
#radiant-website .rw-intro__ac--curve  {
    top: 74%; right: 10%; width: 260px; height: 62px;
    flex-direction: row;
    align-items: center;
    border-radius: 40px 10px 40px 10px;
    border: 1.5px solid var(--rw-primary);
    box-shadow: 0 12px 30px rgba(6, 58, 35, 0.14);
    background: linear-gradient(135deg, #ffffff 0%, #f1f6f2 100%);
}

#radiant-website .rw-intro__ac-row { display: flex; align-items: center; justify-content: space-between; }
#radiant-website .rw-intro__ac-brand {
    font-family: Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: var(--daikin-blue, #0091D2);
}
#radiant-website .rw-intro__ac-tag { font-size: 0.62rem; letter-spacing: 1px; color: #8a8a8a; }
#radiant-website .rw-intro__ac-tag--teal { font-size: 0.72rem; font-weight: 700; color: var(--rw-primary); }
#radiant-website .rw-intro__vent {
    display: block;
    width: 100%;
    height: 6px;
    background: #d1dce0;
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}
#radiant-website .rw-intro__led { width: 10px; height: 10px; border-radius: 50%; }
#radiant-website .rw-intro__led--blue  { background: #0091D2; box-shadow: 0 0 10px #0091D2; }
#radiant-website .rw-intro__led--green { background: var(--rw-secondary); box-shadow: 0 0 10px var(--rw-secondary); }

#radiant-website .rw-intro__airflow {
    position: absolute;
    top: 0;
    left: -55%;
    width: 160%;
    height: 100%;
    z-index: 7;
    pointer-events: none;
    overflow: visible;
}
#radiant-website .rw-intro__air {
    fill: none;
    stroke: url(#rw-intro-airstream);
    stroke-dasharray: 240 260;
    stroke-dashoffset: 500;
    animation: rw-introBlow 2.6s linear infinite;
}
#radiant-website .rw-intro__air--1 { stroke-width: 3.5; animation-delay: 0s; }
#radiant-website .rw-intro__air--2 { stroke-width: 2.0; animation-delay: 0.4s; opacity: 0.7; }
#radiant-website .rw-intro__air--3 { stroke-width: 3.0; animation-delay: 0.7s; }
#radiant-website .rw-intro__air--4 { stroke-width: 1.5; animation-delay: 1.1s; opacity: 0.65; }
#radiant-website .rw-intro__air--5 { stroke-width: 4.0; animation-delay: 0.3s; }
#radiant-website .rw-intro__air--6 { stroke-width: 2.5; animation-delay: 0.9s; opacity: 0.75; }

@keyframes rw-introBlow {
    0%   { stroke-dashoffset: 500; opacity: 0; }
    35%  { opacity: 0.85; }
    100% { stroke-dashoffset: -200; opacity: 0; }
}

/* ---- Small-screen visual: one AC at top-centre + simple air waves ---- */

#radiant-website .rw-intro__visual-sm { display: none; }

#radiant-website .rw-intro__ac--solo {
    position: relative;
    top: auto; right: auto;
    width: 220px;
    height: 62px;
    margin: 0 auto;
    z-index: 2;
    /* AC stays still on small screens - only the air waves + headline move. */
}

#radiant-website .rw-intro__airflow-sm {
    position: absolute;
    left: 50%;
    top: 42px;                 /* start at the AC vent */
    width: 200px;
    height: 150px;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}
#radiant-website .rw-intro__air--s1,
#radiant-website .rw-intro__air--s2,
#radiant-website .rw-intro__air--s3 {
    stroke: url(#rw-intro-airstream-v);   /* vertical gradient: flows top -> bottom */
    stroke-dasharray: 44 120;
    stroke-dashoffset: 164;
    animation: rw-introBlowSm 2.6s linear infinite;
}
#radiant-website .rw-intro__air--s1 { stroke-width: 3;   animation-delay: 0s; }
#radiant-website .rw-intro__air--s2 { stroke-width: 2.4; animation-delay: 0.55s; opacity: 0.8; }
#radiant-website .rw-intro__air--s3 { stroke-width: 2;   animation-delay: 1.1s; opacity: 0.65; }

@keyframes rw-introBlowSm {
    0%   { stroke-dashoffset: 164; opacity: 0; }
    35%  { opacity: 0.9; }
    100% { stroke-dashoffset: -80; opacity: 0; }
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
    #radiant-website .rw-intro__stage { grid-template-columns: 1fr; gap: 0; text-align: center; }
    #radiant-website .rw-intro__visual { display: none; }
    #radiant-website .rw-intro__badge { justify-content: center; }
    #radiant-website .rw-intro__lead { margin-left: auto; margin-right: auto; }

    #radiant-website .rw-intro__visual-sm {
        display: block;
        position: relative;
        width: 240px;
        height: 190px;
        margin: 0 auto 2rem;
    }
}
@media (max-width: 480px) {
    #radiant-website .rw-intro__stage { width: 88%; }
    #radiant-website .rw-intro__prompt { width: 100%; justify-content: center; }
    #radiant-website .rw-intro__visual-sm { margin-bottom: 1.5rem; }
}

/* ---- Reduced motion: keep it calm and still ---- */

@media (prefers-reduced-motion: reduce) {
    #radiant-website .rw-intro__char,
    #radiant-website .rw-intro__air,
    #radiant-website .rw-intro__prompt { animation: none !important; }
    #radiant-website .rw-intro__char--cool { filter: none; }
}
