/* ==========================================================================
   FARTHEST (الأقصى) — Swiss-Cartographic Paper-Relief Mountain Expeditions
   Paper #F4F1EA · Parchment #E9E3D6 · Cardstock #DCD3C2 · Ink #1B1F23
   Signal Red #D33A2C · Moss #2E4A3F · Ochre #C96B3C · Hard Offset Shadows
   ========================================================================== */

:root {
  --paper: #F4F1EA;
  --paper2: #E9E3D6;
  --paper3: #DCD3C2;
  --ink: #1B1F23;
  --red: #D33A2C;
  --red-hi: #B82B1E;
  --moss: #2E4A3F;
  --ochre: #C96B3C;
  --glacier: #6A8CAF;
  --hair: rgba(27, 31, 35, 0.16);
  --font-display: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
  --font-sans: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-behavior: auto; overflow-x: clip; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }

.wrap { width: min(1240px, 100% - 44px); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* Grid-Divided Cartographic Header (1.5px solid #1B1F23 cells + Flush Red CTA) */
.f-nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 70;
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: stretch;
  min-height: 58px;
}

.f-cell {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-inline-end: 1.5px solid var(--ink);
}

.f-brand { font-family: var(--font-display); font-weight: 900; font-size: 1.02rem; gap: 10px; white-space: nowrap; }
.f-brand .r-dot { color: var(--red); font-size: 0.7rem; }

.f-links { display: flex; align-items: stretch; padding: 0; }
.f-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  border-inline-end: 1.5px solid var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  transition: background 0.2s ease;
}
.f-links a span { font-family: var(--font-mono); font-size: 0.68rem; color: var(--red); }
.f-links a:hover { background: var(--paper2); }

.f-utc { flex-direction: column; justify-content: center; align-items: flex-start; font-family: var(--font-mono); font-size: 0.68rem; direction: ltr; line-height: 1.3; }
.f-utc strong { font-size: 0.8rem; }

.f-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  background: var(--red);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 0.2s ease;
}
.f-cta:hover { background: var(--red-hi); }

/* HERO — Hand-Cut Topographic Paper-Relief + Red Crop Marks + Survey Lens + UTC Box */
.hero {
  position: relative;
  min-height: 100svh;
  padding: 84px 0 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
  cursor: crosshair;
}

.hero-bg { position: absolute; inset: 0; z-index: -3; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.04) brightness(0.95); }
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(270deg, rgba(244, 241, 234, 0.88) 0%, rgba(244, 241, 234, 0.56) 46%, rgba(244, 241, 234, 0.14) 100%);
}

.hero-word {
  position: absolute;
  top: 66px;
  inset-inline: 0;
  text-align: center;
  z-index: -1;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(5rem, 17vw, 15.5rem);
  line-height: 0.85;
  color: rgba(244, 241, 234, 0.55);
  letter-spacing: -0.02em;
  pointer-events: none;
  direction: ltr;
}

/* Red Corner Crop Marks */
.crop { position: absolute; width: 16px; height: 16px; border-color: var(--red); border-style: solid; z-index: 3; pointer-events: none; }
.c-tl { top: 74px; left: 16px; border-width: 1.5px 0 0 1.5px; }
.c-tr { top: 74px; right: 16px; border-width: 1.5px 1.5px 0 0; }
.c-bl { bottom: 16px; left: 16px; border-width: 0 0 1.5px 1.5px; }
.c-br { bottom: 16px; right: 16px; border-width: 0 1.5px 1.5px 0; }

/* Cursor-Tracked Circular SURVEY PRINT Halftone Lens */
.survey-lens {
  position: absolute;
  top: 42%;
  left: 36%;
  width: 196px;
  height: 196px;
  margin: -98px 0 0 -98px;
  border-radius: 50%;
  border: 1.5px solid rgba(27, 31, 35, 0.45);
  background:
    radial-gradient(rgba(27, 31, 35, 0.48) 1.4px, transparent 1.4px),
    rgba(244, 241, 234, 0.46);
  background-size: 6px 6px;
  backdrop-filter: grayscale(1) contrast(1.3);
  pointer-events: none;
  z-index: 4;
  transition: transform 0.12s ease-out;
}

