/* ==========================================================================
   Klemen & Nina · Potovanja — "field journal / dispatch"
   A warm, keepsake travel-log. Photos are the heroes; the metadata is typed.
   Type: Newsreader (display + italic voice) · Mulish (body) · Space Mono (labels)
   A single restrained garnet accent; warm paper; no decoration for its own sake.
   ========================================================================== */

:root {
  --paper:    #f3ece4;   /* warm sand page                */
  --paper-2:  #efe6db;   /* slightly deeper paper         */
  --card:     #fbf7f1;   /* lifted surface (cards, sheets)*/
  --white:    #ffffff;

  --ink:      #2a2326;   /* warm near-black — headings/text */
  --ink-2:    #6e625f;   /* taupe — secondary / meta        */
  --ink-3:    #9c8f89;   /* faint — captions / hints        */

  --garnet:      #a21e4b;   /* the single accent            */
  --garnet-hi:   #c4335f;   /* hover / brighter             */
  --garnet-soft: rgba(162, 30, 75, 0.10);
  --garnet-line: rgba(162, 30, 75, 0.28);

  --line:        #e3d7ca;   /* ruled line on paper          */
  --line-soft:   #ece2d6;

  --shadow-sm: 0 2px 10px rgba(58, 40, 30, 0.06);
  --shadow-md: 0 18px 40px -22px rgba(58, 40, 30, 0.35);
  --shadow-lg: 0 30px 70px -28px rgba(42, 28, 22, 0.45);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Mulish", system-ui, -apple-system, sans-serif;
  --mono:  "Space Mono", ui-monospace, "SFMono-Regular", monospace;

  --wrap: 1140px;
  --radius: 4px;
  --radius-lg: 8px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ----- reset ----- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, picture, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
input, textarea, select, button { font: inherit; }
::selection { background: var(--garnet); color: #fff; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(140% 90% at 50% -20%, rgba(255, 255, 255, 0.6), transparent 55%),
    radial-gradient(120% 80% at 50% 120%, rgba(213, 196, 178, 0.35), transparent 60%);
  background-attachment: fixed;
  line-height: 1.62;
  font-size: 17px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ==========================================================================
   Typographic primitives
   ========================================================================== */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--garnet);
}
.dateline {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
}
.dateline .sep { color: var(--garnet-line); }
.dateline b { color: var(--ink); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

.wrap { width: min(100% - 3rem, var(--wrap)); margin-inline: auto; }
.page { position: relative; z-index: 1; min-height: 62vh; }

/* ==========================================================================
   Masthead
   ========================================================================== */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 236, 228, 0.82);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.masthead.is-scrolled { border-bottom-color: var(--line); background: rgba(243, 236, 228, 0.94); }
