/*
 * Ana sayfa — uygulamanın onboarding'inin web karşılığı.
 *
 * Ziyaretçi uygulamayı indirmeden önce asıl işi burada dener: kelimeye
 * dokunur, cümleyi çevirir, dinler, deftere ekler, quiz çözer.
 *
 * Değerler uygulamanın onboarding temasından (Flutter
 * lib/features/onboarding/presentation/utils/onboarding_v2_theme.dart):
 * zemin FAF3EA, mürekkep 1D1D1F, ikincil 6E6A63, vurgu FF9500, kart köşesi 24,
 * düğme köşesi 99, giriş animasyonu 520 ms, balon 650 ms.
 */

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('/fonts/PlusJakartaSans-latin-ext.woff2') format('woff2');
    font-weight: 500 800;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('/fonts/PlusJakartaSans-latin.woff2') format('woff2');
    font-weight: 500 800;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Lora';
    src: url('/fonts/Lora-latin-ext.woff2') format('woff2');
    font-weight: 400 600;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4;
}

@font-face {
    font-family: 'Lora';
    src: url('/fonts/Lora-latin.woff2') format('woff2');
    font-weight: 400 600;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ob-bg: #FAF3EA;
    --ob-ink: #1D1D1F;
    --ob-ink-2: #6E6A63;
    --ob-ink-3: #98928A;
    --ob-accent: #FF9500;
    --ob-card: #FFFFFF;
    --ob-track: #EDE2D2;
    --ob-overline: #C4B8A5;
    --ob-wash: #FFE9CC;
    --ob-ok: #34C759;
    --ob-bad: #FF3B30;
    --ob-card-radius: 24px;
    --ob-card-shadow: 0 8px 24px rgba(29, 29, 31, .05);
    --ob-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --ob-read: 'Lora', Georgia, serif;
    --ob-rise: 520ms;
    --ob-pop: 650ms;
}

body.de-public { background: var(--ob-bg); }
.de-nav { background: rgba(250, 243, 234, .86); backdrop-filter: saturate(160%) blur(14px); }

/* ---------- ilerleme çubuğu (uygulamanın onboarding çubuğu) ---------- */
.ob-progress {
    position: fixed; left: 0; right: 0; top: 0; height: 4px; z-index: 60;
    background: var(--ob-track);
}
.ob-progress i {
    display: block; height: 100%; width: 100%;
    background: var(--ob-accent); border-radius: 0 4px 4px 0;
    transform-origin: left center; transform: scaleX(0);
}

/* ---------- ekran ---------- */
.ob-screen { padding: 72px 0; overflow: hidden; }
.ob-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 56px; align-items: center;
}
.ob-screen.ob-flip .ob-copy { order: 2; }
.ob-copy { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ob-eyebrow {
    margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ob-ink-3);
}
.ob-title {
    margin: 0; font-family: var(--ob-display); font-weight: 800; color: var(--ob-ink);
    font-size: clamp(30px, 4.6vw, 52px); line-height: 1.12; letter-spacing: -.02em; text-wrap: balance;
}
.ob-title em { font-style: normal; color: var(--ob-accent); }
.ob-sub { margin: 0; font-size: clamp(15px, 1.5vw, 18px); font-weight: 500; line-height: 1.55; color: var(--ob-ink-2); max-width: 34em; }
.ob-note { margin: 0; font-size: 13px; color: var(--ob-ink-3); }
.ob-next {
    align-self: flex-start; margin-top: 6px; font-weight: 700; font-size: 15px; color: var(--ob-ink); text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
}
.ob-next span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ob-card); box-shadow: var(--ob-card-shadow); }

.ob-card {
    background: var(--ob-card); border-radius: var(--ob-card-radius); box-shadow: var(--ob-card-shadow);
    border: 1px solid rgba(0, 0, 0, .08); padding: 22px; position: relative; min-width: 0;
}
.ob-overline { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ob-overline); margin: 0 0 10px; }
.ob-text { font-family: var(--ob-read); font-size: clamp(18px, 1.9vw, 21px); line-height: 1.85; color: var(--ob-ink); margin: 0; }
.ob-text + .ob-text { margin-top: .35em; }
.ob-hint { margin: 14px 0 0; font-size: 13px; color: var(--ob-ink-3); text-align: center; min-height: 1.5em; }

