@font-face {
  font-family: "Charter-Roman";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/Charter-Roman/font.ttf") format("truetype");
}

:root {
  --bg: #000;
  --text: #fff;
  --muted: #bdbdbd;
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(0, 0, 0, 0.84);
  --panel-strong: rgba(10, 10, 10, 0.94);
  --button: #ccc;
  --button-text: #3f3c03;
  --size-large: 1.6rem;
  --size-base: 1.1rem;
  --lh-large: 1.15;
  --lh-base: 1.42;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #000;
  color: var(--text);
  font-family: "Charter-Roman", Georgia, serif;
}

body {
  min-width: 320px;
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

.guide-page {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 6%, rgba(210, 180, 120, 0.08), transparent 22%),
    radial-gradient(circle at 84% 10%, rgba(155, 155, 155, 0.06), transparent 18%),
    #000;
}

.guide-topbar,
.guide-dock {
  position: relative;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.guide-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  white-space: nowrap;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem 0.75rem;
  background: linear-gradient(180deg, var(--panel-strong), rgba(0, 0, 0, 0.55));
  border-bottom: 1px solid var(--line);
}

.guide-back,
.guide-archive {
  color: var(--muted);
  font-size: var(--size-base);
  line-height: var(--lh-base);
}

.guide-back:hover,
.guide-archive:hover {
  color: #fff;
}

.guide-title {
  margin: 0;
  flex: 0 1 auto;
  text-transform: uppercase;
  font-size: var(--size-base);
  line-height: var(--lh-base);
  text-align: center;
}

.guide-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0.75rem 1rem;
  overflow: hidden;
}

.guide-media {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-media img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 13rem);
  max-height: calc(100dvh - 13rem);
  object-fit: contain;
}

.guide-dock {
  padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--panel-strong), rgba(0, 0, 0, 0.72));
  border-top: 1px solid var(--line);
}

.guide-row {
  display: grid;
  gap: 0.75rem 1rem;
}

.guide-row-top {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.guide-row-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.9rem;
}

.guide-field {
  min-width: 0;
}

.guide-field span,
.guide-field p {
  display: block;
  margin: 0 0 0.35rem;
  font-size: var(--size-base);
  line-height: var(--lh-base);
}

.guide-field span {
  color: #fff;
  text-transform: uppercase;
}

.guide-field p {
  color: var(--muted);
}

.guide-field-specimen {
  justify-self: end;
}

.guide-field-specimen p {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.guide-field-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  justify-self: start;
  white-space: nowrap;
}

.guide-field-meta span,
.guide-field-meta p {
  margin: 0;
}

.guide-field-meta p {
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
}

.guide-language-switcher {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.guide-language-switcher button,
.guide-button {
  border-radius: 0;
  cursor: pointer;
}

.guide-language-switcher button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.65rem;
  line-height: var(--lh-base);
}

.guide-language-switcher button[aria-pressed="true"],
.guide-language-switcher button:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.guide-button {
  min-height: 2.9rem;
  border: 0;
  padding: 0.55rem 0.9rem;
  font-size: var(--size-base);
  line-height: var(--lh-base);
}

.guide-button-primary {
  background: var(--button);
  color: var(--button-text);
}

.guide-button-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.guide-button:hover {
  filter: brightness(1.08);
}

@media (max-width: 900px) {
  .guide-field-specimen {
    justify-self: end;
  }

  .guide-field-meta {
    justify-content: flex-start;
    justify-self: start;
  }

  .guide-media img {
    max-height: calc(100vh - 15.5rem);
    max-height: calc(100dvh - 15.5rem);
  }
}

@media (max-width: 640px) {
  .guide-archive {
    display: none;
  }

  .guide-field-meta {
    justify-content: flex-start;
    gap: 0.35rem 0.6rem;
  }

  .guide-button {
    min-height: 2.75rem;
  }

  .guide-media img {
    max-height: calc(100vh - 18.5rem);
    max-height: calc(100dvh - 18.5rem);
  }
}
