:root {
  --theme-accent: #477263;
  --theme-ink: #183029;
  --theme-paper: #f6f4eb;
  --theme-rail: #f7f6ed;
  --theme-serif: "Libre Caslon Text", Georgia, serif;
  --theme-sans: Karla, Arial, sans-serif;
  --paper: var(--theme-paper);
  --sheet: #fffef8;
  --ink: var(--theme-ink);
  --rail-text: var(--theme-rail);
  --muted: #52645d;
  --line: #cbd4ca;
  --accent-pale: #dce8df;
  --serif: var(--theme-serif);
  --sans: var(--theme-sans);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input,
select,
textarea {
  min-width: 0;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.05;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 3px;
}

.wrap {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 24px;
}

.kicker,
.field label,
.route-time,
.rail-live,
.fig span,
.who,
.railhead span {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.kicker {
  margin: 0 0 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--sheet);
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.field {
  display: grid;
  gap: 6px;
}

.grid2,
.grid3 {
  display: grid;
  gap: 14px;
}

.grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--rail-text);
  padding: 9px 14px;
  font-weight: 700;
  text-decoration: none;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn.small {
  min-height: 36px;
  padding: 6px 10px;
  font-size: .86rem;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ink);
  color: var(--rail-text);
}

.gate form {
  width: min(100%, 430px);
  border: 1px solid color-mix(in srgb, var(--rail-text) 30%, transparent);
  padding: clamp(26px, 6vw, 52px);
}

.gate .kicker,
.gate .field label {
  color: var(--rail-text);
}

.gate p {
  color: color-mix(in srgb, var(--rail-text) 84%, transparent);
}

.gate input {
  border-color: color-mix(in srgb, var(--rail-text) 60%, transparent);
  background: transparent;
  color: var(--rail-text);
}

.gate .btn {
  margin-top: 8px;
  background: var(--rail-text);
  color: var(--ink);
}

.gate-names {
  margin: 8px 0 20px;
  color: var(--rail-text) !important;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 9vw, 4rem);
  line-height: 1;
}

.err {
  min-height: 1.5em;
  color: #ffd1c4 !important;
}

.album-layout {
  display: grid;
  grid-template-columns: minmax(270px, 30vw) minmax(0, 1fr);
  min-height: 100vh;
}

.album-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  overflow-y: auto;
  background: var(--ink);
  color: var(--rail-text);
  padding: clamp(24px, 4vw, 58px) clamp(20px, 3.5vw, 46px);
}

.rail-intro .kicker,
.album-rail .route-time,
.rail-live {
  color: color-mix(in srgb, var(--rail-text) 72%, var(--theme-accent));
}

.rail-names {
  font-size: clamp(2.5rem, 4.2vw, 4.4rem);
}

.rail-names span {
  display: block;
}

.rail-names .amp {
  color: var(--theme-accent);
  font-size: .45em;
  font-style: italic;
  line-height: .65;
}

.rail-meta {
  margin: 18px 0 0;
  color: color-mix(in srgb, var(--rail-text) 82%, transparent);
}

.rail-status {
  margin: 16px 0 0;
  color: var(--rail-text);
  font-family: var(--serif);
  font-size: 1.18rem;
  font-style: italic;
}

.route {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid color-mix(in srgb, var(--rail-text) 25%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--rail-text) 25%, transparent);
  list-style: none;
}

.route li {
  position: relative;
  min-width: 0;
  padding: 0 0 9px 28px;
}

.route li:last-child {
  padding-bottom: 0;
}

.route li::before {
  position: absolute;
  top: .34rem;
  left: 3px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--rail-text);
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.route li:not(:last-child)::after {
  position: absolute;
  top: 17px;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: color-mix(in srgb, var(--rail-text) 26%, transparent);
  content: "";
}

.route li.now::before {
  border-color: var(--theme-accent);
  background: var(--rail-text);
  box-shadow: 0 0 0 4px var(--theme-accent);
}

.route a {
  display: grid;
  grid-template-columns: 3.6em 1fr;
  gap: 10px;
  align-items: baseline;
  color: inherit;
  text-decoration: none;
}

.route-label {
  display: block;
}

.route li.now .route-label::after {
  margin-left: 7px;
  color: var(--theme-accent);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  content: "now";
}

.rail-upload,
.rail-guestbook {
  display: block;
  width: max-content;
  max-width: 100%;
  border-bottom: 1px solid currentColor;
  color: var(--rail-text);
  font-weight: 700;
  text-decoration: none;
}

.rail-guestbook {
  color: var(--theme-accent);
}

.rail-live {
  margin: auto 0 0;
  min-height: 1.5em;
}

.rail-live:not(:empty)::before {
  margin-right: 7px;
  color: var(--theme-accent);
  content: "●";
}

.album-content {
  min-width: 0;
}

