/* Hadjidraganov's Cellars — tour UI (krpano 1.24 + HTML skin) */

/* ---------- fonts (self-hosted, latin + cyrillic) ---------- */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap;
	src: url(../fonts/manrope-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap;
	src: url(../fonts/manrope-latin-400-normal.woff2) format("woff2"); 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: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
	src: url(../fonts/manrope-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
	src: url(../fonts/manrope-latin-600-normal.woff2) format("woff2"); 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: "Manrope"; font-style: normal; font-weight: 700; font-display: swap;
	src: url(../fonts/manrope-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap;
	src: url(../fonts/manrope-latin-700-normal.woff2) format("woff2"); 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: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap;
	src: url(../fonts/cormorant-garamond-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap;
	src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); 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: "Cormorant Garamond"; font-style: italic; font-weight: 600; font-display: swap;
	src: url(../fonts/cormorant-garamond-cyrillic-600-italic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 600; font-display: swap;
	src: url(../fonts/cormorant-garamond-latin-600-italic.woff2) format("woff2"); 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; }

/* ---------- tokens ---------- */
:root {
	--wine: #8E1B3A;
	--wine-dark: #6E0F2A;
	--gold: #E2BF7E;
	--gold-soft: rgba(226, 191, 126, .35);
	--cream: #F6EBDD;
	--cream-dim: rgba(246, 235, 221, .72);
	--glass: rgba(22, 13, 11, .58);
	--glass-strong: rgba(22, 13, 11, .78);
	--line: rgba(246, 235, 221, .14);
	--shadow: 0 18px 48px -12px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .25);
	--radius: 18px;
	--ease: cubic-bezier(.22, .8, .24, 1);
	--serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--safe-t: env(safe-area-inset-top, 0px);
	--safe-b: env(safe-area-inset-bottom, 0px);
	--safe-l: env(safe-area-inset-left, 0px);
	--safe-r: env(safe-area-inset-right, 0px);
	--gap: 20px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
	background: #140c0a;
	color: var(--cream);
	font: 400 15px/1.5 var(--sans);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
	font-feature-settings: "locl" 0; /* plain Cyrillic forms for small UI text */
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
}
#app { position: fixed; inset: 0; background: #140c0a; }
#pano { position: absolute; inset: 0; }
#ui { position: absolute; inset: 0; pointer-events: none; z-index: 10; transition: opacity .4s var(--ease); }
#ui > * { pointer-events: auto; }
#ui.is-hidden { opacity: 0; visibility: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

.icon { display: inline-flex; width: 22px; height: 22px; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

.glass {
	background: var(--glass);
	-webkit-backdrop-filter: blur(18px) saturate(1.4);
	backdrop-filter: blur(18px) saturate(1.4);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.glass { background: var(--glass-strong); }
}

/* Bulgarian Cyrillic forms (locl) only in the serif display type */
.brand-name, .panel-head h2, .card h2, .loader-title { font-feature-settings: "locl" 1; }

/* ---------- brand ---------- */
.brand {
	position: absolute;
	top: calc(var(--gap) + var(--safe-t));
	left: calc(var(--gap) + var(--safe-l));
	display: flex; align-items: center; gap: 14px;
	padding: 12px 20px 12px 12px;
	border-radius: var(--radius);
	max-width: calc(100vw - 2 * var(--gap));
	animation: rise .7s var(--ease) backwards .15s;
}
.brand-mark { width: 62px; height: auto; aspect-ratio: 205 / 210; flex: none; border-radius: 9px; box-shadow: 0 2px 8px rgba(0,0,0,.4), 0 0 0 1px rgba(226,191,126,.35); }
.brand-text { min-width: 0; }
.brand-kicker {
	font: 600 10.5px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase;
	color: var(--gold);
}
.brand-name {
	margin: 0; padding: .12em 3px .14em 0; font: 600 23px/1.3 var(--serif); letter-spacing: .01em; color: var(--cream);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-room { font-size: 12.5px; color: var(--cream-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-room .sep { margin: 0 .5em; color: var(--gold); opacity: .8; }
#room-section { transition: opacity .3s; }

/* ---------- dock ---------- */
.dock {
	position: absolute;
	left: 50%; bottom: calc(var(--gap) + var(--safe-b));
	transform: translateX(-50%);
	display: flex; align-items: center; gap: 4px;
	padding: 6px;
	border-radius: 999px;
	animation: rise-x .7s var(--ease) backwards .3s;
}
.dock-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }

.icon-btn {
	position: relative;
	display: inline-flex; align-items: center; justify-content: center;
	width: 46px; height: 46px; padding: 0;
	border: 0; border-radius: 999px;
	background: transparent;
	color: var(--cream);
	cursor: pointer;
	transition: background .2s, color .2s, transform .15s var(--ease);
}
.icon-btn:hover { background: rgba(246, 235, 221, .1); color: #fff; }
.icon-btn:active { transform: scale(.92); }
.icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.icon-btn[aria-pressed="true"], .icon-btn[aria-expanded="true"] { color: var(--gold); }
.icon-btn[aria-expanded="true"] { background: rgba(226, 191, 126, .14); }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn.small .icon { width: 18px; height: 18px; }
.lang-btn span { font: 700 12.5px/1 var(--sans); letter-spacing: .08em; }

/* tooltips: only for real pointers */
@media (hover: hover) and (pointer: fine) {
	.icon-btn[data-tip]::after {
		content: attr(data-tip);
		position: absolute; left: 50%; bottom: calc(100% + 14px);
		transform: translate(-50%, 6px);
		padding: 7px 12px; border-radius: 10px;
		background: var(--glass-strong); border: 1px solid var(--line);
		font: 600 12px/1 var(--sans); letter-spacing: .02em; white-space: nowrap; color: var(--cream);
		opacity: 0; pointer-events: none;
		transition: opacity .18s, transform .18s var(--ease);
	}
	.icon-btn[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .25s; }
}

/* ---------- panels: scene browser ---------- */
.panel {
	position: absolute;
	left: 50%; bottom: calc(var(--gap) + var(--safe-b) + 70px);
	width: min(760px, calc(100vw - 2 * var(--gap)));
	max-height: calc(100% - 200px - var(--safe-t) - var(--safe-b));
	display: flex; flex-direction: column;
	border-radius: 22px;
	padding: 16px 16px 18px;
	transform: translateX(-50%);
	transform-origin: 50% 100%;
}
.panel.is-open { animation: pop .38s var(--ease) both; }
.panel-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px 6px; }
.panel-head h2 { margin: 0; font: 600 24px/1.1 var(--serif); }

.tabs { flex: none; display: flex; gap: 6px; padding: 0 2px 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
	flex: none; padding: 8px 14px; border-radius: 999px;
	border: 1px solid var(--line); background: transparent; color: var(--cream-dim);
	font: 600 12.5px/1 var(--sans); letter-spacing: .04em; cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}
.tab:hover { color: var(--cream); border-color: rgba(246,235,221,.3); }
.tab[aria-selected="true"] { background: var(--wine); border-color: var(--wine); color: var(--cream); }
.tab .count { opacity: .6; margin-left: 6px; font-weight: 400; }
.tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.thumbs {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
	overflow-y: auto; padding: 2px; min-height: 0; flex: 1 1 auto;
	grid-auto-rows: max-content; align-content: start;
	scrollbar-width: thin; scrollbar-color: rgba(246,235,221,.25) transparent;
}
.thumb {
	position: relative; display: block; padding: 0;
	border: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
	background: #2a1a16;
	box-shadow: 0 0 0 1px var(--line);
	transition: transform .25s var(--ease), box-shadow .25s;
	animation: fade-up .4s var(--ease) both;
}
.thumb img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.thumb::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(to top, rgba(15,8,6,.85) 0%, rgba(15,8,6,0) 55%);
}
.thumb span {
	position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 1;
	font: 600 12px/1.2 var(--sans); text-align: left; color: var(--cream);
}
.thumb:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(246,235,221,.35), 0 10px 22px -8px rgba(0,0,0,.6); }
.thumb:hover img { transform: scale(1.06); }
.thumb:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.thumb.is-current { box-shadow: 0 0 0 2px var(--gold); }
.thumb.is-current::before {
	content: ""; position: absolute; top: 8px; right: 8px; z-index: 2;
	width: 9px; height: 9px; border-radius: 50%; background: var(--gold);
	box-shadow: 0 0 0 3px rgba(226,191,126,.3);
}

/* ---------- info card ---------- */
.card {
	position: absolute;
	right: calc(var(--gap) + var(--safe-r));
	top: 50%;
	width: min(400px, calc(100vw - 2 * var(--gap)));
	max-height: calc(100% - 220px);
	overflow-y: auto;
	padding: 24px 26px 26px;
	border-radius: 22px;
	transform: translateY(-50%);
	scrollbar-width: thin; scrollbar-color: rgba(246,235,221,.25) transparent;
}
.card::before {
	content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 3px;
	border-radius: 0 3px 3px 0; background: linear-gradient(var(--gold), var(--wine));
}
.card.is-open { animation: slide-in .45s var(--ease) both; }
.card-close { position: absolute; top: 12px; right: 12px; }
.card-kicker {
	display: flex; align-items: center; gap: 8px;
	font: 600 10.5px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--gold);
}
.card-kicker .icon { width: 16px; height: 16px; }
.card h2 { margin: 12px 36px 12px 0; font: 600 29px/1.08 var(--serif); color: var(--cream); }
.card.no-title .card-body { margin-top: 14px; padding-right: 30px; font-size: 16px; color: var(--cream); }
.card-body { color: var(--cream-dim); font-size: 14.5px; line-height: 1.65; }
.card-body p { margin: 0 0 .8em; }
.card-body p:last-child { margin-bottom: 0; }

/* ---------- hint toast ---------- */
.hint {
	position: absolute; left: 50%; top: 50%;
	display: flex; align-items: center; gap: 12px;
	padding: 14px 20px; border-radius: 999px;
	font-weight: 600; font-size: 14px;
	transform: translate(-50%, -50%);
	pointer-events: none;
	animation: hint-in .6s var(--ease) both;
}
.hint .icon { color: var(--gold); animation: wiggle 2s ease-in-out infinite; }
.hint.is-leaving { animation: hint-out .5s var(--ease) both; }

/* ---------- nav hover preview ---------- */
.navtip {
	position: fixed; left: 0; top: 0; z-index: 30;
	width: 176px; padding: 6px; border-radius: 16px;
	background: var(--glass-strong); border: 1px solid var(--line);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	box-shadow: var(--shadow);
	pointer-events: none !important;
	animation: fade .18s ease both;
}
.navtip img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 11px; background: #2a1a16; }
.navtip span { display: block; padding: 8px 6px 3px; font: 600 12.5px/1.25 var(--sans); }
.navtip.is-text { width: auto; max-width: 240px; padding: 4px 6px; border-radius: 999px; }
.navtip.is-text span { padding: 5px 8px; }
.navtip span small { display: block; font-weight: 400; color: var(--cream-dim); font-size: 11.5px; margin-top: 2px; }

/* ---------- loader ---------- */
.loader {
	position: absolute; inset: 0; z-index: 50;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
	background:
		radial-gradient(ellipse at 50% 40%, rgba(142,27,58,.35), transparent 60%),
		#140c0a;
	transition: opacity .8s var(--ease), visibility .8s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-mark { width: 132px; height: auto; aspect-ratio: 205 / 210; margin-bottom: 20px; border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.55), 0 0 0 1px rgba(226,191,126,.3); animation: breathe 2.4s ease-in-out infinite; }
.loader-kicker { font: 600 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.loader-title { font: 600 34px/1.1 var(--serif); text-align: center; padding: 0 24px; }
.loader-bar { width: 180px; height: 2px; margin: 22px 0 10px; border-radius: 2px; background: rgba(246,235,221,.12); overflow: hidden; }
.loader-bar div { width: 0; height: 100%; background: linear-gradient(90deg, var(--wine), var(--gold)); transition: width .3s ease; }
.loader-text { font-size: 12px; color: var(--cream-dim); letter-spacing: .06em; }
.noscript { position: absolute; inset: 0; display: grid; place-items: center; z-index: 60; background: #140c0a; }

/* ---------- animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes rise-x { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 14px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes slide-in { from { opacity: 0; transform: translate(24px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, -40%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes hint-out { to { opacity: 0; transform: translate(-50%, -60%); } }
@keyframes wiggle { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-4px) rotate(-8deg); } 75% { transform: translateX(4px) rotate(8deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: 1; } }

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

/* ---------- small screens ---------- */
@media (max-width: 640px) {
	:root { --gap: 12px; }
	.brand { padding: 8px 14px 8px 8px; gap: 10px; border-radius: 14px; }
	.brand-mark { width: 48px; border-radius: 7px; }
	.brand-kicker { display: none; }
	.brand-name { font-size: 18px; }
	.brand-room { font-size: 11.5px; }

	.dock { gap: 0; padding: 4px; max-width: calc(100vw - 2 * var(--gap)); }
	.icon-btn { width: 42px; height: 42px; }
	.dock-sep { margin: 0 2px; }

	.panel {
		left: 0; right: 0; bottom: 0; width: auto; transform: none;
		max-height: 72%;
		border-radius: 22px 22px 0 0;
		padding-bottom: calc(18px + var(--safe-b));
	}
	.panel.is-open { animation: sheet .4s var(--ease) both; }
	.thumbs { grid-template-columns: repeat(2, 1fr); }

	.card {
		left: 0; right: 0; top: auto; bottom: 0; width: auto;
		max-height: 62%;
		transform: none;
		border-radius: 22px 22px 0 0;
		padding: 22px 22px calc(24px + var(--safe-b));
	}
	.card::before { display: none; }
	.card.is-open { animation: sheet .4s var(--ease) both; }
	.card h2 { font-size: 25px; }

	/* the sheets cover the dock; hide it while one is open */
	.dock { transition: opacity .2s; }
	#ui.sheet-open .dock { opacity: 0; pointer-events: none; }
}
@media (max-width: 380px) {
	.icon-btn { width: 38px; height: 38px; }
	.icon { width: 20px; height: 20px; }
	.dock-sep { display: none; }
}
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }

/* landscape phones: keep everything compact */
@media (max-height: 480px) and (orientation: landscape) {
	:root { --gap: 10px; }
	.brand-kicker { display: none; }
	.brand { padding: 6px 12px 6px 6px; }
	.brand-mark { width: 40px; border-radius: 6px; }
	.brand-name { font-size: 17px; }
	.icon-btn { width: 40px; height: 40px; }
	.panel { max-height: calc(100% - 84px); bottom: calc(var(--gap) + 62px); }
	.card { max-height: calc(100% - 2 * var(--gap) - 64px); top: var(--gap); transform: none; }
	.thumbs { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
	.card.is-open { animation: fade .3s both; }
}