.masthead__inner {
  width: min(100% - 3rem, var(--wrap));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
}
.wordmark { display: inline-flex; align-items: baseline; gap: 0.34rem; }
.wordmark__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wordmark__sub {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.masthead__nav { display: flex; align-items: center; gap: 0.4rem; }
.logout-form { display: inline; }
.navlink {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius);
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.navlink:hover { color: var(--ink); background: rgba(42, 35, 38, 0.05); }
.navlink--cta {
  color: var(--garnet);
  border: 1px solid var(--garnet-line);
}
.navlink--cta:hover { background: var(--garnet); color: #fff; border-color: var(--garnet); }
.navlink--ghost { border: 1px solid var(--line); }
.navlink--ghost:hover { border-color: var(--ink-3); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s;
}
.btn--primary {
  background: var(--garnet);
  color: #fff;
  border-color: var(--garnet);
}
.btn--primary:hover { background: var(--garnet-hi); border-color: var(--garnet-hi); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn--ghost:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.btn--danger { border-color: var(--garnet-line); color: var(--garnet); background: transparent; }
.btn--danger:hover { background: var(--garnet); color: #fff; border-color: var(--garnet); }
.btn--sm { padding: 0.5rem 0.95rem; font-size: 0.7rem; }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toasts {
  position: fixed;
  z-index: 80;
  top: 5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(92vw, 380px);
}
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--garnet);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  animation: toast-in 0.4s var(--ease) both;
}
.toast--error { border-left-color: var(--garnet); }
.toast__close { color: var(--ink-3); font-size: 1.3rem; line-height: 1; padding: 0 0.2rem; }
.toast__close:hover { color: var(--garnet); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Home — intro / lede
   ========================================================================== */
.lede {
  width: min(100% - 3rem, var(--wrap));
  margin: 4.5rem auto 3rem;
  max-width: 60rem;
}
.lede__eyebrow { margin-bottom: 1.1rem; }
.lede__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 7vw, 5rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.lede__title em { font-style: italic; color: var(--garnet); }
.lede__note {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 40ch;
  margin-top: 1.4rem;
}
.lede__foot {
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.4rem;
  align-items: baseline;
  justify-content: space-between;
}

/* ==========================================================================
   Home — journeys index
   ========================================================================== */
.journeys {
  width: min(100% - 3rem, var(--wrap));
  margin: 0 auto 6rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 3rem 2.4rem;
}
.journey { display: flex; flex-direction: column; }
.journey__frame {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
}
.journey__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.journey:hover .journey__img { transform: scale(1.045); }
.journey__frame::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(42, 28, 22, 0.06);
  border-radius: var(--radius-lg);
  pointer-events: none;
}
.journey__empty {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  background:
    repeating-linear-gradient(-45deg, var(--paper-2) 0 11px, var(--paper) 11px 22px);
}
.journey__num {
  position: absolute;
  top: 0.9rem; left: 0.9rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: #fff;
  background: rgba(42, 28, 22, 0.55);
  backdrop-filter: blur(3px);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}
.journey__badge {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--garnet);
  padding: 0.22rem 0.5rem;
  border-radius: 2px;
}
.journey__body { padding: 1.1rem 0.15rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.journey__meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.journey__meta .sep { color: var(--garnet-line); }
.journey__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.7rem;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.2s;
}
.journey:hover .journey__title { color: var(--garnet); }
.journey__note {
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* empty state */
.empty {
  width: min(100% - 3rem, 560px);
  margin: 3rem auto 6rem;
  text-align: center;
  padding: 3.5rem 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.empty__mark {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--garnet);
  margin-bottom: 1rem;
}
.empty h2 { font-family: var(--serif); font-weight: 400; font-size: 2rem; margin-bottom: 0.6rem; color: var(--ink); }
.empty p { color: var(--ink-2); margin-bottom: 1.7rem; max-width: 42ch; margin-inline: auto; }

/* ==========================================================================
   Trip detail — cover
   ========================================================================== */
.cover {
  position: relative;
  min-height: min(76vh, 660px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}
.cover__bg { position: absolute; inset: 0; }
.cover__bg img { width: 100%; height: 100%; object-fit: cover; }
.cover__bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(24, 16, 14, 0.82) 0%, rgba(24, 16, 14, 0.32) 42%, rgba(24, 16, 14, 0.12) 100%);
}
.cover__plain {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 120% at 20% 0%, #3a2b30, #241a1e 60%);
}
.cover__inner {
  position: relative;
  width: min(100% - 3rem, var(--wrap));
  margin: 0 auto;
  padding: 3.5rem 0;
}
.cover .dateline { color: rgba(255, 255, 255, 0.78); margin-bottom: 1rem; }
.cover .dateline b { color: #fff; }
.cover .dateline .sep { color: rgba(255, 255, 255, 0.4); }
.cover__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 20ch;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}
.cover__badge {
  display: inline-block;
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.24rem 0.6rem;
  border-radius: 2px;
}

.editor-bar {
  position: relative; z-index: 4;
  width: min(100% - 3rem, var(--wrap));
  margin: 1.5rem auto -0.5rem;
  display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end;
}

/* overture (summary) */
.overture {
  width: min(100% - 3rem, 720px);
  margin: 4.5rem auto 1rem;
}
.overture__rule {
  width: 44px; height: 2px; background: var(--garnet);
  margin-bottom: 1.6rem;
}
.overture p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.42;
  color: var(--ink);
}

/* ==========================================================================
   Route — the timeline of moments as a marked trail
   ========================================================================== */
.route {
  position: relative;
  width: min(100% - 3rem, 900px);
  margin: 4rem auto 5rem;
  padding-left: 3.2rem;
}
.route::before {
  content: "";
  position: absolute;
  left: 15px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--garnet-line);
}
.stop { position: relative; padding-bottom: 4.5rem; scroll-margin-top: 5.5rem; }
.stop:last-child { padding-bottom: 0; }
.stop__marker {
  position: absolute;
  left: -3.2rem;
  top: -0.1rem;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--garnet);
  background: var(--paper);
  border: 1px solid var(--garnet);
  border-radius: 50%;
}
.stop__head { margin-bottom: 1.4rem; }
.stop .dateline { margin-bottom: 0.5rem; }
.stop__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.stop__story {
  color: var(--ink-2);
  max-width: 64ch;
  margin-top: 0.8rem;
  font-size: 1.05rem;
  line-height: 1.68;
}
.stop__edit { margin-top: 1.1rem; display: flex; gap: 0.5rem; }

