/* ============================================================
   PREMIUM ROLLING SHUTTER PRELOADER
   Demirdelen.com — Kurumsal açılış animasyonu

   Konsept korundu: metal kepenk alttan yukarı akıcı şekilde kalkar.
   Yenilendi: tek parça düzgün metal lameller (repeating-linear-gradient),
   metalik ışık süzülmesi, gerçek progress bar, daha yumuşak easing.
   Sadece oturum başına bir kez oynar (sessionStorage).
   ============================================================ */

/* -------------------------------------------------------
   1. BODY LOCK
   ------------------------------------------------------- */
body.garage-active {
    overflow: hidden !important;
    height: 100vh !important;
}

/* -------------------------------------------------------
   2. OVERLAY CONTAINER
   ------------------------------------------------------- */
.garage-door {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    pointer-events: all;
    overflow: hidden;
    background: #0a0a0a;
}

.garage-door--skip {
    display: none !important;
}

/* -------------------------------------------------------
   3. TOP ROLLER HOUSING
   ------------------------------------------------------- */
.garage-door__track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 26px;
    z-index: 30;
    background: linear-gradient(180deg, #202020 0%, #0e0e0e 70%, #161616 100%);
    border-bottom: 2px solid #2c2c2c;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.85), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.garage-door__track::before,
.garage-door__track::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #5a5a5a, #1a1a1a 70%);
    border: 1px solid #333;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.12);
}

.garage-door__track::before { left: 32px; }
.garage-door__track::after  { right: 32px; }

/* -------------------------------------------------------
   4. THE SHUTTER (moving door)
   ------------------------------------------------------- */
.garage-door__panels {
    position: absolute;
    top: 26px;
    left: 0;
    width: 100%;
    height: calc(100vh - 26px);
    z-index: 10;
    transform: translateY(0);
    will-change: transform;
    overflow: hidden;
    background: #131313;
}

/* Uniform horizontal metal slats — crisp and evenly spaced */
.garage-door__slats {
    position: absolute;
    inset: 0;
    background:
        /* per-slat top highlight + bottom shadow groove */
        repeating-linear-gradient(
            180deg,
            #232323 0px,
            #1b1b1b 14px,
            #141414 30px,
            #0e0e0e 38px,
            #1d1d1d 40px
        );
    box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.55);
}

/* Vertical brushed-metal sheen + animated light sweep across the slats */
.garage-door__sheen {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.45) 0%,
            rgba(255, 255, 255, 0.05) 18%,
            rgba(255, 255, 255, 0.10) 38%,
            rgba(255, 255, 255, 0.04) 50%,
            rgba(255, 255, 255, 0.10) 62%,
            rgba(255, 255, 255, 0.05) 82%,
            rgba(0, 0, 0, 0.45) 100%
        );
    mix-blend-mode: screen;
    opacity: 0.5;
}

/* Travelling glint */
.garage-door__sheen::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.04) 40%,
        rgba(255, 255, 255, 0.16) 50%,
        rgba(255, 255, 255, 0.04) 60%,
        transparent 100%
    );
    animation: gdGlint 2.6s ease-in-out 0.4s infinite;
}

@keyframes gdGlint {
    0%   { left: -60%; }
    55%  { left: 130%; }
    100% { left: 130%; }
}

/* Side rails (guides) */
.garage-door__rail {
    position: absolute;
    top: 0;
    width: 26px;
    height: 100%;
    z-index: 4;
}

.garage-door__rail--left {
    left: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.6), transparent);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.garage-door__rail--right {
    right: 0;
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.6), transparent);
    border-left: 1px solid rgba(255, 255, 255, 0.04);
}

/* -------------------------------------------------------
   5. BRAND + PROGRESS (embossed into the metal)
   ------------------------------------------------------- */
.garage-door__brand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    text-align: center;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(90vw, 460px);
    animation: gdBrandIn 0.7s ease-out both;
}

