:root {
  color-scheme: dark;
  font-family: "Cairo", system-ui, sans-serif;
  --bg: #030811;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --surface: rgba(7, 34, 43, .86);
  --border: rgba(45, 212, 191, .32);
  --chair-main: #2dd4bf;
  --chair-secondary: #06b6d4;
  --page-inline: clamp(14px, 4vw, 64px);
  --icon-size: clamp(64px, min(21vw, 12.5svh), 112px);
}

html.light {
  color-scheme: light;
  --bg: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --surface: rgba(255, 255, 255, .9);
  --border: rgba(13, 148, 136, .25);
}

* { box-sizing: border-box; }
html, body { width: 100%; margin: 0; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); transition: background .3s ease, color .3s ease; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-viewport {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle 380px at 50% 40%, #0b2e3f 0%, #061826 48%, var(--bg) 100%);
  isolation: isolate;
}

html.light .app-viewport { background: radial-gradient(circle 440px at 50% 38%, #dff8f6 0%, #eff6f8 55%, var(--bg) 100%); }
.ambient-glow, .launcher-glow { position: absolute; pointer-events: none; border-radius: 999px; z-index: -1; }
.ambient-glow { width: 380px; height: 380px; top: 28%; left: 50%; translate: -50% -50%; background: rgba(20,184,166,.09); filter: blur(70px); }
.launcher-glow { width: 360px; height: 240px; inset: 50% auto auto 50%; background: radial-gradient(circle, rgba(0,229,255,.22), rgba(13,148,136,.15) 55%, transparent 75%); animation: breathe 9s ease-in-out infinite alternate; will-change: transform, filter, opacity; }
html.light .launcher-glow { background: radial-gradient(circle, rgba(13,148,136,.15), rgba(6,182,212,.1) 55%, transparent 75%); }

@keyframes breathe { from { transform: translate(-50%,-50%) scale(.95); filter: blur(60px); opacity: .8; } to { transform: translate(-50%,-50%) scale(1.05); filter: blur(80px); opacity: 1; } }

.topbar { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: calc(env(safe-area-inset-top, 0px) + clamp(18px, 3.2vmin, 32px)) max(var(--page-inline), env(safe-area-inset-right, 0px)) 8px max(var(--page-inline), env(safe-area-inset-left, 0px)); z-index: 2; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { width: 43px; height: 43px; border-radius: 13px; object-fit: cover; box-shadow: 0 8px 24px rgba(20,184,166,.25); }
.brand div { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.brand strong { color: #38bdf8; font: 800 17px "Plus Jakarta Sans", sans-serif; text-shadow: 0 0 12px rgba(56,189,248,.4); }
html.light .brand strong { color: #0f172a; text-shadow: none; }
.brand span { margin-top: 5px; color: #2dd4bf; font: 700 8px "Plus Jakarta Sans", sans-serif; letter-spacing: .17em; }
html.light .brand span { color: #0d9488; }

.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(45,212,191,.3); border-radius: 50%; background: rgba(15,23,42,.7); color: #5eead4; cursor: pointer; transition: transform .2s, background .3s; }
.theme-toggle:hover { transform: scale(1.06); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.moon-icon { display: none; }
html.light .theme-toggle { background: rgba(255,255,255,.9); color: #334155; border-color: #cbd5e1; }
html.light .sun-icon { display: none; }
html.light .moon-icon { display: block; }

main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(26px, 6svh, 70px); width: 100%; min-width: 0; min-height: 0; padding: clamp(14px, 3svh, 34px) var(--page-inline) 0; transform: translateY(clamp(12px, 3svh, 24px)); z-index: 1; }
h1 { margin: 0; color: var(--text); font-size: clamp(1.2rem, min(5vw, 3.2svh), 2rem); line-height: 1.25; }
.launcher { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; justify-content: center; gap: clamp(4px, 2vw, 30px); width: min(calc(100vw - (2 * var(--page-inline))), 760px); min-width: 0; }
.app-link { display: flex; flex-direction: column; align-items: center; gap: 13px; min-width: 0; text-decoration: none; outline: none; }
.app-icon { display: grid; place-items: center; width: var(--icon-size); height: var(--icon-size); padding: clamp(5px, 1.1vmin, 8px); overflow: hidden; border: 1px solid var(--border); border-radius: 27%; background: var(--surface); box-shadow: 0 18px 42px rgba(0,0,0,.28); transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, border-color .25s; }
.app-icon img { width: 100%; height: 100%; border-radius: 22%; object-fit: cover; }
.app-link strong { color: var(--text); font: 700 clamp(9px, min(2.9vw, 1.8svh), 15px) "Plus Jakarta Sans", sans-serif; text-align: center; line-height: 1.3; overflow-wrap: anywhere; }
.app-link:hover .app-icon, .app-link:focus-visible .app-icon { transform: translateY(-7px) scale(1.04); border-color: #2dd4bf; box-shadow: 0 22px 55px rgba(20,184,166,.24); }
.app-link:active .app-icon { transform: scale(.92); }
.app-link.unavailable { cursor: not-allowed; opacity: .48; filter: grayscale(.85); }
.app-link.unavailable .app-icon { background: rgba(2, 6, 12, .92); border-color: rgba(100, 116, 139, .28); box-shadow: 0 14px 34px rgba(0, 0, 0, .42); }
.app-link.unavailable:hover .app-icon { transform: none; border-color: rgba(100, 116, 139, .28); box-shadow: 0 14px 34px rgba(0, 0, 0, .42); }
.availability { margin-top: -7px; color: #94a3b8; font-size: clamp(7px, 1.8vw, 9px); font-weight: 700; white-space: nowrap; }
html.light .app-link.unavailable { opacity: .56; }

.chair-area { display: flex; align-items: flex-end; justify-content: center; width: 100%; min-height: 0; padding: 0 var(--page-inline); pointer-events: none; }
.chair { width: min(400px, 88vw, 24svh); height: auto; max-height: min(190px, 24svh); filter: drop-shadow(0 0 8px rgba(0,229,255,.35)); animation: chair-pulse-dark 6s ease-in-out infinite alternate; will-change: filter; }
html.light .chair { filter: drop-shadow(0 0 4px rgba(13,148,136,.24)); animation-name: chair-pulse-light; }
@keyframes chair-pulse-dark {
  from { filter: drop-shadow(0 0 8px rgba(0,229,255,.35)); }
  to { filter: drop-shadow(0 0 16px rgba(0,229,255,.6)); }
}
@keyframes chair-pulse-light {
  from { filter: drop-shadow(0 0 4px rgba(13,148,136,.22)); }
  to { filter: drop-shadow(0 0 9px rgba(13,148,136,.38)); }
}

footer { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(6px, 2vw, 14px); width: 100%; padding: clamp(6px, 1.4svh, 10px) max(var(--page-inline), env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + clamp(9px, 2svh, 18px)) max(var(--page-inline), env(safe-area-inset-left, 0px)); color: var(--muted); font: 600 clamp(8px, min(2.2vw, 1.5svh), 11px) "Plus Jakarta Sans", sans-serif; }
footer a { display: inline-flex; align-items: center; gap: 7px; width: fit-content; text-decoration: none; transition: color .2s; }
footer svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.privacy-link { justify-self: start; }
.contact-link { justify-self: end; }
.contact-link svg { width: 25px; height: 25px; padding: 5px; border: 1px solid rgba(34,197,94,.35); border-radius: 50%; fill: currentColor; stroke: none; color: #22c55e; background: rgba(34,197,94,.1); }
footer a:hover { color: #2dd4bf; }

@media (max-width: 420px) {
  .brand img { width: clamp(34px, 9.5vw, 38px); height: clamp(34px, 9.5vw, 38px); }
  .brand strong { font-size: clamp(14px, 4vw, 17px); }
  .theme-toggle { width: 36px; height: 36px; }
  .app-link { gap: clamp(7px, 1.7svh, 11px); }
  footer a { gap: 4px; }
}

@media (max-width: 350px) {
  .brand span { letter-spacing: .1em; }
  .contact-link > span { display: none; }
  footer { grid-template-columns: 1fr auto 1fr; }
}

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