.album-hero,
.album-section,
footer {
  padding: clamp(32px, 7vw, 82px);
}

.album-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  align-items: end;
  gap: clamp(24px, 5vw, 70px);
  min-height: min(100vh, 760px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  opacity: .16;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.55);
}

.hero-bg::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--paper) 4%, transparent 80%), linear-gradient(0deg, var(--paper), transparent 58%);
  content: "";
}

.hero-copy,
.guest-preview {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  max-width: 8ch;
  font-size: clamp(3rem, 6.5vw, 6.4rem);
}

.intro {
  max-width: 46ch;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.42rem);
}

.guest-preview {
  align-self: end;
  border-top: 3px solid var(--theme-accent);
  padding-top: 18px;
}

.guest-preview .sec-head {
  margin-bottom: 16px;
}

.guest-preview .sec-head h2 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
}

.guest-preview .sec-head a {
  color: var(--theme-accent);
  font-size: .85rem;
}

.album-section {
  border-bottom: 1px solid var(--line);
}

.sec-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.sec-head h2 {
  font-size: clamp(2rem, 4.2vw, 3.6rem);
}

.sec-head > p {
  max-width: 36ch;
  margin: 0;
  color: var(--muted);
}

.toolbar,
.chips,
.acts,
.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toolbar {
  margin-bottom: 16px;
}

.search {
  width: min(100%, 250px);
}

.seg {
  display: flex;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.seg button,
.chip {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
}

.seg button[aria-pressed="true"],
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--rail-text);
}

.chip {
  border: 1px solid var(--line);
}

.chip .n {
  margin-left: 5px;
  opacity: .7;
}

.chips {
  margin-bottom: 28px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 22px;
}

.moment-spread,
.railhead,
.empty {
  grid-column: 1 / -1;
}

.moment-spread {
  display: grid;
  gap: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.moment-spread:first-child {
  padding-top: 0;
  border-top: 0;
}

.moment-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.moment-heading h3,
.railhead b {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.moment-heading p,
.railhead span {
  margin: 0;
  color: var(--muted);
}

.moment-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tile {
  position: relative;
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--sheet);
  cursor: zoom-in;
}

.tile .shot {
  position: relative;
  background-position: center;
  background-size: cover;
}

.tile .shot img {
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: cover;
}

.tile .shot img.in {
  opacity: 1;
}

.tile figcaption {
  min-height: 54px;
  padding: 11px 12px;
}

.tile .who {
  display: block;
  margin-top: 4px;
}

.badge,
.dur,
.tile .heart,
.tools button {
  position: absolute;
  z-index: 2;
  border: 0;
  background: rgba(24, 48, 41, .9);
  color: #fff;
  font-size: .74rem;
}

.badge {
  top: 10px;
  left: 10px;
  padding: 4px 7px;
}

.dur {
  right: 10px;
  bottom: 10px;
  padding: 3px 6px;
}

.tile .heart {
  bottom: 10px;
  left: 10px;
  padding: 5px 8px;
}

.tile .heart[data-on="1"] {
  background: var(--theme-accent);
}

.tile .tools {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.tools button {
  position: static;
  width: 30px;
  height: 30px;
}

.tile.processing .shot::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  content: "developing…";
}

.railhead {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 10px;
}

.railhead i {
  flex: 1;
  min-width: 18px;
  height: 1px;
  background: var(--line);
}

.empty {
  margin: 0;
  border: 1px dashed var(--line);
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.moment-empty {
  margin: 0;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  padding: 15px 0 2px;
  font-family: var(--serif);
  font-style: italic;
}

.panel {
  border: 1px solid var(--line);
  background: var(--sheet);
  padding: clamp(18px, 3vw, 34px);
}

.upload-section .panel {
  border-top: 3px solid var(--ink);
}

.drop {
  margin-bottom: 16px;
  border: 2px dashed var(--theme-accent);
  padding: 32px 20px;
  background: color-mix(in srgb, var(--theme-accent) 8%, var(--sheet));
  text-align: center;
}

.drop strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
}

.drop label {
  color: var(--theme-accent);
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
}

.queue {
  display: grid;
  gap: 9px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.queue li {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(60px, 3fr) auto;
  align-items: center;
  gap: 12px;
}

.queue .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue .bar {
  height: 4px;
  overflow: hidden;
  background: var(--line);
}

.queue .bar i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--theme-accent);
}

