/* ============================================================
   Flamona — design system  (editorial · cream & ink)
   Cormorant Garamond (display) · DM Sans (text) · DM Mono (labels)
   Monochrome by design. --primary maps to ink so every component
   stays black-on-cream — no colour.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=DM+Mono:ital,wght@0,300;0,400;1,300&family=DM+Sans:wght@300;400;500;600&family=Inter:wght@300;400;500;600;700;800&family=Lora:wght@400;500;600&family=Nunito:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --bg:          #ffffff;
  --bg2:         #f5f5f6;
  --bg3:         #ececee;
  --surface:     #ffffff;
  --border:      #e6e6e8;
  --border-dark: #d0d0d3;
  --ink:         #111113;
  --ink-mid:     #45454a;
  --ink-muted:   #8a8a90;
  --ink-faint:   #b6b6bb;
  --primary:     #111113;   /* pure neutral ink */
  --primary-600: #000000;
  --primary-soft:#ececee;
  --accent-inv:  #ffffff;
  --gold:        #111113;   /* de-yellowed → neutral ink */
  --success:     #3c7a4e;
  --danger:      #a84a5e;
  --shadow:      0 2px 16px rgba(0,0,0,0.07);
  --shadow-md:   0 10px 32px rgba(0,0,0,0.10);
  --shadow-lg:   0 18px 60px rgba(0,0,0,0.14);
  --ring:        0 0 0 3px var(--bg3);
  --grid:        rgba(17,17,19,.05);
  --serif: 'Space Grotesk', system-ui, sans-serif;
  --sans:  'Inter', system-ui, sans-serif;
  --mono:  'Inter', system-ui, sans-serif;
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 22px;
}
html.dark, body.dark {
  --bg:          #0f0f10;
  --bg2:         #18181a;
  --bg3:         #212124;
  --surface:     #161618;
  --border:      #2a2a2d;
  --border-dark: #3a3a3e;
  --ink:         #f5f5f6;
  --ink-mid:     #c3c3c8;
  --ink-muted:   #8d8d93;
  --ink-faint:   #5c5c61;
  --primary:     #ffffff;   /* pure white */
  --primary-600: #ffffff;
  --primary-soft:#212124;
  --accent-inv:  #0f0f10;
  --grid:        rgba(245,245,246,.05);
  --gold:        #f5f5f6;   /* de-yellowed → neutral ink */
  --success:     #6fbf86;
  --danger:      #e09aab;
  --shadow:      0 2px 16px rgba(0,0,0,0.4);
  --shadow-md:   0 10px 32px rgba(0,0,0,0.5);
  --shadow-lg:   0 18px 60px rgba(0,0,0,0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; scroll-behavior: smooth; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .25s, color .25s;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { color: inherit; }  /* buttons don't inherit color by default → fixes invisible text in dark mode */
::selection { background: var(--ink); color: var(--accent-inv); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 6px; }
.scroll-x { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroll-x::-webkit-scrollbar { display: none; }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.wrap-tight { max-width: 760px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap, .wrap-tight { padding: 0 18px; } }

/* ---------- top navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--border);
}
/* pages that mount the top nav reserve its height so content isn't hidden under the fixed bar */
body.vw-has-nav { padding-top: 64px; }
body.vw-has-nav.nav-collapsed { padding-top: 0; }

/* floating upgrade pill (free members) — compact, centered */
.vw-upbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px);
  padding: 7px 7px 7px 18px; background: var(--ink); color: var(--accent-inv);
  border-radius: 100px; box-shadow: 0 12px 32px rgba(0,0,0,.30);
  animation: vwUpbarIn .4s cubic-bezier(.2,.7,.2,1); }
@keyframes vwUpbarIn { from { opacity: 0; transform: translate(-50%, 140%); } to { opacity: 1; transform: translateX(-50%); } }
.vw-upbar .ub-msg { font-family: var(--sans); font-size: 13px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-upbar .ub-btn { flex: none; font-family: var(--sans); font-weight: 600; font-size: 12.5px; background: var(--accent-inv); color: var(--ink); border-radius: 100px; padding: 8px 16px; white-space: nowrap; transition: transform .15s; }
.vw-upbar .ub-btn:hover { transform: translateY(-1px); }
@media (max-width: 460px) { .vw-upbar { padding-left: 14px; gap: 8px; } .vw-upbar .ub-msg { font-size: 12px; } }

/* username onboarding modal */
.vw-uname-wrap { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 45%, #000); backdrop-filter: blur(5px); animation: vwUFade .25s; }
@keyframes vwUFade { from { opacity: 0; } to { opacity: 1; } }
.vw-uname { width: min(440px, 100%); background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 28px; box-shadow: var(--shadow-lg); }
.vw-uname h2 { font-family: var(--serif); font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.vw-uname > p { font-size: 14px; color: var(--ink-muted); margin: 6px 0 18px; line-height: 1.55; }
.vw-uname-field { display: flex; align-items: center; border: 1.5px solid var(--border-dark); border-radius: 12px; padding: 0 14px; transition: border-color .15s; }
.vw-uname-field:focus-within { border-color: var(--ink); }
.vw-uname-field .at { color: var(--ink-muted); font-size: 16px; }
.vw-uname-field input { flex: 1; border: none; background: none; outline: none; padding: 13px 8px; font-family: var(--sans); font-size: 15.5px; color: var(--ink); }
.vw-uname-msg { font-family: var(--mono); font-size: 11.5px; min-height: 16px; margin: 7px 2px 0; color: var(--ink-muted); }
.vw-uname-msg.ok { color: #3c7a4e; } .vw-uname-msg.no { color: var(--danger); }
.vw-uname-vis { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 20px; }
.vw-vis { text-align: left; font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-mid); background: var(--bg2); border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 14px; cursor: pointer; transition: all .15s; }
.vw-vis.on { border-color: var(--ink); background: var(--bg3); color: var(--ink); }
.vw-uname-actions { display: flex; gap: 10px; align-items: center; }
.vw-uname-skip { flex: none; font-family: var(--sans); font-weight: 600; font-size: 14px; background: none; border: none; color: var(--ink-muted); padding: 12px 16px; cursor: pointer; }
.vw-uname-save { flex: 1; font-family: var(--sans); font-weight: 600; font-size: 14px; background: var(--ink); color: var(--accent-inv); border: none; border-radius: 100px; padding: 12px; cursor: pointer; transition: transform .15s; }
.vw-uname-save:hover { transform: translateY(-1px); }
.vw-uname-save:disabled { opacity: .6; }

/* onboarding popups: approved-promo reveal + Telegram subscribe */
.vw-modal-back { position: fixed; inset: 0; z-index: 320; display: grid; place-items: center; padding: 20px; padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 40%, #000); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: vwUFade .2s; }
.vw-modal { width: min(420px, 100%); background: var(--bg); border: 1px solid var(--border); border-radius: 22px; padding: 30px 26px 24px; box-shadow: var(--shadow-lg); text-align: center; animation: vwModalUp .26s cubic-bezier(.2,.8,.25,1); }
@keyframes vwModalUp { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.vw-modal-ic { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--bg3); color: var(--ink); border: 1px solid var(--border); }
.vw-tg-ic { color: #2aabee; }
.vw-modal h2 { font-family: var(--serif); font-size: 23px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.vw-modal > p { font-size: 14px; color: var(--ink-muted); margin: 9px 0 20px; line-height: 1.55; }
.vw-promo-code { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: .04em; color: var(--ink); background: var(--bg2); border: 1.5px dashed var(--border-dark); border-radius: 14px; padding: 16px 14px; margin-bottom: 16px; word-break: break-all; user-select: all; }
.vw-modal-primary { display: block; width: 100%; box-sizing: border-box; font-family: var(--sans); font-weight: 600; font-size: 15px; background: var(--ink); color: var(--accent-inv); border: none; border-radius: 100px; padding: 14px; cursor: pointer; text-decoration: none; transition: transform .15s; }
.vw-modal-primary:hover { transform: translateY(-1px); }
.vw-modal-primary.ok { background: #2f8a4e; }
.vw-modal-ghost { display: block; width: 100%; margin-top: 8px; font-family: var(--sans); font-weight: 500; font-size: 14px; background: none; border: none; color: var(--ink-muted); padding: 11px; cursor: pointer; }
.vw-gift-reward { display: inline-block; font-family: var(--serif); font-weight: 700; font-size: 26px; letter-spacing: -.01em; color: var(--ink); background: var(--bg3); border: 1.5px dashed var(--border-dark); border-radius: 14px; padding: 12px 22px; margin: 6px 0 18px; }
.vw-gift .vw-modal-ic { color: var(--ink); }
.vw-modal-ghost:hover { color: var(--ink); }

/* visual guide / walkthrough */
.vw-guide { position: relative; width: min(460px, 100%); background: var(--bg); border: 1px solid var(--border); border-radius: 22px; padding: 24px 26px 22px; box-shadow: var(--shadow-lg); text-align: center; animation: vwModalUp .26s cubic-bezier(.2,.8,.25,1); }
.vw-guide-x { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--ink-faint); font-size: 16px; cursor: pointer; line-height: 1; padding: 4px; }
.vw-guide-x:hover { color: var(--ink); }
.vw-guide-art { height: 168px; margin: 4px 0 16px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--border); color: var(--ink); display: grid; place-items: center; padding: 8px; overflow: hidden; }
.vw-guide-art svg { display: block; max-height: 100%; }
.vw-guide-where { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); background: var(--bg3); border-radius: 100px; padding: 5px 12px; margin-bottom: 10px; }
.vw-guide-where .nic { font-size: 13px; color: var(--ink); }
.vw-guide h2 { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.vw-guide > p { font-size: 14px; color: var(--ink-muted); margin: 9px 0 16px; line-height: 1.55; min-height: 66px; }
.vw-guide-dots { display: flex; justify-content: center; gap: 7px; margin-bottom: 16px; }
.vw-guide-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-dark); transition: all .2s; }
.vw-guide-dots i.on { background: var(--ink); width: 20px; border-radius: 4px; }
.vw-guide-nav { display: flex; gap: 10px; align-items: center; }
.vw-guide-nav .vw-modal-ghost { flex: none; width: auto; margin: 0; padding: 13px 20px; }
.vw-guide-nav .vw-modal-primary { flex: 1; margin: 0; }
.nav-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 26px; padding: 0 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 30px; height: 30px; display: grid; place-items: center; flex-shrink: 0; }
.logo img, .mk img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .mark { font-family: var(--serif); font-size: 23px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.brand .mark em { font-family: var(--serif); font-style: normal; font-weight: 700; font-size: 1em; line-height: 1; letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.nav-link {
  font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-muted); padding: 8px 13px; border-radius: 8px; transition: all .16s; white-space: nowrap; position: relative;
}
.nav-link::after { content: ''; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 1.5px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--ink); background: var(--bg3); }
.nav-link.active::after { transform: scaleX(1); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn.nav-toggle { display: none; }

/* nav dropdowns: Learn (Study/Review/Quiz) · Practice (Speaking/Articles) */
.nav-drop { position: relative; }
.nav-drop-btn { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; cursor: pointer; }
.nav-drop-btn .caret { font-size: 8px; line-height: 1; transition: transform .18s; }
.nav-drop-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.drop-menu { left: 0; right: auto; top: calc(100% + 4px); min-width: 168px; }
.drop-menu a.active { background: var(--bg2); color: var(--ink); font-weight: 600; }
/* hover (desktop): tugma bilan menyu orasidagi bo'shliqni ko'rinmas ko'prik yopib turadi */
@media (hover: hover) and (min-width: 881px) {
  .nav-drop::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 8px; }
}

.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; border: 1px solid var(--border-dark); border-radius: 100px; padding: 6px 12px; color: var(--ink-mid); background: var(--bg); transition: all .16s; }
.pill .ic { font-size: 12px; line-height: 1; }
.pill.flame .ic { color: var(--ink-muted); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-dark); background: var(--bg); color: var(--ink-mid); cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; transition: all .16s; }
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }

