/* ===========================================================
   M.Y. Equestrian — spec preview
   Design system — brand-matched to the navy + wine logo
   =========================================================== */

:root {
  /* Brand — taken from the actual logo (navy charcoal + wine) */
  --navy-900: #13171f;   /* deepest dark sections / contact */
  --navy-800: #1b212c;   /* services */
  --navy-700: #252d3a;
  --navy-600: #36404f;
  --wine:     #8e2a44;   /* accent, matched to logo wordmark */
  --wine-700: #6c2034;
  --wine-400: #ab465f;
  --cream:    #f4eee3;
  --cream-200:#ece2d0;
  --sand:     #d8c6a8;   /* warm light accent on dark */
  --ink:      #1c2129;   /* body text on light */
  --ink-soft: #3c4149;
  --paper:    #faf6ef;   /* light page bg */
  --muted:    #6d6a61;
  --line:     rgba(27, 33, 44, 0.13);

  /* Type */
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Fluid scale */
  --step--1: clamp(0.8rem, 0.77rem + 0.15vw, 0.88rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1:  clamp(1.18rem, 1.1rem + 0.4vw, 1.42rem);
  --step-2:  clamp(1.5rem, 1.34rem + 0.8vw, 2rem);
  --step-3:  clamp(2rem, 1.66rem + 1.6vw, 3.05rem);
  --step-4:  clamp(2.6rem, 2.05rem + 2.7vw, 4.6rem);
  --step-5:  clamp(2.25rem, 1.4rem + 3.7vw, 4.5rem);

  /* Space */
  --space-section: clamp(4.5rem, 3rem + 6.5vw, 9.5rem);
  --container: 1240px;
  --gutter: clamp(1.25rem, 0.5rem + 3.4vw, 4.5rem);

  --radius: 3px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.68;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--navy-800); color: var(--cream);
  padding: 0.75rem 1.25rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--wine-400);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Shared bits ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.85rem;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--wine);
  margin: 0 0 1.3rem;
}
.eyebrow::before {
  content: ""; width: clamp(1.4rem, 3vw, 2.4rem); height: 1.5px;
  background: currentColor; opacity: 0.75; flex: none;
}
.eyebrow--light { color: var(--sand); }

.section-title {
  font-size: var(--step-3);
  max-width: 17ch;
  color: var(--navy-900);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: 0.01em;
  padding: 0.95rem 2rem;
  border-radius: 100px;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.4s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s var(--ease);
  will-change: transform;
}
.btn--solid { background: var(--wine); color: #fff; box-shadow: 0 12px 30px -14px rgba(142,42,68,0.85); }
.btn--solid:hover { background: var(--wine-700); transform: translateY(-3px); box-shadow: 0 20px 40px -16px rgba(142,42,68,0.9); }
.btn--ghost { border-color: rgba(244,238,227,0.5); color: var(--cream); }
.btn--ghost:hover { background: rgba(244,238,227,0.1); border-color: rgba(244,238,227,0.85); transform: translateY(-3px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600;
  text-decoration: none;
  color: var(--wine);
  letter-spacing: 0.01em;
  padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.3s var(--ease), gap 0.3s var(--ease);
}
.link-arrow span { transition: transform 0.3s var(--ease); }
.link-arrow:hover { border-color: var(--wine-400); gap: 0.75rem; }
.link-arrow:hover span { transform: translateX(4px); }

/* ===========================================================
   Header
   =========================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.header-inner {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(0.85rem, 0.5rem + 1vw, 1.35rem) var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.brand { display: inline-flex; }
.brand-mark {
  width: auto; height: clamp(42px, 5vw, 56px);
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,0.35));
  transition: filter 0.4s var(--ease);
}
.nav { display: none; gap: clamp(1rem, 2vw, 2.3rem); }
.nav a {
  font-family: var(--sans); font-weight: 600; font-size: var(--step--1);
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; color: var(--cream);
  position: relative; padding: 0.3rem 0;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
  transition: color 0.3s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--wine-400); transition: width 0.35s var(--ease);
}
.nav a:hover::after, .nav a:focus-visible::after { width: 100%; }

.nav-cta {
  display: inline-flex; flex-direction: column; align-items: flex-end;
  text-decoration: none; color: var(--cream); line-height: 1.15;
  border-left: 1px solid rgba(244,238,227,0.3); padding-left: 1.25rem;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
  transition: color 0.3s var(--ease);
}
.nav-cta-label { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sand); font-weight: 600; }
.nav-cta-num { font-family: var(--serif); font-size: var(--step-1); letter-spacing: 0.01em; }
.nav-cta:hover { color: #fff; }
.nav-cta:hover .nav-cta-num { color: var(--wine-400); }

/* Scrolled state */
.site-header.is-scrolled {
  background: rgba(250, 246, 239, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line), 0 14px 30px -28px rgba(19,23,31,0.5);
}
.site-header.is-scrolled .brand-mark { filter: none; }
.site-header.is-scrolled .nav a,
.site-header.is-scrolled .nav-cta { color: var(--navy-800); text-shadow: none; }
.site-header.is-scrolled .nav-cta-label { color: var(--muted); }
.site-header.is-scrolled .nav-cta { border-color: var(--line); }
.site-header.is-scrolled .nav-cta:hover .nav-cta-num { color: var(--wine); }

@media (max-width: 479px) {
  .nav-cta { padding-left: 0; border-left: none; }
  .nav-cta-label { font-size: 0.58rem; letter-spacing: 0.18em; }
  .nav-cta-num { font-size: 1.08rem; }
}

@media (min-width: 920px) {
  .nav { display: flex; }
}

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  position: relative;
  min-height: clamp(580px, 92svh, 884px);
  display: grid;
  align-items: end;
  padding: clamp(7rem, 13vh, 10rem) var(--gutter) clamp(2.75rem, 6vh, 4.75rem);
  isolation: isolate;
  color: var(--cream);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 38%;
  animation: heroZoom 14s var(--ease) forwards;
}
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .hero-media img { animation: none; } }

