/* Airavad Web Solutions — light, premium, glass UI over a WebGL world */
:root {
  --primary: #0f2a3f;
  --secondary: #2596be;
  --accent: #36b9e8;
  --bg: #f7fafc;
  --card: #ffffff;
  --text: #16232e;
  --muted: #5b7080;
  --line: rgba(15, 42, 63, 0.1);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.85);
  --shadow: 0 24px 60px -24px rgba(15, 42, 63, 0.35);
  --radius: 20px;
  --font: "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 28px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
html.modal-open { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 10px; transition: top 0.2s; }
.skip-link:focus { top: 12px; }

/* ---------- stage ---------- */
#canvas-section {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  width: 100%;
  height: calc(100dvh - var(--header-h));
  z-index: 0;
}
#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  background: linear-gradient(#cfe6f4, #f6fafc);
}
#spacer { height: 700vh; pointer-events: none; }
.is-fallback #spacer { display: none; }

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

/* ---------- loader ---------- */
#loader { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: var(--bg); transition: opacity 0.7s var(--ease), visibility 0.7s; }
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-card { display: grid; justify-items: center; gap: 12px; color: var(--primary); }
.loader-card small { color: var(--muted); }
.loader-bar { width: 180px; height: 4px; border-radius: 4px; background: #dcebf4; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, var(--secondary), var(--accent)); animation: slide 1.1s infinite ease-in-out; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- header ---------- */
.hdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px var(--gutter);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 42, 63, 0.06);
  box-shadow: 0 8px 24px -10px rgba(15, 42, 63, 0.15);
  transition: background 0.35s, box-shadow 0.35s;
}
.hdr.scrolled, .hdr.menu-open {
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 32px -12px rgba(15, 42, 63, 0.2);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.logo b { font-weight: 800; }
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  position: relative;
}
.logo-size {
  height: 48px;
  display: flex;
  align-items: center;
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M6 26 16 6l10 20M10.5 19h11' fill='none' stroke='%23ffffff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block;
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}
.nav a:hover {
  background: rgba(54, 185, 232, 0.12);
  color: var(--secondary);
}
.hdr-right { display: flex; align-items: center; gap: 10px; }
.only-mobile { display: none; }
.burger { display: none; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--primary); transition: transform 0.3s, opacity 0.3s; }
.burger span:nth-child(1) { top: 15px; } .burger span:nth-child(2) { top: 21px; } .burger span:nth-child(3) { top: 27px; }
.menu-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }


/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 0.95rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.btn:hover { transform: scale(1.03); }
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), #1b5a7d); box-shadow: 0 10px 24px -12px rgba(15, 42, 63, 0.7); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 0 4px rgba(54, 185, 232, 0.25), 0 12px 28px -12px rgba(15, 42, 63, 0.7); }
.btn-secondary { color: var(--primary); background: #fff; border-color: rgba(37, 150, 190, 0.45); }
.btn-secondary:hover { border-color: var(--secondary); box-shadow: 0 0 0 4px rgba(54, 185, 232, 0.18); }
.btn-ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.btn-ghost:hover { color: var(--primary); background: rgba(255, 255, 255, 0.7); }
.btn[aria-pressed="true"] { background: linear-gradient(135deg, var(--secondary), var(--accent)); }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--secondary); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.7); cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--primary); }

/* ---------- selector ---------- */
.selector {
  position: fixed;
  z-index: 30;
  right: 24px;
  left: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  padding: 16px 14px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 40px -12px rgba(15, 42, 63, 0.2);
  --p: 0;
}
.sel-rail {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 32px;
  bottom: 32px;
  width: 2px;
  height: auto;
  background: rgba(15, 42, 63, 0.12);
  border-radius: 2px;
}
.sel-rail i {
  position: absolute;
  inset: 0 0 0 auto;
  width: auto;
  height: calc(var(--p) * 100%);
  background: linear-gradient(180deg, var(--accent), var(--secondary));
  border-radius: 2px;
}