/* user menu */
.user-btn { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border-dark); background: var(--bg); border-radius: 100px; padding: 4px 5px 4px 13px; cursor: pointer; transition: all .16s; }
.user-btn:hover { border-color: var(--ink); }
.user-btn .un { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--accent-inv); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 15px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.menu { position: absolute; top: 54px; right: 0; min-width: 222px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 8px; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: all .18s; z-index: 90; }
.menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.menu .mhead { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu .mhead b { font-family: var(--serif); font-weight: 700; font-size: 17px; display: block; line-height: 1.1; }
.menu .mhead span { font-family: var(--mono); font-size: 10px; color: var(--ink-muted); }
.menu a, .menu button { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--ink-mid); background: none; border: none; cursor: pointer; transition: all .14s; }
.menu a:hover, .menu button:hover { background: var(--bg2); color: var(--ink); }
/* notifications */
.nav-bell { position: relative; }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 100px; background: var(--ink); color: var(--accent-inv); font-family: var(--mono); font-size: 9px; line-height: 16px; text-align: center; display: none; border: 2px solid var(--bg); }
.bell-badge.show { display: block; }
.notif-menu { width: 330px; max-width: 86vw; max-height: 440px; overflow-y: auto; padding: 6px; }
.notif-head { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); padding: 8px 10px 6px; }
.notif { display: flex; gap: 11px; padding: 11px 10px; border-radius: 10px; text-decoration: none; color: inherit; align-items: flex-start; }
.notif:hover { background: var(--bg2); }
.notif .nic { width: 30px; height: 30px; border-radius: 9px; background: var(--bg2); display: grid; place-items: center; flex: none; color: var(--ink); font-size: 13px; }
.notif.unseen .nic { background: var(--ink); color: var(--accent-inv); }
.notif .nt { font-size: 13.5px; font-weight: 600; color: var(--ink); display: block; }
.notif .nb { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; line-height: 1.45; display: block; }
.notif .ntime { font-family: var(--mono); font-size: 9px; color: var(--ink-faint); margin-top: 4px; display: block; }
.notif-empty { padding: 30px; text-align: center; color: var(--ink-muted); font-size: 13px; }
/* mobile: keep the nav from overflowing + anchor the notif panel to the viewport */
html { overflow-x: hidden; }
@media (max-width: 560px) {
  .nav-inner { gap: 8px; }
  .nav-search { display: none; }
  .notif-menu { position: fixed; top: 62px; right: 10px; left: auto; width: min(330px, 92vw); }
}
.menu .danger:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }

