/* =========================================================
   Meridian — custom layer on top of Tailwind (Play CDN)
   Only what utilities can't express: fonts, sticky header
   states, reveal animations, grain texture, form + nav bits.
   ========================================================= */

:root {
  --ink: #0f1210;
  --forest: #132a24;
  --forest-light: #1d3b32;
  --forest-deep: #08120f;
  --moss: #3f5b4c;
  --sage: #a8bbae;
  --bone: #f3f0e7;
  --sand: #e6e1d2;
  --clay: #d4451c;
  --clay-dark: #af3714;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Annotations are set in mono, the way a field report labels its plates. */
.label-mono {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bone);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -0.005em;
}

/* Outline type: an annotation drawn rather than filled in */
.stroke-type {
  color: transparent !important;
  -webkit-text-stroke: 1.2px var(--sage);
  paint-order: stroke fill;
}

::selection {
  background: rgba(212, 69, 28, 0.24);
}

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

/* ---------------- Header ---------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  color: var(--bone);
  border-bottom: 1px solid transparent;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease),
    border-color 0.45s var(--ease), backdrop-filter 0.45s var(--ease);
}

.site-header[data-stuck='true'] {
  background: rgba(243, 240, 231, 0.9);
}

/* Edge-framing for brevety sheets: content sits inside a thin border cabinet. */
.bleed-edges {
  background:
    linear-gradient(180deg, var(--sand) 0%, transparent 1px) padding-box,
    linear-gradient(0deg,
        var(--bone) 0%, var(--bone) 3px,
        transparent 3px, transparent 100%) border-box;
  border: 1px solid var(--bone);
  border-image: linear-gradient(180deg, var(--bone), var(--bone)) 1;
}

.bleed-edges::before,
.bleed-edges::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: none;
}

.bleed-edges::before {
  top: 0;
  background: linear-gradient(90deg, transparent, var(--bone) 8%, var(--bone) 92%, transparent);
}

.bleed-edges::after {
  bottom: 0;
  background: linear-gradient(90deg, transparent, var(--bone) 8%, var(--bone) 92%, transparent);
}

/* Frame plates: content sits inside a thin cabinet with fine inner field lines. */
.cabinet {
  border: 1px solid var(--bone);
  background: var(--bone);
  box-shadow:
    inset 0 0 0 1px rgba(15, 18, 16, 0.12),
    inset 0 0 0 2px rgba(15, 18, 16, 0.05);
}

.cabinet > *:first-child {
  margin-top: 0;
}

.cabinet > *:last-child {
  margin-bottom: 0;
}

.frame-transparent {
  border: 1px solid rgba(15, 18, 16, 0.1);
  box-shadow: inset 0 0 0 1px rgba(15, 18, 16, 0.06);
}
  backdrop-filter: blur(18px) saturate(1.4);
  color: var(--ink);
  border-bottom-color: rgba(15, 18, 16, 0.12);
}

.nav-link {
  position: relative;
  padding: 0.35rem 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.nav-link:hover::after,
.nav-link[aria-current='page']::after {
  transform: scaleX(1);
}

.header-cta {
  background: var(--bone);
  color: var(--ink);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}
.header-cta:hover {
  background: var(--clay);
  color: var(--bone);
}

.site-header[data-stuck='true'] .header-cta {
  background: var(--forest);
  color: var(--bone);
}
.site-header[data-stuck='true'] .header-cta:hover {
  background: var(--clay);
}

/* Menu toggle inherits the header's colour, so the border must too */
.menu-btn {
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  border-radius: 6px;
  padding: 0.95rem 1.5rem;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.3s var(--ease);
}

.btn-primary {
  background: var(--forest);
  color: var(--bone);
}
.btn-primary:hover {
  background: var(--forest-light);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(15, 18, 16, 0.22);
}

.btn-clay {
  background: var(--clay);
  color: var(--bone);
}
.btn-clay:hover {
  background: var(--clay-dark);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(175, 55, 20, 0.28);
}

.btn-light {
  background: var(--bone);
  color: var(--ink);
}
.btn-light:hover {
  background: var(--sand);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(15, 18, 16, 0.18);
}

.btn-outline {
  border-color: rgba(15, 18, 16, 0.28);
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bone);
}

.btn-outline-light {
  border-color: rgba(243, 240, 231, 0.38);
  color: var(--bone);
}
.btn-outline-light:hover {
  background: var(--bone);
  border-color: var(--bone);
  color: var(--ink);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-underline-offset: 4px;
}
.btn-link:hover {
  text-decoration: underline;
}

/* ---------------- Small pieces ---------------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.eyebrow-line {
  display: block;
  height: 0;
  width: 2.25rem;
  border-top: 1px dashed currentColor;
  opacity: 0.6;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 5px;
  border: 1px solid rgba(15, 18, 16, 0.18);
  padding: 0.55rem 0.9rem;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.chip:hover {
  border-color: rgba(15, 18, 16, 0.5);
}
.chip[aria-pressed='true'] {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--bone);
}

.field {
  width: 100%;
  border-radius: 5px;
  border: 1px solid rgba(15, 18, 16, 0.18);
  background: var(--bone);
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.field::placeholder {
  color: rgba(15, 18, 16, 0.38);
}
.field:focus {
  outline: none;
  border-color: var(--forest);
  background: #fff;
}
.field[aria-invalid='true'] {
  border-color: var(--clay);
  background: rgba(212, 69, 28, 0.05);
}

.card-media {
  position: relative;
  overflow: hidden;
  outline: 1px solid rgba(15, 18, 16, 0.14);
  outline-offset: -1px;
  background-image: linear-gradient(135deg, var(--forest) 0%, var(--moss) 55%, var(--sage) 100%);
}

.img-broken {
  opacity: 0;
}

/* ---------------- Mobile menu ---------------- */
#mobile-menu {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease),
    visibility 0.45s var(--ease);
}
#mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

@keyframes menuItemIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#mobile-menu.is-open [data-menu-item] {
  animation: menuItemIn 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms + 120ms);
}

body.no-scroll {
  overflow: hidden;
}

/* ---------------- Scroll reveal ---------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------- Texture + motion ---------------- */
.grain {
  position: relative;
  isolation: isolate;
}

.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* Survey graticule: the map grid laid over photographic plates. */
.survey {
  position: relative;
}
.survey::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(243, 240, 231, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(243, 240, 231, 0.09) 1px, transparent 1px);
  background-size: 88px 88px;
  background-position: center;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 78%),
    linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 78%),
    linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-composite: intersect;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.animate-marquee {
  animation: marquee 44s linear infinite;
}

/* The ticker reads as a scrolling gazetteer, not a headline. */
.animate-marquee span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.marquee-mask {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-floaty {
  animation: floaty 7s ease-in-out infinite;
}

/* ---------------- Trip grid filtering ---------------- */
.trip-card {
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.trip-card.is-filtered {
  display: none;
}

/* ---------------- Accordion ---------------- */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
}
.faq-panel > div {
  overflow: hidden;
}
.faq-item[data-open='true'] .faq-panel {
  grid-template-rows: 1fr;
}
.faq-item[data-open='true'] .faq-icon {
  transform: rotate(45deg);
}
.faq-icon {
  transition: transform 0.4s var(--ease);
}

/* ---------------- Slider ---------------- */
.quote-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}
.quote-slide.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js [data-reveal],
  #mobile-menu,
  #mobile-menu.is-open [data-menu-item] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .animate-marquee,
  .animate-floaty {
    animation: none !important;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}