/* ---------- product dock: four briefcases ---------- */
#product-selector {
  --case-w: 96px;   /* case width; height follows the 120:100 viewBox */
  --logo: 56px;     /* logo size inside the open case */
  --plate: calc(var(--case-w) * 0.72); /* white plate behind the icon: 72% of the case width */
  --rise: 18px;     /* how far the logo rises out of the case */
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.case {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--case-w);
  cursor: pointer;
}
.case[data-tier="bronze"]   { --tier-a: #b8733a; --tier-b: #8a5226; }
.case[data-tier="silver"]   { --tier-a: #c9ced6; --tier-b: #8f98a6; }
.case[data-tier="gold"]     { --tier-a: #f2c94c; --tier-b: #c9972b; }
.case[data-tier="platinum"] { --tier-a: #e8eef5; --tier-b: #aebccf; }
.case input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.case-body {
  position: relative;
  display: block;
  width: var(--case-w);
  aspect-ratio: 120 / 100;
  border-radius: 14px;
  transition: transform 0.25s var(--ease), box-shadow 0.3s ease;
}
.case:hover .case-body { transform: translateY(-2px); }
.case input:checked + .case-body {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tier-b) 45%, transparent), 0 0 24px 2px color-mix(in srgb, var(--tier-b) 50%, transparent);
}
.case input:focus-visible + .case-body {
  outline: 3px solid var(--secondary);
  outline-offset: 4px;
}
.case-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.case-svg--back { z-index: 1; filter: drop-shadow(0 8px 10px rgba(15, 42, 63, 0.18)); }
.case-svg--front { z-index: 3; }
.case.is-open { z-index: 2; } /* an open case stays above its neighbours, so the logo is never under them */
.case + .case { margin-top: 26px; } /* room for the logo that rises above each case */
/* Lid rotation, logo rise and sparkle are driven by GSAP in js/ui/case-dock.js.
   CSS only sets the closed look and the hidden starting state of the logo. */
.case-lid {
  transform-box: view-box;
  transform-origin: 60px 26px; /* back hinge: top edge of the lid */
  transform: perspective(360px) rotateX(0deg);
}
.case-clasp { fill: rgba(15, 42, 63, 0.35); }
.case-handle { fill: rgba(15, 42, 63, 0.35); }
.case-mark {
  position: absolute;
  left: 50%;
  top: calc(var(--case-w) * 0.3 + var(--plate) * 0.1); /* resting place: just under the rim; the rise (translateY -100%) ends with 10% of it over the rim */
  width: var(--plate);
  height: var(--plate);
  margin-left: calc(var(--plate) / -2);
  padding: calc(var(--plate) * 0.075); /* the icon fills about 85% of the plate */
  box-sizing: border-box;
  border-radius: 14px;
  border: 2px solid rgba(15, 42, 63, 0.12);
  background: #fff; /* white backing: readable on every tier colour */
  box-shadow: 0 6px 18px -4px rgba(15, 42, 63, 0.4);
  z-index: 4; /* in front of the case: above the front body (z 3) and the lid, so no part of the logo is covered */
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.case-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  -webkit-user-drag: none;
}
.logo-failed .case-logo { opacity: 0; }
.case-letter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(var(--tier-a), var(--tier-b));
  color: #fff;
  font-size: calc(var(--logo) * 0.5);
  font-weight: 700;
  opacity: 0;
}
.logo-failed .case-letter { opacity: 1; }
.case-spark {
  position: absolute;
  left: 50%;
  top: calc(var(--case-w) * 0.2);
  font-size: 11px;
  line-height: 1;
  color: #f5c542;
  text-shadow: 0 0 6px rgba(245, 197, 66, 0.8);
  pointer-events: none;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 1024px) {
  #product-selector { --case-w: 86px; --logo: 50px; --rise: 16px; }
  .selector {
    right: 16px;
  }
}

@media (min-width: 1100px) and (max-height: 720px) {
  #product-selector { --case-w: 80px; --logo: 46px; --rise: 15px; }
}

@media (max-width: 640px) {
  #product-selector { --case-w: 68px; --logo: 40px; --rise: 13px; gap: 10px; }
  .selector {
    right: 12px;
    padding: 12px 10px;
  }
}

/* ---------- assistant panel ---------- */
/* ---------- intro bubble, chat launcher, tour skip ---------- */
.intro-bubble[hidden],
.intro-actions[hidden],
.chat-launcher[hidden],
.panel[hidden] { display: none; }
.intro-bubble {
  position: fixed;
  z-index: 45;
  left: 0;
  top: 0;
  width: min(360px, 88vw);
  max-height: none;
  overflow: visible;
  padding: 16px 44px 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
  color: var(--primary);
  transform: translate(-50%, 0); /* top is the anchor: the box grows downward from it, never above it */
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.intro-bubble.is-visible { opacity: 1; }
.intro-bubble.is-compact { padding: 12px 40px 12px 14px; width: min(360px, 88vw); }
.intro-bubble.is-compact .intro-text { font-size: 0.9rem; }
.intro-bubble.is-compact .intro-btn { min-height: 40px; }
.intro-bubble.is-tailless::after { display: none; }
.intro-bubble::after { /* tail pointing down at the head */
  content: "";
  position: absolute;
  left: calc(50% + var(--tail-x, 0px));
  bottom: -9px;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.97);
  border-right: 1px solid var(--glass-line);
  border-bottom: 1px solid var(--glass-line);
  transform: translateX(-50%) rotate(45deg);
}
.intro-text { margin: 0; font-size: 1rem; line-height: 1.45; font-weight: 600; min-height: 1.45em; text-wrap: pretty; }
.intro-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.intro-actions.is-in { opacity: 1; transform: none; }
.intro-btn { flex: 1 1 120px; min-height: 44px; }
.intro-close:focus-visible,
.intro-btn:focus-visible,
.chat-launcher:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; }
.chat-launcher {
  position: fixed;
  z-index: 44;
  left: var(--gutter);
  bottom: 84px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #1b5a7d);
  box-shadow: 0 10px 24px -10px rgba(15, 42, 63, 0.7);
  cursor: pointer;
}
@media (max-width: 1099px) {
  .chat-launcher { bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-bubble, .intro-actions { transition: none; }
}

/* ---------- contact card (contact station) ---------- */
.contact-card {
  position: fixed; z-index: 35; left: var(--gutter); top: calc(var(--header-h) + 16px);
  width: min(340px, calc(100vw - var(--gutter) * 2));
  max-height: calc(100dvh - var(--header-h) - 32px); overflow: auto;
  display: grid; gap: 14px; padding: 20px;
  border-radius: 22px; background: #fff; border: 1px solid var(--glass-line); box-shadow: var(--shadow);
  color: var(--primary);
}
.contact-card[hidden] { display: none; }
.contact-logo-wrap { position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 14px; }
.contact-logo { display: block; height: 56px; width: auto; }
.contact-card.is-shine .contact-logo-wrap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  transform: translateX(-100%); animation: contact-shine 1.4s ease 0.4s 1 forwards;
}
@keyframes contact-shine { to { transform: translateX(100%); } }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.contact-list a { display: inline-flex; align-items: center; min-height: 44px; color: var(--primary); font-weight: 600; text-decoration: none; }
.contact-list a:hover { color: var(--secondary); }
.contact-reach { min-height: 44px; }
.contact-card a:focus-visible, .contact-card button:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; }
.selector.contact-fade { transition: opacity 0.4s var(--ease); }
.selector.is-contact-hidden { opacity: 0; pointer-events: none; }
@media (max-width: 767px) {
  .contact-card { top: calc(var(--header-h) + 12px); left: 12px; right: 12px; width: auto; max-height: 50dvh; }
}