.queue .pct {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.guestbook-section {
  background: var(--accent-pale);
}

.guestbook-section .panel {
  border-top: 3px solid var(--theme-accent);
}

.action-field {
  align-self: end;
}

.guestbook-section .btn {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
}

.note-field {
  margin-top: 14px;
}

.notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.note {
  position: relative;
  border-left: 1px solid var(--theme-accent);
  background: var(--sheet);
  padding: 16px;
}

.note p {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.note .who {
  color: var(--theme-accent);
}

.note .del {
  position: absolute;
  top: 7px;
  right: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.fig {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.fig b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 400;
}

.fig span {
  color: var(--muted);
}

footer {
  background: var(--ink);
  color: var(--rail-text);
  text-align: center;
}

footer .own {
  max-width: 58ch;
  margin: 0 auto 24px;
  color: color-mix(in srgb, var(--rail-text) 80%, transparent);
}

.links {
  justify-content: center;
}

.links a {
  color: var(--rail-text);
}

.qr {
  display: grid;
  place-items: center;
  gap: 10px;
  margin-top: 26px;
}

.qr svg,
.qr img {
  width: 132px;
  height: 132px;
  background: #fff;
  padding: 8px;
}

.newpill,
.toast {
  position: fixed;
  z-index: 100;
  border: 0;
  background: var(--ink);
  color: var(--rail-text);
}

.newpill {
  top: 18px;
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  transform: translateX(-50%);
}

.toast {
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

.admin {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(430px, 100%);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--sheet);
  padding: 28px;
  transform: translateX(100%);
}

.admin.open {
  transform: none;
}

.admin .field {
  margin-top: 14px;
}

.close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  background: none;
  font-size: 1.4rem;
}

.theme-settings {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  border: 1px solid var(--line);
  padding: 16px;
}

.theme-settings legend {
  padding: 0 5px;
  font-family: var(--serif);
}

.admin-actions {
  margin-top: 18px;
}

dialog {
  border: 0;
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(9, 18, 15, .94);
}

.light,
.cinema {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  background: transparent;
}

.light-grid {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
}

.stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 22px;
}

.stage img,
.stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.stage .arrow,
.stage .x,
.cinema .quit {
  position: absolute;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, .5);
  background: rgba(24, 48, 41, .76);
  color: #fff;
}

.stage .arrow {
  top: 50%;
  width: 42px;
  height: 42px;
}

.stage .arrow.l {
  left: 16px;
}

.stage .arrow.r {
  right: 16px;
}

.stage .x {
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
}

.sheet {
  max-height: 46vh;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.sheet .wrap {
  padding-top: 18px;
  padding-bottom: 22px;
}

.sheet h3 {
  font-size: 1.35rem;
}

.sheet .sub,
.cmt time {
  color: var(--muted);
}

.cmt {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.cmt time {
  margin-left: 8px;
  font-size: .8rem;
}

.cmt-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.cinema {
  background: #0b100e;
}

.cinema img,
.cinema video,
.cinema .frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cinema .frame {
  opacity: 0;
}

.cinema .frame.on {
  opacity: 1;
}

.cinema .cap {
  position: absolute;
  right: 0;
  bottom: 34px;
  left: 0;
  margin: 0;
  padding: 0 10vw;
  color: var(--rail-text);
  font-family: var(--serif);
  font-size: 1.35rem;
  text-align: center;
}

.cinema .cap span {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: .8rem;
}

.cinema .quit {
  top: 18px;
  right: 18px;
  padding: 8px 13px;
}

@media (max-width: 900px) {
  .album-layout {
    grid-template-columns: 1fr;
  }

  .album-rail {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .route {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .route li,
  .route li:last-child {
    padding: 0 0 12px 26px;
  }

  .route li::after {
    display: none;
  }

  .rail-live {
    margin-top: 0;
  }

  .album-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .guest-preview {
    max-width: 680px;
  }
}

@media (max-width: 600px) {
  .album-hero,
  .album-section,
  footer {
    padding: 32px 20px;
  }

  .route,
  .grid2,
  .grid3,
  .notes,
  .moment-photos {
    grid-template-columns: 1fr;
  }

  .sec-head,
  .moment-heading {
    align-items: start;
    flex-direction: column;
  }

  .toolbar {
    align-items: stretch;
  }

  .search,
  .toolbar > .btn {
    width: 100%;
  }

  .seg {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .seg button {
    padding-inline: 6px;
  }

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

  .figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .queue .bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .sheet {
    max-height: 54vh;
  }

  .cmt-form {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .album-content {
    animation: album-fade .35s ease-out both;
  }

  .btn:hover,
  .tile:hover {
    transform: translateY(-2px);
  }

  @keyframes album-fade {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }
}

@media print {
  .album-rail,
  .toolbar,
  .chips,
  .upload-section,
  footer,
  .newpill,
  .admin,
  .queue {
    display: none !important;
  }

  .album-layout {
    display: block;
  }
}

::selection {
  background: var(--theme-accent);
  color: var(--theme-paper);
}

html {
  caret-color: var(--theme-accent);
  accent-color: var(--theme-accent);
}

a[href="#guestbook"] {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .route {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    padding: 10px 0;
  }

  .route li {
    padding-bottom: 6px;
  }

  .route li:not(:last-child)::after {
    display: none;
  }

  .rail-names {
    font-size: 2.4rem;
  }
}
