:root {
  --bg: #171615;
  --panel: #22201f;
  --panel2: #2a2827;
  --text: #f0ece4;
  --muted: #a8a39b;
  --steel: #88a8ca;
  --gold: #d7a755;
  --line: #3b3735;
} 

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 18px;
}

html,
body {
  margin: 0;
  background: linear-gradient(180deg, #171615, #1c1b1a);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

body {
  font-size: 14px;
  line-height: 1.5;
}

button {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: #191817;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-inner {
  width: 100%;
  max-width: 240px;
  border: 1px solid rgba(217, 178, 76, 0.10);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(34, 32, 31, 0.88), rgba(28, 26, 25, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 36px rgba(0, 0, 0, 0.18);
  padding: 16px 14px;
}

.sidebar-logo {
  margin-top: auto;
  padding: 15px 0 10px;
  display: flex;
  justify-content: center;
  width: 100%;
  text-decoration: none;
}

.sidebar-logo img {
  width: 80px;
  height: auto;
  display: block;
  opacity: 0.96;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.sidebar-logo:hover img {
  transform: translateY(-1px);
  opacity: 1;
}

.brand-wrap {
  width: 100%;
  margin: 0 0 12px;
}

.brand-crest {
  position: relative;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  aspect-ratio: 1 / 1.08;
}

.brand-crest-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 210px;
  margin: 0 auto;
}

.nav a {
  padding: 11px 14px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: #1c1a19;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav a:hover:not(.active) {
  background: linear-gradient(180deg, #221f1d, #1a1817);
  border-color: rgba(217, 178, 76, 0.24);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 6px 14px rgba(0, 0, 0, 0.14);
}

.nav a.active {
  background: linear-gradient(180deg, #262320, #1d1a18);
  border-color: rgba(217, 178, 76, 0.40);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.18);
}

.main {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, #22201f, #2a2827);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  color: var(--gold);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.section-head span {
  font-size: 12px;
  color: var(--steel);
  font-weight: 600;
}

.thumb-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.thumb {
  min-height: 150px;
  border: 1px solid rgba(217, 178, 76, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, #252220, #1b1918);
  color: var(--text);
  position: relative;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.thumb:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 178, 76, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 24px rgba(0, 0, 0, 0.26);
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  opacity: 1;
}

.thumb-map img {
  object-fit: cover;
}

.thumb span {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #262320, #1d1a18);
  color: #fff;
  padding: 7px 12px;
  border-radius: 999px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(217, 178, 76, 0.40);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.18);
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

#platforms .grid2 {
  grid-template-columns: repeat(3, 1fr);
}

#network-security .mini strong {
  margin-bottom: 10px;
}

#network-security .grid2 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

#network-security .grid2 .mini:nth-child(1),
#network-security .grid2 .mini:nth-child(2),
#network-security .grid2 .mini:nth-child(3) {
  grid-column: span 2;
}

#network-security .grid2 .mini:nth-child(4),
#network-security .grid2 .mini:nth-child(5) {
  grid-column: span 3;
}

.mini {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #1c1a19;
}

.mini strong,
.mini .platform-title {
  display: block;
  color: var(--steel);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}

.mini span,
.mini .devices {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.mini .role {
  display: block;
  font-style: normal;
  color: #e8cf8a;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  opacity: 0.95;
  line-height: 1.2;
}

.mini .devices-label {
  color: #fff;
  font-weight: 600;
  font-style: normal;
}

.mini .line-label {
  color: #ffffff;
  font-weight: 500;
  font-style: normal;
}

.mini .inline-link {
  color: var(--text);
  font-weight: 600;
}

.mini .inline-link:hover,
.footer-inner a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.camera-links {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.camera-link {
  background: none;
  border: none;
  padding: 0;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.camera-link:hover {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.camera-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.84);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
}

.lightbox.open {
  display: flex;
}

.light-inner {
  width: min(94vw, 1360px);
  max-height: min(92vh, 980px);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: #111;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 0;
  align-items: stretch;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  position: relative;
}

.light-inner img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(92vh, 980px);
  object-fit: contain;
  background: #111;
  padding: 18px;
}

.light-caption {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 4;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(38, 35, 32, 0.96), rgba(29, 26, 24, 0.96));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  border: 1px solid rgba(217, 178, 76, 0.40);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.light-inner.camera-mode {
  display: block;
  width: min(94vw, 1100px);
  max-height: min(92vh, 900px);
  background: #111;
}

.light-inner.camera-mode img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(92vh, 900px);
  object-fit: contain;
  padding: 18px;
  border-bottom: none;
}

.light-inner.camera-mode .plan-devices {
  display: none;
}

.light-inner.camera-mode .light-caption {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.light-caption:empty {
  display: none;
}

.light-inner.camera-mode ~ .nav-btn,
.lightbox.camera-mode-active .nav-btn {
  display: none;
}

.plan-devices {
  border-left: 1px solid rgba(136, 168, 202, 0.25);
  background: #141312;
  min-height: 0;
  max-height: min(92vh, 980px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  color: var(--text);
}

.plan-devices-title {
  color: var(--steel);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  padding: 18px 20px 14px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, #171615 0%, #121110 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.plan-room-list {
  display: grid;
  gap: 0;
  padding: 10px 20px 18px;
}

.plan-room {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  break-inside: avoid;
}

.plan-room:last-child {
  border-bottom: none;
}

.plan-room-name {
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  line-height: 1.1;
}

.plan-room-devices {
  margin: 0;
  padding-left: 16px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  font-size: 12px;
  line-height: 1.25;
}

.plan-room-devices li {
  margin: 0;
}

.close,
.nav-btn {
  position: fixed;
  background: #22201f;
  color: var(--text);
  border: 1px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.18);
  z-index: 1001;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.close:hover,
.nav-btn:hover {
  border-color: rgba(217, 178, 76, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 20px rgba(0, 0, 0, 0.22);
}

.close {
  top: 16px;
  right: 16px;
  padding: 10px 14px;
  font-size: 14px;
}

.nav-btn {
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  padding: 10px 14px;
  line-height: 1;
}

.nav-btn.right {
  right: 16px;
}

.nav-btn:not(.right) {
  left: 16px;
}

.thumb:focus-visible,
.close:focus-visible,
.nav-btn:focus-visible,
.nav a:focus-visible,
.sidebar-logo:focus-visible,
.footer-inner a:focus-visible,
.mini .inline-link:focus-visible,
.camera-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 10px;
  background: #191817;
}

.footer-inner {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-logo-link {
  display: none;
  text-decoration: none;
}

.footer-logo {
  width: 78px;
  height: auto;
  display: block;
}

.footer-inner a {
  color: var(--steel);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.18s ease;
}

@media (max-width: 1100px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-logo {
    display: none;
  }

  .footer-logo-link {
    display: inline-flex;
    justify-content: center;
  }

  .thumb-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #platforms .grid2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .lightbox {
    align-items: flex-start;
    padding: 78px 10px 10px;
  }

  .light-inner {
    width: 100%;
    max-height: calc(100vh - 102px);
    margin-top: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    border-radius: 18px;
  }

  .light-inner img {
    width: 100%;
    height: auto;
    max-height: 42vh;
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .plan-devices-title {
    padding: 16px 16px 12px;
    font-size: 17px;
  }

  .plan-devices {
    border-left: none;
    border-top: 1px solid rgba(136, 168, 202, 0.18);
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: max(44px, env(safe-area-inset-bottom));
  }

  .plan-room-list {
    padding: 8px 16px calc(44px + env(safe-area-inset-bottom));
  }


  .plan-room-list--two-col {
    grid-template-columns: 1fr;
  }

  .close,
  .nav-btn {
    top: 12px;
    bottom: auto;
    transform: none;
    font-size: 13px;
    z-index: 1002;
  }

  .close {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 10px 16px;
  }

  .nav-btn {
    padding: 10px 14px;
    font-size: 22px;
    line-height: 1;
  }

  .nav-btn:not(.right) {
    left: 10px;
  }

  .nav-btn.right {
    right: 10px;
  }

  .light-caption {
    bottom: 14px;
    font-size: 13px;
    padding: 9px 14px;
  }
}

@media (max-width: 700px) {
  .thumb-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .thumb {
    min-height: 140px;
  }

  .thumb span {
    padding: 8px 14px;
    margin: 0 0 12px;
    font-size: 16px;
  }

  #platforms .grid2,
  #network-security .grid2 {
    grid-template-columns: 1fr;
  }

  #network-security .grid2 .mini {
    grid-column: auto;
  }

  .sidebar {
    padding: 18px 16px;
    align-items: center;
  }

  .sidebar-inner {
    max-width: 100%;
    padding: 22px 18px 18px;
    border-radius: 20px;
  }

  .brand-wrap {
    margin-bottom: 15px;
  }

  .brand-crest {
    max-width: 350px;
  }

  .nav {
    width: 100%;
    max-width: 100%;
    gap: 15px;
  }

  .nav a {
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(180deg, #201e1d, #1b1918);
    border-color: var(--gold);
  }

  .nav a:active {
    transform: scale(0.99);
  }

  .main {
    padding: 12px;
  }

  .card {
    padding: 14px;
  }

  .section-head h2 {
    font-size: 24px;
  }
}

@media (min-width: 901px) {
  .plan-room-list--two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    align-content: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .thumb,
  .sidebar-logo img,
  .nav a,
  .close,
  .nav-btn,
  .footer-inner a {
    transition: none;
  }
}
