/* ============================================================
   The Rameys — Experience Layer
   GSAP / Lenis-powered upgrade: cursor, overlay menu, veil,
   marquee, reveals, editorial details. Loaded on every page
   after style.css / page.css.
   ============================================================ */

:root {
  --z-progress: 1600;
  --z-nav: 1500;
  --z-menu: 9500;   /* above app-page overlays (euro-trip FAB 7000, modals 9200) */
  --z-veil: 10000;
}
/* Nav must outrank the overlay only while the menu is open; the rest of
   the time it stays below page modals (euro-trip bottom sheets, etc.) */
body.menu-open .nav { z-index: calc(var(--z-menu) + 10); }

/* ===== Lenis smooth-scroll housekeeping ===== */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ===== Nav upgrades ===== */
.nav {
  z-index: var(--z-nav); /* keep logo + hamburger above the overlay menu */
  transition: background 0.45s var(--ease-smooth),
              box-shadow 0.45s var(--ease-smooth),
              transform 0.5s var(--ease-out);
}
.nav--solid,
body.inner-page .nav {
  background: rgba(250, 247, 242, 0.8) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(28, 58, 74, 0.06) !important;
}
.nav--hidden { transform: translateY(-102%); }

/* Sticky sub-bars (euro-trip destination tabs, stocks controls) slide up
   into the vacated space when the main nav hides on scroll */
.trip-nav,
.controls-bar { transition: top 0.5s var(--ease-out); }
.nav--hidden ~ .trip-nav { top: 0 !important; }
.nav--hidden ~ .portfolio-main .controls-bar { top: 0 !important; }
body.menu-open .nav {
  background: transparent !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none !important;
  transform: none;
}
body.menu-open .nav__logo { color: var(--linen); }
body.menu-open .nav__links { opacity: 0; pointer-events: none; }
.nav__links { transition: opacity 0.3s ease; }

/* Hamburger becomes the menu trigger on every viewport */
.nav__hamburger { display: flex; z-index: calc(var(--z-menu) + 10); position: relative; }
body.menu-open .nav__hamburger span { background: var(--linen); }

/* Retire the old dropdown drawer once JS is live */
body.exp-ready .nav__mobile { display: none !important; }

/* ===== Scroll progress bar ===== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: var(--z-progress);
  pointer-events: none;
}
.scroll-progress__fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--terracotta), var(--driftwood));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ===== Fullscreen overlay menu ===== */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  background: linear-gradient(160deg, #122833 0%, var(--navy) 55%, #234A5C 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-height) + 1rem) var(--pad-x) 4rem;
  overflow-y: auto; /* short landscape viewports can scroll the menu */
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease-out), visibility 0s linear 0.7s;
}
.menu-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}
body.menu-open .menu-overlay {
  visibility: visible;
  clip-path: inset(0 0 0% 0);
  transition: clip-path 0.7s var(--ease-out), visibility 0s;
}

.menu-overlay__nav {
  display: flex;
  flex-direction: column;
  gap: clamp(0.1rem, 1vh, 0.6rem);
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}
.menu-overlay__link {
  display: inline-flex;
  align-items: baseline;
  gap: 1.2rem;
  width: fit-content;
  overflow: hidden;
  text-decoration: none;
}
.menu-overlay__num {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--driftwood);
  opacity: 0.8;
}
.menu-overlay__text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.2rem, 6.5vh, 4.2rem);
  line-height: 1.12;
  color: var(--linen);
  display: inline-block;
  transform: translateY(115%);
  transition: transform 0.75s var(--ease-out), color 0.3s ease;
  transition-delay: 0s;
}
body.menu-open .menu-overlay__text {
  transform: translateY(0);
  transition-delay: calc(0.18s + var(--i, 0) * 0.055s);
}
.menu-overlay__link:hover .menu-overlay__text,
.menu-overlay__link.is-current .menu-overlay__text { color: var(--terracotta); }
.menu-overlay__link.is-current .menu-overlay__num::after {
  content: ' — you are here';
  letter-spacing: 0.12em;
}

