/* Medvezzers vitrine — single-file CSS (no build needed)
   This file is served as /assets/vitrine.css
*/

:root{
  /* layout */
  --nav-w: 52px;                /* ~30% narrower than the old wide sidebar */
  --nav-pad: 8px;
  --nav-gap: 8px;
  --divider-inset: 5%;
  --radius: 18px;

  /* hover / neon */
  --aqua: var(--brand);
  --aqua-soft: transparent;
  --shadow-aqua: none;

  /* typography */
  --font: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ---------- Themes ---------- */
html[data-theme="sun"]{
  --bg0: #f7f8fa;
  --bg1: #f1f4f8;
  --bg2: #e8edf3;
  --ink: rgba(25, 28, 35, .90);
  --muted: rgba(25, 28, 35, .60);
  --tile-ink: rgba(25, 28, 35, .86);
  --glass: rgba(255,255,255,.78);
  --glass2: rgba(255,255,255,.62);
  --nav-bg: rgba(244,246,249,.76);
  --nav-ink: rgba(20, 24, 28, .78);
  --stroke: rgba(20, 24, 28, .45);
  --brand: #6f8098;
}
html[data-theme="moon"]{
  --bg0: #14161b;
  --bg1: #1b2028;
  --bg2: #0f141c;
  --ink: rgba(245, 248, 255, .92);
  --muted: rgba(245, 248, 255, .62);
  --tile-ink: rgba(245, 248, 255, .90);
  --glass: rgba(30,35,44,.62);
  --glass2: rgba(30,35,44,.28);
  --nav-bg: rgba(20, 22, 28, .70);
  --nav-ink: rgba(235, 242, 255, .82);
  --stroke: rgba(235, 242, 255, .45);
  --brand: #86a7ff;
}
html[data-theme="malina"]{
  --bg0: #2a1120;
  --bg1: #08162a;
  --bg2: #102018;
  --ink: rgba(255, 246, 252, .92);
  --muted: rgba(255, 246, 252, .62);
  --tile-ink: rgba(255, 246, 252, .90);
  --glass: rgba(35, 16, 26, .56);
  --glass2: rgba(35, 16, 26, .26);
  --nav-bg: rgba(18, 10, 18, .68);
  --nav-ink: rgba(255, 246, 252, .84);
  --stroke: rgba(255, 246, 252, .45);
  --brand: #a84a8a;
}
html[data-theme="wave"]{
  --bg0: #071013;
  --bg1: #0b171b;
  --bg2: #050b0d;
  --ink: rgba(232, 251, 255, .92);
  --muted: rgba(232, 251, 255, .62);
  --tile-ink: rgba(232, 251, 255, .90);
  --glass: rgba(11, 23, 27, .62);
  --glass2: rgba(11, 23, 27, .28);
  --nav-bg: rgba(7, 16, 19, .70);
  --nav-ink: rgba(232, 251, 255, .82);
  --stroke: rgba(232, 251, 255, .45);
  --brand: #2aa9a9;
}

html[data-theme="zephyr"]{
  --bg0: #fff6e6;
  --bg1: #ffefd7;
  --bg2: #fffaf2;
  --ink: rgba(22, 26, 34, .90);
  --muted: rgba(22, 26, 34, .60);
  --tile-ink: rgba(22, 26, 34, .86);
  --glass: rgba(255,248,236,.82);
  --glass2: rgba(255,248,236,.64);
  --nav-bg: rgba(245,245,245,.70);
  --nav-ink: rgba(22, 26, 34, .78);
  --stroke: rgba(22, 26, 34, .45);
  --brand: #c08a47;
}

/* ---------- Base ---------- */
*{ box-sizing: border-box; }
html,body{ height: 100%; }
body{
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
  radial-gradient(1200px 800px at 50% 0%, color-mix(in oklab, var(--bg0), transparent 78%), transparent 70%),
  linear-gradient(180deg,
    var(--bg0),
    color-mix(in oklab, var(--bg0), var(--bg1) 12%) 55%,
    color-mix(in oklab, var(--bg0), var(--bg2) 10%));

  overflow-x: hidden;
  padding-left: var(--nav-w);
}

/* lock body scroll when modal open */
body.lock{ overflow: hidden; }

/* ---------- Left sidebar ---------- */
.v-nav{
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--nav-w);
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--nav-gap);
  background:
    radial-gradient(380px 520px at 50% 20%, color-mix(in oklab, var(--nav-bg), transparent 0%), transparent 70%),
    linear-gradient(180deg, color-mix(in oklab, var(--nav-bg), transparent 18%), color-mix(in oklab, var(--nav-bg), transparent 8%));
  border-right: 1px solid color-mix(in oklab, var(--stroke), transparent 35%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 20;
}

