/* =====================================================
   Saddlehorn Systems — Premium Stylesheet
   ===================================================== */

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

:root {
  /* Palette */
  --navy-deep:    #060d1a;
  --navy:         #0b1629;
  --navy-light:   #122035;
  --navy-mid:     #0f1b30;

  --gold:         #c9a84c;
  --gold-light:   #e8c97a;
  --gold-dark:    #9a7d35;
  --gold-dim:     rgba(201, 168, 76, 0.12);
  --gold-border:  rgba(201, 168, 76, 0.25);

  --white:        #ffffff;
  --cream:        #f8f5f0;
  --cream-dark:   #f0ebe3;

  --text-body:    #3a4455;
  --text-muted:   #7a8898;
  --text-light:   #a8baca;
  --text-on-dark: #c8d8e8;
  --border:       #e4ddd4;

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

  /* Layout */
  --max-width: 1140px;
  --radius:    4px;
  --radius-lg: 8px;
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-body);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* =====================================================
   TYPOGRAPHY UTILITIES
   ===================================================== */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: block;
}
.eyebrow-dark { color: var(--gold-dark); }
.eyebrow-gold { color: var(--gold-light); }

.section-header {
  margin-bottom: 3.5rem;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy-deep);
}

.section-sub {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  text-decoration: none;
}

.btn-gold {
  background: var(--gold);
  color: var(--navy-deep);
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--navy-deep);
  box-shadow: 0 4px 20px rgba(201,168,76,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(255,255,255,0.2);
}
.btn-ghost:hover {
  border-color: var(--gold-border);
  color: var(--gold-light);
  background: rgba(201,168,76,0.06);
}

.btn-gold-outline {
  background: transparent;
  color: var(--gold-light);
  border-color: var(--gold-border);
  margin-top: 2rem;
}
.btn-gold-outline:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* =====================================================
   HEADER / NAV
   ===================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  /* Account for Dynamic Island / notch safe area */
  padding: max(1.25rem, env(safe-area-inset-top)) 0 1.25rem;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
              padding 0.3s var(--ease), box-shadow 0.4s var(--ease);
}

.site-header.scrolled {
  background: rgba(6, 13, 26, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: max(0.85rem, env(safe-area-inset-top)) 0 0.85rem;
  box-shadow: 0 1px 0 rgba(201,168,76,0.15), 0 8px 32px rgba(0,0,0,0.4);
}

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

.logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.04em;
  text-decoration: none;
}
.logo-accent {
  color: var(--gold);
  font-weight: 400;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  position: relative;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 100%;
  height: 1px;
  background: var(--gold);
  transition: right 0.3s var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--gold-light); }
.nav-links a:hover::after,
.nav-links a.active::after { right: 0; }

.nav-links a.nav-cta {
  background: var(--gold-dim);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 0.45rem 1.1rem;
  color: var(--gold-light);
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.nav-links a.nav-cta::after { display: none; }
.nav-links a.nav-cta:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 10;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh; /* iOS: excludes browser chrome for a true full-screen hero */
  display: flex;
  align-items: center;
  background: var(--navy-deep);
  overflow: hidden;
}

/* Subtle grid overlay with slow drift */
.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  animation: gridDrift 30s linear infinite;
  will-change: background-position;
}
@keyframes gridDrift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 64px 64px, 64px 64px; }
}

/* Radial glow */
.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -5%;
  width: 70%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(201,168,76,0.055) 0%, transparent 65%);
  pointer-events: none;
}

/* Bottom gradient fade */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, rgba(6,13,26,0.6));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 8rem 0 6rem;
  max-width: 780px;
}

.hero-content .eyebrow { margin-bottom: 1.5rem; }

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--gold-light);
}

.hero-sub {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-light);
  line-height: 1.75;
  max-width: 540px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Scroll hint pulse */
.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  justify-content: center;
}
.hero-scroll-hint span {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--gold));
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* =====================================================
   SECTORS BAR
   ===================================================== */
.sectors-bar {
  background: var(--navy-mid);
  border-top: 1px solid rgba(201,168,76,0.15);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  padding: 3.5rem 0;
}

.sectors-grid {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.sector {
  flex: 1;
  padding: 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.sector:first-child { padding-left: 0; }
.sector:last-child  { padding-right: 0; }

.sector-icon {
  width: 36px;
  height: 36px;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.sector h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.25;
}

.sector p {
  font-size: 0.83rem;
  color: var(--text-light);
  line-height: 1.75;
  opacity: 0.85;
}

.sector-divider {
  width: 1px;
  background: rgba(201,168,76,0.18);
  flex-shrink: 0;
  margin: 0.5rem 0;
}

/* =====================================================
   SECTIONS
   ===================================================== */
.section { padding: 6rem 0; }
.section-light { background: var(--cream); }
.section-dark  { background: var(--navy-deep); color: var(--text-on-dark); }

/* =====================================================
   SERVICE CARDS
   ===================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-top-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
              transform 0.3s var(--ease);
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,168,76,0.03) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover {
  border-top-color: var(--gold);
  box-shadow: 0 12px 40px rgba(0,0,0,0.09);
  transform: translateY(-4px);
}
.card:hover::before { opacity: 1; }

.card-number {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gold);
  opacity: 0.7;
}

.card-icon {
  width: 42px;
  height: 42px;
  color: var(--navy);
  margin: 0.25rem 0;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy-deep);
  line-height: 1.2;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.card-arrow {
  font-size: 1rem;
  color: var(--gold);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
  margin-top: 0.25rem;
  display: inline-block;
}
.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

.card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  border-radius: var(--radius-lg);
}
.card-link .card { width: 100%; }

/* =====================================================
   ABOUT
   ===================================================== */
.about-wrap {
  max-width: 720px;
}

.about-wrap h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 1.25rem;
}

.about-wrap p {
  font-size: 0.98rem;
  color: var(--text-on-dark);
  line-height: 1.85;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.about-wrap .btn-gold-outline {
  margin-top: 1rem;
}

/* =====================================================
   CONTACT
   ===================================================== */
.contact-wrap { max-width: 720px; margin: 0 auto; }

.contact-wrap .section-header { text-align: center; }
.contact-wrap .section-header h2 { color: var(--navy-deep); }
.contact-wrap .section-sub { margin: 0.75rem auto 2.5rem; text-align: center; max-width: 100%; }

.contact-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem 1rem;
  min-height: 44px; /* iOS minimum tap target */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-body);
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.contact-form textarea { resize: vertical; min-height: 130px; }

.contact-form .btn-gold { align-self: flex-start; }

.form-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.02em;
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  background: var(--navy-deep);
  border-top: 1px solid rgba(201,168,76,0.15);
  padding: 2.75rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.03em;
}
.footer-tagline {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.2rem;
  opacity: 0.75;
}