.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(130% 105% at 0% 102%, rgba(11,14,20,0.95) 0%, rgba(11,14,20,0.46) 42%, rgba(11,14,20,0) 72%),
    linear-gradient(90deg, rgba(11,14,20,0.6) 0%, rgba(11,14,20,0.18) 38%, rgba(11,14,20,0) 62%),
    linear-gradient(180deg, rgba(11,14,20,0.58) 0%, rgba(11,14,20,0.04) 22%, rgba(11,14,20,0.08) 48%, rgba(11,14,20,0.78) 100%);
}
.hero-scrim::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 200px 40px rgba(13,16,22,0.4);
}
.hero-inner { max-width: var(--container); margin: 0 auto; width: 100%; }
.hero-content { max-width: 60rem; position: relative; }
.hero-content .eyebrow--light {
  color: #fff;
  text-shadow: 0 1px 14px rgba(0,0,0,0.55);
}
.hero-content .eyebrow--light::before { background: var(--sand); opacity: 1; }
.hero-title {
  font-size: var(--step-5);
  letter-spacing: -0.028em;
  text-shadow: 0 2px 36px rgba(0,0,0,0.42);
  margin-bottom: 1.6rem;
}
/* each sentence is its own line at every width (no run-together, no clipping) */
.hero-title .hl { display: block; text-wrap: balance; }
.hero-title .hl + .hl { margin-top: 0.06em; }
@media (min-width: 720px) {
  .hero-content {
    padding-left: clamp(1.4rem, 2.4vw, 2.4rem);
  }
  .hero-content::before {
    content: ""; position: absolute; left: 0; top: 0.55rem; bottom: 0.4rem;
    width: 2px; border-radius: 2px;
    background: linear-gradient(180deg, var(--wine-400) 0%, rgba(171,70,95,0.85) 38%, rgba(171,70,95,0) 100%);
  }
}
.hero-sub {
  font-size: var(--step-1);
  max-width: 46ch;
  color: rgba(244,238,227,0.94);
  margin: 0 0 2.3rem;
  font-weight: 400;
  text-shadow: 0 1px 18px rgba(0,0,0,0.4);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-credential {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(3rem, 7vh, 5.5rem);
  max-width: 290px;
  background: rgba(15, 19, 26, 0.66);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(244,238,227,0.16);
  border-left: 3px solid var(--wine-400);
  box-shadow: 0 24px 50px -28px rgba(0,0,0,0.85);
  padding: 1.35rem 1.45rem;
  border-radius: var(--radius);
  font-size: var(--step--1);
  line-height: 1.55;
  color: rgba(244,238,227,0.92);
  display: none;
}
.hero-credential-tag {
  display: block; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.66rem; color: var(--sand); margin-bottom: 0.55rem;
}
.hero-credential p { margin: 0; }
@media (min-width: 1080px) { .hero-credential { display: block; } }

.hero-scroll {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: clamp(1.1rem, 2.4vh, 1.9rem);
  display: none;
  flex-direction: column; align-items: center; gap: 0.55rem;
  text-decoration: none; color: rgba(244,238,227,0.78);
  transition: color 0.3s var(--ease);
}
.hero-scroll-label {
  font-family: var(--sans); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.32em; text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}
.hero-scroll-line {
  width: 1px; height: 42px; overflow: hidden; position: relative;
  background: rgba(244,238,227,0.28);
}
.hero-scroll-line::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 42%;
  background: var(--sand);
  animation: scrollPulse 2.4s var(--ease) infinite;
}
.hero-scroll:hover { color: #fff; }
@keyframes scrollPulse {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(240%); }
}
@media (min-width: 1080px) { .hero-scroll { display: flex; } }
@media (prefers-reduced-motion: reduce) { .hero-scroll-line::after { animation: none; top: auto; bottom: 0; } }