/* ---------- guided tour control bar ---------- */
.tour-bar {
  position: fixed; z-index: 46; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(580px, calc(100vw - 24px));
  padding: 0 14px 12px; border-radius: 20px; overflow: hidden;
  background: rgba(255, 255, 255, 0.97); border: 1px solid var(--glass-line); box-shadow: var(--shadow);
  color: var(--primary);
}
.tour-bar[hidden] { display: none; }
.tour-progress { height: 4px; margin: 0 -14px 10px; background: #dcebf4; }
.tour-progress[hidden] { display: none; }
.tour-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--secondary), var(--accent)); }
.tour-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-status { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.tour-count { font-weight: 700; font-size: 0.9rem; }
.tour-dots { display: flex; gap: 6px; align-items: center; }
.tour-dot { width: 8px; height: 8px; border-radius: 50%; background: #c9d6df; display: inline-block; }
.tour-dot.is-on { width: 10px; height: 10px; }
.tour-timer { font-size: 0.75rem; color: var(--muted); white-space: nowrap; min-height: 1em; }
.tour-btn { min-height: 44px; }
.tour-btn:disabled { opacity: 0.45; cursor: default; }
.tour-bar button:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; }
@media (max-width: 767px) {
  .tour-bar { bottom: 100px; width: calc(100vw - 24px); padding: 0 10px 10px; }
  .tour-row { gap: 4px; }
  .tour-btn { padding-left: 10px; padding-right: 10px; }
}

.panel:focus { outline: none; }
.panel {
  position: fixed; z-index: 40; left: var(--gutter); bottom: var(--gutter);
  width: min(430px, calc(100vw - var(--gutter) * 2));
  max-height: min(66vh, 620px);
  display: flex; flex-direction: column;
  border-radius: 26px; overflow: hidden;
  transition: max-height 0.4s var(--ease), width 0.4s var(--ease);
}
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--secondary), var(--accent)); flex: none; }
.panel-title { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.panel-title strong { font-size: 0.95rem; color: var(--primary); }
.panel-title span { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-body { overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 18px; display: grid; gap: 12px; align-content: start; scroll-behavior: smooth; }
.panel.is-min .panel-body { display: none; }
.panel.is-min { width: 280px; }
.panel.is-walking .panel-body { padding: 12px 16px 14px; }
.panel.is-walking { width: min(340px, calc(100vw - var(--gutter) * 2)); }
.walking-note { color: var(--muted); font-weight: 600; font-size: 0.9rem; display: flex; gap: 10px; align-items: center; }
.walking-note::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; flex: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(54, 185, 232, 0.5); } 50% { box-shadow: 0 0 0 8px rgba(54, 185, 232, 0); } }
.is-fallback .panel:not(.is-active) { display: none; }