.footer-nav {
  display: flex;
  gap: 2rem;
  justify-content: center;
}
.footer-nav a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--gold-light); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.5;
}

/* =====================================================
   SKIP LINK
   ===================================================== */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 300;
  padding: 0.75rem 1.5rem;
  background: var(--gold);
  color: var(--navy-deep);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* =====================================================
   SCROLL PROGRESS BAR
   ===================================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 250;
  pointer-events: none;
}

/* =====================================================
   HONEYPOT
   ===================================================== */
.contact-form .honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  min-height: 0;
  overflow: hidden;
}

/* =====================================================
   FORM SUCCESS
   ===================================================== */
.form-success {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}
.form-success-icon {
  width: 56px;
  height: 56px;
  color: var(--gold);
  margin: 0 auto 1.5rem;
}
.form-success h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy-deep);
  margin-bottom: 0.5rem;
}
.form-success p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.form-success .btn-gold-outline {
  margin-top: 0;
}

/* =====================================================
   FORM VALIDATION
   ===================================================== */
.field-error {
  font-size: 0.75rem;
  color: #c94c4c;
  margin-top: 0.25rem;
  display: none;
}
.field-error.visible {
  display: block;
}
.contact-form input.invalid,
.contact-form textarea.invalid {
  border-color: #c94c4c;
  box-shadow: 0 0 0 3px rgba(201, 76, 76, 0.08);
}

/* =====================================================
   BACK TO TOP
   ===================================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--gold-border);
  border-radius: 50%;
  background: var(--navy-deep);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
}
.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* =====================================================
   SCROLL ANIMATIONS
   ===================================================== */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-animate].visible {
  opacity: 1;
  transform: none;
}
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* ----- Tablet: 900px and below ----- */
@media (max-width: 900px) {
  .section { padding: 4.5rem 0; }

  /* 2-column cards on tablet — more comfortable than 3, less sparse than 1 */
  .cards { grid-template-columns: repeat(2, 1fr); }

  /* Sectors: 2-column grid on tablet */
  .sectors-bar { padding: 2.5rem 0; }
  .sectors-grid { flex-wrap: wrap; gap: 0; }
  .sector { flex: 1 1 calc(50% - 1px); padding: 1.5rem; }
  .sector:first-child { padding-left: 0; }
  .sector:last-child  { padding-right: 0; }
  .sector-divider:first-of-type { width: 1px; height: auto; margin: 0.5rem 0; }
  .sector-divider:last-of-type  { display: none; }

  /* Footer stack */
  .footer-inner { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
  .footer-copy { text-align: center; }
  .footer-nav { justify-content: center; }
}

/* ----- Mobile nav + phone layout: 768px and below ----- */
@media (max-width: 768px) {
  /* Hamburger nav */
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6,13,26,0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: 2rem;
    /* Push content below the safe area / Dynamic Island */
    padding-top: max(2rem, env(safe-area-inset-top));
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.1rem; color: var(--white); }
  .nav-links a.nav-cta { font-size: 1.1rem; padding: 0.75rem 2rem; }

  /* Hero */
  .hero-content { padding: 7rem 0 4rem; }
  .hero h1 { font-size: clamp(2.2rem, 7vw, 3rem); }
  .hero-sub { font-size: 0.98rem; }

  /* Sectors: fully stacked on phone */
  .sectors-bar { padding: 2.5rem 0; }
  .sectors-grid { flex-direction: column; gap: 0; flex-wrap: nowrap; }
  .sector { flex: none; width: 100%; padding: 1.5rem 0; }
  .sector:first-child { padding-left: 0; }
  .sector:last-child  { padding-right: 0; }
  .sector-divider { display: block; width: 100%; height: 1px; margin: 0; }

  /* Form */
  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 1.5rem; }
}

/* ----- Small phones: 600px and below ----- */
@media (max-width: 600px) {
  /* Cards drop to 1 column */
  .cards { grid-template-columns: 1fr; }
}

/* ----- iPhone-sized: 480px and below ----- */
@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }

  .hero-content { padding: 6rem 0 4rem; }
  .hero h1 { font-size: 2rem; line-height: 1.15; }
  .hero-sub { font-size: 0.93rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; }

  .section { padding: 3.5rem 0; }
  .sectors-bar { padding: 2rem 0; }
  .contact-form { padding: 1.25rem; }
}