/* settings (gear) panel */
.settings-menu { min-width: 258px; padding: 10px; }
.settings-menu .set-head { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); padding: 4px 6px 10px; }
.settings-menu .set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 6px; }
.settings-menu .set-row.col { flex-direction: column; align-items: stretch; gap: 9px; }
.settings-menu .set-lbl { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-mid); }
.settings-menu .set-seg { display: flex; gap: 4px; background: var(--bg2); border-radius: 10px; padding: 3px; width: auto; }
.settings-menu .set-seg button { width: auto; padding: 6px 14px; border: none; background: none; border-radius: 8px; font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-muted); cursor: pointer; transition: all .15s; }
.settings-menu .set-seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.settings-menu .set-swatches { display: flex; gap: 9px; }
.settings-menu .swatch { width: 28px; height: 28px; padding: 0; border-radius: 50%; background: var(--sw); border: 2px solid var(--border); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.settings-menu .swatch:hover { transform: scale(1.1); }
.settings-menu .swatch.active { border-color: var(--bg); box-shadow: 0 0 0 2px var(--ink); }
.settings-menu .set-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.settings-menu .font-opt { width: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 13px; color: var(--ink-mid); cursor: pointer; text-align: center; transition: all .15s; }
.settings-menu .font-opt:hover { border-color: var(--ink-muted); color: var(--ink); }
.settings-menu .font-opt.active { border-color: var(--ink); color: var(--ink); background: var(--bg2); font-weight: 600; }

@media (max-width: 880px) {
  .nav-links { position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px; margin: 0; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .2s; box-shadow: var(--shadow); }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-link { padding: 13px 14px; font-size: 12px; border-radius: 10px; }
  .icon-btn.nav-toggle { display: flex; }
  .pill.hide-sm, .user-btn .un { display: none; }
  /* mobile: dropdown flattens back into the list — all links visible, no extra tap */
  .nav-drop { position: static; }
  .nav-drop-btn { display: none; }
  .drop-menu { position: static; opacity: 1; transform: none; pointer-events: auto; box-shadow: none; border: none; background: none; min-width: 0; padding: 0; border-radius: 0; }
  .drop-menu a { font-family: var(--mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-muted); padding: 13px 14px; border-radius: 10px; font-weight: 500; }
  .drop-menu a.active { color: var(--ink); background: var(--bg3); }
}

/* small phones: keep the top nav from overflowing off-screen */
@media (max-width: 480px) {
  .nav-inner { gap: 10px; padding: 0 14px; }
  .nav-right { gap: 6px; }
  .nav-right .btn { padding: 8px 12px !important; font-size: 12.5px; }
  .brand .mark { font-size: 19px; }
  .brand .logo { width: 25px; height: 25px; font-size: 14px; }
  .flamona-fab { font-size: 12px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-family: var(--sans); font-size: 14px; font-weight: 500; padding: 12px 22px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: all .22s cubic-bezier(.2,.7,.2,1); user-select: none; white-space: nowrap; position: relative; overflow: hidden; }
.btn::before { content: ''; position: absolute; inset: 0; left: -120%; width: 60%; background: linear-gradient(105deg, transparent, rgba(255,255,255,.22), transparent); transform: skewX(-18deg); transition: left .6s cubic-bezier(.2,.7,.2,1); }
.btn:hover::before { left: 140%; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--accent-inv); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(0,0,0,.18); transform: translateY(-2px); }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--border-dark); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-lg { padding: 15px 30px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn .ar { font-family: var(--mono); transition: transform .2s; }
.btn:hover .ar { transform: translateX(3px); }

/* ---------- labels ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-muted); }
.eyebrow span.rule { width: 22px; height: 1px; background: var(--ink-faint); }
.label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- badges (monochrome) ---------- */
.cefr { font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: .08em; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--border-dark); color: var(--ink-mid); background: var(--bg); }
.lang-chip { flex-shrink: 0; font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; margin-top: 2px; }
.lang-chip.en { background: var(--ink); color: var(--accent-inv); }
.lang-chip.uz { background: var(--bg3); color: var(--ink-mid); border: 1px solid var(--border-dark); }