.menu-overlay__foot {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: 1.6rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(250, 247, 242, 0.35);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease-out);
}
body.menu-open .menu-overlay__foot {
  opacity: 1;
  transform: none;
  transition-delay: 0.55s;
}

/* ===== Page transition veil ===== */
.veil {
  position: fixed;
  inset: 0;
  z-index: var(--z-veil);
  display: flex;
  pointer-events: none;
  visibility: hidden;
}
.veil.is-active { visibility: visible; }
.veil__slat {
  flex: 1;
  height: 102%;
  transform: translateY(103%);
}
.veil__slat:nth-child(1) { background: #16303D; }
.veil__slat:nth-child(2) { background: var(--navy); }
.veil__slat:nth-child(3) { background: #234A5C; }

/* ===== Split-text reveal scaffolding ===== */
[data-split] .sw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  /* Italic serif descenders/ascenders need breathing room inside the mask */
  padding: 0.08em 0.06em 0.12em;
  margin: -0.08em -0.06em -0.12em;
}
[data-split] .swi {
  display: inline-block;
  will-change: transform;
}

/* ===== Hero canvas (home) ===== */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero::before { z-index: 1; } /* grain stays above the WebGL canvas */
.hero__content, .scroll-indicator { z-index: 2; }

/* ===== Destination marquee ===== */
.marquee {
  background: var(--navy);
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2.4rem) 0;
  position: relative;
}
.marquee__inner {
  display: flex;
  width: max-content;
  animation: marqueeScroll 46s linear infinite;
}
.marquee__track {
  display: flex;
  align-items: baseline;
  flex-shrink: 0;
}
.marquee__item {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  color: var(--linen);
  white-space: nowrap;
  padding-right: 1.6rem;
}
.marquee__item--ghost {
  color: transparent;
  -webkit-text-stroke: 1px rgba(250, 247, 242, 0.35);
}
.marquee__sep {
  color: var(--terracotta);
  font-size: clamp(1rem, 2vw, 1.4rem);
  padding-right: 1.6rem;
  align-self: center;
}
@keyframes marqueeScroll {
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__inner { animation: none; }
}

/* ===== Feature block editorial numbers ===== */
.feature-content { position: relative; }
.feature-index {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(5rem, 12vw, 9rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(28, 58, 74, 0.18);
  position: absolute;
  top: clamp(1rem, 3vw, 2.5rem);
  right: clamp(1.2rem, 4vw, 3rem);
  pointer-events: none;
  user-select: none;
}

/* ===== Footer, elevated ===== */
.footer__logo {
  font-size: clamp(2.6rem, 7vw, 5rem);
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.footer__nav a {
  position: relative;
  padding-bottom: 3px;
}
.footer__nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--sandy-blush);
  transition: width 0.35s var(--ease-smooth);
}
.footer__nav a:hover::after { width: 100%; }

/* ===== Silk hero (sub-pages) ===== */
.silk-hero {
  position: relative;
  height: 88vh;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--pad-x) clamp(2.5rem, 6vw, 4.5rem);
  overflow: hidden;
  background: var(--navy); /* paint-before-shader + WebGL fallback */
  margin-top: 0;
}
.silk-hero--compact {
  height: 54vh;
  min-height: 400px;
}
.silk-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* grain + legibility scrim above the canvas */
.silk-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  z-index: 1;
}
.silk-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 20, 28, 0.36), transparent 55%);
  pointer-events: none;
  z-index: 1;
}
.silk-hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}
.silk-hero__eyebrow {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(250, 247, 242, 0.7);
  display: block;
  margin-bottom: 1rem;
}
.silk-hero__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(3.2rem, 9.5vw, 7.5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--linen);
}
.silk-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.9rem;
  margin-top: 1.4rem;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(250, 247, 242, 0.75);
}
.silk-hero__meta .sep { color: var(--terracotta); letter-spacing: 0; }

