@font-face {
  font-family: Bricolage;
  src: url("vendor/bricolage.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("vendor/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #172620;
  --muted: #53645a;
  --forest: #14271f;
  --accent: #d7fa54;
  --paper: #f7f8f2;
  --white: #fff;
  --line: #e0e5db;
  --headline: Bricolage, "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.5 var(--body);
}

main { flex: 1; }

h1, h2, h3, p { margin: 0; }

h1, h2, h3 {
  font-family: var(--headline);
  line-height: 1.08;
  letter-spacing: -.037em;
}

a { color: inherit; }

button, input, select { font: inherit; }

:focus-visible { outline: 3px solid #429066; outline-offset: 3px; }

.skip-link {
  position: absolute;
  z-index: 20;
  top: .6rem;
  left: 1rem;
  padding: .6rem 1rem;
  border-radius: .5rem;
  background: var(--white);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

.shell {
  width: min(100% - 5.5rem, 76rem);
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fcfdf8;
}

.header-layout {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}

.brand img { flex: none; border-radius: 12px; }

.brand-name {
  font: 800 1.49rem/.99 var(--headline);
  letter-spacing: -.045em;
}

.brand-subtitle {
  display: block;
  margin-top: .33rem;
  color: var(--muted);
  font: 600 .75rem/1 var(--body);
  letter-spacing: .015em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-weight: 700;
  font-size: .91rem;
}

.nav-gallery { text-decoration: none; }
.nav-gallery:hover { text-decoration: underline; text-underline-offset: .25em; }
.site-nav .button { min-height: 42px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 46px;
  padding: .62rem 1.07rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: .94rem;
  line-height: 1.25;
  cursor: pointer;
}

.button-outline { border-color: #d7ded2; background: transparent; }
.button-outline:hover { background: #eaf0e7; }
.button-dark { background: var(--forest); color: var(--white); }
.button-dark:hover { background: #254637; }
.button-accent { background: var(--accent); color: var(--forest); padding-inline: 1.22rem; }
.button-accent:hover { background: #e8ff95; }
.button:disabled { opacity: .46; cursor: default; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 406px;
  display: grid;
  align-items: center;
  margin-top: 2rem;
  border-radius: 1.45rem;
  background: var(--forest);
  color: #f9fbf4;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(60%, 39rem);
  padding: 3.15rem 0 3.25rem 3.35rem;
}

.eyebrow {
  font: 700 .77rem/1.3 var(--body);
  letter-spacing: .14em;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: .57rem;
  color: #d5e4d8;
}

.hero-eyebrow > span {
  width: .43rem;
  height: .43rem;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin-top: .86rem;
  font-size: clamp(3.65rem, 6.35vw, 6rem);
  font-weight: 800;
  letter-spacing: -.044em;
  line-height: .94;
}

.hero h1 em { color: var(--accent); font-style: normal; }

.hero-description {
  max-width: 24rem;
  margin: 1.2rem 0 1.5rem;
  color: #d2e0d6;
  font-size: 1.02rem;
}

.hero-visual {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 61%;
  z-index: 0;
}

.hero-map {
  position: absolute;
  inset: 0;
  background-color: #1b3127;
  background-image:
    repeating-linear-gradient(0deg, #aac2a911 0 1px, transparent 1px 41px),
    repeating-linear-gradient(90deg, #aac2a911 0 1px, transparent 1px 41px);
}

.hero-map .leaflet-tile-pane {
  filter: grayscale(1) invert(1) sepia(.34) hue-rotate(70deg) saturate(.75) brightness(.53);
  opacity: .81;
}

.hero-map-shade {
  position: absolute;
  z-index: 401;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--forest), #14271fee 12%, #14271f22 42%, #14271f00 75%);
}

.map-caption {
  position: absolute;
  z-index: 402;
  right: 1.3rem;
  bottom: 1.75rem;
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  max-width: calc(100% - 2.6rem);
  padding: .5rem .76rem;
  border: 1px solid #d5e4d856;
  border-radius: .55rem;
  background: #13261ee8;
  color: #f4fbef;
  font-size: .82rem;
  font-weight: 700;
}

.status-point {
  width: .46rem;
  height: .46rem;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.gallery {
  margin-top: 3.15rem;
  margin-bottom: 4.1rem;
  scroll-margin-top: 1.5rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1.05rem;
}

.section-heading h2 {
  font-size: clamp(2.15rem, 3.2vw, 3rem);
  font-weight: 800;
}

.route-count {
  flex: none;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.2rem;
}

.route-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 1.09rem;
  background: var(--white);
  box-shadow: 0 5px 16px #2c442508;
}

.route-card h3 {
  margin: 1.16rem 1.2rem 1rem;
  font-size: clamp(1.43rem, 2.15vw, 1.83rem);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.card-map, .editor-map {
  z-index: 0;
  background:
    repeating-linear-gradient(0deg, #748d6617 0 1px, transparent 1px 36px),
    repeating-linear-gradient(90deg, #748d6617 0 1px, transparent 1px 36px),
    #e8eee1;
}

.card-map { height: clamp(215px, 24vw, 325px); border-block: 1px solid #e3e8de; }

.card-map .leaflet-tile-pane, .editor-map .leaflet-tile-pane {
  filter: saturate(.63) contrast(.91) brightness(1.065);
}

.map .leaflet-control-attribution {
  padding: 1px .4rem;
  font: 600 .69rem/1.45 var(--body);
  background: #fcfdf1e9;
  color: #27392e;
}

.map .leaflet-control-attribution a { color: inherit; text-decoration: underline; }

.hero-map .leaflet-control-attribution {
  position: relative;
  z-index: 402;
  margin-right: .9rem;
  border-radius: .25rem .25rem 0 0;
  background: #13261ee8;
  color: #e5eee1;
}

.map .leaflet-bar {
  border: 1px solid #d7e1d3;
  border-radius: .46rem;
  box-shadow: 0 2px 6px #11391b17;
}

.map .leaflet-bar a { color: var(--forest); }

.map-message, .map noscript {
  position: absolute;
  z-index: 450;
  bottom: 1.4rem;
  left: .6rem;
  max-width: calc(100% - 1.2rem);
  padding: .37rem .55rem;
  background: #fcfdf5ec;
  color: var(--forest);
  border-radius: .35rem;
  font: 600 .79rem/1.35 var(--body);
}

.hero-map .map-message { bottom: 4.2rem; left: auto; right: 1.3rem; }

.route-details { margin-top: auto; padding: 1rem 1.2rem 1.1rem; }

.route-stats {
  display: grid;
  grid-template-columns: minmax(7rem, .8fr) minmax(0, 1fr);
  gap: .7rem;
}

.route-stat { display: flex; align-items: center; gap: .63rem; min-width: 0; }

.route-stat > div { min-width: 0; overflow-wrap: anywhere; }
.route-stat strong { font-weight: 700; }
.stat-label { display: block; color: var(--muted); font-size: .81rem; }

.route-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .97rem;
  padding-top: .76rem;
  border-top: 1px solid var(--line);
}

.route-action time { color: var(--muted); font-size: .82rem; }

.download-link {
  display: inline-flex;
  align-items: center;
  gap: .49rem;
  color: #23523a;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}

.download-link:hover { text-decoration: underline; text-underline-offset: .23em; }

.icon { display: inline-block; flex: none; position: relative; width: 1rem; height: 1rem; }
.icon::before, .icon::after { content: ""; position: absolute; }
.icon-lock::before { inset: 6px 2px 1px; border: 1.5px solid currentColor; border-radius: 2px; }
.icon-lock::after { inset: 1px 4px 8px; border: 1.5px solid currentColor; border-radius: 6px 6px 0 0; }
.icon-file::before { inset: 1px 3px 1px 2px; border: 1.5px solid currentColor; border-radius: 2px; }
.icon-file::after { inset: 6px 6px 5px 5px; border-block: 1px solid currentColor; }
.icon-distance::before { inset: 5px 0; transform: rotate(-35deg); border: 1.5px solid currentColor; border-radius: 2px; }
.icon-person::before { inset: 0 5px 9px; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-person::after { inset: 9px 2px 0; border: 1.5px solid currentColor; border-radius: 9px 9px 3px 3px; }
.route-stat .icon { color: #456a54; }

.empty-gallery {
  padding: 2rem;
  border: 1px dashed #cbd9c7;
  border-radius: 1rem;
}

.empty-gallery p { margin-top: .55rem; color: var(--muted); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.footer-layout { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.footer-brand .brand-name { font-size: 1.13rem; }
.footer-brand img { border-radius: 8px; }
.footer-layout > a:last-child { color: var(--muted); font-size: .82rem; }

.admin-shell { margin-block: 2.6rem 4rem; }
.admin-heading h1, .auth-panel h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; }

.admin-nav {
  display: flex;
  gap: .35rem;
  margin: 1.45rem 0;
  border-bottom: 1px solid #d8e2d5;
}

.admin-nav a {
  padding: .7rem .95rem;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  font-weight: 700;
}

.admin-nav a[aria-current="page"] { border-color: #45795a; }
.admin-nav a:hover { background: #eaf0e7; }

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .87fr);
  align-items: start;
  gap: 1.1rem;
}

.editor-aside { display: grid; gap: 1.1rem; }

.panel {
  background: var(--white);
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.panel h2 { font-size: 1.6rem; }
.panel h2 + p { margin-top: .42rem; }
.muted, .field-help { color: var(--muted); }

.editor-form, .version-form { display: grid; gap: .85rem; margin-top: 1rem; }
.editor-form label, .version-form label { display: grid; gap: .32rem; font-weight: 700; }

.editor-form input:not([type="color"]), .version-form select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 45px;
  padding: .48rem .6rem;
  border: 1px solid #becbbd;
  border-radius: .48rem;
  background-color: #fff;
  color: var(--ink);
  font-weight: 500;
}

.editor-form input[type="file"] { padding: .32rem; }
.editor-form input::file-selector-button {
  margin-right: .4rem;
  padding: .34rem .56rem;
  border: 0;
  border-radius: .28rem;
  background: #eaf0e6;
  color: var(--ink);
  cursor: pointer;
}

.field-help { margin-top: -.56rem; font-size: .86rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.form-actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .4rem; }

.color-field {
  display: flex;
  align-items: center;
  gap: .58rem;
  min-height: 45px;
  padding: .25rem .5rem;
  border: 1px solid #becbbd;
  border-radius: .48rem;
}

.color-field input { border: 0; width: 2.65rem; height: 2rem; padding: .13rem; background: none; cursor: pointer; }
.color-field output { font: 500 .9rem var(--body); }
.editor-map { height: 240px; border-radius: .55rem; margin: .85rem 0 .65rem; }
.editor-preview-details { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.saved-list { padding: 0; margin: .7rem 0 0; list-style: none; }
.saved-list li { border-top: 1px solid var(--line); }
.saved-list a {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem .4rem;
  text-decoration: none;
}
.saved-list a:hover, .saved-list a[aria-current="page"] { background: #f1f5ee; }
.saved-list a span:first-child { overflow-wrap: anywhere; font-weight: 700; }
.saved-list a span:last-child { flex: none; color: var(--muted); }

.auth-shell { margin-block: 3.5rem; display: grid; place-items: start center; }
.auth-panel { width: min(100%, 31rem); padding: 1.8rem; }
.auth-panel h1 { font-size: clamp(1.9rem, 4vw, 2.52rem); }
.auth-panel > p { margin-top: .65rem; }
.auth-panel button, .auth-panel > a { justify-self: start; margin-top: .3rem; }
.notice { padding: .7rem .9rem; margin-bottom: .8rem; border-radius: .45rem; background: #edf2e8; }
.notice-error { background: #f8e9e4; color: #7d2619; }
.notice-success { background: #edf4d8; color: #304c25; }
.deploy-panel { max-width: 55rem; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: .8rem; }
.panel-heading form { flex: none; }
.deployment-summary { display: flex; gap: 1rem 2rem; flex-wrap: wrap; margin-block: 1.1rem; }
.deployment-summary dt { color: var(--muted); font-size: .88rem; }
.deployment-summary dd { margin: .18rem 0 0; font-weight: 700; }
.version-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.version-form select { text-overflow: ellipsis; }

@media (max-width: 900px) {
  .shell { width: calc(100% - 3.5rem); }
  .hero-content { padding-left: 2.2rem; }
  .hero-visual { width: 58%; }
}

@media (max-width: 680px) {
  .shell { width: calc(100% - 2rem); }
  .header-layout { min-height: 65px; }
  .site-nav { gap: .8rem; }
  .site-nav .button { min-height: 38px; padding-inline: .62rem; }
  .brand { gap: .5rem; }
  .brand img { width: 39px; height: 39px; }
  .brand-name { font-size: 1.32rem; }
  .brand-subtitle { font-size: .7rem; }
  .hero { border-radius: 1rem; display: flex; flex-direction: column; min-height: 0; margin-top: 1rem; }
  .hero-content { order: -1; width: 100%; padding: 1.75rem 1.25rem 1.08rem; }
  .hero h1 { font-size: clamp(2.5rem, 10.2vw, 4.35rem); }
  .hero-description { margin-block: .85rem 1rem; font-size: .98rem; }
  .hero-visual { position: relative; flex: none; width: 100%; height: 235px; }
  .hero-map-shade { background: linear-gradient(180deg, var(--forest), #14271f00 19%); }
  .map-caption { bottom: 1.35rem; right: .69rem; }
  .hero-map .leaflet-control-attribution { margin-right: .45rem; }
  .gallery { margin-block: 2rem 2.7rem; }
  .gallery-grid { gap: .9rem; }
  .panel { padding: 1.05rem; }
  .admin-grid { grid-template-columns: 1fr; }
  .panel-heading { flex-wrap: wrap; }
  .version-form { grid-template-columns: 1fr; }
  .version-form button { justify-self: start; }
  .footer-brand img { width: 30px; height: 30px; }
}

@media (max-width: 360px) {
  .header-layout { gap: .55rem; }
  .site-nav { gap: .55rem; }
  .brand img { width: 33px; height: 33px; }
  .brand-name { font-size: 1.17rem; }
  .site-nav .button { padding-inline: .5rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.account-panel { margin-top: 1.1rem; }
.account-link { display: inline-block; margin-top: 1rem; font-size: .92rem; color: #23523a; }
.account-list { list-style: none; padding: 0; margin: .85rem 0 0; }
.account-list li { padding: .9rem 0; border-top: 1px solid var(--line); }
.account-row { display: flex; justify-content: space-between; gap: .75rem; align-items: center; margin-bottom: .6rem; }
.account-row strong { overflow-wrap: anywhere; }
.account-row span { color: var(--muted); font-size: .88rem; }
.account-list .button { min-height: 38px; font-size: .86rem; }
.create-user-form select {
  min-height: 45px;
  padding: .48rem .6rem;
  border: 1px solid #becbbd;
  border-radius: .48rem;
  background: #fff;
  color: var(--ink);
  font-weight: 500;
}
.recovery-code { margin-block: .85rem; }
.recovery-code code {
  display: inline-block;
  max-width: 100%;
  margin-top: .35rem;
  padding: .39rem .54rem;
  border-radius: .36rem;
  background: #e9f2d8;
  color: #203324;
  overflow-wrap: anywhere;
}
.delete-control { margin-top: .85rem; color: #802c22; }
.delete-control summary { width: fit-content; cursor: pointer; font-size: .92rem; font-weight: 700; }
.delete-control p { margin-block: .52rem; color: var(--ink); }
.button-danger { border-color: #dec1bb; color: #802c22; background: #fbf1ef; }
.button-danger:hover { background: #f5dfda; }
