/* =================================================================
   Professional Compass - custom styles
   Companion to Tailwind v4 Browser CDN.

   Design tokens live in each page's <style type="text/tailwindcss">
   @theme block so Tailwind utilities (bg-brand-500, text-cream-50,
   font-display, etc.) work directly in markup.

   This file holds ONLY what Tailwind utilities cannot express:
     - keyframe animations + reveal helpers
     - decorative pseudo-element accents (grain, eyebrow rule)
     - editorial type components (pullquote, dropcap)
     - form-field base styling
     - sticky-header scroll state
     - mobile drawer open/closed state

   Colors, spacing, fonts, layout - reach for Tailwind utilities first.
   ================================================================= */

/* CSS-variable mirror of the @theme tokens, for the few custom
   rules below that need to reference them in plain CSS. */
:root {
  --brand-500: #006eb3;
  --brand-600: #005d97;
  --brand-700: #004a78;
  --navy-900: #0a2540;
  --cream-50:  #fefcf8;
  --cream-100: #faf7f2;
  --coral-500: #e87b45;
  --coral-600: #c75f2c;
  --ink: #1a1f2e;
  --ink-soft: #3a4254;
  --ink-muted: #6b7280;
  --font-display: "Cormorant Garamond", ui-serif, Georgia, serif;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
}

/* ::selection + focus visible (kept here so every page gets it
   without having to remember a utility class) */
::selection { background: var(--brand-500); color: var(--cream-50); }
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 2px;
}

/* 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;
  }
}

/* ---------- editorial type components ------------------------------ */

/* Eyebrow label with leading rule */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-600);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: 0 0 auto;
}

/* Pullquote */
.pullquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.55rem, 2.6vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.pullquote-mark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 4.5rem;
  line-height: 0.7;
  color: var(--coral-500);
  margin-bottom: -0.2em;
}

/* Drop cap on first letter of a paragraph */
.dropcap::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 3.5em;
  line-height: 0.86;
  padding: 0.05em 0.12em 0 0;
  color: var(--brand-500);
  font-weight: 500;
}

/* Animated link underline (background-image instead of border) */
.link-quiet {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.4s ease;
}
.link-quiet:hover { background-size: 100% 1px; }

/* ---------- decorative accents ------------------------------------ */

/* Editorial grain overlay, pinned, very subtle */
.grain::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.03;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Faint hairline divider */
.rule-faint {
  border: 0;
  border-top: 1px solid rgba(10, 37, 64, 0.08);
}

/* ---------- motion ------------------------------------------------- */

/* Single-element reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered child reveals */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
[data-stagger].is-visible > * {
  opacity: 1;
  transform: translateY(0);
}
[data-stagger].is-visible > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger].is-visible > *:nth-child(2) { transition-delay: 0.15s; }
[data-stagger].is-visible > *:nth-child(3) { transition-delay: 0.25s; }
[data-stagger].is-visible > *:nth-child(4) { transition-delay: 0.35s; }
[data-stagger].is-visible > *:nth-child(5) { transition-delay: 0.45s; }
[data-stagger].is-visible > *:nth-child(6) { transition-delay: 0.55s; }

/* Gentle needle sway */
@keyframes needle-sway {
  0%, 100% { transform: rotate(-7deg); }
  50%      { transform: rotate(6deg); }
}
.needle-sway {
  animation: needle-sway 7s ease-in-out infinite;
  transform-origin: 50% 50%;
}

/* Slow compass rotation */
@keyframes compass-rotate {
  to { transform: rotate(360deg); }
}
.compass-rotate {
  animation: compass-rotate 140s linear infinite;
}

/* Quiet card lift on hover */
.card-lift {
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
              border-color 0.4s ease;
}
.card-lift:hover {
  transform: translateY(-3px);
  border-color: rgba(10, 37, 64, 0.18);
}

/* ---------- header scroll state ----------------------------------- */
[data-site-header] .header-bar {
  transition: background-color 0.35s ease, backdrop-filter 0.35s ease;
}
[data-site-header].is-scrolled .header-bar {
  background: rgba(250, 247, 242, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-site-header].is-scrolled [data-header-rule] {
  background: rgba(10, 37, 64, 0.07);
}

/* ---------- mobile drawer state ----------------------------------- */
[data-nav] {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
[data-nav].is-open {
  pointer-events: auto;
  opacity: 1;
}

/* ---------- form fields ------------------------------------------- */
.field {
  width: 100%;
  background: var(--cream-50);
  border: 1px solid rgba(10, 37, 64, 0.14);
  border-radius: 0.625rem;
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.field:focus {
  outline: none;
  border-color: var(--brand-500);
  background: #fff;
}
.field::placeholder { color: var(--ink-muted); opacity: 0.7; }

textarea.field {
  resize: vertical;
  min-height: 8rem;
  line-height: 1.55;
}

/* ---------- header-spacer reserves space below fixed header ------- */
.header-spacer {
  height: 5.25rem;
}
@media (min-width: 768px) {
  .header-spacer { height: 5.75rem; }
}

/* ---------- image placeholder (swap with real photo later) -------- */
.image-placeholder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #ffffff;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 16px,
      rgba(10, 37, 64, 0.035) 16px,
      rgba(10, 37, 64, 0.035) 32px
    );
  border: 1px dashed rgba(10, 37, 64, 0.22);
  border-radius: 1rem;
  color: var(--ink-muted);
  padding: 2rem 1.5rem;
  text-align: center;
  overflow: hidden;
}
.image-placeholder__icon {
  font-size: 1.75rem;
  color: rgba(10, 37, 64, 0.32);
  margin-bottom: 0.85rem;
}
.image-placeholder__label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(10, 37, 64, 0.55);
  margin-bottom: 0.35rem;
}
.image-placeholder__desc {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.35;
  color: rgba(10, 37, 64, 0.7);
  max-width: 22rem;
}
.image-placeholder__hint {
  margin-top: 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: rgba(10, 37, 64, 0.42);
  letter-spacing: 0.04em;
}

/* ---------- light-section gradient (welcoming whites) ------------- */
.bg-soft-light {
  background: #ffffff;
}

/* Belt-and-suspenders: never allow horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ---------- hero photo backdrop (for pillar pages) ---------------- */
.hero-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.12;
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(250, 247, 242, 0.55) 0%, rgba(250, 247, 242, 0.95) 65%, #faf7f2 100%);
}