.survey-tag {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  white-space: nowrap;
  direction: ltr;
  line-height: 1.35;
}
.survey-tag b { color: var(--red); display: block; }

.scale-chips { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 5; }
.scale-chips span { padding: 4px 10px; background: rgba(27, 31, 35, 0.72); color: var(--paper); font-family: var(--font-mono); font-size: 0.66rem; direction: ltr; }

.hero-mid { position: relative; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 28px; margin-top: auto; }
.hero-copy { max-width: 580px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  margin-bottom: 16px;
}
.hero-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }

.hero-title { margin: 0 0 12px; font-family: var(--font-display); font-weight: 900; font-size: clamp(2.8rem, 5.8vw, 5.1rem); line-height: 1.05; color: var(--ink); }
.hero-title em { font-style: normal; color: var(--red); }

.squiggle-line { width: 220px; height: 10px; margin-bottom: 18px; display: block; }
.hero-lead { margin: 0 0 24px; max-width: 44ch; font-size: 1rem; color: rgba(27, 31, 35, 0.84); }

.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.btn-rect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1.5px solid var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--paper3);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease;
}
.btn-rect:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn-rect--red { background: var(--red); color: #ffffff; border-color: var(--ink); }
.btn-rect--paper { background: var(--paper); color: var(--ink); }

.dep-box {
  width: 268px;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(27, 31, 35, 0.25);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  direction: ltr;
}
.dep-head { background: var(--red); padding: 10px 14px; display: flex; justify-content: space-between; font-weight: 700; }
.dep-row { display: flex; justify-content: space-between; padding: 9px 14px; border-top: 1px solid rgba(244, 241, 234, 0.16); }
.dep-row span { opacity: 0.62; }

/* CHAPTER #way-in (Dark 4-Beat Interactive Rail) */
.way-sec { position: relative; height: 220svh; background: var(--ink); color: var(--paper); }
.way-stage { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; overflow: hidden; background: radial-gradient(circle at 60% 45%, rgba(211, 58, 44, 0.22), var(--ink) 70%); }
.way-grid { display: grid; grid-template-columns: 1fr auto; gap: 36px; align-items: center; }
.wbeats { position: relative; min-height: 220px; }
.wbeat { position: absolute; inset: 0; opacity: 0; transform: translateY(14px); transition: all 0.38s var(--ease); }
.wbeat.is-active { opacity: 1; transform: translateY(0); }
.wbeat h2 { margin: 10px 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(2.1rem, 4.4vw, 3.8rem); line-height: 1.1; }
.wrail { display: flex; flex-direction: column; gap: 10px; }
.wrail button { padding: 8px 14px; border: 1px solid rgba(244, 241, 234, 0.25); background: transparent; color: rgba(244, 241, 234, 0.65); font-family: var(--font-mono); font-size: 0.7rem; cursor: pointer; text-align: end; }
.wrail button.is-cur { background: var(--red); border-color: var(--red); color: #ffffff; }

/* SECTIONS */
.sec { padding: clamp(72px, 9vw, 120px) 0; }
.sec-p2 { background: var(--paper2); border-block: 1.5px solid var(--ink); }
.h2 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 900; font-size: clamp(2.1rem, 4.4vw, 3.8rem); line-height: 1.1; }
.h2 em { font-style: normal; color: var(--red); }

/* Staggered Expeditions Cards (#expeditions) */
.trips-grid { margin-top: 34px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.trip-card { background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 6px 6px 0 var(--paper3); overflow: hidden; }
.trip-card.is-mid { margin-top: 28px; }
.trip-img { position: relative; aspect-ratio: 16 / 11; border-bottom: 1.5px solid var(--ink); overflow: hidden; }
.trip-img img, .trip-img svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.grade-badge { position: absolute; top: 12px; inset-inline-start: 12px; width: 36px; height: 36px; border-radius: 50%; background: var(--red); color: #ffffff; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 0.74rem; border: 1.5px solid var(--ink); }
.trip-body { padding: 20px; }
.trip-body h3 { margin: 6px 0 8px; font-family: var(--font-display); font-size: 1.35rem; }

/* Scroll-Drawn Elevation Itinerary (#itinerary) */
.itin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; margin-top: 30px; }
.elev-box { position: sticky; top: 82px; padding: 20px; background: var(--paper2); border: 1.5px solid var(--ink); box-shadow: 6px 6px 0 var(--paper3); }
.stage-list { border-top: 1.5px solid var(--ink); }
.stage-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--hair); align-items: baseline; }
.stage-row b { color: var(--red); font-family: var(--font-mono); }