/* clickable zones */
.v-item{
  width: calc(var(--nav-w) - 8px);
  height: 42px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--nav-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  border-radius: 10px; /* no “pill”, just for focus */
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.v-item svg{
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .95;
  transition: transform .14s ease, color .14s ease, opacity .14s ease, filter .14s ease;
}

/* neon strip near the edge (with gap to icon) */
.v-item::after{
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  bottom: 7px;
  width: 4px;                 /* x2 thickness vs old */
  border-radius: 6px;
  background: transparent;
  opacity: 0;
  transform: scaleY(.7);
  transition: opacity .14s ease, transform .14s ease, background .14s ease, box-shadow .14s ease;
}

.v-item:hover{
  color: var(--aqua);
}
.v-item:hover::after{
  opacity: 1;
  transform: scaleY(1);
  background: var(--brand);
  box-shadow: none;
}
.v-item:hover svg{
  transform: translateX(1px) scale(1.02);
  filter: none;
}

/* keyboard focus */
.v-item:focus-visible{
  outline: 2px solid color-mix(in oklab, var(--aqua), transparent 40%);
  outline-offset: 2px;
}

.v-cut{
  width: calc(100% - (var(--divider-inset) * 2));
  height: 1px;
  background: color-mix(in oklab, var(--stroke), transparent 55%);
  border-radius: 2px;
  opacity: .9;
  margin: 4px 0 2px 0;
}
.v-cut--bottom{ margin: 2px 0 0 0; }

.v-spacer{ flex: 1 1 auto; }

/* ---------- Main layout ---------- */
.v-page{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 clamp(14px, 4vw, 64px) 64px;
}

.v-hero{
  width: min(980px, 100%);
  text-align: center;
  padding-top: clamp(92px, 12vh, 140px); /* ~3–4 cm */
}

.v-title{
  margin: 0;
  font-size: clamp(28px, 4.2vw, 44px);
  letter-spacing: .18em;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  color: color-mix(in oklab, var(--ink), transparent 8%);
  text-wrap: balance;
  text-shadow: 0 12px 50px rgba(0,0,0,.12);
}

.v-brand{
  margin-top: 10px;
  font-size: 18px;
  letter-spacing: .48em;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
}

.v-storydog-wrap{
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.v-storydog{
  width: min(340px, 72vw);
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  filter: none;
}

@media (max-width: 560px){
  .v-storydog{ width: min(300px, 86vw); }
}
/* ---------- Tiles ---------- */
/* Tile grid tokens (stable) */
html[data-theme="sun"],
html[data-theme="zephyr"]{
  --tile-grid-a: rgba(0,0,0,.07);
  --tile-grid-b: rgba(0,0,0,.06);
}

html[data-theme="moon"],
html[data-theme="malina"],
html[data-theme="wave"]{
  --tile-grid-a: rgba(255,255,255,.06);
  --tile-grid-b: rgba(255,255,255,.05);
}


.v-tiles{
  width: min(980px, 100%);
  margin-top: clamp(34px, 5vh, 58px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 22px);
}

@media (max-width: 880px){
  .v-tiles{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .v-tiles{ grid-template-columns: 1fr; }
}

.v-tile{
  height: 72px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--tile-ink);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  background:
    /* glass */
    linear-gradient(180deg, var(--glass), var(--glass2)),
    /* stable grid */
    repeating-linear-gradient(0deg, var(--tile-grid-a) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(90deg, var(--tile-grid-b) 0 1px, transparent 1px 10px);
  box-shadow:
    0 18px 45px rgba(0,0,0,.12),
    0 0 0 1px color-mix(in oklab, var(--stroke), transparent 58%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}


.v-tile span{
  text-align: center;
  line-height: 1.05;
  padding: 0 10px;
}

.v-tile::before{ display:none; }

.v-tile:hover{
  transform: translateY(-2px);
  box-shadow:
    0 26px 70px rgba(0,0,0,.18),
    0 0 0 1px color-mix(in oklab, var(--stroke), transparent 35%);
  filter: none;
}
.v-tile:hover::before{ opacity: 1; }

/* ---------- Overlay + modals ---------- */
.v-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 50;
  opacity: 0;
  transition: opacity .16s ease;
}
.v-overlay.open{ opacity: 1; }

.v-pop,
.v-modal{
  position: fixed;
  z-index: 60;
  background: linear-gradient(180deg, var(--nav-bg), color-mix(in oklab, var(--nav-bg), transparent 28%));
  border: 1px solid color-mix(in oklab, var(--stroke), transparent 55%);
  border-radius: 18px;
  box-shadow: 0 40px 120px rgba(0,0,0,.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(8px) scale(.99);
  transition: opacity .16s ease, transform .16s ease;
}
.v-pop.open,
.v-modal.open{
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* popovers are positioned by JS */
.v-pop{
  padding: 18px 18px 16px;
  min-width: 220px;
}
.v-pop--theme{ width: 240px; }
.v-pop--lang{
  width: min(720px, calc(100vw - var(--nav-w) - 32px));
}

.v-pop-title{
  font-weight: 900;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: 12px;
  color: color-mix(in oklab, var(--ink), transparent 20%);
  margin-bottom: 12px;
}

.v-pop-x,
.v-modal-x{
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--stroke), transparent 55%);
  background: color-mix(in oklab, var(--glass), transparent 10%);
  color: color-mix(in oklab, var(--ink), transparent 12%);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, color .14s ease;
}
.v-pop-x:hover,
.v-modal-x:hover{
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--brand), transparent 35%);
  color: var(--brand);
  box-shadow: none;
}

/* Theme grid */
.v-theme-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-top: 6px;
}
.v-chip{
  height: 56px;
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--stroke), transparent 55%);
  background:
    linear-gradient(180deg, var(--glass), var(--glass2)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 9px);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, filter .14s ease;
  color: color-mix(in oklab, var(--ink), transparent 10%);
}
.v-chip svg{
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.v-chip:hover{
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--stroke), transparent 25%);
  box-shadow: none;
  filter: none;
}

