@font-face {
  font-family: "Kargo Sans";
  src: url("./assets/fonts/IFKargoSans-ExtraLight.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kargo Sans";
  src: url("./assets/fonts/IFKargoSans-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kargo Sans";
  src: url("./assets/fonts/IFKargoSans-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kargo Sans";
  src: url("./assets/fonts/IFKargoSans-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #000000;
  --fg-muted: #555555;
  --fg-subtle: #999999;
  --accent: #9a7a3c;
  --accent-hover: #6b5527;
  --accent-fg: #fbfafd;
  --dark-bg: #313236;
  --dark-fg: #eeedf5;
  --dark-line: rgba(238, 237, 245, 0.25);
  font-family: "Kargo Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#experience {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #313236;
  color: var(--fg);
}

#experience::after {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.16) 100%);
}

button,
input {
  font: inherit;
}

button,
.site-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--fg);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.language-button {
  width: 54px;
  min-width: 54px;
  padding-inline: 0;
}

button:hover,
.site-button:hover {
  background: var(--fg);
  color: var(--bg);
}

button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
}

button:active,
.site-button:active {
  transform: scale(0.98);
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: var(--fg);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.loading-overlay[hidden] {
  display: none !important;
}

.loading-overlay > div,
.title-panel,
.status-panel,
.control-dock {
  border: 1px solid var(--fg);
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  box-shadow: none;
  backdrop-filter: none;
}

.loading-overlay > div {
  width: min(420px, calc(100vw - 36px));
  padding: 24px;
}

.loading-overlay strong,
.title-panel p,
.status-panel > p,
.control-dock label span,
.meters label {
  margin: 0;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.loading-overlay p {
  margin: 12px 0;
  color: var(--fg);
}

.loading-overlay span {
  display: block;
  height: 2px;
  overflow: hidden;
  border: 1px solid var(--fg);
}

.loading-overlay i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0.08);
  transform-origin: left;
  background: var(--accent);
}

#errorText {
  display: block;
  margin-top: 10px;
  color: var(--fg-muted);
}

.title-panel,
.status-panel,
.control-dock {
  position: fixed;
  z-index: 5;
}

.title-panel {
  top: clamp(16px, 3vw, 32px);
  left: clamp(16px, 3vw, 34px);
  width: min(430px, calc(100vw - 32px));
  padding: 24px;
  pointer-events: none;
}

.title-panel h1 {
  margin: 10px 0 12px;
  font-size: clamp(1.8rem, 3.2vw, 3.45rem);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: 0;
}

.title-panel span,
.status-panel span {
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

.status-panel {
  right: clamp(16px, 3vw, 34px);
  top: clamp(16px, 3vw, 32px);
  width: min(360px, calc(100vw - 32px));
  padding: 20px;
}

.status-panel h2 {
  margin: 10px 0;
  font-size: 1.22rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
}

.meters {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.meters label {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: center;
  gap: 12px;
  color: var(--fg);
  letter-spacing: 0.08em;
}

.meters i {
  display: block;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--fg);
  border-radius: 0;
  background: var(--bg);
}

.meters b {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--accent);
}

.step-strip {
  position: fixed;
  left: 50%;
  bottom: 104px;
  z-index: 6;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.step-strip button {
  width: 44px;
  padding: 0;
}

.control-dock {
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(1180px, calc(100vw - 32px));
  padding: 12px;
  transform: translateX(-50%);
}

.timeline-control {
  flex: 1 1 360px;
  min-width: min(420px, 45vw);
  display: grid;
  gap: 6px;
}

.timeline-control span {
  display: flex;
  justify-content: space-between;
}

.control-dock input[type="range"] {
  width: 100%;
  height: 44px;
  margin: 0;
  accent-color: var(--accent);
  background: transparent;
  cursor: pointer;
}

.control-dock input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border: 1px solid var(--fg);
  background: var(--bg);
}

.control-dock input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 1px solid var(--fg);
  border-radius: 6px;
  background: var(--fg);
  appearance: none;
}

.control-dock input[type="range"]::-moz-range-track {
  height: 2px;
  border: 1px solid var(--fg);
  background: var(--bg);
}

.control-dock input[type="range"]::-moz-range-progress {
  height: 2px;
  background: var(--accent);
}

.control-dock input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 1px solid var(--fg);
  border-radius: 6px;
  background: var(--fg);
}

@media (max-width: 860px) {
  .title-panel {
    width: min(370px, calc(100vw - 28px));
    padding: 16px;
  }

  .title-panel span {
    display: none;
  }

  .status-panel {
    display: none;
  }

  .status-panel h2 {
    font-size: 1.05rem;
  }

  .status-panel span {
    display: none;
  }

  .meters {
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-top: 12px;
  }

  .meters label {
    grid-template-columns: 78px 1fr;
    font-size: 10px;
  }

  .control-dock {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    transform: none;
    flex-wrap: nowrap;
    justify-content: stretch;
  }

  .control-dock button,
  .control-dock .site-button {
    min-height: 30px;
    min-width: 0;
    padding: 0 6px;
    flex: 0 1 auto;
    font-size: 9px;
    line-height: 1;
    white-space: nowrap;
  }

  .timeline-control {
    min-width: 46px;
    flex: 1 1 60px;
    gap: 0;
  }

  .timeline-control span {
    display: none;
  }

  .control-dock input[type="range"] {
    height: 30px;
  }

  .control-dock input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-radius: 4px;
  }

  .control-dock input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 4px;
  }

  .language-button {
    width: 30px;
    min-width: 30px;
    padding-inline: 0;
  }

  .step-strip {
    bottom: 118px;
  }

}
