/* RailroaderHub's shared look for every page after the home page: the night-sky palette, type,
   buttons, forms, the nav and the footer. Pages add their own sheet on top. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2-variations"), url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff2") format("woff2-variations"), url("/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #140c2e;
  --night-2: #1d1342;
  --night-3: #2a1d58;
  --ink: #0d0822;
  --panel: rgba(29, 19, 66, 0.72);
  --moon: #f6f1ff;
  --haze: #b4a9d3;
  --dim: #8f84b5;
  --pink: #f0287f;
  --pink-press: #d3176c;
  --pink-hover: #c0105f;
  --amber: #ffc35c;
  --green: #4fe3a1;
  --cyan: #45d4f0;
  --red: #ff6b82;
  --line: rgba(196, 176, 255, 0.13);
  --line-strong: rgba(196, 176, 255, 0.26);
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(18px, 4.5vw, 56px);
  --content: 1200px;
  --nav-h: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--moon);
  font: 400 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--amber);
  color: #241300;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(var(--content), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------ buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--pink-press);
  color: var(--moon);
  font: 700 15.5px/1 var(--text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover {
  background: var(--pink-hover);
}

.button:disabled {
  cursor: default;
  opacity: 0.55;
}

.button-quiet {
  border-color: var(--line-strong);
  background: rgba(246, 241, 255, 0.05);
}

.button-quiet:hover {
  border-color: rgba(246, 241, 255, 0.5);
  background: rgba(246, 241, 255, 0.1);
}

.button-on {
  border-color: rgba(246, 241, 255, 0.4);
  background: rgba(246, 241, 255, 0.12);
}

.button-on:hover {
  border-color: var(--red);
  background: rgba(255, 107, 130, 0.12);
  color: #ffd1d9;
}

.button-small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14.5px;
}

.button-danger {
  background: transparent;
  border-color: rgba(255, 107, 130, 0.5);
  color: #ffc2cc;
}

.button-danger:hover {
  background: rgba(255, 107, 130, 0.14);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(246, 241, 255, 0.05);
  color: var(--moon);
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(246, 241, 255, 0.5);
  background: rgba(246, 241, 255, 0.1);
}

.icon-button svg,
.button svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--haze);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--moon);
}

/* ------------------------------------------------------------ chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--haze);
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.chip-gold {
  border-color: rgba(255, 195, 92, 0.45);
  color: var(--amber);
}

.chip-plus {
  border-color: transparent;
  background: linear-gradient(120deg, rgba(255, 195, 92, 0.22), rgba(240, 40, 127, 0.2));
  color: #ffe0a6;
}

.chip-tester {
  border-color: rgba(79, 227, 161, 0.45);
  color: #8ff0c4;
}

.chip-team {
  border-color: rgba(69, 212, 240, 0.45);
  color: #9be8f7;
}

/* ------------------------------------------------------------ nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  background: rgba(20, 12, 46, 0.84);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(var(--content), 100% - 2 * var(--gutter));
  height: 100%;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 11px;
  font: 750 21px/1 var(--display);
  font-stretch: 88%;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--haze);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--moon);
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* The bell in the nav, with how many notifications are new. */
.bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(246, 241, 255, 0.04);
  color: var(--moon);
}

.bell:hover {
  border-color: rgba(246, 241, 255, 0.45);
}

.bell svg {
  width: 19px;
  height: 19px;
}

.bell-count {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--night);
  border-radius: 999px;
  background: var(--pink-press);
  color: var(--moon);
  font: 800 11px/16px var(--text);
  text-align: center;
}

.me-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 240px;
  padding: 4px 14px 4px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(246, 241, 255, 0.04);
  color: var(--moon);
  font: 650 15px/1 var(--text);
  cursor: pointer;
}

.me-button:hover,
.me-button[aria-expanded="true"] {
  border-color: rgba(246, 241, 255, 0.45);
}

.me-button img {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.me-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu {
  position: absolute;
  top: calc(var(--nav-h) - 6px);
  right: max(var(--gutter), (100% - var(--content)) / 2);
  z-index: 45;
  display: grid;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #1a1140;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}

.menu a,
.menu button {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--moon);
  font: 600 15px/1.2 var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu a:hover,
.menu button:hover,
.menu a:focus-visible,
.menu button:focus-visible {
  background: rgba(246, 241, 255, 0.08);
}

.menu hr {
  width: 100%;
  margin: 6px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Your communities, in the menu. */
.menu {
  min-width: 260px;
  max-width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - var(--nav-h) - 16px);
  overflow-y: auto;
}

.menu-label {
  margin: 0;
  padding: 4px 12px 2px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 650;
}

.menu-place {
  display: grid;
}

.menu .menu-place-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.menu-place-name img,
.menu-place-initials {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  object-fit: cover;
}

.menu-place-initials {
  display: grid;
  place-items: center;
  color: var(--moon);
  font: 800 10px/1 var(--display);
}

.menu-place-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-place-links {
  display: flex;
  gap: 2px;
  padding: 0 0 4px 38px;
}

.menu .menu-place-links a {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  color: var(--haze);
  font-size: 13.5px;
}

.menu-count {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--pink-press);
  color: var(--moon);
  font-size: 11.5px;
  font-weight: 800;
}

/* ------------------------------------------------------------ forms */

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

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 700;
}

