/* --------------------------------------------------
   HEADER LAYOUT
-------------------------------------------------- */
/* stylelint-disable declaration-block-no-redundant-longhand-properties, declaration-block-no-shorthand-property-overrides */

:root[data-theme="light"] {
  --back: #c9d7bb;
  --panel: #f7f0dc;
  --panel-glass: rgb(250 246 226 / 78%);
  --button: rgb(239 232 207 / 92%);
  --text: #17251b;
  --line: #52654c;
  --highlight1: #2d8f83;
  --highlight2: #e7ad42;
  --logo-shadow: 0 0.4cqh 0.8cqh rgb(31 50 35 / 28%);
}

:root[data-theme="dark"] {
  --back: #18232a;
  --panel: #27343a;
  --panel-glass: rgb(17 28 36 / 76%);
  --button: rgb(51 68 72 / 94%);
  --text: #f4eedc;
  --line: #879e98;
  --highlight1: #66c8b5;
  --highlight2: #e0b45e;
  --logo-shadow: 0 0.4cqh 1cqh rgb(0 0 0 / 55%);
}

html {
  background: var(--back);
}

body {
  isolation: isolate;
  background: transparent;
}

#b-camera {
  background: transparent;
}

body::before,
body::after {
  position: fixed;
  z-index: -2;
  inset: 0;
  content: "";
  background-position: center;
  background-size: cover;
}

.theme-transition-ready body::before,
.theme-transition-ready body::after {
  transition: opacity 1000ms ease-in-out;
}

body::before {
  background-image:
    linear-gradient(rgb(249 244 222 / 10%), rgb(249 244 222 / 10%)),
    url("/assets/pond-day-master.png");
  opacity: 1;
}

body::after {
  z-index: -1;
  background-image:
    linear-gradient(rgb(5 13 22 / 8%), rgb(5 13 22 / 8%)),
    url("/assets/pond-night-master.png");
  opacity: 0;
}

:root[data-theme="dark"] body::before {
  opacity: 0;
}

:root[data-theme="dark"] body::after {
  opacity: 1;
}

.logo,
.theme-toggle,
.app-footer {
  color: var(--text);
  text-shadow: 0 0.15cqh 0.5cqh var(--panel), 0 0 1cqh var(--panel);
}

#b-top-bar {
  display: grid;
  grid-template-columns: 10% 80% 10%;
  grid-template-areas: "hleft hlogo hright";
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.PORTRAIT #b-top-bar {
  grid-template-columns: 20% 60% 20%;
}

.logo {
  grid-area: hlogo;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 3.2em;
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow:
    0 0.25cqh 0 var(--panel),
    0 0.5cqh 0 var(--line),
    0 1cqh 1.8cqh rgb(0 0 0 / 30%);
}

.logo-box {
  height: 100%;
  width: 100%;             /* <-- key change */
  max-width: 100%;         /* safety */
  container-type: size;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.logo-group {
  display: flex;
}

.logo-tile {
  margin: 1.5cqh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  background: var(--button);
  color: var(--text);
  box-shadow: var(--logo-shadow);
}

.LANDSCAPE .logo-tile {
  width: 60cqh;
  height: 60cqh;
  font-size: 55cqh;
  border-radius: 5cqh;
  border: 6cqh solid var(--line);
}

.PORTRAIT .logo-tile {
  width: 10vw;
  height: 10vw;
  font-size: 35cqh;
  border-radius: 4cqh;
  border: 5cqh solid var(--line);
}

.PORTRAIT .theme-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.CAM-LANDSCAPE-B #ninr-theme-toggle {
  font-size: 2.8cqh;
}

.logo-tile.avail {
  border-color: var(--highlight1);
}

/* --------------------------------------------------
   THEME TOGGLER (right aligned)
-------------------------------------------------- */
.header-left {
  grid-area: hleft;
}

.header-right {
  grid-area: hright;
  display: grid;
  place-items: center;
}

.theme-toggle {
  display: block;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: max-content;
  background: none;
  border: none;
}

/* grouped theme options */
.theme-option {
  display: flex;
  align-items: center;
  gap: 0.5vh;
}

.theme-icon {
  width: 2.5vh;
  height: 2.5vh;
}

.theme-text {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}

/* colors */
.theme-light-option .theme-icon,
.theme-light-option .theme-text {
  color: rgb(106 108 9);
}

.theme-dark-option .theme-icon,
.theme-dark-option .theme-text {
  color: rgb(110 105 138);
}

/* theme switching */
[data-theme="light"] .theme-dark-option {
  display: none;
}

[data-theme="dark"] .theme-light-option {
  display: none;
}

/* --------------------------------------------------
   FOOTER
-------------------------------------------------- */

.app-footer {
  text-align: center;
}
