/* PWA / app mode.
   Outside the installed app (or ?app=1) only the install banner can show; the app bar and tab bar stay hidden.
   Inside it (html.is-app) the site turns into an app shell: slim top bar, bottom tab bar, rounded cards, compact footer. */
.de-appbar,
.de-tabbar { display: none; }

/* ---- install banner (normal mobile browser) ---- */
.de-install {
	position: fixed;
	left: 0.75rem;
	right: 0.75rem;
	bottom: calc(0.75rem + env(safe-area-inset-bottom));
	z-index: 1500;
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 0.7rem 0.7rem 0.8rem;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 1.1rem;
	background: rgba(14, 14, 14, 0.94);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	color: #fff;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.de-install[hidden] { display: none; }
.de-install img { width: 2.75rem; height: 2.75rem; border-radius: 0.7rem; }
.de-install strong { display: block; font: 800 0.9rem var(--de-body); }
.de-install span { display: block; margin-top: 0.1rem; font-size: 0.78rem; color: rgba(255, 255, 255, 0.65); }
.de-install__go { padding: 0.6rem 1rem; border: 0; border-radius: 999px; background: var(--de-red); color: #fff; font: 800 0.78rem var(--de-body); letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.de-install__go[hidden] { display: none; }
.de-install__x { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; color: rgba(255, 255, 255, 0.6); font-size: 1.4rem; line-height: 1; cursor: pointer; }
html.is-app .de-install { display: none; }

/* ---- app mode ---- */
html.is-app {
	--app-bar: calc(3.6rem + env(safe-area-inset-top));
	--app-tabs: calc(4.3rem + env(safe-area-inset-bottom));
	--de-radius: 1.1rem;
	overscroll-behavior-y: none;
}
html.is-app body {
	padding-bottom: var(--app-tabs);
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
}
html.is-app a,
html.is-app button { -webkit-tap-highlight-color: transparent; }

/* the floating website header is replaced by the app bar */
html.is-app .de-header,
html.is-app .de-nav-overlay,
html.is-app .de-totop { display: none !important; }

html.is-app .de-appbar {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 900;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--app-bar);
	padding: env(safe-area-inset-top) 1rem 0 1.1rem;
	background: rgba(0, 0, 0, 0.9);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
html.is-app .de-appbar__logo img { display: block; height: 2.3rem; width: auto; }
html.is-app .de-appbar__wa {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--de-red);
	color: #fff;
	transition: transform 0.2s var(--de-ease);
}
html.is-app .de-appbar__wa:active { transform: scale(0.9); }

html.is-app .de-content { padding-top: var(--app-bar); }
html.is-app .de-hero { min-height: calc(100svh - var(--app-bar) - var(--app-tabs)); padding-top: 3rem; }
html.is-app .de-page-hero { padding-top: 2.5rem; }
html.is-app .pr-hero { padding-top: 2.5rem; }

/* bottom tab bar */
html.is-app .de-tabbar {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 950;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	height: var(--app-tabs);
	padding: 0.35rem 0.4rem env(safe-area-inset-bottom);
	border-radius: 1.4rem 1.4rem 0 0;
	background: rgba(12, 12, 12, 0.94);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}
html.is-app .de-tabbar__item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.28rem;
	color: rgba(255, 255, 255, 0.55);
	font: 700 0.64rem var(--de-body);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	transition: color 0.25s var(--de-ease), transform 0.2s var(--de-ease);
}
html.is-app .de-tabbar__item svg { width: 1.45rem; height: 1.45rem; transition: transform 0.3s var(--de-ease); }
html.is-app .de-tabbar__item:active { transform: scale(0.92); }
html.is-app .de-tabbar__item.is-active { color: #fff; }
html.is-app .de-tabbar__item.is-active svg { color: var(--de-red); transform: translateY(-2px); }
html.is-app .de-tabbar__item.is-active::before {
	content: "";
	position: absolute;
	top: -0.35rem;
	width: 1.8rem;
	height: 3px;
	border-radius: 0 0 3px 3px;
	background: var(--de-red);
}

/* app feel for the content */
html.is-app .de-btn { border-radius: 999px; }
html.is-app .de-service,
html.is-app .de-card,
html.is-app .pr-card,
html.is-app .de-portfolio__item,
html.is-app .de-portfolio__media,
html.is-app .de-stat { border-radius: 1.1rem; overflow: hidden; }
html.is-app .de-section { padding-block: clamp(2.2rem, 8vw, 3.5rem); }

/* footer shrinks to one line; the tab bar already carries the navigation */
html.is-app .de-footer__grid { display: none; }
html.is-app .de-footer__bar { padding-block: 1.1rem; text-align: center; }
html.is-app .de-footer { padding-top: 0; }

/* lightbox and menus sit above the bars */
html.is-app .de-lb { z-index: 2000; }

/* no hover-only effects on touch */
@media (hover: none) {
	html.is-app .de-service:hover,
	html.is-app .pr-card:hover { transform: none; }
}
