/* =========================================================
   HIMAL TRAILS NEPAL — style.css
   Design tokens, base, shared components
   ========================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  --ink: #0E1A22;
  --ink-soft: #1A2B36;
  --slate: #2C4657;
  --snow: #F5F2EC;
  --stone: #E4DED3;
  --ochre: #C77D2E;
  --ochre-hover: #D89040;
  --ochre-dark: #9A5C17;
  --ochre-light: #E2A15A;

  --text: #0E1A22;
  --text-muted: #55636D;
  --text-light: #F5F2EC;
  --text-light-muted: rgba(245, 242, 236, 0.72);
  --line: rgba(14, 26, 34, 0.14);
  --line-light: rgba(245, 242, 236, 0.2);
  --error: #B3261E;

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-h1: clamp(2.5rem, 1.6rem + 4.6vw, 5.5rem);
  --fs-h2: clamp(1.75rem, 1.2rem + 2.6vw, 3.25rem);
  --fs-h3: clamp(1.25rem, 1.1rem + 0.8vw, 1.75rem);
  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.75rem;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;
  --section-y: clamp(4.5rem, 3rem + 7vw, 9rem);
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --container: 1200px;

  --radius: 4px;
  --header-h: 72px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--snow);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

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

.skip-link {
  position: fixed; left: 1rem; top: -4rem; z-index: 10000;
  background: var(--ink); color: var(--snow);
  padding: 0.75rem 1rem; border-radius: var(--radius);
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- 3. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--dark { background: var(--ink); color: var(--text-light); }
.section--stone { background: var(--stone); }
.text-center { text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ochre-dark);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.section--dark .eyebrow,
.eyebrow--light { color: var(--ochre-light); }

.section-head { max-width: 720px; margin-bottom: var(--sp-7); }
.section-head h2 { font-size: var(--fs-h2); margin-top: var(--sp-3); }
.section-head p { margin-top: var(--sp-4); color: var(--text-muted); }
.section--dark .section-head p { color: var(--text-light-muted); }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 48px; padding: 0 1.6rem;
  border: 1.5px solid transparent; border-radius: var(--radius);
  font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn--primary { background: var(--ochre); color: var(--ink); }
.btn--primary:hover { background: var(--ochre-hover); }

.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--snow); }

.btn--outline-light { border-color: rgba(245, 242, 236, 0.6); color: var(--snow); }
.btn--outline-light:hover { background: var(--snow); border-color: var(--snow); color: var(--ink); }

.btn--block { width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding-block: 0.5rem; border-bottom: 1px solid currentColor;
  font-size: 0.9375rem; font-weight: 700;
  transition: gap 0.3s var(--ease), color 0.3s var(--ease);
}
.link-arrow svg { width: 18px; height: 18px; }
.link-arrow:hover { gap: 0.9rem; color: var(--ochre-dark); }
.section--dark .link-arrow:hover { color: var(--ochre-light); }

/* ---------- 5. Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__mark .sun { stroke: var(--ochre-light); }
.brand__name {
  display: grid; font-family: var(--font-head);
  font-size: 1.25rem; line-height: 1; letter-spacing: 0.01em;
}
.brand__name small {
  margin-top: 0.3rem; font-family: var(--font-body);
  font-size: 0.625rem; font-weight: 700;
  letter-spacing: 0.32em; text-transform: uppercase; opacity: 0.75;
}

/* ---------- 6. Header & desktop nav ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h); color: var(--text-light);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; gap: var(--sp-5);
}
.site-header.is-scrolled,
.site-header--solid {
  background: rgba(245, 242, 236, 0.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--ink); box-shadow: 0 1px 0 var(--line);
}
.site-header.is-scrolled .brand__mark .sun,
.site-header--solid .brand__mark .sun { stroke: var(--ochre); }

.nav, .nav__cta { display: none; }

@media (min-width: 960px) {
  .nav { display: block; margin-left: auto; }
  .nav__cta { display: inline-flex; min-height: 44px; padding: 0 1.2rem; }
  .menu-btn { display: none; }
}

.nav__list { display: flex; align-items: center; gap: 0.25rem; }
.nav__item { position: relative; }
.nav__link {
  position: relative; display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.9rem; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em;
}
.nav__link::after {
  content: ""; position: absolute; left: 0.9rem; right: 0.9rem; bottom: 0.2rem;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link svg { width: 12px; height: 12px; transition: transform 0.3s var(--ease); }
.has-dropdown:hover .nav__link svg,
.has-dropdown:focus-within .nav__link svg { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 250px; padding: 0.5rem;
  background: var(--snow); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(14, 26, 34, 0.14);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.dropdown a {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0.9rem; border-radius: 2px; font-size: 0.9rem; font-weight: 600;
}
.dropdown a span { color: var(--text-muted); font-weight: 500; }
.dropdown a:hover { background: var(--stone); }
.dropdown__all { margin-top: 0.25rem; border-top: 1px solid var(--line); border-radius: 0 !important; color: var(--ochre-dark); }

/* ---------- 7. Mobile menu ---------- */
.menu-btn {
  display: grid; place-content: center; gap: 6px;
  width: 48px; height: 48px; margin-right: -10px;
}
.menu-btn span {
  display: block; width: 26px; height: 2px; background: currentColor;
  transition: transform 0.4s var(--ease);
}
body.menu-open .menu-btn span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
body.menu-open .menu-btn span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