.field-count {
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.field-help {
  color: var(--dim);
  font-size: 13.5px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(13, 8, 34, 0.6);
  color: var(--moon);
  font: 400 16px/1.4 var(--text);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--haze) 50%), linear-gradient(135deg, var(--haze) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--amber);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 195, 92, 0.2);
}

.field[data-invalid="true"] .input,
.field[data-invalid="true"] .textarea {
  border-color: var(--red);
}

.field-error {
  color: #ffb3c0;
  font-size: 13.5px;
  font-weight: 600;
}

/* An on/off switch built on a checkbox. */
.toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.toggle b {
  display: block;
  font-size: 15px;
}

.toggle small {
  display: block;
  color: var(--dim);
  font-size: 13.5px;
}

.toggle input {
  appearance: none;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: rgba(196, 176, 255, 0.22);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.toggle input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--moon);
  transition: transform 0.15s ease;
}

.toggle input:checked {
  background: var(--pink-press);
}

.toggle input:checked::after {
  transform: translateX(20px);
}

.toggle input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

/* An input with fixed text in front of it, like railroaderhub.com/c/ before an address. */
.input-prefix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(13, 8, 34, 0.6);
}

.input-prefix:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 195, 92, 0.2);
}

.field[data-invalid="true"] .input-prefix {
  border-color: var(--red);
}

.input-prefix-base {
  display: flex;
  align-items: center;
  padding-left: 14px;
  color: var(--dim);
  white-space: nowrap;
}

.input-prefix .input {
  min-width: 0;
  padding-left: 1px;
  border: 0;
  background: none;
  box-shadow: none;
}

/* ------------------------------------------------------------ dialogs */

.sheet {
  width: min(560px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 0 0 auto;
  padding: 0;
  overflow: hidden;
  overflow: clip;
  border: 0;
  border-left: 1px solid var(--line-strong);
  background: #170f38;
  color: var(--moon);
  box-shadow: -30px 0 80px -20px rgba(0, 0, 0, 0.7);
}

.sheet::backdrop {
  background: rgba(8, 4, 22, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.sheet-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  font-size: 26px;
  font-weight: 750;
  font-stretch: 86%;
}

.sheet-body {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 22px;
  padding: 24px;
  overflow-y: auto;
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: rgba(13, 8, 34, 0.4);
}

.modal {
  width: min(480px, calc(100% - 32px));
  max-height: min(640px, calc(100% - 48px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #170f38;
  color: var(--moon);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.85);
}

.modal::backdrop {
  background: rgba(8, 4, 22, 0.6);
}

/* Reporting something to the RailroaderHub team. */
.report-dialog {
  width: min(500px, calc(100% - 32px));
  max-height: calc(100% - 32px);
}

.report-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 34px);
}

.report-body {
  display: grid;
  gap: 18px;
  padding: 20px 24px;
  overflow-y: auto;
}

.report-intro {
  color: var(--haze);
  font-size: 15px;
}

.report-reasons {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.report-reasons legend {
  margin-bottom: 8px;
  padding: 0;
}

.report-reason {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.report-reason:hover {
  border-color: var(--line-strong);
}

.report-reason:has(input:checked) {
  border-color: rgba(240, 40, 127, 0.7);
  background: rgba(240, 40, 127, 0.08);
}

.report-reason input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--pink);
}

.report-dialog .field-error {
  margin: 0;
}

/* ------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  max-width: min(520px, calc(100% - 32px));
  padding: 13px 20px;
  border-radius: 14px;
  background: var(--moon);
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  box-shadow: 0 18px 50px -16px rgba(0, 0, 0, 0.8);
  transform: translateX(-50%);
}

.toast[data-kind="bad"] {
  background: #ffd0d8;
  color: #3a0612;
}

/* ------------------------------------------------------------ footer */

.footer {
  margin-top: 96px;
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px 36px;
  color: var(--dim);
  font-size: 14.5px;
}

.footer .brand {
  color: var(--moon);
  font-size: 18px;
}

.footer .brand svg {
  width: 26px;
  height: 26px;
}

.footer-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
}

.footer-end a {
  color: var(--haze);
  text-decoration: none;
}

.footer-end a:hover {
  color: var(--moon);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------ smaller screens */

@media (max-width: 760px) {
  :root {
    --nav-h: 60px;
  }

  body {
    font-size: 16.5px;
  }

  .nav-links {
    display: none;
  }

  .me-button span {
    display: none;
  }

  .me-button {
    padding: 3px;
  }

  .sheet {
    width: 100%;
    border-left: 0;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation: none !important;
  }
}