@keyframes gdBrandIn {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.garage-door__logo-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(1.6rem, 5vw, 2.6rem);
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #f4f4f4;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12),
        0 -1px 1px rgba(0, 0, 0, 0.9),
        0 2px 8px rgba(0, 0, 0, 0.6);
}

.garage-door__logo-text span {
    color: #d11f1f;
    text-shadow:
        0 1px 0 rgba(255, 120, 120, 0.18),
        0 -1px 1px rgba(0, 0, 0, 0.9),
        0 0 16px rgba(196, 30, 30, 0.45);
}

.garage-door__tagline {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.58rem, 1.6vw, 0.74rem);
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
}

/* Real loading progress bar */
.garage-door__progress {
    width: min(70vw, 240px);
    height: 3px;
    margin-top: 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.garage-door__progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #8c1515, #d11f1f 60%, #ff5252);
    box-shadow: 0 0 12px rgba(209, 31, 31, 0.55);
    animation: gdProgress 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes gdProgress {
    0%   { width: 0; }
    60%  { width: 72%; }
    100% { width: 100%; }
}

/* -------------------------------------------------------
   6. VIGNETTE
   ------------------------------------------------------- */
.garage-door__ambient {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 45%, transparent 32%, rgba(0, 0, 0, 0.35) 72%, rgba(0, 0, 0, 0.65) 100%);
}

/* -------------------------------------------------------
   7. FLOOR LINE
   ------------------------------------------------------- */
.garage-door__floor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    z-index: 25;
    background: linear-gradient(180deg, #2e2e2e 0%, #1a1a1a 50%, #101010 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.5);
}

/* -------------------------------------------------------
   8. LIFTING SEQUENCE (smooth & premium, ~1.6s total)
   ------------------------------------------------------- */

/* Brand fades up & out first */
.garage-door--lifting .garage-door__brand {
    animation: gdBrandOut 0.45s ease-in forwards;
}

@keyframes gdBrandOut {
    to { opacity: 0; transform: translate(-50%, -58%); }
}

/* Shutter rolls up — single smooth motion with a touch of ease-in */
.garage-door--lifting .garage-door__panels {
    animation: gdLift 2.75s cubic-bezier(0.76, 0, 0.24, 1) 0.25s forwards;
}

@keyframes gdLift {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-101%); }
}

/* Glint stops while lifting */
.garage-door--lifting .garage-door__sheen::after {
    animation: none;
    opacity: 0;
}

/* Vignette clears as the site is revealed */
.garage-door--lifting .garage-door__ambient {
    animation: gdFade 1.1s ease-out 0.3s forwards;
}

/* Track retracts right after the shutter */
.garage-door--lifting .garage-door__track {
    animation: gdTrackUp 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) 2.7s forwards;
}

@keyframes gdTrackUp {
    to { transform: translateY(-120%); opacity: 0; }
}

.garage-door--lifting .garage-door__floor {
    animation: gdFade 0.5s ease-out 2.5s forwards;
}

@keyframes gdFade {
    to { opacity: 0; }
}

.garage-door--lifting {
    pointer-events: none;
}

/* -------------------------------------------------------
   9. RESPONSIVE
   ------------------------------------------------------- */
@media (max-width: 768px) {
    .garage-door__track { height: 22px; }
    .garage-door__panels { top: 22px; height: calc(100vh - 22px); }
    .garage-door__track::before { left: 18px; }
    .garage-door__track::after  { right: 18px; }
}

/* -------------------------------------------------------
   10. REDUCED MOTION — respect user preference
   ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .garage-door__sheen::after,
    .garage-door__progress-fill { animation-duration: 0.01s !important; }

    .garage-door--lifting .garage-door__panels,
    .garage-door--lifting .garage-door__track,
    .garage-door--lifting .garage-door__floor,
    .garage-door--lifting .garage-door__brand,
    .garage-door--lifting .garage-door__ambient {
        animation-duration: 0.2s !important;
    }
}