body.menu-open { overflow: hidden; }
body.menu-open .site-header {
  background: transparent; color: var(--text-light); box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.menu-open .site-header .brand__mark .sun { stroke: var(--ochre-light); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column;
  padding: calc(var(--header-h) + 1.25rem) var(--gutter) 2rem;
  background: var(--ink); color: var(--text-light); overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease-out), visibility 0s linear 0.5s;
}
body.menu-open .mobile-menu {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
@media (min-width: 960px) { .mobile-menu { display: none; } }

.mobile-menu__list > li {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease-out);
}
body.menu-open .mobile-menu__list > li {
  opacity: 1; transform: none; transition-delay: calc(0.1s + var(--i, 0) * 0.06s);
}
.mobile-menu__link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line-light);
  font-family: var(--font-head); font-size: clamp(1.75rem, 7vw, 2.25rem);
}
.mobile-menu__sub { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.9rem 0 1.1rem; }
.mobile-menu__sub a {
  padding: 0.5rem 0.85rem; border: 1px solid var(--line-light);
  border-radius: 2px; font-size: 0.875rem; font-weight: 600;
}
.mobile-menu__foot { display: grid; gap: 1rem; margin-top: auto; padding-top: 2rem; }
.mobile-menu__contact { color: var(--text-light-muted); font-size: var(--fs-small); text-align: center; }

/* ---------- 8. Footer ---------- */
.site-footer {
  padding-top: var(--sp-8); background: var(--ink); color: var(--text-light-muted);
  font-size: 0.9375rem;
}
.footer__grid { display: grid; gap: var(--sp-7); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1.3fr; } }

.footer__brand .brand { color: var(--text-light); }
.footer__brand p { margin-top: var(--sp-4); max-width: 34ch; }
.footer__title {
  margin-bottom: var(--sp-4); font-family: var(--font-body);
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-light);
}
.footer__list li + li { margin-top: 0.6rem; }
.footer__list a { transition: color 0.25s; }
.footer__list a:hover { color: var(--ochre-light); }
.footer__badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: var(--sp-5); }
.footer__badges span {
  padding: 0.35rem 0.6rem; border: 1px solid var(--line-light); border-radius: 2px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3) var(--sp-5);
  margin-top: var(--sp-8); padding-block: var(--sp-5) calc(var(--sp-5) + 64px);
  border-top: 1px solid var(--line-light); font-size: var(--fs-small);
}
@media (min-width: 720px) { .footer__bottom { padding-bottom: var(--sp-5); } }

/* ---------- 9. Floating WhatsApp ---------- */
.wa-float {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 80;
  display: flex; align-items: center; gap: 0.6rem; height: 54px; padding: 0 1.1rem;
  border-radius: 999px; background: #14803F; color: #fff;
  font-size: 0.9rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.wa-float:hover { transform: translateY(-3px); }
.wa-float svg { width: 22px; height: 22px; }
body.menu-open .wa-float { opacity: 0; pointer-events: none; }

/* ---------- 10. Scroll reveal ---------- */
html.js .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 11. Breadcrumbs ---------- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: var(--fs-small); }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.5rem; opacity: 0.5; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ---------- 12. Forms ---------- */
.field { display: grid; gap: 0.4rem; }
.field label { font-size: var(--fs-small); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 0.85rem 1rem;
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 140px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--ochre); box-shadow: 0 0 0 3px rgba(199, 125, 46, 0.25);
}
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea { border-color: var(--error); }
.field__error { min-height: 1em; font-size: 0.8125rem; color: var(--error); }

/* ---------- 13. Accordion ---------- */
.accordion__item { border-bottom: 1px solid var(--line); }
.accordion__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; padding: 1.25rem 0; text-align: left;
  font-family: var(--font-head); font-size: var(--fs-h3); line-height: 1.2;
}
.accordion__icon { position: relative; flex: none; width: 18px; height: 18px; }
.accordion__icon::before,
.accordion__icon::after {
  content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 1.5px;
  background: currentColor; transition: transform 0.35s var(--ease);
}
.accordion__icon::after { transform: rotate(90deg); }
.accordion__item.is-open .accordion__icon::after { transform: rotate(0); }
.accordion__panel {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease);
}
.accordion__item.is-open .accordion__panel { grid-template-rows: 1fr; }
.accordion__inner { min-height: 0; overflow: hidden; }
.accordion__content { padding-bottom: 1.5rem; color: var(--text-muted); max-width: 70ch; }