/* ---------- surfaces ---------- */
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
mark { background: var(--ink); color: var(--accent-inv); border-radius: 2px; padding: 0 2px; }

/* ---------- speak button ---------- */
.speak { flex-shrink: 0; width: 30px; height: 30px; border: 1px solid var(--border-dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); background: var(--bg); cursor: pointer; transition: all .16s; }
.speak:hover { color: var(--ink); border-color: var(--ink); }
.speak:active { transform: scale(.9); }
.speak.speaking { background: var(--ink); border-color: var(--ink); color: var(--accent-inv); animation: pulseRing 1.1s ease-out infinite; }
.speak svg { display: block; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--border); margin-top: 72px; padding: 40px 0 56px; color: var(--ink-muted); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; }
.foot .fb { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.foot .fb em { font-family: var(--serif); font-style: normal; font-weight: 700; font-size: 1em; line-height: 1; letter-spacing: -.02em; }
.foot small { font-family: var(--mono); font-size: 10px; display: block; margin-top: 6px; color: var(--ink-faint); }
.foot-links { display: flex; gap: 18px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.foot-links a:hover { color: var(--ink); }
/* richer footer */
.foot .fb .logo { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; }
.foot-top { display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between; }
.foot-brand { max-width: 380px; }
.foot-desc { margin-top: 14px; font-size: 13.5px; line-height: 1.65; color: var(--ink-muted); font-weight: 300; }
.foot-meta { margin-top: 16px; display: flex; gap: 22px; flex-wrap: wrap; }
.foot-meta .fm b { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--ink); display: block; line-height: 1; }
.foot-meta .fm span { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); margin-top: 5px; display: block; }
.foot-author { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--ink-mid); border: 1px solid var(--border-dark); border-radius: 100px; padding: 8px 15px; transition: all .16s; }
.foot-author:hover { border-color: var(--ink); color: var(--ink); }
.foot-cols { display: flex; gap: 54px; flex-wrap: wrap; }
.foot-col { display: flex; flex-direction: column; gap: 11px; }
.foot-col h4 { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 3px; font-weight: 600; }
.foot-col a { font-size: 14px; color: var(--ink-muted); transition: color .15s; }
.foot-col a:hover { color: var(--ink); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 42px; padding-top: 22px; border-top: 1px solid var(--border); }
.foot-bottom small { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: .03em; margin: 0; display: inline; }
@media (max-width: 640px) { .foot-top { gap: 30px; } .foot-cols { gap: 30px; } }

