/* SaraFilm — asos: tokenlar, tipografiya, sahifa qobigʻi */

:root {
    /* zamin: logotipdagi toʻq binafsha siyoh */
    --bg: oklch(0.215 0.004 200);
    --bg-2: oklch(0.255 0.004 200);
    --bg-3: oklch(0.295 0.004 200);
    --bg-4: oklch(0.345 0.004 200);
    --line: oklch(0.39 0.004 200);
    --line-soft: oklch(0.31 0.004 200);

    /* matn: krem, ikkilamchi tuslar zamin rangidan boʻyalgan */
    --ink: oklch(0.975 0.002 200);
    --ink-2: oklch(0.83 0.004 200);
    --ink-3: oklch(0.67 0.005 200);

    /* marquee amber — yagona harakat rangi */
    --amber: oklch(0.8 0.165 68);
    --amber-hi: oklch(0.86 0.15 78);
    --amber-lo: oklch(0.7 0.16 60);
    --amber-ink: oklch(0.2 0.02 70);
    --amber-soft: oklch(0.8 0.165 68 / 0.14);

    --crimson: oklch(0.63 0.21 20);
    --green: oklch(0.8 0.15 158);

    --font-display: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-brand: 'Sofia Sans Extra Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --r-xs: 8px;
    --r-sm: 12px;
    --r-md: 12px;
    --r-lg: 18px;

    --shadow-1: 0 2px 6px -2px oklch(0.08 0.004 200 / 0.6), 0 10px 24px -12px oklch(0.08 0.004 200 / 0.7);
    --shadow-2: 0 6px 14px -6px oklch(0.08 0.004 200 / 0.7), 0 28px 56px -24px oklch(0.06 0.004 200 / 0.85);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --gutter: 24px;
    --content: min(1500px, 78vw);
    --wrap: calc(var(--content) + var(--gutter) * 2);
    --header-h: 72px;
    --tabbar-h: 0px;
}

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

html {
    background: var(--bg);
    color-scheme: dark;
    scroll-behavior: smooth;
    scrollbar-color: var(--bg-4) var(--bg);
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    caret-color: var(--amber);
    overflow-x: clip;
}

::selection { background: var(--amber); color: var(--amber-ink); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border: 3px solid var(--bg); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }

h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
    border-radius: 4px;
}

main { flex: 1; outline: none; padding-bottom: 96px; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.display {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}

.text-link {
    color: var(--amber);
    text-decoration: underline;
    text-decoration-color: oklch(0.8 0.165 68 / 0.4);
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
    transition: text-decoration-color 0.2s;
}
.text-link:hover { text-decoration-color: currentColor; }

.skip-link {
    position: fixed; top: 8px; left: 8px; z-index: 200;
    padding: 10px 16px; border-radius: var(--r-sm);
    background: var(--amber); color: var(--amber-ink); font-weight: 600;
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.noscript { padding: 40px var(--gutter); text-align: center; }

/* xlopushka chiziqlari — ajratgich va yuklanish belgisi */
.slate {
    height: 14px;
    background: repeating-linear-gradient(-60deg, var(--amber) 0 22px, var(--bg) 22px 44px);
}

.progress {
    position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 300;
    background: repeating-linear-gradient(-60deg, var(--amber) 0 12px, var(--amber-ink) 12px 24px);
    background-size: 200% 100%;
    transform: scaleX(0); transform-origin: left;
    opacity: 0;
    transition: transform 0.5s var(--ease), opacity 0.3s 0.2s;
}
.progress.is-active {
    opacity: 1;
    transform: scaleX(0.85);
    transition: transform 8s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 0.1s;
    animation: slate-run 0.7s linear infinite;
}
.progress.is-done { transform: scaleX(1); opacity: 0; }
@keyframes slate-run { to { background-position: -27.7px 0; } }

/* ---------------------------------------------------------------- sarlavha */
.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 100;
    height: var(--header-h);
    transition: background-color 0.3s, box-shadow 0.3s;
}
.site-header::before {
    content: ''; position: absolute; inset: 0 0 -28px 0; z-index: -1; pointer-events: none;
    background: linear-gradient(oklch(0.12 0.004 200 / 0.82), transparent);
    transition: opacity 0.3s;
}
.site-header.is-solid {
    background: oklch(0.215 0.004 200 / 0.88);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 1px 0 var(--line-soft);
}
.site-header.is-solid::before { opacity: 0; }

.header-inner { height: 100%; display: flex; align-items: center; gap: clamp(16px, 3vw, 44px); }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 34px; height: 34px; transition: transform 0.6s var(--ease); }
.brand:hover .brand-mark { transform: rotate(72deg); }
.brand-word {
    font-family: var(--font-brand); font-weight: 900; font-size: 1.85rem;
    line-height: 1;
}
.brand-word b { font-weight: inherit; color: var(--amber); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
    position: relative; padding: 9px 14px; border-radius: 99px;
    font-weight: 500; font-size: 0.95rem; color: var(--ink-2);
    transition: color 0.2s, background-color 0.2s;
}
.main-nav a:hover { color: var(--ink); background: oklch(1 0 0 / 0.07); }
.main-nav a[aria-current='page'] { color: var(--amber-ink); background: var(--amber); font-weight: 600; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }

.search-trigger {
    display: flex; align-items: center; gap: 10px;
    height: 42px; width: clamp(180px, 24vw, 320px); padding: 0 8px 0 14px;
    border-radius: 99px; border: 1px solid var(--line);
    background: oklch(0.215 0.004 200 / 0.55);
    color: var(--ink-3); font-size: 0.92rem; text-align: left;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.search-trigger:hover { border-color: var(--ink-3); color: var(--ink); background: var(--bg-2); }
kbd {
    display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
    border-radius: 6px; border: 1px solid var(--line); background: var(--bg-3);
    font: 600 0.72rem var(--font-body); color: var(--ink-2);
}

.user-slot { display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------------------------------------------------------------- mobil pastki panel */
.tabbar { display: none; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: oklch(0.13 0.004 200); margin-top: auto; }
.footer-inner {
    display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(140px, 1fr));
    gap: 40px 32px; padding-block: 56px 40px;
}
.footer-brand p { margin-top: 16px; max-width: 38ch; color: var(--ink-3); font-size: 0.95rem; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer-nav h2 {
    font: 700 0.8rem var(--font-display);
    color: var(--ink-3); margin-bottom: 6px;
}
.footer-nav a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); transition: color 0.2s; }
.footer-nav a:hover { color: var(--amber); }
.footer-legal { padding-block: 20px 28px; border-top: 1px solid var(--line-soft); color: var(--ink-3); font-size: 0.85rem; }

/* ---------------------------------------------------------------- sahifa almashinuvi */
@keyframes page-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
#app.is-entering > * { animation: page-in 0.5s var(--ease) both; }

::view-transition-old(root) { animation: 0.18s ease-out both vt-out; }
::view-transition-new(root) { animation: 0.32s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
::view-transition-group(poster) { animation-duration: 0.45s; animation-timing-function: var(--ease); }

/* ---------------------------------------------------------------- moslashuv */
@media (max-width: 1020px) {
    .main-nav { display: none; }
}

@media (max-width: 760px) {
    :root { --header-h: 58px; --tabbar-h: calc(62px + env(safe-area-inset-bottom)); }
    main { padding-bottom: 64px; }
    .search-trigger { display: none; }
    .brand-word { font-size: 1.6rem; }
    .brand-mark { width: 30px; height: 30px; }

    .tabbar {
        position: fixed; inset: auto 0 0 0; z-index: 100;
        display: grid; grid-template-columns: repeat(5, 1fr);
        height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
        background: oklch(0.14 0.004 200 / 0.94);
        backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid var(--line-soft);
    }
    .tabbar a, .tabbar button {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        color: var(--ink-3); font-size: 0.68rem; font-weight: 500;
    }
    .tabbar .icon { width: 22px; height: 22px; }
    .tabbar [aria-current='page'] { color: var(--amber); }
    .site-footer { padding-bottom: var(--tabbar-h); }
    .footer-inner { grid-template-columns: 1fr 1fr; padding-block: 40px 28px; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ================================================================ iTV uslubidagi qobiq */
@media (max-width: 1200px) { :root { --content: calc(100vw - var(--gutter) * 2); } }
@media (max-width: 760px) { :root { --gutter: 16px; --header-h: 60px; } }

.site-header::before { inset: 0; background: linear-gradient(rgb(0 0 0 / 0.55), transparent); }
.site-header.is-solid { background: oklch(0.215 0.004 200 / 0.92); box-shadow: none; }
.header-inner { gap: clamp(20px, 2.6vw, 40px); }
.main-nav { gap: clamp(14px, 1.6vw, 26px); }
.main-nav a { padding: 8px 0; border-radius: 0; font-weight: 600; font-size: 0.98rem; letter-spacing: -0.01em; color: var(--ink-3); }
.main-nav a:hover { color: var(--ink); background: none; }
.main-nav a[aria-current='page'] { color: var(--ink); background: none; font-weight: 700; }
.header-actions { gap: 8px; }
.square-btn {
    display: inline-grid; place-items: center; flex: none; width: 50px; height: 50px; border-radius: 12px;
    background: var(--bg-2); color: var(--ink); font-weight: 700;
    transition: background-color 0.2s, transform 0.2s var(--ease);
}
.square-btn:hover { background: var(--bg-4); }
.square-btn:active { transform: scale(0.94); }
.square-btn .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.progress { background: var(--amber); animation: none !important; }
.slate { display: none; }
.site-footer { background: oklch(0.19 0.004 200); border-top: 1px solid var(--line-soft); }
.footer-nav h2 { font: 700 0.95rem var(--font-display); color: var(--ink); }
@media (max-width: 760px) {
    .square-btn { width: 44px; height: 44px; }
}
