/* Parcel explorer: a full-height 3D scene with a side panel (a bottom sheet on phones).
   Colours and type come from the site's design system (../assets/css/style.css). */

body.explorer {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bar {
  display: flex;
  align-items: baseline;
  gap: 0.6rem 1.25rem;
  flex-wrap: wrap;
  padding: 0.7rem var(--gutter);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--paper);
  position: relative;
  z-index: 2;
}

.bar .site-name {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.bar .site-name span { color: var(--gold); font-style: italic; }

.bar-title {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.6;
}

.bar nav { margin-left: auto; display: flex; gap: 1.1rem; }

.bar nav a {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.75;
}

.bar nav a:hover { color: var(--gold); opacity: 1; }

.stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24rem;
}

.scene { position: relative; min-height: 0; background: var(--paper-mid); touch-action: none; }
.scene canvas { display: block; width: 100%; height: 100%; outline: none; }

.scene-note {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  margin: 0;
  max-width: 28rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 0.6rem 0.8rem;
}

.panel {
  overflow-y: auto;
  border-left: 1px solid var(--rule-strong);
  background: var(--paper);
  padding: 1.4rem 1.5rem 1rem;
  font-size: 0.86rem;
  line-height: 1.6;
}

.panel h1 {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.05;
  margin: 0.15rem 0 0.8rem;
}

.panel p { margin: 0 0 0.8rem; }

.label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 1.1rem 0 0.4rem;
  display: block;
}

#intro > .label:first-child, #lot > .label:first-of-type { margin-top: 0; }

.panel select {
  width: 100%;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink);
  background: var(--paper-mid);
  border: 1px solid var(--rule-strong);
  padding: 0.45rem 0.5rem;
  color-scheme: light dark;
}

.legend { list-style: none; padding: 0; margin: 1rem 0 0; font-family: var(--mono); font-size: 0.68rem; }
.legend li { display: flex; align-items: center; gap: 0.55rem; margin: 0.3rem 0; }
.swatch { width: 1.1rem; height: 0.75rem; display: inline-block; border: 1px solid var(--rule-strong); }
.swatch.corner { background: var(--gold-warm); }
.swatch.lot { background: var(--paper-dark); }
.swatch.line { border: 0; border-top: 3px solid var(--gold); height: 0; }
.swatch.g3 { background: #8fae8b; }

.back {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
  cursor: pointer;
  opacity: 0.7;
}

.back:hover { color: var(--gold); opacity: 1; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.9rem; margin: 0 0 0.9rem; }
.facts dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.65; padding-top: 0.15rem; }
.facts dd { margin: 0; }

.photo { margin: 0 0 0.6rem; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-dark); border: 1px solid var(--rule); }
.photo figcaption { font-family: var(--mono); font-size: 0.62rem; margin-top: 0.35rem; opacity: 0.75; }
.photo.none img { display: none; }

.panel a { color: var(--gold); }
.links { font-family: var(--mono); font-size: 0.72rem; }

.kits { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }

.kits button {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-mid);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.kits button:hover { border-color: var(--gold); }
.kits button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--paper); }
.kits button.before { grid-column: 1 / -1; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; }
.kits button:focus-visible, .back:focus-visible, .panel select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.no-building { font-style: italic; opacity: 0.8; }

.rule { border-top: 1px solid var(--rule-strong); margin-top: 1.1rem; padding-top: 0.2rem; }
.rule-use { font-family: var(--display); font-size: 1.25rem; font-weight: 600; margin-bottom: 0.4rem; }
.rule blockquote { margin: 0 0 0.7rem; padding-left: 0.8rem; border-left: 2px solid var(--gold-warm); font-style: italic; font-size: 0.8rem; }
.rule-table { width: 100%; border-collapse: collapse; margin: 0 0 0.7rem; }
.rule-table th, .rule-table td { text-align: left; padding: 0.35rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.rule-table th { font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.04em; width: 45%; }
.rule-table th span { opacity: 0.6; }
.rule-table td { font-family: var(--mono); font-size: 0.74rem; }
.rule-table td.no { color: #b2402a; }
.rule-table td.yes { color: #4f7a4a; }

.fine { font-size: 0.7rem; opacity: 0.75; line-height: 1.5; }
.credits { border-top: 1px solid var(--rule); margin-top: 1.4rem; padding-top: 0.8rem; font-size: 0.7rem; opacity: 0.8; line-height: 1.5; }

@media (prefers-color-scheme: dark) {
  .rule-table td.no { color: #e0846c; }
  .rule-table td.yes { color: #9cc394; }
}

/* Phones: the scene on top, the panel as a sheet below it. */
@media (max-width: 820px) {
  .bar nav { display: none; }
  .stage { grid-template-columns: 1fr; grid-template-rows: minmax(0, 52%) minmax(0, 48%); }
  .panel { border-left: 0; border-top: 1px solid var(--rule-strong); padding: 1rem 1.1rem; }
  .panel h1 { font-size: 1.6rem; }
}

/* The case studies, first in the intro panel. */
.case-links ul { list-style: none; padding: 0; margin: 0.35rem 0 0.25rem; display: grid; gap: 0.3rem; }
.case-links a { font-family: var(--display, inherit); font-size: 1.02rem; text-decoration: none; border-bottom: 1px solid currentColor; }
.case-links a::after { content: ' →'; }