/* photo gallery */
.gallery-wrap { margin-top: 1.7rem; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.7rem;
}
/* collapsed: keep only the first row; JS marks the overflow shots */
.gallery.is-collapsed .shot.is-extra { display: none; }
.gallery__toggle {
  margin-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--garnet);
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--garnet-line);
  border-radius: var(--radius);
  background: var(--card);
  transition: background 0.2s, border-color 0.2s;
}
.gallery__toggle[hidden] { display: none; }
.gallery__toggle:hover { background: var(--garnet-soft); border-color: var(--garnet); }
.gallery__toggle::after { content: "↓"; transition: transform 0.2s; }
.gallery__toggle.is-open::after { transform: rotate(180deg); }
.shot {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.shot__img {
  width: 100%; height: 100%;
  object-fit: cover;
  aspect-ratio: 1;
  transition: transform 0.7s var(--ease);
}
.shot--portrait { grid-row: span 2; }
.shot--portrait .shot__img { aspect-ratio: 3 / 4; }
.shot:hover .shot__img { transform: scale(1.05); }
.shot::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(42, 28, 22, 0.08);
  border-radius: var(--radius);
  pointer-events: none;
}
.shot__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6rem 0.7rem 0.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(to top, rgba(24, 16, 14, 0.8), transparent);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.shot:hover .shot__cap { opacity: 1; transform: none; }

/* ==========================================================================
   Trip overview — every day's track on one map
   ========================================================================== */
.overview {
  width: min(100% - 3rem, var(--wrap));
  margin: 4rem auto 1rem;
}
.overview__head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.4rem;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1.2rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.overview__totals { display: flex; flex-wrap: wrap; gap: 1.1rem 2.4rem; align-items: baseline; }
.overview__map {
  position: relative;  /* stacking context: keep Leaflet controls under the masthead */
  z-index: 0;
  height: clamp(360px, 52vh, 560px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.overview .leaflet-container { font-family: var(--sans); background: var(--paper-2); }
.overview__hint {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* numbered stage marker on the overview map (echoes the route waypoints) */
.daymark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--garnet);
  color: var(--garnet);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 5px rgba(42, 28, 22, 0.3);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.daymark:hover {
  background: var(--garnet);
  color: #fff;
  transform: scale(1.12);
}

/* day popup on the overview map */
.leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.leaflet-popup-tip { background: var(--card); }
.leaflet-popup-content { margin: 0.8rem 1rem; }
.daypop { display: flex; flex-direction: column; gap: 0.25rem; }
.daypop strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.15;
}
.daypop__place {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.daypop__stats {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink);
  margin-top: 0.2rem;
}
.daypop__link {
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--garnet);
  font-weight: 700;
}
.daypop__link:hover { color: var(--garnet-hi); text-decoration: underline; }

/* ==========================================================================
   Activity track — map + stats (from a GPX)
   ========================================================================== */
.track { margin-top: 1.7rem; }
.track__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem 2.4rem;
  align-items: baseline;
  margin-bottom: 1.1rem;
}
.track__stat { display: flex; flex-direction: column; gap: 0.15rem; }
.track__val {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.track__unit {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.track__map {
  position: relative;   /* own stacking context so Leaflet controls stay below the masthead */
  z-index: 0;
  height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.track .leaflet-container { font-family: var(--sans); background: var(--paper-2); }
.track__link {
  display: inline-block;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--garnet);
}
.track__link:hover { color: var(--garnet-hi); }

/* current track, shown on the moment editor */
.track-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.8rem 1rem;
  margin-bottom: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.track-current__info { display: flex; flex-direction: column; gap: 0.15rem; }
.track-current__info strong { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; }
.track-current__info span { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); }
.track-current__remove { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; color: var(--ink-2); }
.track-current__remove input { width: 1.1rem; height: 1.1rem; accent-color: var(--garnet); }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(24, 16, 14, 0.94);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s;
}
.lightbox.is-open { display: flex; opacity: 1; }
.lightbox__img {
  max-width: 90vw; max-height: 82vh;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: pop 0.32s var(--ease);
}
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.lightbox__cap {
  position: absolute; bottom: 1.5rem; left: 0; right: 0;
  text-align: center; color: rgba(255, 255, 255, 0.85);
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em;
  padding: 0 1rem;
}
.lightbox__btn, .lightbox__close {
  position: absolute;
  width: 48px; height: 48px; border-radius: 50%;
  color: #fff; font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid; place-items: center;
  transition: transform 0.2s, background 0.2s;
}
.lightbox__btn:hover, .lightbox__close:hover { background: var(--garnet); border-color: var(--garnet); }
.lightbox__btn { top: 50%; transform: translateY(-50%); }
.lightbox__btn:hover { transform: translateY(-50%) scale(1.08); }
.lightbox__btn--prev { left: 1.5rem; }
.lightbox__btn--next { right: 1.5rem; }
.lightbox__close { top: 1.3rem; right: 1.5rem; width: 44px; height: 44px; font-size: 1.3rem; }

