/* ============================================================
   Kingsman — design tokens, reset, layout chrome
   Palette from the iOS app: gold #F1A424, soft gold #FFD980,
   luxe dark #0F0F12/#1F1F23, light #F5F5F6/#FFFFFF.
   ============================================================ */

:root {
    --gold: #f1a424;
    --gold-soft: #ffd980;
    --gold-deep: #c9820f;
    --gold-grad: linear-gradient(135deg, #ffd980 0%, #f1a424 55%, #d98f12 100%);

    --bg: #f5f5f6;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --text: #131316;
    --text-2: rgba(10, 10, 14, 0.55);
    --text-3: rgba(10, 10, 14, 0.35);
    --hairline: rgba(10, 10, 14, 0.08);
    --hairline-strong: rgba(10, 10, 14, 0.14);
    --shimmer-base: rgba(10, 10, 14, 0.06);
    --shimmer-glow: rgba(255, 255, 255, 0.65);
    --overlay: rgba(12, 12, 16, 0.45);
    --header-bg: rgba(255, 255, 255, 0.82);

    --success: #2fa563;
    --danger: #e5484d;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-pill: 999px;

    --shadow-card: 0 1px 2px rgba(12, 12, 16, 0.05), 0 8px 24px -12px rgba(12, 12, 16, 0.12);
    --shadow-lift: 0 2px 4px rgba(12, 12, 16, 0.06), 0 18px 40px -16px rgba(12, 12, 16, 0.22);
    --shadow-pop: 0 24px 60px -18px rgba(12, 12, 16, 0.35);
    --shadow-gold: 0 10px 30px -10px rgba(241, 164, 36, 0.55);

    --font-ui: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: "Playfair Display", "Didot", "Bodoni MT", Georgia, serif;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --container: 1240px;
    --header-h: 64px;
}

[data-theme="dark"] {
    --bg: #0f0f12;
    --surface: #1c1c21;
    --surface-2: #232329;
    --text: #f2f2f4;
    --text-2: rgba(245, 245, 246, 0.58);
    --text-3: rgba(245, 245, 246, 0.35);
    --hairline: rgba(255, 255, 255, 0.09);
    --hairline-strong: rgba(255, 255, 255, 0.16);
    --shimmer-base: rgba(255, 255, 255, 0.07);
    --shimmer-glow: rgba(255, 255, 255, 0.14);
    --overlay: rgba(0, 0, 0, 0.62);
    --header-bg: rgba(15, 15, 18, 0.82);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px -16px rgba(0, 0, 0, 0.65);
    --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
}

/* ---------------- reset ---------------- */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    transition: background 0.35s ease, color 0.35s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

body.no-scroll { overflow: hidden; }

::selection { background: rgba(241, 164, 36, 0.28); }

/* ---------------- layout ---------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 20px;
}

main {
    flex: 1;
    padding-bottom: 72px;
}

#page {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
#page.page--in { opacity: 1; transform: none; }

/* ---------------- splash ---------------- */

#splash {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: var(--bg);
    transition: opacity 0.55s ease, visibility 0.55s;
}
#splash.splash--done { opacity: 0; visibility: hidden; }
#splash img {
    width: 72px;
    height: 72px;
    animation: splash-pulse 1.6s var(--ease-out) infinite;
}
@keyframes splash-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.75; }
}

/* ---------------- header ---------------- */

.announce {
    background: linear-gradient(90deg, #17130a, #2b1f08, #17130a);
    color: var(--gold-soft);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
    padding: 7px 16px;
    overflow: hidden;
    white-space: nowrap;
}
.announce span {
    display: inline-block;
    background: linear-gradient(90deg, var(--gold-soft), #fff3d6, var(--gold-soft));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gold-sheen 5s linear infinite;
}
@keyframes gold-sheen {
    to { background-position: -200% 0; }
}

.header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--hairline);
    transition: box-shadow 0.3s ease;
}
.header--scrolled { box-shadow: var(--shadow-card); }

.header__row {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--header-h);
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.header__logo img { height: 34px; width: auto; transition: transform 0.4s var(--ease-spring); }
.header__logo:hover img { transform: scale(1.06) rotate(-2deg); }
.header__logo-text {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.16em;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header__search { flex: 1; position: relative; max-width: 560px; margin-inline: auto; }

.header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.iconbtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    border-radius: var(--r-pill);
    color: var(--text);
    transition: background 0.25s ease, transform 0.2s var(--ease-spring);
}
.iconbtn:hover { background: var(--hairline); }
.iconbtn:active { transform: scale(0.92); }
.iconbtn .icon svg { width: 21px; height: 21px; display: block; }
.iconbtn--labeled { width: auto; padding-inline: 12px; font-size: 13px; font-weight: 600; }

