:root {
    --paper: #f4f1ea;
    --paper-deep: #e8e2d6;
    --ink: #1c2430;
    --ink-soft: #4a5568;
    --champagne: #b8954a;
    --champagne-deep: #9a7a38;
    --champagne-soft: rgba(184, 149, 74, 0.22);
    --line: rgba(28, 36, 48, 0.12);
    --field: #ffffff;
    --rx: 0deg;
    --ry: 0deg;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

body {
    min-height: 100vh;
    height: 100vh;
    font-family: "Manrope", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    overflow: hidden;
}

button, input { font: inherit; }

.gate {
    position: relative;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    isolation: isolate;
    display: grid;
    place-items: stretch;
    /* Sağda nefes: panel ekranın kenarına yapışmasın */
    padding: clamp(8px, 1.5vh, 18px) clamp(40px, 6.5vw, 96px) clamp(8px, 1.5vh, 18px) clamp(12px, 2vw, 28px);
    overflow: hidden;
}

/* —— Açık, nefes alan sahne —— */
.gate-world {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    perspective: 1200px;
}

.gate-sky {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 85% 50% at 50% -5%, rgba(247, 244, 238, 0.75), transparent 55%),
        radial-gradient(ellipse 55% 40% at 12% 85%, rgba(184, 149, 74, 0.12), transparent 60%),
        radial-gradient(ellipse 50% 35% at 88% 70%, rgba(120, 150, 180, 0.1), transparent 55%),
        linear-gradient(165deg, #f7f4ee 0%, #efe9de 45%, #e7e0d2 100%);
}

.gate-haze {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 40% at 50% 38%, rgba(244, 241, 234, 0.35), transparent 72%);
    animation: gateHaze 12s ease-in-out infinite alternate;
}

@keyframes gateHaze {
    from { opacity: 0.75; transform: scale(1); }
    to { opacity: 1; transform: scale(1.03); }
}

.gate-beam {
    position: absolute;
    left: 50%;
    top: -25%;
    width: min(72vw, 760px);
    height: 95vh;
    transform: translateX(-50%);
    background: linear-gradient(
        180deg,
        rgba(244, 241, 234, 0.35) 0%,
        rgba(184, 149, 74, 0.08) 38%,
        transparent 78%
    );
    filter: blur(22px);
    animation: gateBeam 9s ease-in-out infinite alternate;
}

@keyframes gateBeam {
    from { opacity: 0.55; transform: translateX(-50%) scaleX(0.94); }
    to { opacity: 0.95; transform: translateX(-50%) scaleX(1.06); }
}

.gate-grain {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.gate-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 70% at 50% 45%, transparent 40%, rgba(215, 205, 185, 0.28) 100%);
}

/* —— Sol: kurs çizimi · Sağ: giriş (tek ekran, kaydırma yok) —— */
.gate-layout {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, 560px);
    align-items: center;
    gap: clamp(8px, 1.6vw, 24px);
    margin-inline: 0;
    overflow: hidden;
}

.gate-art {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    align-self: stretch;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    background: transparent;
    overflow: hidden;
}