/* ---------- motion ---------- */
@keyframes auraDrift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(-22px,16px) scale(1.08); } 100% { transform: translate(0,0) scale(1); } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,.22); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* floating Flamona AI button (owner-only, bottom-right) — bare PNG logo, no fill */
.flamona-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 78;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px; border-radius: 100px;
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  animation: floatY 4.2s ease-in-out infinite;
  transition: transform .18s, opacity .18s;
}
.flamona-fab.round { padding: 0; }
.flamona-fab .ffab-logo { width: 48px; height: 48px; object-fit: contain; display: block; filter: drop-shadow(0 6px 14px rgba(0,0,0,.28)); }
.flamona-fab.round .ffab-logo { width: 56px; height: 56px; }
.flamona-fab .ffab-txt { line-height: 1; padding-right: 4px; }
.flamona-fab:hover { transform: translateY(-3px) scale(1.06); }
.flamona-fab:active { transform: translateY(-1px) scale(.98); }
@media (max-width: 640px) { .flamona-fab { right: 14px; bottom: 14px; } }
@media (prefers-reduced-motion: reduce) { .flamona-fab { animation: none; } }

/* Flamona dynamic AI chat panel */
.fchat {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 44px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border-dark); border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0,0,0,.30);
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity .22s cubic-bezier(.2,.7,.2,1), transform .22s cubic-bezier(.2,.7,.2,1);
}
.fchat.open { opacity: 1; transform: none; pointer-events: auto; }
.fchat-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.fchat-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; }
.fchat-brand img { width: 28px; height: 28px; object-fit: contain; }
.fchat-brand b { font-weight: 700; color: var(--ink); }
.fchat-acts { display: flex; gap: 4px; }
.fchat-ic { width: 30px; height: 30px; border: none; background: transparent; color: var(--ink-muted); border-radius: 8px; cursor: pointer; font-size: 15px; transition: background .15s, color .15s; }
.fchat-ic:hover { background: var(--bg2); color: var(--ink); }
.fchat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.fchat-empty { margin: auto; text-align: center; color: var(--ink-muted); padding: 10px; }
.fchat-empty img { width: 52px; height: 52px; object-fit: contain; margin-bottom: 12px; }
.fchat-empty p { font-size: 13.5px; line-height: 1.6; max-width: 300px; margin: 0 auto; }
.fmsg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; animation: fchatMsgIn .26s cubic-bezier(.2,.7,.2,1); }
@keyframes fchatMsgIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.fmsg.user { flex-direction: row-reverse; }
.fmsg-av { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; margin-top: 2px; }
.fmsg-b { font-size: 13.5px; line-height: 1.6; padding: 9px 13px; border-radius: 14px; max-width: 80%; word-wrap: break-word; overflow-wrap: anywhere; }
.fmsg.assistant .fmsg-b { background: var(--bg2); color: var(--ink); border-top-left-radius: 4px; }
.fmsg.user .fmsg-b { background: var(--ink); color: var(--accent-inv); border-top-right-radius: 4px; }
.fmsg-b .fmd-h { display: block; font-weight: 700; font-size: 1.02em; margin: 8px 0 3px; line-height: 1.35; }
.fmsg-b .fmd-h:first-child { margin-top: 0; }
.fmsg-b em { font-style: italic; }
.fmsg-b code { font-family: var(--mono); font-size: .86em; background: var(--bg3); padding: 1px 5px; border-radius: 4px; }
.fmsg-b pre { background: var(--bg3); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; overflow-x: auto; margin: 7px 0; }
.fmsg-b pre code { background: none; padding: 0; font-size: 12px; line-height: 1.5; }
.fmsg-b hr { border: none; border-top: 1px solid var(--border-dark); margin: 9px 0; }
.fmsg.user .fmsg-b hr { border-top-color: rgba(255,255,255,.3); }
.fmsg-typing { display: inline-flex; gap: 4px; align-items: center; }
.fmsg-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); animation: fchatBlink 1.1s infinite ease-in-out; }
.fmsg-typing span:nth-child(2) { animation-delay: .18s; }
.fmsg-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes fchatBlink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
/* footer frames the floating composer; only the message body above it scrolls */
.fchat-foot { position: relative; flex-shrink: 0; padding: 10px 12px 13px; }
.fchat-foot::before { content: ''; position: absolute; left: 0; right: 0; top: -24px; height: 24px; pointer-events: none; background: linear-gradient(to top, var(--bg) 30%, transparent); }
.fchat-composer { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 7px; border: 1px solid var(--border-dark); border-radius: 22px; padding: 10px 10px 9px; background: var(--bg); box-shadow: 0 3px 14px rgba(0,0,0,.06); transition: border-color .16s, box-shadow .16s; }
.fchat-composer:focus-within { border-color: var(--ink); box-shadow: 0 5px 22px rgba(0,0,0,.10); }
.fchat-composer textarea { border: none; outline: none; resize: none; background: transparent; padding: 4px 7px; font-family: var(--sans); font-size: 14px; line-height: 1.45; color: var(--ink); max-height: 140px; }
.fchat-composer textarea::placeholder { color: var(--ink-faint); }
.fchat-row { display: flex; align-items: center; gap: 8px; }
/* model picker lives INSIDE the composer; inherits the user's chosen font (var(--sans)) */
.fchat-model { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-dark); background: var(--bg); color: var(--ink-mid); border-radius: 100px; padding: 5px 10px 5px 11px; font-family: var(--sans); font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, transform .12s; }
.fchat-model:hover { border-color: var(--ink); color: var(--ink); }
.fchat-model:active { transform: scale(.97); }
.fchat-model .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.fchat-model .car { color: var(--ink-faint); font-size: 9px; }
.fchat-send { margin-left: auto; width: 36px; height: 36px; flex-shrink: 0; border: none; border-radius: 50%; background: var(--ink); color: var(--accent-inv); cursor: pointer; display: grid; place-items: center; transition: transform .15s, opacity .15s; }
.fchat-send:hover { transform: scale(1.08); }
.fchat-send:active { transform: scale(.9); }
/* model menu floats above the composer; user font, soft pop-in */
.fchat-mmenu { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 8px); z-index: 6; background: var(--bg); border: 1px solid var(--border-dark); border-radius: 15px; box-shadow: 0 16px 44px rgba(0,0,0,.24); padding: 6px; display: none; }
.fchat-mmenu.open { display: block; animation: fchatPop .17s cubic-bezier(.2,.7,.2,1); }
@keyframes fchatPop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.fchat-mmenu button { display: block; width: 100%; box-sizing: border-box; border: none; background: transparent; text-align: left; padding: 9px 11px; border-radius: 11px; cursor: pointer; font-family: var(--sans); transition: background .13s; }
.fchat-mmenu button:hover { background: var(--bg2); }
.fchat-mmenu .mn { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink); }
.fchat-mmenu .chk { margin-left: auto; color: var(--ink); }
.fchat-mmenu .md { display: block; font-size: 11px; color: var(--ink-muted); margin-top: 2px; line-height: 1.4; }
.fchat-mmenu .mt { display: inline-block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .03em; color: var(--ink-mid); border: 1px solid var(--border-dark); border-radius: 100px; padding: 2px 8px; margin-top: 5px; }
.fchat-mmenu .mt.zero { color: #a84a5e; border-color: #a84a5e; }
@media (max-width: 640px) {
  .fchat { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: none; }
  .fchat-foot { padding-bottom: calc(13px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .fchat, .fchat.open, .fmsg, .fchat-mmenu.open { animation: none; transition: none; }
}

.fade-up { opacity: 0; transform: translateY(20px) scale(.985); filter: blur(6px); transition: opacity .75s cubic-bezier(.16,.84,.28,1), transform .75s cubic-bezier(.16,.84,.28,1), filter .75s cubic-bezier(.16,.84,.28,1); }
.fade-up.in { opacity: 1; transform: none; filter: blur(0); }
.d1 { transition-delay: .07s; } .d2 { transition-delay: .14s; } .d3 { transition-delay: .21s; }
.d4 { transition-delay: .28s; } .d5 { transition-delay: .35s; } .d6 { transition-delay: .42s; }

.sheen { position: relative; overflow: hidden; }
.sheen::after { content: ''; position: absolute; top: 0; left: -120%; width: 70%; height: 100%; background: linear-gradient(105deg, transparent, color-mix(in srgb, var(--ink) 7%, transparent), transparent); transform: skewX(-18deg); transition: left .7s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
.sheen:hover::after { left: 130%; }

[data-tilt] { transform-style: preserve-3d; transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s; will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade-up { opacity: 1; transform: none; filter: none; }
}