.badge-count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 16px;
    height: 16px;
    padding-inline: 4px;
    border-radius: var(--r-pill);
    background: var(--gold-grad);
    color: #1c1503;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s, transform 0.3s var(--ease-spring);
}
.badge-count--show { opacity: 1; transform: scale(1); }
.badge-count--pop { animation: badge-pop 0.45s var(--ease-spring); }
@keyframes badge-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.45); }
    100% { transform: scale(1); }
}

.lang-btn {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    width: 40px;
    height: 40px;
    border-radius: var(--r-pill);
    transition: background 0.25s ease;
}
.lang-btn:hover { background: var(--hairline); }

/* category nav */
.cat-nav {
    display: flex;
    gap: 2px;
    height: 46px;
    align-items: stretch;
    overflow-x: auto;
    scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav__item { position: relative; display: flex; }
.cat-nav__link {
    display: flex;
    align-items: center;
    padding-inline: 14px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-2);
    white-space: nowrap;
    border-radius: var(--r-sm);
    position: relative;
    transition: color 0.25s ease;
}
.cat-nav__link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold-grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out);
}
.cat-nav__item:hover .cat-nav__link { color: var(--text); }
.cat-nav__item:hover .cat-nav__link::after { transform: scaleX(1); }

.cat-nav__drop {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
    padding: 8px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.3s var(--ease-out), visibility 0.25s;
    z-index: 95;
}
.cat-nav__item:hover .cat-nav__drop { opacity: 1; visibility: visible; transform: none; }
.cat-nav__drop-link {
    padding: 9px 12px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    color: var(--text-2);
    transition: background 0.2s, color 0.2s, padding-left 0.2s ease;
}
.cat-nav__drop-link:hover { background: var(--hairline); color: var(--text); padding-left: 16px; }

/* burger — mobile only */
.burger { display: none; }

/* ---------------- drawer (mobile categories) ---------------- */

.drawer {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: var(--overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.drawer--open { opacity: 1; visibility: visible; }
.drawer__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(320px, 86vw);
    background: var(--surface);
    padding: 20px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.38s var(--ease-out);
}
.drawer--open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer__group { border-bottom: 1px solid var(--hairline); padding-block: 6px; }
.drawer__cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 4px;
    font-weight: 700;
    font-size: 15px;
}
.drawer__cat .icon svg { width: 16px; height: 16px; color: var(--text-3); }
.drawer__sub { display: block; padding: 8px 4px 8px 16px; font-size: 14px; color: var(--text-2); }
.drawer__sub:active, .drawer__sub:hover { color: var(--gold); }

/* ---------------- footer ---------------- */

.footer {
    background: #121014;
    color: rgba(245, 245, 246, 0.75);
    margin-top: auto;
}
[data-theme="dark"] .footer { background: #101014; border-top: 1px solid var(--hairline); }
.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 36px;
    padding-block: 46px 36px;
}
.footer__brand img { height: 40px; margin-bottom: 14px; }
.footer__tagline { font-size: 13.5px; color: rgba(245, 245, 246, 0.5); max-width: 300px; }
.footer__title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-soft);
    margin-bottom: 14px;
}
.footer__link {
    display: block;
    padding-block: 5px;
    font-size: 14px;
    color: rgba(245, 245, 246, 0.65);
    transition: color 0.2s, padding-left 0.25s ease;
}
.footer__link:hover { color: var(--gold-soft); padding-left: 6px; }
.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-block: 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12.5px;
    color: rgba(245, 245, 246, 0.4);
    flex-wrap: wrap;
}

/* ---------------- mobile tab bar (mirrors the iOS app) ---------------- */

.tabbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--hairline);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 0 9px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-3);
    position: relative;
    transition: color 0.25s ease;
}
.tabbar__link .icon svg { width: 22px; height: 22px; }
.tabbar__link.is-active { color: var(--gold); }
.tabbar__link.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 2.5px;
    border-radius: 3px;
    background: var(--gold-grad);
    animation: tab-in 0.35s var(--ease-spring);
}
@keyframes tab-in {
    from { transform: scaleX(0.2); opacity: 0; }
}
.tabbar .badge-count { top: 2px; right: calc(50% - 20px); }

/* ---------------- reveal / motion ---------------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal--in { opacity: 1; transform: none; }

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

/* ---------------- responsive ---------------- */

@media (max-width: 960px) {
    .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    :root { --header-h: 58px; }
    .header__search { display: none; }
    .header .cat-nav { display: none; }
    .burger { display: inline-flex; }
    .header__actions .iconbtn--desktop { display: none; }
    .tabbar { display: flex; }
    main { padding-bottom: 96px; }
    .footer { padding-bottom: 64px; }
    .footer__grid { grid-template-columns: 1fr; gap: 24px; padding-block: 32px 24px; }
    .container { padding-inline: 14px; }
}