/* ---------- giriş hareketi ---------- */
.ob-js .ob-rise { opacity: 0; transform: translateY(18px); }
.ob-js .in .ob-rise, .ob-js .ob-rise.in {
    opacity: 1; transform: none;
    transition: opacity var(--ob-rise) ease-out, transform var(--ob-rise) ease-out;
    transition-delay: calc(var(--i, 0) * 90ms);
}

/* ---------- 1. açılış: uçan kitaplar ---------- */
.ob-hero { padding-top: 56px; }
.ob-books { position: relative; height: clamp(320px, 42vw, 520px); }
.ob-book {
    position: absolute; left: var(--x); top: var(--y); width: var(--w, 30%);
    aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden;
    box-shadow: 0 18px 40px rgba(29, 29, 31, .22);
    transform: rotate(var(--r)); z-index: var(--z, 1);
    will-change: transform;
}
.ob-book img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ob-js .ob-book { animation: ob-fly 1100ms cubic-bezier(.16, .9, .28, 1.12) both, ob-float var(--f, 6s) ease-in-out 1200ms infinite alternate; animation-delay: calc(var(--i) * 90ms), calc(1200ms + var(--i) * 140ms); }
@keyframes ob-fly {
    from { opacity: 0; transform: translate(var(--fx, 0), 110vh) rotate(calc(var(--r) * -4)) scale(.8); }
    60% { opacity: 1; }
    to { opacity: 1; transform: rotate(var(--r)); }
}
@keyframes ob-float {
    from { transform: translateY(0) rotate(var(--r)); }
    to { transform: translateY(-12px) rotate(calc(var(--r) + 1.5deg)); }
}

/* ---------- 2. kelimeye dokun ---------- */
.ob-w {
    font: inherit; color: inherit; background: none; border: 0; padding: 0 1px; margin: 0; cursor: pointer; border-radius: 6px;
    text-decoration: underline dotted var(--ob-overline); text-underline-offset: 5px; text-decoration-thickness: 2px;
    transition: background-color .15s ease;
}
.ob-w:hover { background: var(--ob-wash); }
.ob-w.is-on { background: var(--ob-wash); box-shadow: inset 0 -2px 0 var(--ob-accent); text-decoration-color: transparent; }
.ob-w.is-saved { text-decoration-color: var(--ob-accent); text-decoration-style: solid; }
.ob-w.pulse { animation: ob-pulse 1600ms ease-out 2; }
@keyframes ob-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 149, 0, .55); }
    100% { box-shadow: 0 0 0 16px rgba(255, 149, 0, 0); }
}
.ob-balloon {
    position: absolute; z-index: 5; left: 0; top: 0; width: max-content; max-width: min(280px, 86%);
    background: var(--ob-card); border-radius: 18px; padding: 12px 12px 12px 16px;
    box-shadow: 0 14px 36px rgba(29, 29, 31, .18); border: 1px solid rgba(0, 0, 0, .06);
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: center;
    transform-origin: 50% 100%;
}
.ob-balloon[hidden] { display: none; }
.ob-balloon.pop { animation: ob-pop var(--ob-pop) cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes ob-pop { from { opacity: 0; transform: translateY(8px) scale(.82); } to { opacity: 1; transform: none; } }
.ob-balloon::after {
    content: ""; position: absolute; left: var(--arrow, 50%); bottom: -7px; width: 14px; height: 14px; background: var(--ob-card);
    transform: translateX(-50%) rotate(45deg); border-radius: 3px; box-shadow: 4px 4px 8px rgba(29, 29, 31, .06);
}
.ob-balloon b { font-family: var(--ob-read); font-size: 22px; font-weight: 600; line-height: 1.15; }
.ob-balloon small { grid-column: 1; font-size: 13px; color: var(--ob-ink-2); }
.ob-add {
    grid-row: 1 / span 2; grid-column: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--ob-accent); color: #fff; font-size: 24px; line-height: 1; font-weight: 500; display: grid; place-items: center;
    transition: transform .15s ease, background-color .2s ease;
}
.ob-add:active { transform: scale(.92); }
.ob-add.done { background: var(--ob-ok); font-size: 18px; }
.ob-fly-chip {
    position: fixed; z-index: 80; pointer-events: none; font-family: var(--ob-read); font-weight: 600; font-size: 16px;
    background: var(--ob-accent); color: #fff; border-radius: 99px; padding: 4px 12px;
    transition: transform 700ms cubic-bezier(.5, -0.2, .3, 1), opacity 700ms ease-in;
}
.ob-pocket {
    position: absolute; right: 16px; top: 16px; display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; color: var(--ob-ink-2); background: var(--ob-bg); border-radius: 99px; padding: 6px 10px;
}
.ob-pocket b { color: var(--ob-accent); font-variant-numeric: tabular-nums; }
.ob-pocket.bump { animation: ob-bump 380ms ease-out; }
@keyframes ob-bump { 40% { transform: scale(1.18); } }