/* ===========================================================
   Discipline strip
   =========================================================== */
.strip { background: var(--navy-900); color: var(--cream); border-top: 2px solid var(--wine); }
.strip-inner {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(1.8rem, 1rem + 2.2vw, 2.9rem) var(--gutter);
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.7rem 1rem;
}
.strip-item { display: flex; flex-direction: column; gap: 0.4rem; position: relative; }
.strip-k { font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sand); font-weight: 600; }
.strip-v { font-family: var(--serif); font-size: var(--step-1); color: var(--cream); }
@media (min-width: 760px) {
  .strip-inner { grid-template-columns: repeat(4, 1fr); }
  .strip-item + .strip-item::before {
    content: ""; position: absolute; left: -0.5rem; top: 0.15rem; bottom: 0.15rem;
    width: 1px; background: rgba(244,238,227,0.16);
  }
}

/* ===========================================================
   About
   =========================================================== */
.about { padding: var(--space-section) var(--gutter); max-width: var(--container); margin: 0 auto; }
.about-grid {
  display: grid; gap: clamp(2.5rem, 5vw, 5.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}
.about-photos { position: relative; }
.about-photo { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 34px 70px -44px rgba(19,23,31,0.7); }
.about-photo--main img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; }
.about-photo--inset {
  display: none;
  position: absolute; right: -1.75rem; bottom: -2.25rem; width: 54%;
  border: 7px solid var(--paper);
  box-shadow: 0 30px 60px -34px rgba(19,23,31,0.65);
}
.about-photo--inset img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.about-body p { color: var(--ink-soft); max-width: 56ch; }
.cred-list { list-style: none; margin: 2.2rem 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.cred-list li {
  display: flex; align-items: baseline; gap: 1.2rem;
  padding: 1.05rem 0; border-bottom: 1px solid var(--line);
  font-size: var(--step--1); color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase;
}
.cred-list span {
  font-family: var(--serif); font-size: var(--step-2); color: var(--wine);
  min-width: 2.4em; line-height: 1; letter-spacing: -0.01em; text-transform: none;
}
@media (min-width: 880px) {
  .about-grid { grid-template-columns: 0.9fr 1.1fr; }
  .about-photo--inset { display: block; }
}

/* ===========================================================
   Services
   =========================================================== */
.services { background: var(--navy-800); color: var(--cream); padding: var(--space-section) 0; }
.services-head { max-width: var(--container); margin: 0 auto clamp(2.5rem, 4vw, 4rem); padding: 0 var(--gutter); }
.services-head .eyebrow { color: var(--sand); }
.services-head .section-title { color: var(--cream); max-width: 20ch; }

.svc {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4.5rem) var(--gutter);
  display: grid; gap: clamp(2rem, 4vw, 4.5rem);
  grid-template-columns: 1fr;
  align-items: center;
  border-top: 1px solid rgba(244,238,227,0.14);
}
.svc-media { border-radius: var(--radius); overflow: hidden; box-shadow: 0 34px 70px -46px rgba(0,0,0,0.85); }
.svc-media img {
  width: 100%; aspect-ratio: 11 / 8; object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.svc:hover .svc-media img { transform: scale(1.05); }
.svc-text { position: relative; }
.svc-index {
  font-family: var(--serif); font-size: clamp(3rem, 6vw, 5rem); line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--wine-400);
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
  opacity: 0.85;
}
.svc-title { font-size: var(--step-3); color: var(--cream); margin-bottom: 0.9rem; }
.svc-text p { color: rgba(244,238,227,0.82); max-width: 48ch; }
.svc-text .link-arrow { color: var(--sand); margin-top: 0.9rem; }
.svc-text .link-arrow:hover { border-color: var(--wine-400); color: var(--cream); }

@media (min-width: 860px) {
  .svc { grid-template-columns: 1.05fr 0.95fr; }
  .svc--flip .svc-media { order: 2; }
}

/* ===========================================================
   Gallery
   =========================================================== */
