:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #111312;
  color: #f4f1ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(76, 145, 173, 0.2), transparent 28%),
    linear-gradient(135deg, #151917 0%, #222725 54%, #141514 100%);
}

.app-shell.realistic-mode {
  grid-template-columns: 1fr;
}

.app-shell.realistic-mode .lesson {
  display: none;
}

.viewer {
  position: relative;
  min-width: 0;
  min-height: 100vh;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  opacity: 1;
}

.topbar {
  position: absolute;
  inset: 24px 24px auto 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: #8fd0bf;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 76px);
  line-height: 0.95;
}

.realistic-mode h1 {
  font-size: clamp(28px, 3.4vw, 48px);
}

h2 {
  font-size: 25px;
  line-height: 1.15;
}

.status {
  min-width: 142px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(17, 19, 18, 0.72);
  padding: 10px 12px;
  border-radius: 8px;
  color: #d9efe9;
  font-size: 13px;
  text-align: center;
}

.view-tabs {
  position: absolute;
  top: 126px;
  left: 24px;
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(17, 19, 18, 0.74);
  backdrop-filter: blur(16px);
}

.realistic-mode .view-tabs {
  top: 104px;
}

.view-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d8d4cb;
  padding: 0 12px;
  cursor: pointer;
}

.view-tabs button.active {
  background: #f0b35d;
  color: #171512;
}

.toolbar {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.toolbar.is-active {
  opacity: 1;
  pointer-events: auto;
}

.toolbar button,
.toolbar label {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(244, 241, 234, 0.1);
  color: #f4f1ea;
  padding: 0 14px;
  backdrop-filter: blur(16px);
}

.toolbar button {
  cursor: pointer;
}

.toolbar button:hover,
.part-button:hover {
  border-color: #8fd0bf;
}

.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.toolbar input {
  width: 150px;
  accent-color: #f0b35d;
}

.lesson {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
  padding: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 18, 17, 0.9);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.24);
}

.lesson p {
  margin: 0;
  color: #d8d4cb;
  line-height: 1.55;
}

.facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

dt {
  color: #99958d;
  font-size: 13px;
}

dd {
  margin: 0;
  color: #f4f1ea;
}

.parts {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.parts.is-hidden {
  display: none;
}

.part-button {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #1f2321;
  color: #f4f1ea;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.part-button.active {
  border-color: #f0b35d;
  background: #2a2a23;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .viewer {
    min-height: 68vh;
  }

  .lesson {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .topbar {
    inset: 16px 16px auto 16px;
  }

  .toolbar {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .view-tabs {
    top: 112px;
    left: 16px;
  }

}