.msg { max-width: 94%; padding: 12px 15px; border-radius: 18px; font-size: 0.95rem; line-height: 1.45; }
.msg-bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: 0 8px 20px -14px rgba(15, 42, 63, 0.4); color: var(--text); }
.msg-kicker { display: block; font-size: 0.72rem; font-weight: 700; color: var(--secondary); letter-spacing: 0.04em; margin-bottom: 2px; }
.msg-user { justify-self: end; background: linear-gradient(135deg, var(--secondary), var(--accent)); color: #fff; border-bottom-right-radius: 6px; font-weight: 600; }
.note { font-size: 0.82rem; color: var(--muted); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

.opts { display: grid; gap: 8px; }
.opts.cols-2 { grid-template-columns: 1fr 1fr; }
.opts.cols-1 { grid-template-columns: 1fr; }
.opt {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left;
  min-height: 54px; padding: 10px 14px; border-radius: 16px;
  background: #fff; border: 1.5px solid rgba(15, 42, 63, 0.12); cursor: pointer;
  font-weight: 600; font-size: 0.9rem; color: var(--primary); line-height: 1.25;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.opt:hover:not(:disabled) { transform: scale(1.03); border-color: var(--accent); box-shadow: 0 10px 22px -14px rgba(37, 150, 190, 0.8); }
.opt-single { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
.opt-hint { font-size: 0.74rem; font-weight: 500; color: var(--muted); }
.opt-single.is-picked { background: linear-gradient(135deg, var(--secondary), var(--accent)); color: #fff; border-color: transparent; }
.opt-single.is-picked .opt-hint { color: rgba(255, 255, 255, 0.85); }
.opt:disabled:not(.is-picked) { opacity: 0.55; }
.opt-multi input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt-check { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid #b4c7d3; background: #fff; display: grid; place-items: center; transition: all 0.2s; }
.opt-check::after { content: ""; width: 10px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) scale(0) translateY(-1px); transition: transform 0.2s var(--ease); }
.opt-multi input:checked ~ .opt-check { background: var(--secondary); border-color: var(--secondary); }
.opt-multi input:checked ~ .opt-check::after { transform: rotate(-45deg) scale(1) translateY(-1px); }
.opt-multi:has(input:checked) { border-color: var(--secondary); background: #eef9fe; box-shadow: 0 0 0 3px rgba(54, 185, 232, 0.18); }
.opt-multi input:focus-visible ~ .opt-check { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt-multi:has(input:disabled) { opacity: 0.7; cursor: default; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions.stack { flex-direction: column; }
.actions.stack .btn { width: 100%; }

.analyzing { display: grid; gap: 8px; font-weight: 600; font-size: 0.9rem; color: var(--primary); }
.analyzing .bar { height: 6px; border-radius: 6px; background: #dcebf4; overflow: hidden; }
.analyzing .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--secondary), var(--accent)); animation: fill 1.4s var(--ease) forwards; }
@keyframes fill { to { width: 100%; } }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(54, 185, 232, 0.16); color: #14688a; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; }
.badge-rec { background: linear-gradient(135deg, var(--secondary), var(--accent)); color: #fff; }

.pcard {
  position: relative; display: grid; gap: 6px; padding: 18px 18px 16px; border-radius: 20px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px -22px rgba(15, 42, 63, 0.5);
  border-top: 4px solid var(--accent, #36b9e8);
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.pcard:hover { box-shadow: 0 24px 50px -22px rgba(37, 150, 190, 0.7); }
.pcard h3 { font-size: 1.7rem; letter-spacing: -0.02em; color: var(--primary); font-weight: 800; }
.pcard .badge { justify-self: start; }
.pcard-level { color: var(--secondary); font-weight: 700; font-size: 0.82rem; }
.pcard-tag { color: var(--text); }
.pcard-why { font-size: 0.82rem; color: var(--muted); }
.pcard .actions { margin-top: 8px; }

/* ---------- contact form ---------- */
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.78rem; font-weight: 700; color: var(--primary); }
.field .req { color: #c0392b; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 12px; border: 1.5px solid #d5e5ee; background: #fbfdfe; transition: border-color 0.2s, box-shadow 0.2s; }
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 4px rgba(54, 185, 232, 0.2); }
.form-status { min-height: 1.2em; margin-top: 6px; font-size: 0.85rem; font-weight: 600; }
.form-status.is-ok { color: #1b7a4b; }
.form-status.is-error { color: #b03a2e; }

/* ---------- scroll hint ---------- */
.scroll-hint { position: fixed; z-index: 20; left: 24px; bottom: 24px; transform: none; transition: opacity 0.4s; display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.78); border: 1px solid var(--glass-line); backdrop-filter: blur(10px); font-size: 0.85rem; font-weight: 700; color: var(--primary); pointer-events: none; }
.scroll-hint i { width: 10px; height: 10px; border-right: 2.5px solid var(--secondary); border-bottom: 2.5px solid var(--secondary); transform: rotate(45deg); animation: nudge 1.4s infinite; }
.scroll-hint.is-end i { display: none; }
@keyframes nudge { 0%, 100% { transform: translateY(-2px) rotate(45deg); } 50% { transform: translateY(3px) rotate(45deg); } }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 42, 63, 0.3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity 0.35s; }
.modal.is-open .modal-backdrop { opacity: 1; }
.modal-panel {
  position: relative; width: min(1000px, 100%); max-height: min(90vh, 900px); display: flex; flex-direction: column; overflow: hidden;
  background: rgba(255, 255, 255, 0.95); border-radius: 30px; box-shadow: 0 40px 100px -30px rgba(15, 42, 63, 0.6);
  opacity: 0; transform: translateY(24px) scale(0.97); transition: opacity 0.35s, transform 0.4s var(--ease);
}
.modal.is-open .modal-panel { opacity: 1; transform: none; }
#modal-content { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.modal-close { position: absolute; top: 16px; right: 16px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--primary); display: grid; place-items: center; cursor: pointer; transition: transform 0.2s; }
.modal-close:hover { transform: scale(1.08) rotate(90deg); }
.modal-hero { padding: 44px 44px 28px; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent, #36b9e8) 22%, #fff), #fff 70%); display: grid; gap: 10px; justify-items: start; }
.modal-hero h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -0.035em; line-height: 1.02; color: var(--primary); font-weight: 800; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 36px; padding: 28px 44px 20px; }
.modal-grid .full { grid-column: 1 / -1; display: grid; gap: 22px; }
.modal-grid h3 { font-size: 0.8rem; text-transform: none; letter-spacing: 0.02em; color: var(--secondary); margin-bottom: 10px; font-weight: 800; }
.modal-grid section > p { color: var(--text); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.check-list li { position: relative; padding-left: 28px; }
.check-list li::before { content: ""; position: absolute; left: 0; top: 5px; width: 17px; height: 17px; border-radius: 6px; background: rgba(54, 185, 232, 0.18); }
.check-list li::after { content: ""; position: absolute; left: 5px; top: 9px; width: 8px; height: 4px; border-left: 2.2px solid var(--secondary); border-bottom: 2.2px solid var(--secondary); transform: rotate(-45deg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; background: #eef7fc; border: 1px solid rgba(37, 150, 190, 0.3); color: var(--primary); font-weight: 600; font-size: 0.86rem; }
.size-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 520px; }
.size-meter span { display: grid; gap: 6px; }
.size-meter i { height: 8px; border-radius: 8px; background: #dcebf4; }
.size-meter .on i { background: linear-gradient(90deg, var(--secondary), var(--accent)); }
.size-meter small { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.modal-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 44px 26px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 40%); }

/* ---------- 2D fallback ---------- */
.is-fallback body, .is-fallback { background: linear-gradient(#eaf4fa, var(--bg) 40%); }
.is-fallback #selector, .is-fallback #where, .is-fallback #scroll-hint { display: none; }
.fallback { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 120px var(--gutter) 160px; display: grid; gap: 28px; }
.fallback[hidden] { display: none; }
.fb-hero { display: grid; gap: 16px; justify-items: start; padding: 20px 0 40px; }
.fb-hero h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); letter-spacing: -0.035em; line-height: 1.04; color: var(--primary); font-weight: 800; max-width: 760px; }
.fb-sec { display: grid; grid-template-columns: 90px 1fr; gap: 20px; padding: 32px; border-radius: 28px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-left: 6px solid var(--accent, #36b9e8); }
.fb-step { font-size: 3rem; font-weight: 800; color: rgba(37, 150, 190, 0.35); letter-spacing: -0.04em; }
.fb-body { display: grid; gap: 12px; justify-items: start; }
.fb-body h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.03em; color: var(--primary); font-weight: 800; }
.fb-contact { grid-template-columns: 1fr; }
.fb-contact .contact-form { width: min(560px, 100%); }
.noscript { position: fixed; inset: 0; z-index: 500; padding: 120px 28px; background: var(--bg); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1099px) {
  :root { --gutter: 20px; --header-h: 68px; }
  .scroll-hint { display: none; }
  .panel { width: min(380px, calc(100vw - 40px)); max-height: 58vh; }
  .modal-hero { padding: 36px 32px 24px; }
  .modal-grid { padding: 24px 32px 16px; }
  .modal-foot { padding: 16px 32px 24px; }
}
@media (max-width: 899px) {
  .nav { position: fixed; left: 0; right: 0; top: 0; padding: 74px 20px 20px; background: rgba(255, 255, 255, 0.97); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); transform: translateY(-110%); transition: transform 0.4s var(--ease); z-index: -1; margin: 0; }
  .menu-open .nav { transform: none; }
  .nav ul { flex-direction: column; gap: 2px; }
  .nav a { padding: 14px 12px; font-size: 1.05rem; border-radius: 12px; }
  .only-mobile { display: block; margin-top: 10px; }
  .hide-mobile { display: none; }
  .burger { display: block; }
  .hdr-right { margin-left: auto; }
  .logo-text { font-size: 0.95rem; }
}
@media (max-width: 767px), (max-width: 1099px) and (orientation: portrait) {
  :root { --gutter: 14px; --header-h: 60px; }
  .hdr { padding: 10px 14px; }
  .logo-size { height: 40px; }
  .selector {
    position: fixed;
    z-index: 30;
    right: 12px;
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: auto;
    margin: 0;
    padding: 10px 8px;
  }
  .sel-rail { display: none; }
  #product-selector {
    gap: 8px;
  }
  .panel { left: 0; right: 0; bottom: 0; width: auto; max-height: 52svh; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .panel.is-walking, .panel.is-min { width: auto; }
  .panel-head { padding: 10px 14px; }
  .avatar { width: 32px; height: 32px; border-radius: 10px; }
  .panel-body { padding: 12px 14px 16px; }
  .opt { min-height: 56px; font-size: 0.88rem; }
  .btn { min-height: 50px; }
  .pcard h3 { font-size: 1.5rem; }
  .modal { padding: 0; place-items: end center; }
  .modal-panel { width: 100%; max-height: 92svh; border-radius: 26px 26px 0 0; transform: translateY(100%); }
  .modal-hero { padding: 28px 20px 18px; }
  .modal-grid { grid-template-columns: 1fr; padding: 18px 20px 10px; gap: 22px; }
  .modal-foot { padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 calc(50% - 5px); min-height: 48px; padding: 0 12px; }
  .modal-foot .btn-primary { flex-basis: 100%; }
  .contact-form { grid-template-columns: 1fr; }
  .fb-sec { grid-template-columns: 1fr; padding: 22px; }
  .fb-step { font-size: 2rem; }
  .fallback { padding-top: 90px; }
}
@media (max-width: 340px) {
  #product-selector { --case-w: 56px; --logo: 34px; --rise: 11px; }
  .selector {
    right: 8px;
    padding: 8px 6px;
  }
}
@media (max-width: 380px) {
  .opts.cols-2 { grid-template-columns: 1fr; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .panel { max-height: 78vh; }
}

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