/* Departures Dark Board (#departures) */
.deps-dark { background: var(--ink); color: var(--paper); padding: clamp(76px, 9vw, 126px) 0; }
.dep-table { width: 100%; border-collapse: collapse; margin-top: 28px; }
.dep-table th, .dep-table td { text-align: start; padding: 16px 14px; border-bottom: 1px solid rgba(244, 241, 234, 0.16); }
.dep-table th { color: rgba(244, 241, 234, 0.55); font-family: var(--font-mono); font-size: 0.68rem; }
.seat-pill { padding: 4px 10px; border-radius: 999px; font-family: var(--font-mono); font-size: 0.68rem; }
.seat-pill.is-open { background: var(--moss); color: #ffffff; }
.seat-pill.is-low { background: var(--red); color: #ffffff; }

/* Region Filter Picker (#next) */
.reg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 24px; }
.reg-card { padding: 18px 14px; border: 1.5px solid var(--ink); background: var(--paper); text-align: start; cursor: pointer; box-shadow: 4px 4px 0 var(--paper3); transition: all 0.2s ease; }
.reg-card.is-active, .reg-card:hover { background: var(--red); color: #ffffff; }
.reg-card strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.reg-card small { font-family: var(--font-mono); font-size: 0.66rem; opacity: 0.78; }

/* Light Cartographic Footer (#F4F1EA + Giant Condensed FARTHEST) */
.f-foot { background: var(--paper); border-top: 1.5px solid var(--ink); padding: 64px 0 32px; overflow: hidden; }
.f-foot-top { display: grid; grid-template-columns: 1.3fr 0.8fr 1fr 1.4fr; gap: 32px; }
.f-foot h4 { margin: 0 0 12px; color: var(--red); }
.f-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; }
.fn-form { display: flex; gap: 8px; margin-top: 10px; }
.fn-form input { flex: 1; padding: 10px 12px; border: 1.5px solid var(--ink); background: #ffffff; outline: none; }
.fn-form button { padding: 10px 18px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer; }
.f-foot-word { margin: 36px 0 14px; font-family: var(--font-display); font-weight: 900; font-size: clamp(4.2rem, 18vw, 16rem); line-height: 0.84; letter-spacing: -0.04em; color: var(--ink); text-align: center; direction: ltr; user-select: none; }
.f-foot-bot { padding-top: 18px; border-top: 1.5px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; font-size: 0.8rem; }

@media (max-width: 1024px) {
  .f-nav { grid-template-columns: auto 1fr auto; }
  .f-utc { display: none; }
  .trips-grid, .itin-grid, .f-foot-top { grid-template-columns: 1fr; }
  .trip-card.is-mid { margin-top: 0; }
  .reg-grid { grid-template-columns: 1fr 1fr; }
  .elev-box { position: static; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .f-links, .survey-lens { display: none; }
  .f-nav { grid-template-columns: 1fr auto; }
  .dep-box { width: 100%; }
}
