/* ==========================================================================
   PALE HORSE COLLECTIVE — Western Gothic Luxury
   ========================================================================== */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Outfit:wght@200;300;400;500;600&display=swap');

/* --- Custom Properties --- */
:root {
  /* Palette — tinted neutrals, no pure black/white */
  --bone:       #e8e0d4;
  --bone-light: #f2ece4;
  --bone-dim:   #c9bfaf;
  --gold:       #b8964e;
  --gold-light: #d4b574;
  --gold-dark:  #8a6f3a;
  --ink:        #0e0c0a;
  --ink-light:  #1a1714;
  --ink-mid:    #2a2520;
  --ink-soft:   #3d3630;
  --charcoal:   #1f1c18;
  --smoke:      #6b6058;
  --blood:      #8b2020;
  --sage:       #4a5a40;

  /* Typography scale — fluid */
  --fs-hero:    clamp(3.2rem, 8vw, 7.5rem);
  --fs-display: clamp(2.4rem, 5vw, 4.5rem);
  --fs-h1:      clamp(2rem, 4vw, 3.5rem);
  --fs-h2:      clamp(1.6rem, 3vw, 2.5rem);
  --fs-h3:      clamp(1.2rem, 2vw, 1.75rem);
  --fs-body:    clamp(0.95rem, 1.2vw, 1.125rem);
  --fs-small:   clamp(0.8rem, 1vw, 0.9rem);
  --fs-caption: clamp(0.7rem, 0.8vw, 0.8rem);

  /* Spacing */
  --sp-xs:  clamp(0.5rem, 1vw, 0.75rem);
  --sp-sm:  clamp(1rem, 2vw, 1.5rem);
  --sp-md:  clamp(2rem, 4vw, 3rem);
  --sp-lg:  clamp(3rem, 6vw, 5rem);
  --sp-xl:  clamp(3.5rem, 7vw, 5.5rem);
  --sp-xxl: clamp(4.5rem, 9vw, 7rem);

  /* Layout */
  --max-width: 1400px;
  --gutter: clamp(1.5rem, 4vw, 3rem);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-fast: 0.2s;
  --duration-med: 0.4s;
  --duration-slow: 0.8s;
  --duration-glacial: 1.2s;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--bone-dim);
  background: var(--ink);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  color: var(--bone);
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.display-text {
  font-family: 'Cinzel', serif;
  font-size: var(--fs-display);
  color: var(--bone);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.serif-accent {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
}

.label {
  font-family: 'Outfit', sans-serif;
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--sp-lg);
}

.section--tight {
  padding-block: var(--sp-lg);
}

/* --- Divider --- */
.divider {
  width: 60px;
  height: 1px;
  background: var(--gold);
  border: none;
  margin-block: var(--sp-xs);
}

.divider--center { margin-inline: auto; }

.divider--wide {
  width: 100%;
  background: var(--ink-mid);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: all var(--duration-med) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

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

.btn--primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--bone);
  border: 1px solid var(--bone-dim);
}

.btn--outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--gold);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gold-dark);
}

.btn--ghost:hover {
  border-color: var(--gold-light);
  color: var(--gold-light);
}

.btn--ghost .arrow {
  display: inline-block;
  transition: transform var(--duration-fast) var(--ease-out-quart);
}

.btn--ghost:hover .arrow {
  transform: translateX(4px);
}

/* --- Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 1.25rem 0;
  transition: background var(--duration-med) var(--ease-out-quart),
              padding var(--duration-med) var(--ease-out-quart);
}

.site-header.scrolled {
  background: rgba(14, 12, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.75rem 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav__logo {
  font-family: 'Cinzel', serif;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 600;
  color: var(--bone);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav__logo span {
  color: var(--gold);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3rem);
}

.nav__link {
  font-size: var(--fs-caption);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: color var(--duration-fast) var(--ease-out-quart);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--duration-med) var(--ease-out-expo);
}

.nav__link:hover,
.nav__link.active {
  color: var(--bone);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.nav__cta {
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--gold);
  padding: 0.6rem 1.5rem;
  transition: all var(--duration-fast) var(--ease-out-quart);
}

.nav__cta:hover {
  background: var(--gold-light);
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 9999;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--bone);
  transition: all var(--duration-med) var(--ease-out-expo);
  transform-origin: center;
}

.nav__toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 5px);
}

.nav__toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -5px);
}

/* Mobile overlay */
.nav__overlay {
  display: none;
}

/* --- Footer --- */
.site-footer {
  background: var(--ink);
  border-top: 1px solid var(--ink-mid);
  padding-block: var(--sp-md) var(--sp-sm);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.footer__brand-name {
  font-family: 'Cinzel', serif;
  font-size: var(--fs-h3);
  color: var(--bone);
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-xs);
}

.footer__brand-name span { color: var(--gold); }