/* ---------- 3. cümleyi çevir ---------- */
.ob-s {
    font: inherit; color: inherit; background: none; border: 0; padding: 2px 4px; margin: 0 -4px; cursor: pointer; border-radius: 8px; text-align: left;
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
    background-image: linear-gradient(var(--ob-wash), var(--ob-wash)); background-repeat: no-repeat; background-size: 0% 100%;
    transition: background-size 420ms ease-out;
}
.ob-s.is-on { background-size: 100% 100%; }
.ob-tr {
    margin-top: 16px; background: #FFF3E0; border-radius: 18px; padding: 14px 16px; font-family: var(--ob-read); font-size: 17px; line-height: 1.6;
    min-height: 3.6em; display: flex; align-items: center;
}
.ob-tr span { display: block; }
.ob-tr.swap span { animation: ob-slide 380ms ease-out both; }
@keyframes ob-slide { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 4. dinle ---------- */
.ob-listen .ob-ls { transition: color .25s ease; color: var(--ob-ink-3); }
.ob-listen .ob-ls.is-now { color: var(--ob-ink); }
.ob-listen .ob-lw { border-radius: 5px; padding: 0 1px; transition: background-color .12s linear; }
.ob-listen .ob-lw.is-now { background: var(--ob-wash); box-shadow: inset 0 -2px 0 var(--ob-accent); }
.ob-listen.is-idle .ob-ls { color: var(--ob-ink); }
.ob-player {
    margin-top: 18px; display: flex; align-items: center; gap: 14px; background: var(--ob-bg); border-radius: 99px; padding: 8px 16px 8px 8px;
}
.ob-play {
    width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--ob-accent); color: #fff; cursor: pointer; flex: none;
    display: grid; place-items: center; transition: transform .15s ease;
}
.ob-play:active { transform: scale(.94); }
.ob-play svg { width: 20px; height: 20px; fill: currentColor; }
.ob-wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 30px; min-width: 0; overflow: hidden; }
.ob-wave i { flex: 1 1 3px; max-width: 4px; height: calc(20% + var(--h) * 80%); border-radius: 2px; background: var(--ob-overline); transform-origin: center; }
.ob-listen.is-playing .ob-wave i { background: var(--ob-accent); animation: ob-wave 900ms ease-in-out infinite alternate; animation-delay: calc(var(--n) * -70ms); }
@keyframes ob-wave { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.ob-time { font-size: 12px; font-weight: 700; color: var(--ob-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 5. defter ve quiz ---------- */
.ob-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ob-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ob-list li {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--ob-track);
}
.ob-list li:first-child { border-top: 0; }
.ob-list li.new { animation: ob-drop 550ms cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes ob-drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.ob-list b { font-family: var(--ob-read); font-size: 18px; font-weight: 600; }
.ob-list span { font-size: 14px; color: var(--ob-ink-2); }
.ob-q { font-family: var(--ob-read); font-size: 26px; font-weight: 600; margin: 0 0 4px; }
.ob-q-sub { margin: 0 0 12px; font-size: 13px; color: var(--ob-ink-3); }
.ob-opts { display: grid; gap: 8px; }
.ob-opt {
    font: inherit; font-weight: 600; text-align: left; min-height: 48px; padding: 10px 14px; border-radius: 16px; cursor: pointer;
    background: var(--ob-bg); border: 2px solid transparent; color: var(--ob-ink);
    transition: background-color .15s ease, border-color .15s ease, transform .12s ease;
}
.ob-opt:active { transform: scale(.98); }
.ob-opt.right { background: #E8F8EC; border-color: var(--ob-ok); animation: ob-bump 380ms ease-out; }
.ob-opt.wrong { background: #FDECEA; border-color: var(--ob-bad); animation: ob-shake 320ms ease-in-out; }
@keyframes ob-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.ob-dots { display: flex; gap: 6px; margin-top: 14px; }
.ob-dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--ob-track); }
.ob-dots i.on { background: var(--ob-accent); }

/* ---------- 6. raf ---------- */
.ob-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ob-chip {
    font: inherit; font-weight: 700; font-size: 14px; min-height: 40px; padding: 8px 16px; border-radius: 99px; border: 0; cursor: pointer;
    background: #EFE6D8; color: var(--ob-ink); transition: background-color .15s ease;
}
.ob-chip[aria-pressed="true"] { background: var(--ob-accent); }
.ob-shelf {
    display: flex; gap: 16px; overflow-x: auto; padding: 8px 20px 18px; margin: 0 -20px; scroll-snap-type: x proximity; scrollbar-width: none;
}
.ob-shelf::-webkit-scrollbar { display: none; }
.ob-tome { flex: 0 0 148px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.ob-tome[hidden] { display: none; }
.ob-tome img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; box-shadow: 0 10px 24px rgba(29, 29, 31, .16); display: block; }
.ob-tome.swap { animation: ob-slide 380ms ease-out both; animation-delay: calc(var(--n, 0) * 50ms); }
.ob-tome b { font-size: 14px; line-height: 1.25; }
.ob-tome span { font-size: 12px; color: var(--ob-ink-2); }

/* ---------- 7. son ekran ---------- */
.ob-final { text-align: center; padding-bottom: 96px; }
.ob-final .ob-copy { align-items: center; max-width: 620px; margin: 0 auto; }
.ob-final .ob-sub { text-align: center; }
.ob-story {
    display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: center; text-align: left; width: min(100%, 380px);
    padding: 14px;
}
.ob-story img { width: 84px; height: 112px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; display: block; }
.ob-story b { font-family: var(--ob-display); font-size: 19px; font-weight: 800; display: block; }
.ob-story span { display: block; font-size: 14px; color: var(--ob-ink-2); }
.ob-final .de-stores { justify-content: center; }

/* ---------- telefonda sabit indirme düğmesi ---------- */
.ob-sticky { display: none; }

@media (max-width: 860px) {
    .ob-screen { padding: 44px 0; }
    .ob-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .ob-screen.ob-flip .ob-copy { order: 0; }
    .ob-hero { padding-top: 20px; }
    .ob-hero .ob-books { order: -1; height: 240px; margin: 0 -8px 8px; }
    .ob-hero .ob-book { width: calc(var(--w, 30%) * .82); }
    .ob-duo { grid-template-columns: minmax(0, 1fr); }
    .ob-card { padding: 18px; }
    .ob-final { padding-bottom: 120px; }
    .ob-sticky {
        display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: linear-gradient(to top, var(--ob-bg) 62%, rgba(250, 243, 234, 0));
        transform: translateY(110%); transition: transform 260ms ease-out;
    }
    .ob-sticky.show { transform: none; }
    .ob-sticky a {
        display: flex; align-items: center; justify-content: center; min-height: 54px; border-radius: 99px;
        background: var(--ob-accent); color: #fff; font-family: var(--ob-display); font-weight: 800; font-size: 17px; text-decoration: none;
        box-shadow: 0 10px 24px rgba(255, 149, 0, .35);
    }
    .ob-sticky a:active { transform: scale(.98); }
}

@media (prefers-reduced-motion: reduce) {
    .ob-js .ob-rise { opacity: 1; transform: none; }
    .ob-js .ob-book { animation: none; }
    .ob-balloon.pop, .ob-w.pulse, .ob-list li.new, .ob-tr.swap span, .ob-tome.swap, .ob-opt.right, .ob-opt.wrong, .ob-pocket.bump { animation: none; }
    .ob-listen.is-playing .ob-wave i { animation: none; }
    .ob-s, .ob-sticky, .ob-fly-chip { transition: none; }
}