/* ---------- 14. Trek card ---------- */
.trek-card { position: relative; display: flex; flex-direction: column; gap: var(--sp-4); }
.trek-card__media {
  position: relative; overflow: hidden; aspect-ratio: 4 / 5;
  border-radius: var(--radius); background: var(--stone);
}
.trek-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}
.trek-card:hover .trek-card__media img { transform: scale(1.06); }
.trek-card__tag {
  position: absolute; left: 1rem; top: 1rem; padding: 0.35rem 0.6rem;
  background: var(--snow); color: var(--ink); border-radius: 2px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.trek-card__title { font-size: var(--fs-h3); }
.trek-card__title a::after { content: ""; position: absolute; inset: 0; }
.trek-card__meta {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1rem;
  font-size: var(--fs-small); color: var(--text-muted);
}
.trek-card__foot {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: var(--sp-3); border-top: 1px solid var(--line);
  font-size: var(--fs-small); color: var(--text-muted);
}
.trek-card__price strong { font-family: var(--font-head); font-size: 1.25rem; color: var(--ink); }

/* ---------- 15. Destination card ---------- */
.dest-card {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  aspect-ratio: 3 / 4; border-radius: var(--radius);
  background: var(--ink); color: var(--text-light);
}
.dest-card img {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.4s var(--ease-out);
}
.dest-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(14, 26, 34, 0.88), rgba(14, 26, 34, 0.05) 65%);
}
.dest-card:hover img { transform: scale(1.06); }
.dest-card__body { position: absolute; inset: auto 0 0 0; padding: var(--sp-5); }
.dest-card__title { font-size: var(--fs-h3); }
.dest-card__meta { margin-top: 0.25rem; font-size: var(--fs-small); color: var(--text-light-muted); }

/* ---------- 16. Testimonial ---------- */
.testimonial {
  display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-6);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.testimonial blockquote { font-family: var(--font-head); font-size: 1.25rem; line-height: 1.45; }
.testimonial figcaption {
  display: grid; gap: 0.15rem; margin-top: auto;
  font-size: var(--fs-small); color: var(--text-muted);
}
.testimonial figcaption strong { font-size: 1rem; color: var(--ink); }
.section--dark .testimonial { background: var(--ink-soft); border-color: var(--line-light); }
.section--dark .testimonial figcaption { color: var(--text-light-muted); }
.section--dark .testimonial figcaption strong { color: var(--text-light); }

/* ---------- 17. CTA band ---------- */
.cta-band {
  position: relative; isolation: isolate; overflow: hidden;
  padding-block: var(--section-y); background: var(--ink); color: var(--text-light);
}
.cta-band__bg { position: absolute; inset: 0; z-index: -1; }
.cta-band__bg img { width: 100%; height: 100%; object-fit: cover; }
.cta-band__bg::after { content: ""; position: absolute; inset: 0; background: rgba(14, 26, 34, 0.72); }
.cta-band__inner { max-width: 760px; margin-inline: auto; text-align: center; }
.cta-band__inner h2 { font-size: var(--fs-h2); margin-top: var(--sp-3); }
.cta-band__inner p { margin-top: var(--sp-4); color: var(--text-light-muted); }
.cta-band__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-6); }

/* ---------- 18. Intro preloader (logo + tagline) ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: var(--ink); color: var(--snow); touch-action: none;
  transition: transform 1s var(--ease-io), visibility 0s linear 1s;
}
.preloader__inner {
  display: grid; justify-items: center; gap: 1.1rem;
  padding-inline: var(--gutter); text-align: center;
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease);
}
.preloader__mark { width: clamp(64px, 18vw, 88px); height: auto; margin-bottom: 0.4rem; }
.preloader__mark path,
.preloader__mark circle {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: pl-draw 1.4s var(--ease) 0.2s both;
}
.preloader__mark .base { animation-duration: 0.9s; animation-delay: 0.1s; }
.preloader__mark .sun { stroke: var(--ochre-light); animation-duration: 0.7s; animation-delay: 1.1s; }

.preloader__name {
  font-family: var(--font-head); font-size: clamp(1.75rem, 7vw, 3rem);
  font-weight: 500; line-height: 1;
  animation: pl-track 1.1s var(--ease-out) 1.2s both;
}
.preloader__tagline {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--ochre-light);
  animation: pl-rise 0.9s var(--ease-out) 1.9s both;
}
.preloader__line {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--ochre); transform-origin: left;
  animation: pl-grow 2.6s var(--ease-io) 0.2s both;
}
.preloader.is-done { transform: translateY(-100%); visibility: hidden; }
.preloader.is-done .preloader__inner { opacity: 0; transform: translateY(-24px); }

@keyframes pl-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pl-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pl-track { from { opacity: 0; letter-spacing: 0.3em; } to { opacity: 1; letter-spacing: 0.02em; } }
@keyframes pl-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes unhide { to { visibility: visible; } }

/* While the intro plays, hide the page behind it (CSS failsafe after 7s) */
html.has-preloader body > *:not(.preloader) {
  visibility: hidden; animation: unhide 0s linear 7s forwards;
}

/* ---------- 19. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}