.footer__brand p {
  max-width: 320px;
  color: var(--smoke);
  margin-bottom: var(--sp-sm);
}

.footer__socials {
  display: flex;
  gap: 1rem;
}

.footer__social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink-mid);
  color: var(--bone-dim);
  font-size: 0.85rem;
  transition: all var(--duration-fast) var(--ease-out-quart);
}

.footer__social-link:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.footer__heading {
  font-family: 'Outfit', sans-serif;
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-sm);
}

.footer__link {
  display: block;
  color: var(--smoke);
  margin-bottom: 0.6rem;
  font-size: var(--fs-small);
  transition: color var(--duration-fast) var(--ease-out-quart);
}

.footer__link:hover { color: var(--bone); }

.footer__contact-item {
  color: var(--smoke);
  font-size: var(--fs-small);
  margin-bottom: 0.6rem;
}

.footer__contact-item strong {
  color: var(--bone-dim);
  font-weight: 400;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-md);
  border-top: 1px solid var(--ink-mid);
  font-size: var(--fs-caption);
  color: var(--smoke);
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}

.stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.5s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.6s; }
.stagger.visible > *:nth-child(8) { transition-delay: 0.7s; }

/* --- Image treatment --- */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-grayscale {
  filter: grayscale(40%) contrast(1.1);
  transition: filter var(--duration-slow) var(--ease-out-expo);
}

.img-grayscale:hover {
  filter: grayscale(0%) contrast(1);
}

/* --- Gold line accent --- */
.gold-line {
  position: relative;
}

.gold-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
}

/* --- Texture overlay --- */
.texture-overlay {
  position: relative;
}

.texture-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
  pointer-events: none;
  z-index: 1;
}

/* --- Lightbox (global) --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(14, 12, 10, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-med) var(--ease-out-expo);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--bone-dim);
  border: 1px solid var(--ink-mid);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-quart);
  z-index: 1;
}

.lightbox__close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

/* --- Back to top button --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-light);
  border: 1px solid var(--ink-mid);
  color: var(--bone-dim);
  font-size: 1.2rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all var(--duration-med) var(--ease-out-expo);
  cursor: pointer;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

/* --- Form styles (global) --- */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: var(--ink-light);
  border: 1px solid var(--ink-mid);
  color: var(--bone);
  font-family: 'Outfit', sans-serif;
  font-size: var(--fs-small);
  font-weight: 300;
  transition: border-color var(--duration-fast) var(--ease-out-quart),
              box-shadow var(--duration-fast) var(--ease-out-quart);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(184, 150, 78, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--smoke);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6058' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-select option {
  background: var(--ink-light);
  color: var(--bone);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-label {
  display: block;
  font-size: var(--fs-caption);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 0.4rem;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-md);
  }
}

@media (max-width: 768px) {
  .nav__links,
  .nav__cta-wrap { display: none; }

  .nav__toggle { display: flex; }

  .nav__overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ink);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding-bottom: 4rem;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-med) var(--ease-out-expo);
  }

  .nav__overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav__overlay a {
    font-family: 'Cinzel', serif;
    font-size: var(--fs-h3);
    color: var(--bone);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--duration-med) var(--ease-out-expo),
                transform var(--duration-med) var(--ease-out-expo),
                color var(--duration-fast) var(--ease-out-quart);
  }

  .nav__overlay.open a {
    opacity: 1;
    transform: translateY(0);
  }

  .nav__overlay.open a:nth-child(1) { transition-delay: 0.05s; }
  .nav__overlay.open a:nth-child(2) { transition-delay: 0.1s; }
  .nav__overlay.open a:nth-child(3) { transition-delay: 0.15s; }
  .nav__overlay.open a:nth-child(4) { transition-delay: 0.2s; }
  .nav__overlay.open a:nth-child(5) { transition-delay: 0.25s; }
  .nav__overlay.open a:nth-child(6) { transition-delay: 0.3s; }
  .nav__overlay.open a:nth-child(7) { transition-delay: 0.35s; }
  .nav__overlay.open a:nth-child(8) { transition-delay: 0.4s; }

  .nav__overlay a:hover { color: var(--gold); }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-md) var(--sp-sm);
  }

  .footer__brand,
  .footer__grid > div:last-child {
    grid-column: 1 / -1;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* Touch targets — enforce 44px minimum */
  .nav__toggle {
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .footer__social-link {
    width: 44px;
    height: 44px;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
  }

  /* Fix iOS auto-zoom on form inputs (font-size must be >= 16px) */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
  }

  /* Buttons — ensure touch-friendly sizing */
  .btn {
    padding: 0.9rem 2rem;
    min-height: 44px;
  }

  .btn--ghost {
    padding: 0.7rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal, .reveal-left, .reveal-right,
  .stagger > * {
    opacity: 1;
    transform: none;
  }
}