/* ===== Editorial sections ===== */
.section-pad {
  background: var(--linen);
  padding: clamp(4rem, 8vw, 7rem) var(--pad-x);
  position: relative;
  overflow: hidden;
}
.section-pad--blush { background: var(--sandy-blush); }
.section-pad--navy { background: var(--navy); }
.section-head {
  max-width: var(--content-max);
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}
.section-head .heading-display {
  font-style: italic;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  margin-bottom: 0.9rem;
}
.section-head p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--navy);
  opacity: 0.62;
  max-width: 460px;
  line-height: 1.85;
}

/* ===== Index rows (editorial lists) ===== */
.index-rows {
  max-width: var(--content-max);
  margin: 0 auto;
}
.index-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.3rem, 3vw, 2rem) 0;
  border-bottom: 1px solid rgba(28, 58, 74, 0.14);
  text-decoration: none;
}
.index-rows > .index-row:first-child { border-top: 1px solid rgba(28, 58, 74, 0.14); }
.index-row__num {
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--driftwood);
}
.index-row__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.7rem, 4.5vw, 3rem);
  line-height: 1.15;
  color: var(--navy);
  transition: transform 0.45s var(--ease-out), color 0.3s ease;
}
.index-row:hover .index-row__title {
  transform: translateX(12px);
  color: var(--terracotta);
}
.index-row__note {
  font-family: var(--font-body);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--driftwood);
  text-align: right;
  white-space: nowrap;
}

/* ===== Postcard (full-bleed parallax image band) ===== */
.postcard {
  position: relative;
  height: 56vh;
  min-height: 380px;
  overflow: hidden;
}
.postcard__media {
  position: absolute;
  inset: -9% 0;
}
.postcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.postcard__caption {
  position: absolute;
  right: var(--pad-x);
  bottom: 1.4rem;
  z-index: 1;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 12px rgba(8, 16, 24, 0.5);
}
@media (max-width: 640px) {
  .postcard { height: 40vh; min-height: 260px; }
}

/* ===== Skeleton shimmer (placeholder widgets) ===== */
.skel {
  background: linear-gradient(90deg,
    rgba(28, 58, 74, 0.06) 25%,
    rgba(28, 58, 74, 0.13) 50%,
    rgba(28, 58, 74, 0.06) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 2.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 640px) {
  .silk-hero { height: 74vh; min-height: 440px; }
  .silk-hero--compact { height: 46vh; min-height: 320px; }
  .index-row { grid-template-columns: auto 1fr; }
  .index-row__note { grid-column: 2; text-align: left; }
}

/* ===== Display heading italic variant ===== */
.heading-display--italic { font-style: italic; }

/* ===== Trip status — hero microlabel ===== */
.hero-status {
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--driftwood);
  display: block;
  margin: -1.6rem 0 2.6rem;
  min-height: 1em;
}
.hero-status.is-imminent { color: var(--terracotta); }

/* ===== Presence strip ("Presently ...") ===== */
.presence {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 247, 242, 0.5);
  min-height: 1.2em;
  margin-bottom: 2.2rem;
  position: relative;
  z-index: 1;
}
.presence__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terracotta);
  align-self: center;
  animation: presencePulse 3s ease-in-out infinite;
}
.presence__label {
  color: var(--driftwood);
  font-weight: 500;
  letter-spacing: 0.24em;
}
.presence__line { letter-spacing: 0.14em; }
@keyframes presencePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

/* ===== Skip link ===== */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 12000;
  background: var(--navy);
  color: var(--linen);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.7rem 1.4rem;
  border-radius: 50px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ===== Focus visibility ===== */
:focus-visible {
  outline: 2px solid var(--ocean-blue);
  outline-offset: 3px;
}

/* ===== Index rows that aren't open yet ===== */
.index-row--soon { cursor: default; }
.index-row--soon:hover .index-row__title {
  transform: none;
  color: var(--navy);
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .menu-overlay,
  .menu-overlay__text,
  .menu-overlay__foot,
  .nav { transition: none; }
  .scroll-progress { display: none; }
  .skel { animation: none; opacity: 0.5; }
  .index-row__title { transition: none; }
  .presence__dot { animation: none; }
}