.gate-sketch-stage {
    position: relative;
    width: 100%;
    max-height: calc(100% - 28px);
    aspect-ratio: 1536 / 1024;
    transform-origin: right center;
    animation:
        gateSketchGrow 1.35s cubic-bezier(0.16, 1, 0.3, 1) both,
        gateSketchDrift 11s ease-in-out 1.35s infinite;
    /* Sol/üst/alt dolu; sağda forma yumuşak geçiş */
    -webkit-mask-image:
        linear-gradient(90deg, #000 0%, #000 78%, transparent 100%),
        linear-gradient(180deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
    mask-image:
        linear-gradient(90deg, #000 0%, #000 78%, transparent 100%),
        linear-gradient(180deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

.gate-sketch-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: left center;
    background: transparent;
    opacity: 0.97;
    mix-blend-mode: multiply;
    filter: contrast(1.12) saturate(0.85);
}

.gate-art-caption {
    flex: 0 0 auto;
    margin: 6px 0 0 4%;
    align-self: flex-start;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 0.95rem;
    font-style: italic;
    letter-spacing: 0.04em;
    color: #6b7280;
    opacity: 0.75;
    animation: gateSketchIn 1s ease 0.6s both;
}

@keyframes gateSketchIn {
    from { opacity: 0; }
    to { opacity: 0.75; }
}

/* İlk giriş: sağdan sola doğru büyüyerek gelir */
@keyframes gateSketchGrow {
    from {
        opacity: 0;
        transform: scaleX(0.72) scaleY(0.9) translateX(36px);
    }
    to {
        opacity: 0.96;
        transform: scaleX(1) scaleY(1) translateX(0);
    }
}

/* Ufak sürekli hareket — sağ kökten hafif nefes (kaydırma yaratmasın) */
@keyframes gateSketchDrift {
    0%, 100% {
        transform: scale(1) translateX(0) translateY(0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    }
    40% {
        transform: scale(1.012) translateX(-6px) translateY(-3px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    }
    70% {
        transform: scale(1.006) translateX(-2px) translateY(2px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    }
}

/* —— İçerik —— */
.gate-stage {
    position: relative;
    z-index: 2;
    width: min(100%, 540px);
    max-width: 540px;
    align-self: center;
    justify-self: start; /* kolon içinde sola — sağ kenara sıkışmasın */
    margin-right: clamp(8px, 1.5vw, 28px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: gateEnter 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes gateEnter {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.gate-brand {
    margin-bottom: clamp(14px, 2.4vh, 28px);
}

.gate-logo-wrap {
    position: relative;
    width: clamp(84px, 12vh, 104px);
    height: clamp(84px, 12vh, 104px);
    margin: 0 auto clamp(10px, 1.6vh, 18px);
}

.gate-logo-aura {
    position: absolute;
    inset: -16%;
    border-radius: 30px;
    background: radial-gradient(circle, rgba(184, 149, 74, 0.28), transparent 70%);
    filter: blur(8px);
    animation: gateAura 5.5s ease-in-out infinite alternate;
}

@keyframes gateAura {
    from { opacity: 0.5; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1.06); }
}

.gate-logo {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 16px;
    border-radius: 24px;
    background: linear-gradient(160deg, #2a3a52 0%, #1c2a3d 100%);
    border: 1px solid rgba(184, 149, 74, 0.35);
    box-shadow:
        0 16px 36px rgba(28, 36, 48, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: gateLogoFloat 7s ease-in-out infinite;
}

@keyframes gateLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.gate-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
}

.gate-brand-title {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2.1rem, 3.6vw, 2.95rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--ink);
}

.gate-brand-sub {
    margin: 10px 0 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--champagne-deep);
}

/* —— Form paneli: opak, okunur —— */
.gate-panel {
    position: relative;
    width: 100%;
    padding: clamp(26px, 3.5vh, 38px) clamp(28px, 3vw, 40px) clamp(22px, 3vh, 30px);
    border-radius: 26px;
    background: #fff;
    border: 1px solid rgba(28, 36, 48, 0.08);
    box-shadow:
        0 24px 50px rgba(28, 36, 48, 0.1),
        0 2px 0 rgba(255, 255, 255, 0.8) inset;
    overflow: hidden;
}

.gate-panel-edge {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(184, 149, 74, 0.55),
        transparent 38%,
        transparent 62%,
        rgba(184, 149, 74, 0.28)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.gate-panel h2 {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.gate-panel-lead {
    margin: 10px 0 0;
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--ink-soft);
}

.gate-alert {
    margin-top: 16px;
    padding: 11px 14px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
}

.gate-form {
    margin-top: 26px;
    text-align: left;
}

.gate-field {
    margin-bottom: 16px;
}

.gate-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.gate-input {
    position: relative;
}

.gate-input svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #8b95a5;
    pointer-events: none;
    transition: color 0.2s ease;
}

.gate-input input {
    width: 100%;
    height: clamp(50px, 6.5vh, 56px);
    padding: 0 18px 0 46px;
    border-radius: 15px;
    border: 1.5px solid #d5dbe5;
    background: #f8f7f4;
    color: var(--ink);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.gate-input input::placeholder {
    color: #9aa3b2;
}

.gate-input input:focus {
    border-color: var(--champagne);
    background: #fff;
    box-shadow: 0 0 0 3px var(--champagne-soft);
}

.gate-input:focus-within svg {
    color: var(--champagne-deep);
}

.gate-submit {
    position: relative;
    width: 100%;
    height: clamp(50px, 6.5vh, 56px);
    margin-top: 12px;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(135deg, #c9a85a 0%, #b8954a 48%, #9a7a38 100%);
    color: #1a1408;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: 0 12px 28px rgba(154, 122, 56, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.gate-submit-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 48%,
        transparent 66%
    );
    transform: translateX(-120%);
    animation: gateShine 4.8s ease-in-out infinite;
}

@keyframes gateShine {
    0%, 60%, 100% { transform: translateX(-120%); }
    75% { transform: translateX(120%); }
}

.gate-submit-text {
    position: relative;
    z-index: 1;
}

.gate-submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 16px 34px rgba(154, 122, 56, 0.34);
}

.gate-submit:active {
    transform: translateY(0);
}

.gate-foot {
    margin: 16px 0 0;
    font-size: 12px;
    font-weight: 500;
    color: #8a93a3;
    text-align: center;
}

@media (max-width: 900px) {
    html, body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .gate {
        height: auto;
        max-height: none;
        min-height: 100vh;
        place-items: center;
        padding: clamp(16px, 3vh, 28px) 16px;
        overflow: visible;
    }

    .gate-layout {
        grid-template-columns: 1fr;
        max-width: 520px;
        height: auto;
        min-height: 0;
        gap: 16px;
        margin-inline: auto;
        overflow: visible;
    }

    .gate-art {
        order: -1;
        min-height: 0;
        height: auto;
    }

    .gate-sketch-stage {
        width: min(520px, 94vw);
        max-height: 260px;
        margin-inline: auto;
        animation: none;
        -webkit-mask-image:
            linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
        mask-image:
            linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
    }

    .gate-sketch-img {
        opacity: 0.9;
        object-fit: contain;
        object-position: center;
    }

    .gate-art-caption {
        font-size: 0.95rem;
        margin-left: 0;
        align-self: center;
    }
}

@media (max-width: 480px) {
    .gate-logo-wrap {
        width: 84px;
        height: 84px;
    }

    .gate-logo {
        padding: 12px;
        border-radius: 20px;
    }

    .gate-logo img {
        max-width: 48px;
        max-height: 48px;
    }

    .gate-panel {
        padding: 26px 20px 22px;
    }

    .gate-sketch-stage {
        max-height: 180px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gate-haze,
    .gate-beam,
    .gate-logo-aura,
    .gate-logo,
    .gate-submit-shine,
    .gate-stage,
    .gate-art,
    .gate-sketch-stage,
    .gate-sketch-img,
}