.gallery { padding: var(--space-section) var(--gutter); max-width: var(--container); margin: 0 auto; }
.gallery-head { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.6rem, 1.4vw, 1.15rem);
  grid-auto-flow: dense;
}
.g { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--cream-200); position: relative; }
.g img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.g:hover img { transform: scale(1.06); }
.g--tall { grid-row: span 2; }
.g--wide { grid-column: span 2; }
@media (min-width: 760px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; }
  .g img { aspect-ratio: auto; }
  .g--tall { grid-row: span 2; }
  .g--wide { grid-column: span 2; }
}
@media (max-width: 759px) {
  .g { aspect-ratio: 4/3; }
  .g--tall { aspect-ratio: 3/4; grid-row: auto; }
  .g--wide { grid-column: span 2; aspect-ratio: 16/9; }
}

/* ===========================================================
   Contact
   =========================================================== */
.contact { background: var(--navy-900); color: var(--cream); padding: var(--space-section) var(--gutter); }
.contact-grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; gap: clamp(2.5rem, 5vw, 5rem);
  grid-template-columns: 1fr; align-items: center;
}
.contact-title { color: var(--cream); max-width: 14ch; }
.contact-lead { color: rgba(244,238,227,0.85); max-width: 44ch; font-size: var(--step-1); margin: 0 0 2rem; }
.contact-actions { margin-bottom: 2.5rem; }
.contact-meta { display: grid; gap: 1.25rem; margin: 0; border-top: 1px solid rgba(244,238,227,0.18); padding-top: 1.85rem; }
.contact-meta div { display: grid; gap: 0.25rem; }
.contact-meta dt { font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sand); font-weight: 600; }
.contact-meta dd { margin: 0; font-family: var(--serif); font-size: var(--step-1); color: var(--cream); }
.contact-meta a { color: var(--cream); text-decoration: none; transition: color 0.3s var(--ease); }
.contact-meta a:hover { color: var(--wine-400); }
.contact-photo { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 36px 80px -42px rgba(0,0,0,0.8); }
.contact-photo img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center 22%; }
@media (min-width: 880px) {
  .contact-grid { grid-template-columns: 1.1fr 0.9fr; }
  .contact-meta { grid-template-columns: repeat(2, 1fr); }
  .contact-meta div:first-child { grid-column: 1 / -1; }
}

/* ===========================================================
   Footers
   =========================================================== */
.site-footer { background: var(--navy-900); color: var(--cream); padding: clamp(3rem, 5vw, 4.5rem) var(--gutter); border-top: 1px solid rgba(244,238,227,0.1); }
.site-footer-inner { max-width: var(--container); margin: 0 auto; text-align: center; display: grid; gap: 0.95rem; justify-items: center; }
.footer-mark { height: 56px; width: auto; filter: brightness(0) invert(1); opacity: 0.92; }
.footer-tag { font-family: var(--serif); font-size: var(--step-1); letter-spacing: 0.05em; margin: 0; color: var(--cream); }
.footer-area { font-size: var(--step--1); color: var(--sand); margin: 0; letter-spacing: 0.04em; }
.footer-area a { color: var(--sand); text-decoration: none; }
.footer-area a:hover { color: var(--wine-400); }

.spec-footer {
  background: #0c0f14; color: #8d9280;
  font-family: var(--sans); font-size: 0.8rem; line-height: 1.6;
  text-align: center; padding: 1.45rem var(--gutter);
}
.spec-footer a { color: var(--wine-400); }

/* ===========================================================
   Motion / reveals
   =========================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* stagger hero children */
.hero .reveal { transition-delay: 0.05s; }
.hero-sub.reveal { transition-delay: 0.46s; }
.hero-actions.reveal { transition-delay: 0.58s; }
.hero-credential.reveal { transition-delay: 0.72s; }

/* hero headline rises line-by-line rather than as one block */
.js .hero-title.reveal { opacity: 1; transform: none; transition: none; }
.js .hero-title .hl {
  opacity: 0;
  transform: translateY(0.62em);
  transition: opacity 0.8s var(--ease), transform 0.85s var(--ease);
  will-change: opacity, transform;
}
.js .hero-title.is-in .hl { opacity: 1; transform: none; }
.js .hero-title.is-in .hl:nth-child(1) { transition-delay: 0.16s; }
.js .hero-title.is-in .hl:nth-child(2) { transition-delay: 0.28s; }
.js .hero-title.is-in .hl:nth-child(3) { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .hero-title .hl { opacity: 1 !important; transform: none !important; transition: none !important; }
  .svc:hover .svc-media img, .g:hover img { transform: none; }
  .btn, .link-arrow span { transition: none; }
}