/* ==========================================================================
   Forms / editor sheets
   ========================================================================== */
.sheet {
  width: min(100% - 3rem, 720px);
  margin: 3.5rem auto 5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.6rem, 4vw, 3rem);
}
.sheet__header { margin-bottom: 2.2rem; border-bottom: 1px solid var(--line); padding-bottom: 1.4rem; }
.sheet__crumb { margin-bottom: 0.8rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; }
.sheet__crumb a { color: var(--ink-2); }
.sheet__crumb a:hover { color: var(--garnet); }
.sheet__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.05; color: var(--ink);
}

.field { margin-bottom: 1.6rem; }
.field > label, .field-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 0.5rem;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="date"],
.field input[type="number"],
.field input[type="email"],
.field textarea,
.field select,
.input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--ink-3); font-weight: 400; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus {
  outline: none;
  border-color: var(--garnet);
  box-shadow: 0 0 0 3px var(--garnet-soft);
}
.field textarea { resize: vertical; min-height: 6.5rem; line-height: 1.6; font-family: var(--sans); }
.field__help { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.45rem; }
.field__error { color: var(--garnet); font-size: 0.86rem; margin-top: 0.45rem; font-weight: 600; }
.field--check { display: flex; align-items: center; gap: 0.6rem; }
.field--check input { width: 1.15rem; height: 1.15rem; accent-color: var(--garnet); }
.field--check label { margin: 0; font-family: var(--sans); font-size: 0.98rem; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

.form-actions {
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center;
  margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
}
.form-actions .spacer { flex: 1; }

/* file dropzone */
.dropzone {
  border: 1px dashed var(--garnet-line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  padding: 2.2rem 1.5rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--garnet); background: var(--garnet-soft); }
.dropzone input[type="file"] { display: none; }
.dropzone__icon {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--garnet);
}
.dropzone__hint { font-size: 0.95rem; color: var(--ink-2); margin-top: 0.5rem; }
.preview-grid { margin-top: 1.2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.5rem; }
.preview-grid img { aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }

/* existing photos editor */
.photo-edit { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.photo-edit__row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 0.9rem; align-items: center;
  padding: 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
.photo-edit__row img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius); }

/* ==========================================================================
   Gate & login (centered card)
   ========================================================================== */
.portal {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}
.portal__card {
  width: min(100%, 440px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(2rem, 6vw, 3rem);
  position: relative;
}
.portal__stamp { margin-bottom: 1.4rem; }
.portal__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.9rem, 5vw, 2.5rem); line-height: 1.06; color: var(--ink);
}
.portal__title em { font-style: italic; color: var(--garnet); }
.portal__text { color: var(--ink-2); margin: 0.8rem 0 1.9rem; font-size: 1rem; line-height: 1.6; }
.portal form { display: flex; flex-direction: column; gap: 1.1rem; }
.portal .field { margin: 0; }
.portal .btn { justify-content: center; }
.portal__foot { margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--ink-2); }
.portal__foot a { color: var(--garnet); font-weight: 600; }
.portal__error {
  background: var(--garnet-soft);
  border: 1px solid var(--garnet-line);
  color: var(--garnet);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem; font-size: 0.92rem; font-weight: 500;
}
.backlink {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em;
  color: var(--ink-2);
}
.backlink:hover { color: var(--garnet); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.footer__inner {
  width: min(100% - 3rem, var(--wrap));
  margin-inline: auto;
  padding: 2.2rem 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; align-items: baseline; justify-content: space-between;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.05em; color: var(--ink-2);
}
.footer__brand { color: var(--ink); }
.footer__coord { color: var(--ink-3); }

/* ==========================================================================
   Reveal-on-scroll (progressive enhancement)
   ========================================================================== */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .masthead__inner { gap: 0.5rem; }
  .wordmark__sub { display: none; }
  .masthead__nav { gap: 0.2rem; }
  .navlink { padding: 0.45rem 0.55rem; font-size: 0.68rem; }
  .lede { margin-top: 3rem; }
  .field-row { grid-template-columns: 1fr; }
  .route { padding-left: 2.6rem; }
  .stop__marker { left: -2.6rem; width: 28px; height: 28px; }
  .route::before { left: 13px; }
  .lightbox__btn { width: 40px; height: 40px; }
  .footer__inner { gap: 0.5rem 1.2rem; }
}
