/* ============================================================
   PRELUDE PAINTING — Base
   Reset · Root typography · Utility classes · Animations
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--warm-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol { list-style: none; }

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* ── Page wrapper (accounts for sticky nav) ── */
.page-wrapper {
  padding-top: calc(var(--nav-height) + var(--topbar-height));
}

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

/* ── Section spacing ── */
.section {
  padding-block: var(--space-28);
}
.section--sm  { padding-block: var(--space-20); }
.section--lg  { padding-block: clamp(80px, 10vw, 140px); }

/* ── Section labels & headings ── */
.label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-4);
}

.label::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

.heading-display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.1;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.heading-display em {
  font-style: italic;
  color: var(--gold);
}

.h1 { font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl)); }
.h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
.h3 { font-size: clamp(var(--text-xl),  3vw, var(--text-3xl)); }
.h4 { font-size: clamp(var(--text-lg),  2vw, var(--text-2xl)); }

.body-lead {
  font-size: clamp(var(--text-base), 1.5vw, var(--text-md));
  line-height: 1.8;
  color: var(--text-light);
  font-weight: 300;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--duration-fast) var(--ease),
              box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.98); }

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke-width: 2;
}

/* Primary */
.btn--primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn--primary:hover {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
  box-shadow: 0 6px 24px rgba(201, 169, 110, 0.35);
}

/* Gold */
.btn--gold {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn--gold:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* Outline dark */
.btn--outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn--outline:hover {
  background: var(--navy);
  color: #fff;
}

/* Outline light (on dark backgrounds) */
.btn--outline-light {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.35);
}
.btn--outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--gold);
  border-color: transparent;
  padding-inline: 0;
}
.btn--ghost:hover { color: var(--gold-dark); }

/* Sizes */
.btn--sm { padding: 10px 22px; font-size: 10px; }
.btn--lg { padding: 18px 44px; font-size: var(--text-xs); letter-spacing: 0.18em; }
.btn--full { width: 100%; }

/* ── Form elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-light);
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  background: var(--warm-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--text-base);
  font-weight: 300;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}

.form-control--textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.65;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 40px;
}

/* ── Page Hero (inner pages) ── */
.page-hero {
  background: var(--navy);
  padding: var(--space-20) 0;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,169,110,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.page-hero__label { color: var(--gold); }

.page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl));
  font-weight: 300;
  color: #fff;
  line-height: 1.1;
  margin-top: var(--space-3);
}

.page-hero__title em { font-style: italic; color: var(--gold); }

.page-hero__sub {
  color: rgba(255, 255, 255, 0.6);
  max-width: 580px;
  margin-top: var(--space-4);
  font-size: var(--text-md);
  font-weight: 300;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-6);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.breadcrumb a { color: rgba(255,255,255,0.5); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { color: var(--gold); }

/* ── Divider ── */
.divider {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin-block: var(--space-6);
}

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

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}
.badge--gold { background: rgba(201,169,110,0.15); color: var(--gold-dark); }
.badge--navy { background: rgba(28,43,74,0.08); color: var(--navy); }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--left  { transform: translateX(-28px); }
.reveal--right { transform: translateX(28px); }
.reveal--left.visible,
.reveal--right.visible { transform: translateX(0); }

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }

/* ── Aspect ratios ── */
.aspect-square    { aspect-ratio: 1 / 1; }
.aspect-4-3       { aspect-ratio: 4 / 3; }
.aspect-16-9      { aspect-ratio: 16 / 9; }
.aspect-3-4       { aspect-ratio: 3 / 4; }
.aspect-4-5       { aspect-ratio: 4 / 5; }

/* ── Overlay ── */
.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.overlay--bottom {
  background: linear-gradient(to top,
    rgba(28,43,74,0.9) 0%,
    rgba(28,43,74,0.4) 40%,
    transparent 100%
  );
}
.overlay--dark { background: rgba(28,43,74,0.45); }
.overlay--subtle { background: rgba(28,43,74,0.20); }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Loading spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-inline: auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notification ── */
.toast {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--navy);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 400;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  transition: transform 0.4s var(--ease-spring);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast--success { border-left: 3px solid #4ade80; }
.toast--error   { border-left: 3px solid #f87171; }

/* ── Back to top ── */
#back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 44px;
  height: 44px;
  background: var(--warm-white);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-above);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), background var(--transition),
              border-color var(--transition), transform var(--duration-fast) var(--ease);
  box-shadow: var(--shadow-sm);
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
#back-to-top:hover {
  background: var(--gold);
  border-color: var(--gold);
  transform: translateY(-2px);
}
#back-to-top svg { width: 18px; height: 18px; color: var(--navy); stroke-width: 2; }

/* ── Responsive helpers ── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .section { padding-block: var(--space-20); }
  .section--lg { padding-block: var(--space-20); }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
