/* ==========================================================================
   Necat Bakal Oyun Parkı — Landing Page
   Aesthetic: storybook + retro-pop, sıcak palet, hand-drawn vibes
   ========================================================================== */

:root {
    --cream:        #FFF6E0;
    --cream-deep:   #FCE7A8;
    --mustard:      #F4B942;
    --tomato:       #E94F37;
    --berry:        #D5527E;
    --mint:         #6FBF87;
    --sky:          #5DA9E9;
    --lavender:     #B197FC;
    --ink:          #2A1B0E;
    --ink-soft:     #5A4634;
    --paper:        #FFFDF6;

    --shadow-flat:  6px 6px 0 var(--ink);
    --shadow-flat-lg: 10px 10px 0 var(--ink);
}

html { scroll-behavior: smooth; }

body.home {
    background: var(--cream);
    color: var(--ink);
    font-family: 'Quicksand', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.font-display {
    /* Fredoka 700: yuvarlak, "fat" oyuncak hissi + tam Türkçe Latin Extended
       desteği (ş, Ş, ı, İ, ğ, Ğ, ç, Ç, ö, Ö, ü, Ü).
       Quicksand fallback olarak listelendi: Fredoka yüklenemezse bile
       Türkçe karakterler düzgün render edilsin (system-ui'ye düşmesin). */
    font-family: 'Fredoka', 'Quicksand', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 0.98;
}

.font-hand {
    font-family: 'Caveat', cursive;
    font-weight: 600;
}

/* ---------------------------------------------------------------- grain */
.grain::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.65 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.18;
    mix-blend-mode: multiply;
}

