/* ============================================================
   KINVOY.AI — Global Stylesheet
   No framework. No build step. Just CSS.
   ============================================================ */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }

/* --- CUSTOM PROPERTIES (DESIGN TOKENS) --- */
:root {
  /* Colors */
  --stone-warm: #FAFAF8;
  --stone-muted: #F2EFE9;
  --ink: #1C1917;
  --ink-light: #6B6560;
  --gold: #B08D57;
  --ink-deep: #2C2420;

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;

  /* Sizes (fluid) */
  --text-display: clamp(2.5rem, 5vw, 4.5rem);
  --text-headline: clamp(1.75rem, 3vw, 2.75rem);
  --text-subhead: clamp(1.25rem, 2vw, 1.75rem);
  --text-body: 1.0625rem;
  --text-caption: 0.8125rem;

  /* Spacing */
  --section-py: clamp(5rem, 8vw, 8rem);
  --container-max: 72rem;
  --container-px: clamp(1.5rem, 3vw, 2.5rem);
  --gap: clamp(2rem, 3vw, 3rem);

  /* Nav */
  --nav-h: 4rem;
  --nav-h-md: 5rem;
}

/* --- GLOBAL --- */
body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.75;
  color: var(--ink);
  background: var(--stone-warm);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}

::selection { background: var(--gold); color: #fff; }

*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* --- SKIP LINK --- */
.skip-link {
  position: fixed; top: 1rem; left: 1rem; z-index: 200;
  background: var(--ink); color: var(--stone-warm);
  padding: 0.5rem 1rem; font-size: 0.875rem; border-radius: 4px;
  transform: translateY(-200%); transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

/* --- LAYOUT --- */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--container-px); }
.section { padding: var(--section-py) 0; }
.section--warm { background: var(--stone-warm); }
.section--muted { background: var(--stone-muted); }
.section--dark { background: var(--ink-deep); color: var(--stone-warm); }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-narrow { max-width: 48rem; }
.max-w-mid { max-width: 56rem; }

/* --- GRID --- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.grid-bio { grid-template-columns: 1fr; }
.grid-phase { grid-template-columns: 1fr; }

/* Tablet (768px) */
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-bio { grid-template-columns: 2fr 3fr; }
  .grid-phase { grid-template-columns: 3fr 9fr; }
}

/* Desktop (1024px) */
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- TYPOGRAPHY --- */
.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }

.text-display {
  font-family: var(--font-serif);
  font-size: var(--text-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.text-headline {
  font-family: var(--font-serif);
  font-size: var(--text-headline);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.text-subhead {
  font-family: var(--font-serif);
  font-size: var(--text-subhead);
  line-height: 1.3;
}
.text-body { font-size: var(--text-body); line-height: 1.75; }
.text-caption {
  font-family: var(--font-sans);
  font-size: var(--text-caption);
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.color-ink { color: var(--ink); }
.color-ink-light { color: var(--ink-light); }
.color-gold { color: var(--gold); }
.color-warm { color: var(--stone-warm); }

/* --- GOLD DIVIDER --- */
.divider {
  width: 6rem; height: 1px;
  background: var(--gold);
  margin: 0 auto;
}

/* --- BUTTONS --- */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1rem 2rem;
  min-height: 2.75rem; /* 44px minimum touch target */
  transition: all 0.3s ease;
}
.btn--primary {
  background: var(--ink);
  color: var(--stone-warm);
}
.btn--primary:hover { background: var(--gold); }
.btn--ghost {
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover {
  background: var(--ink);
  color: var(--stone-warm);
}
.btn--gold {
  background: var(--gold);
  color: var(--stone-warm);
}
.btn--gold:hover { background: #9a7a4a; }

/* --- HEADER --- */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50; height: var(--nav-h);
  transition: transform 0.3s, background 0.3s;
}
.header--scrolled {
  background: rgba(44, 36, 32, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.header--hidden { transform: translateY(-100%); }
.header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.header__logo {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.25rem;
  letter-spacing: 0.3em;
  color: var(--stone-warm);
  z-index: 60;
}
.header__nav { display: none; }
.header__nav a {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-warm);
  padding-bottom: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.header__nav a:hover,
.header__nav a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Desktop nav */
@media (min-width: 768px) {
  .header { height: var(--nav-h-md); }
  .header__nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
  .hamburger { display: none !important; }
}

/* Hamburger */
.hamburger {
  z-index: 60;
  padding: 0.5rem;
  color: var(--stone-warm);
}
.hamburger svg { width: 24px; height: 24px; }

/* Mobile overlay */
.mobile-menu {
  position: fixed; inset: 0;
  background: var(--ink-deep);
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu__close {
  position: absolute; top: 1.25rem; right: 1.5rem;
  color: var(--stone-warm); padding: 0.5rem;
}
.mobile-menu__close svg { width: 28px; height: 28px; }
.mobile-menu nav { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.mobile-menu nav a {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  color: var(--stone-warm);
  transition: color 0.2s;
}
.mobile-menu nav a:hover { color: var(--gold); }

/* Header spacer */
.header-spacer { height: var(--nav-h); }
@media (min-width: 768px) { .header-spacer { height: var(--nav-h-md); } }

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: calc(-1 * var(--nav-h));
}
@media (min-width: 768px) {
  .hero { min-height: 85vh; margin-top: calc(-1 * var(--nav-h-md)); }
}
.hero--short { min-height: 40vh; }
@media (min-width: 768px) { .hero--short { min-height: 50vh; } }
.hero__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute; inset: 0;
  background: rgba(28, 25, 23, 0.5);
}
.hero__content {
  position: relative; z-index: 10;
  max-width: 56rem; margin: 0 auto;
  padding: 0 var(--container-px);
  text-align: center;
  color: var(--stone-warm);
}
.hero__content .text-display { margin-bottom: 1.5rem; }
.hero__content .text-subhead {
  color: rgba(250, 250, 248, 0.9);
  max-width: 42rem; margin: 0 auto 2.5rem;
}

/* --- DESTINATION CARD --- */
.dest-card { overflow: hidden; }
.dest-card__img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.dest-card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.dest-card:hover .dest-card__img img { transform: scale(1.05); }
.dest-card__img::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(28, 25, 23, 0.15);
  transition: background 0.3s;
}
.dest-card:hover .dest-card__img::after { background: rgba(28, 25, 23, 0.05); }
.dest-card h3 { margin-top: 1rem; margin-bottom: 0.5rem; }
.dest-card p { color: var(--ink-light); }

/* --- CONTACT FORM --- */
.form { max-width: 42rem; margin: 0 auto; }
.form__row { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .form__row--2col { grid-template-columns: 1fr 1fr; } }
.form__group { display: flex; flex-direction: column; }
.form__group label {
  font-size: 0.875rem; font-weight: 500;
  margin-bottom: 0.5rem;
}
.form__group label .required { color: var(--gold); }
.form__group label .optional { color: var(--ink-light); font-size: 0.75rem; font-weight: 400; }
.form__group input,
.form__group textarea {
  border: 1px solid rgba(107, 101, 96, 0.3);
  background: var(--stone-warm);
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem; /* 16px prevents iOS Safari auto-zoom on focus */
  color: var(--ink);
  border-radius: 0; /* Prevent iOS default rounded inputs */
  -webkit-appearance: none; /* Consistent cross-browser */
  appearance: none;
  transition: border-color 0.2s;
}
.form__group input::placeholder,
.form__group textarea::placeholder { color: rgba(107, 101, 96, 0.5); }
.form__group input:focus,
.form__group textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.form__group textarea { resize: vertical; min-height: 8rem; }
.form__submit { margin-top: 0.5rem; }
.form__success {
  display: none; text-align: center;
  padding: 2rem 0;
}
.form__success.visible { display: block; }
.form__success .text-headline { margin-bottom: 0.75rem; }

/* --- PHASE NUMBER (large faded) --- */
.phase-num {
  font-family: var(--font-serif);
  font-size: var(--text-display);
  line-height: 1.1;
  color: rgba(176, 141, 87, 0.25);
}

/* --- STEP NUMBER (gold) --- */
.step-num {
  font-family: var(--font-serif);
  font-size: var(--text-subhead);
  line-height: 1.3;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* --- FOOTER --- */
.footer { background: var(--ink-deep); color: var(--stone-warm); }
.footer__inner { padding-top: 4rem; }
.footer__grid {
  display: grid; gap: var(--gap);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .footer__grid { grid-template-columns: 1fr 1fr 1fr; } }
.footer__brand p { color: var(--ink-light); font-size: 0.875rem; max-width: 20rem; margin-top: 1rem; line-height: 1.6; }
.footer__nav-title {
  font-size: var(--text-caption); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-light);
  margin-bottom: 1rem; font-weight: 500;
}
.footer__nav-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer__nav-links a { font-size: 0.875rem; color: var(--stone-warm); transition: color 0.2s; }
.footer__nav-links a:hover { color: var(--gold); }
.footer__cta .btn { margin-bottom: 1.5rem; }
.footer__cta p { color: var(--ink-light); font-size: 0.875rem; }
.footer__divider { width: 100%; height: 1px; background: rgba(176, 141, 87, 0.3); margin: 3rem 0; }

/* Partner logo bar */
.footer__partners {
  padding: 2rem 0;
}
.footer__partners-title {
  font-size: var(--text-caption);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.footer__partners-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem 2.5rem;
  opacity: 0.7;
}
.footer__partners-grid img {
  height: 28px;
  width: auto;
  filter: brightness(1.4); /* Lighten SVGs slightly for dark background */
}
@media (min-width: 768px) {
  .footer__partners-grid { gap: 2rem 3rem; }
  .footer__partners-grid img { height: 32px; }
}
@media (max-width: 767px) {
  .footer__partners-grid { gap: 1.5rem 2rem; }
  .footer__partners-grid img { height: 24px; }
}
.footer__bottom {
  display: flex; flex-direction: column; gap: 1rem;
  align-items: center; justify-content: space-between;
  padding-bottom: 2rem; font-size: 0.75rem; color: var(--ink-light);
}
@media (min-width: 768px) { .footer__bottom { flex-direction: row; } }
.footer__bottom a { color: var(--ink-light); transition: color 0.2s; }
.footer__bottom a:hover { color: var(--gold); }

/* --- MOBILE REFINEMENTS --- */

/* Mobile hero: ensure content clears fixed nav */
@media (max-width: 767px) {
  .hero__content { padding-top: 2rem; }
  .hero { min-height: 80vh; } /* Taller on mobile for full-screen feel */

  /* Buttons: full-width on small screens */
  .btn { width: 100%; text-align: center; max-width: 20rem; }

  /* Mobile menu links: generous tap targets */
  .mobile-menu nav a {
    padding: 0.75rem 1rem;
    min-height: 2.75rem;
  }

  /* Phase layout: stack number above content */
  .grid-phase { gap: 0.5rem; }
  .phase-num { font-size: clamp(2rem, 8vw, 3rem); }

  /* Footer: center on mobile */
  .footer__grid { text-align: center; }
  .footer__brand p { margin-left: auto; margin-right: auto; }
  .footer__nav-links { align-items: center; }
}

/* Tablet refinements */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Destination grid: 2-col on tablet already handled by grid-3 */
  /* Nav: tighten gap for 5 links */
  .header__nav { gap: 1.25rem; }
  .header__nav a { font-size: 0.75rem; }
}

/* Ensure images never overflow container */
img { max-width: 100%; height: auto; }

/* Tap target: all interactive elements */
a, button { min-height: 2.75rem; }
.header__nav a { min-height: auto; padding: 0.5rem 0; } /* Nav links: padding provides target */
.footer__nav-links a { padding: 0.25rem 0; }

/* Prevent horizontal scroll on any element */
main, section, .container { max-width: 100%; }

/* --- UTILITY SPACING --- */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.py-0 { padding-top: 0; padding-bottom: 0; }