/* Language grid (4 rows x 5 cols) */
.v-lang-grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding-top: 4px;
}
@media (max-width: 860px){
  .v-lang-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 660px){
  .v-lang-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px){
  .v-lang-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.v-lang-item{
  height: 58px;
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--stroke), transparent 55%);
  background:
    linear-gradient(180deg, var(--glass), var(--glass2)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 1px, transparent 1px 10px);
  display: grid;
  grid-template-columns: 1.2fr 2.2fr;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  cursor: pointer;
  color: color-mix(in oklab, var(--ink), transparent 8%);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, filter .14s ease;
}
.v-lang-item .flag{
  font-size: 20px;
  line-height: 1;
}
.v-lang-item .lbl{
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v-lang-item:hover{
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--stroke), transparent 25%);
  box-shadow: none;
  filter: none;
}

/* Article / legal modal */
.v-modal{
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.99);
  width: min(760px, calc(100vw - var(--nav-w) - 32px));
  max-height: min(78vh, 720px);
  padding: 22px 22px 18px;
  overflow: auto;
}
.v-modal--nums,
.v-modal--numsDone{
  padding: 0 !important;
  box-sizing: border-box;
}
.v-modal.open{
  transform: translate(-50%, -50%) scale(1);
}

.v-article h2{
  margin: 6px 0 10px;
  font-size: 20px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.v-article p{
  margin: 8px 0 10px;
  color: color-mix(in oklab, var(--ink), transparent 10%);
  line-height: 1.5;
}
.v-article ul{
  margin: 10px 0 0;
  padding-left: 18px;
  color: color-mix(in oklab, var(--ink), transparent 12%);
}
.v-article li{ margin: 6px 0; }

.v-note{
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed color-mix(in oklab, var(--stroke), transparent 45%);
  background: color-mix(in oklab, var(--glass2), transparent 0%);
}
.v-note code{
  font-family: var(--mono);
  font-size: 13px;
}

/* reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior: auto !important; }
}

/* Theme picker (LK icons, no glow) */
.v-pop--theme{ width: 320px; }
.v-pop--theme .v-theme-grid{ grid-template-columns: repeat(3, 1fr); }
.v-pop--theme .v-chip{ min-height: 40px; padding: 10px 10px; }
.v-pop--theme .v-chip svg{ width: 20px; height: 20px; display:block; }

.v-theme-cur{ display:grid; place-items:center; }
.v-theme-cur__ico{ display:none; line-height:0; }
.v-theme-cur__ico svg{ width: 18px; height: 18px; display:block; }
html[data-theme="zephyr"] .v-theme-cur__ico--zephyr{ display:block; }
html[data-theme="wave"]   .v-theme-cur__ico--wave{ display:block; }
html[data-theme="malina"] .v-theme-cur__ico--malina{ display:block; }
html[data-theme="sun"]    .v-theme-cur__ico--sun{ display:block; }
html[data-theme="moon"]   .v-theme-cur__ico--moon{ display:block; }

html[data-theme="malina"] .v-item.v-theme{ color:#a84a8a; }
html[data-theme="wave"]   .v-item.v-theme{ color:#2aa9a9; }
html[data-theme="zephyr"] .v-item.v-theme{ color:#c08a47; }
html[data-theme="sun"]    .v-item.v-theme{ color:#6f8098; }
html[data-theme="moon"]   .v-item.v-theme{ color:#86a7ff; }


/* China media (bubble) + dog row */
.v-media-row{
  width: min(980px, 100%);
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 860px){
  .v-media-row{ grid-template-columns: 1fr; }
}

.v-china{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.v-china-head{ text-align: center; }

.v-china-title{
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.15;
}

.v-china-sub{
  margin-top: 8px;
  opacity: .92;
  font-weight: 800;
  letter-spacing: .02em;
}

.v-china-bubble{
  width: min(340px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: #fff; /* всегда белый фон */
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 18px 45px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  position: relative;
}

.v-china-bubble-head{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 82%;
  text-align: center;
  pointer-events: none;
  z-index: 3;
}

.v-china-bubble-head .v-china-title{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.15;
  color: rgba(0,0,0,.88);
}

.v-china-bubble-head .v-china-sub{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  color: rgba(0,0,0,.78);
}

/* крест-разделитель на 4 секции */
.v-china-bubble::before{
  content:"";
  position:absolute;
  z-index: 1;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 1px;
  background: rgba(0,0,0,.12);
}
.v-china-bubble::after{
  content:"";
  position:absolute;
  z-index: 1;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 1px;
  background: rgba(0,0,0,.12);
}

.v-china-logos{
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0; /* крест виден чётко */
  align-content: stretch;
  justify-items: stretch;
}

.v-china-logo-tile{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
}

.v-china-logo{
  max-width: 92%;
  max-height: 46px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

/* сделать Weibo и Youku крупнее */
.v-china-logo[src$="weibo.png"],
.v-china-logo[src$="youku.png"]{
  max-height: 78px;
  max-width: 94%;
}

.v-china-under{
  font-size: 11px;
  line-height: 1.15;
  color: rgba(0,0,0,.72);
  text-align: center;
  max-width: 140px;
  word-break: break-word;
}

.v-storydog-side{
  display: flex;
  justify-content: flex-end;
}

.v-storydog--side{
  width: min(340px, 100%);
  height: auto;
}

@media (max-width: 860px){
  .v-storydog-side{ justify-content: center; }
}

@media (max-width: 520px){
  .v-china-under{ font-size: 10px; max-width: 130px; }
}


/* Vitrine fixes: theme icons + china confirm */
.v-item.v-theme .v-theme-cur svg{
  fill: currentColor;
  stroke: none;
}

.v-pop--theme .v-chip svg{
  fill: currentColor;
  stroke: none;
}

.v-pop--theme .v-chip[data-theme-pick="malina"]{ color:#a84a8a; }
.v-pop--theme .v-chip[data-theme-pick="wave"]{ color:#2aa9a9; }
.v-pop--theme .v-chip[data-theme-pick="zephyr"]{ color:#c08a47; }
.v-pop--theme .v-chip[data-theme-pick="sun"]{ color:#6f8098; }
.v-pop--theme .v-chip[data-theme-pick="moon"]{ color:#86a7ff; }

.v-pop--theme .v-chip[aria-pressed="true"]{
  border-color: color-mix(in oklab, currentColor, transparent 40%);
  box-shadow: 0 0 0 2px color-mix(in oklab, currentColor, transparent 78%) inset;
}

.v-modal--china{
  width: min(560px, calc(100vw - var(--nav-w) - 32px));
  max-height: none;
}

.v-china-actions{
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.v-btn{
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--stroke), transparent 55%);
  background: color-mix(in oklab, var(--glass), transparent 8%);
  color: color-mix(in oklab, var(--ink), transparent 8%);
  cursor: pointer;
  font-weight: 800;
}

.v-btn--ghost{
  background: transparent;
}

.v-btn:hover{
  border-color: color-mix(in oklab, var(--brand), transparent 35%);
  color: var(--brand);
}

.v-china-under{ display:none !important; }

/* 3) собака: вниз + в центр */
.v-storydog--side{
  margin-top: 40px;
  margin-right: 22px;
}
@media (max-width: 860px){
  .v-storydog--side{ margin-right: 0; }
}


/* Nav graphite (forced) */.v-nav{
  --nav-bg: rgba(20, 22, 28, .78);
  --nav-ink: rgba(235, 242, 255, .86);
  --stroke: rgba(235, 242, 255, .38);
}