/* ---------------------------------------------------------------- nav */
.nav-link {
    position: relative;
    padding: 0.4rem 0.2rem;
    font-weight: 600;
    color: var(--ink);
    transition: color 200ms;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 3px;
    background: var(--tomato);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link:hover::after { transform: scaleX(1); }

/* ---------------------------------------------------------------- buttons */
.btn-chunky {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.95rem 1.7rem;
    border-radius: 999px;
    border: 2.5px solid var(--ink);
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    background: var(--ink);
    color: var(--cream);
    box-shadow: 0 5px 0 var(--ink);
    transform: translateY(0);
    transition: transform 150ms ease, box-shadow 150ms ease;
    cursor: pointer;
}
.btn-chunky:hover  { transform: translateY(-3px); box-shadow: 0 8px 0 var(--ink); }
.btn-chunky:active { transform: translateY(2px);  box-shadow: 0 1px 0 var(--ink); }

.btn-chunky--tomato  { background: var(--tomato);  color: var(--cream); }
.btn-chunky--mustard { background: var(--mustard); color: var(--ink); }
.btn-chunky--mint    { background: var(--mint);    color: var(--ink); }
.btn-chunky--ghost   { background: var(--paper);   color: var(--ink); }

/* ---------------------------------------------------------------- cards */
.chunky-card {
    position: relative;
    border: 2.5px solid var(--ink);
    border-radius: 1.75rem;
    box-shadow: var(--shadow-flat);
    transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chunky-card:hover {
    transform: translate(-3px, -4px);
    box-shadow: var(--shadow-flat-lg);
}

/* ---------------------------------------------------------------- ticket */
.ticket {
    position: relative;
    background: var(--paper);
    border: 2.5px solid var(--ink);
    border-radius: 1.5rem;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: var(--shadow-flat);
    transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ticket:hover {
    transform: translate(-3px, -4px);
    box-shadow: var(--shadow-flat-lg);
}
.ticket--featured {
    background: var(--cream-deep);
    transform: scale(1.04) rotate(-1deg);
}
.ticket--featured:hover {
    transform: scale(1.05) translate(-3px, -5px);
}

/* perforation: yarım daire kesikler */
.ticket::before,
.ticket::after {
    content: '';
    position: absolute;
    top: 64%;
    width: 24px; height: 24px;
    background: var(--cream);
    border: 2.5px solid var(--ink);
    border-radius: 50%;
    transform: translateY(-50%);
}
.ticket::before { left: -14px; }
.ticket::after  { right: -14px; }
.ticket--featured::before,
.ticket--featured::after { background: var(--cream); }

.ticket-divider {
    margin: 1.25rem -0.25rem 1rem;
    border: none;
    border-top: 2.5px dashed var(--ink-soft);
    opacity: 0.5;
}

/* ---------------------------------------------------------------- floats */
@keyframes float {
    0%, 100% { transform: translateY(0)     rotate(var(--rot, 0deg)); }
    50%      { transform: translateY(-14px) rotate(var(--rot-alt, var(--rot, 0deg))); }
}
.float-slow   { animation: float 6.5s ease-in-out infinite; }
.float-medium { animation: float 5s   ease-in-out infinite 0.4s; }
.float-fast   { animation: float 4s   ease-in-out infinite 1s; }

/* ---------------------------------------------------------------- pop in */
@keyframes pop-in {
    0%   { opacity: 0; transform: translateY(28px) scale(0.92); }
    70%  { opacity: 1; transform: translateY(-4px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0)    scale(1); }
}
.pop-in { animation: pop-in 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; }
.pop-in-1 { animation-delay: 0.05s; }
.pop-in-2 { animation-delay: 0.18s; }
.pop-in-3 { animation-delay: 0.32s; }
.pop-in-4 { animation-delay: 0.46s; }

/* ---------------------------------------------------------------- bouncy nav badge */
@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50%      { transform: rotate(3deg); }
}
.wiggle { animation: wiggle 4s ease-in-out infinite; transform-origin: center; }

/* ---------------------------------------------------------------- section divider squiggle */
.squiggle {
    width: 100%;
    height: 28px;
    color: var(--ink);
    overflow: hidden;
}

/* ---------------------------------------------------------------- spotlight blob */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    opacity: 0.55;
}

/* ---------------------------------------------------------------- speech bubble */
.speech {
    position: relative;
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 1rem;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    box-shadow: 3px 3px 0 var(--ink);
}
.speech::after {
    content: '';
    position: absolute;
    bottom: -10px; left: 24px;
    width: 16px; height: 16px;
    background: var(--paper);
    border-right: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    transform: rotate(45deg);
}

/* ---------------------------------------------------------------- tarife rayı (yatay scroll) */
/*
 * Az kart -> ortalanır
 * Çok kart -> taşma + yatay scroll
 *
 * Püf nokta: `justify-content: safe center` overflow olduğunda otomatik
 * `flex-start`'a düşer, böylece ilk kart kesilmez. Eski `width: max-content +
 * margin: 0 auto` yöntemi overflow:auto context'inde sağa yaslama yapıyordu.
 */
/* Wrapper: ok butonlarını rail'in üstüne mutlak konumlandırmak için referans. */
.tariff-rail-wrap {
    position: relative;
}

.tariff-rail {
    display: flex;
    justify-content: safe center;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: visible;
    margin: 0 -1rem;                 /* shadow'lar kenarlardan kesilmesin */
    padding: 1.5rem 1rem 2rem;
    scroll-snap-type: x mandatory;
    scroll-padding: 1rem;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Sol/sağ kaydırma okları — sadece 4+ tarife varsa ve scroll mümkünse görünür.
   Default gizli; JS overflow olduğunu tespit edince .is-visible ekler. */
.tariff-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    border: 2.5px solid var(--ink);
    background: var(--cream);
    color: var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
}
.tariff-arrow svg { width: 1.25rem; height: 1.25rem; }
.tariff-arrow:hover {
    transform: translateY(-50%) translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink);
}
.tariff-arrow:active {
    transform: translateY(-50%) translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--ink);
}
.tariff-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: translateY(-50%);
    box-shadow: 3px 3px 0 var(--ink);
}
.tariff-arrow--prev { left: -0.5rem; }
.tariff-arrow--next { right: -0.5rem; }
@media (min-width: 768px) {
    .tariff-arrow--prev { left: -1.25rem; }
    .tariff-arrow--next { right: -1.25rem; }
}
.tariff-rail-wrap.is-scrollable .tariff-arrow {
    display: inline-flex;
}
.tariff-rail > .ticket {
    flex: 0 0 18rem;                 /* sabit kart genişliği */
    scroll-snap-align: center;
}
.tariff-rail > .ticket--featured {
    flex: 0 0 19rem;                 /* featured biraz daha geniş */
}
@media (min-width: 640px) {
    .tariff-rail { margin: 0; }
}
/* özel scrollbar */
.tariff-rail::-webkit-scrollbar { height: 8px; }
.tariff-rail::-webkit-scrollbar-track { background: transparent; }
.tariff-rail::-webkit-scrollbar-thumb {
    background: rgba(42, 27, 14, 0.25);
    border-radius: 9999px;
}

/* ---------------------------------------------------------------- responsive tweaks */
@media (max-width: 640px) {
    .ticket--featured { transform: rotate(0); }
    .chunky-card { box-shadow: 4px 4px 0 var(--ink); }
    .chunky-card:hover { transform: none; box-shadow: 4px 4px 0 var(--ink); }
}

/* ---------------------------------------------------------------- accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        transition-duration: 0.001s !important;
    }
}
