/* ===================================
   Design Tokens
   =================================== */
:root {
  /* Color Palette — warm "old money" tones */
  --color-bg: #F5EFE6;
  --color-bg-deep: #EDE4D6;
  --color-surface: rgba(67, 38, 22, 0.04);
  --color-text: #432616;
  --color-text-muted: #7F6244;
  --color-accent: #9E7B5A;
  --color-accent-light: #C4A882;
  --color-gold: #B8965A;
  --color-divider: rgba(67, 38, 22, 0.15);
  --color-shadow: rgba(67, 38, 22, 0.08);

  /* Typography */
  --font-brand: 'SanBrainy', 'TexGyrePagella', Georgia, serif;
  --font-display: 'TexGyrePagella', Georgia, serif;
  --font-body: 'GoudyBookLetter', 'TexGyrePagella', Georgia, serif;
  --font-ui: 'GoudyBookLetter', 'TexGyrePagella', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  /* Transitions */
  --ease-premium: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 0.2s var(--ease-premium);
  --transition-med: 0.4s var(--ease-premium);
  --transition-slow: 0.7s var(--ease-premium);
}


/* ===================================
   Custom Fonts
   =================================== */
@font-face {
  font-family: 'GoudyBookLetter';
  src: url('../fonts/GoudyBookLetter_1911.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SanBrainy';
  src: url('../fonts/SanBrainy-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TexGyrePagella';
  src: url('../fonts/TexGyrePagella-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}


/* ===================================
   Reset & Base
   =================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(ellipse at 50% 40%, rgba(184, 150, 90, 0.06) 0%, transparent 70%),
    linear-gradient(175deg, var(--color-bg) 0%, var(--color-bg-deep) 100%);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  text-align: center;
  animation: fadeIn 0.8s ease forwards;
  position: relative;
  overflow-x: hidden;
}

/* Subtle paper grain texture overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}


/* ===================================
   Animation Layers (canvases & SVGs)
   =================================== */
.animation-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

#wave-canvas {
  z-index: 0;
}

#particle-canvas {
  z-index: 1;
}

#svg-morph-bg {
  z-index: 1;
}

#page-border {
  z-index: 2;
}

#page-border svg {
  width: 100%;
  height: 100%;
}

/* Animated dashed border */
.animated-border-rect {
  stroke-dashoffset: 0;
  animation: borderDash 20s linear infinite;
}

@keyframes borderDash {
  to {
    stroke-dashoffset: -200;
  }
}


/* ===================================
   Corner Ornaments
   =================================== */
.corner-ornament {
  position: fixed;
  pointer-events: none;
  z-index: 3;
  transition: transform 0.15s ease-out;
}

.corner-tl {
  top: 15px;
  left: 15px;
}

.corner-tr {
  top: 15px;
  right: 15px;
}

.corner-bl {
  bottom: 15px;
  left: 15px;
}

.corner-br {
  bottom: 15px;
  right: 15px;
}


/* ===================================
   Page Wrapper (above animation layers)
   =================================== */
.page-wrapper {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1080px;
  padding: 0 var(--space-md);
  margin: 0 auto;
}


/* ===================================
   Header / Navbar
   =================================== */
.site-header {
  padding-top: var(--space-sm);
  border-bottom: 0.5px solid var(--color-divider);
  margin-bottom: var(--space-xs);
}

.navbar {
  padding: var(--space-sm) 0;
}

/* Brand wrapper with monogram */
.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar .navbar-brand {
  font-family: var(--font-brand);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text) !important;
  transition: opacity var(--transition-fast);
  text-decoration: none;
}

.navbar .navbar-brand:hover {
  opacity: 0.75;
}

/* ── Monogram ── */
.monogram-container {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease-out;
}

.monogram-letter {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-gold);
  position: relative;
  z-index: 2;
  animation: monogramFloat 4s ease-in-out infinite;
}

@keyframes monogramFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

.monogram-orbits {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  overflow: visible;
}

/* Toggler */
.navbar-toggler {
  border: 1px solid var(--color-divider);
  outline: none !important;
  box-shadow: none !important;
  padding: 0.35rem 0.6rem;
  transition: border-color var(--transition-fast);
}

.navbar-toggler:focus,
.navbar-toggler:active {
  outline: none;
  box-shadow: none !important;
  border-color: var(--color-accent);
}

/* Nav Items */
.navbar .nav-item {
  text-align: start;
  padding-left: 0.3rem;
}

.navbar .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text) !important;
  text-decoration: none;
  transition: color var(--transition-fast);
  padding: 0.5rem 0;
}

/* SVG-style animated underline on email link */
.navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar .nav-link:hover::after,
.navbar .nav-link.link-hover-active::after {
  width: 100%;
}

.navbar .nav-link:hover {
  color: var(--color-accent) !important;
}

.navbar .nav-link .menu-label {
  display: inline;
  padding-right: 0.25rem;
  color: var(--color-text) !important;
}

.navbar .nav-link .menu-icon {
  max-height: 1.15rem;
  opacity: 0.7;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.navbar .nav-link:hover .menu-icon {
  opacity: 1;
  transform: translateY(-1px);
}

/* Desktop Navbar */
@media (min-width: 600px) {
  .navbar .navbar-collapse {
    display: flex !important;
    flex-basis: auto !important;
  }

  .navbar .navbar-toggler {
    display: none;
  }

  .navbar .navbar-nav {
    flex-direction: row !important;
  }

  .navbar .nav-item {
    margin-left: 1.5rem;
  }

  .navbar .nav-link .menu-label {
    display: none;
  }
}


/* ===================================
   Main Content Area
   =================================== */
.site-main-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: var(--space-lg);
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-sm);
}


/* ===================================
   Hero Image
   =================================== */
.image-section {
  flex: 0 0 auto;
  text-align: center;
}

.image-section img {
  min-width: 220px;
  max-width: 320px;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow:
    0 8px 30px var(--color-shadow),
    0 2px 8px rgba(67, 38, 22, 0.06),
    0 0 60px rgba(184, 150, 90, 0.08);
  border: 1.5px solid rgba(184, 150, 90, 0.25);
  outline: 1px solid rgba(184, 150, 90, 0.12);
  outline-offset: 5px;
  transition: transform var(--transition-med), box-shadow var(--transition-med),
    border-color var(--transition-med), outline-color var(--transition-med);
}

.image-section img:hover {
  transform: scale(1.02) translateY(-2px);
  box-shadow:
    0 16px 48px rgba(67, 38, 22, 0.14),
    0 4px 12px rgba(67, 38, 22, 0.08),
    0 0 80px rgba(184, 150, 90, 0.1);
  border-color: rgba(184, 150, 90, 0.35);
  outline-color: rgba(184, 150, 90, 0.2);
}


/* ===================================
   Content Section
   =================================== */
.content-section {
  flex: 1;
  max-width: 420px;
  text-align: left;
  color: var(--color-text);
}

.content-section .tagline {
  font-family: var(--font-body);
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

/* ── Animated SVG Divider ── */
.animated-divider {
  margin: var(--space-xs) 0 var(--space-sm);
  text-align: center;
}

.animated-divider svg {
  width: 180px;
  height: 20px;
  overflow: visible;
}

.content-section p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--color-text);
  margin-bottom: 0.85rem;
}

p.text-in-center {
  text-align: center;
  margin-top: var(--space-sm);
}

p.text-in-justify {
  text-align: justify;
  text-align-last: center;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Italic treatment for the opening Latin quote */
.content-section p.text-in-justify:first-of-type {
  font-style: italic;
}


/* ===================================
   Entrance Animations
   =================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-in {
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-premium) forwards;
}

.animate-in.delay-1 {
  animation-delay: 0.15s;
}

.animate-in.delay-2 {
  animation-delay: 0.35s;
}

.animate-in.delay-3 {
  animation-delay: 0.55s;
}

.animate-in.delay-4 {
  animation-delay: 0.75s;
}

.animate-fade {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
  animation-delay: 0.3s;
}


/* ===================================
   Footer
   =================================== */
.site-footer {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: var(--space-md) 0 var(--space-sm);
  margin-top: auto;
  position: relative;
}

.footer-line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent-light), transparent);
  margin: 0 auto var(--space-sm);
  transition: width 1s var(--ease-premium);
}

.footer-visible .footer-line {
  width: 80px;
}

.footer-text {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
  display: inline-block;
}

.footer-visible .footer-text {
  opacity: 1;
  transform: translateY(0);
}


/* ===================================
   404 Page
   =================================== */
.error-page .site-main-body {
  flex-direction: column !important;
}

.error-page .image-section img {
  width: 180px;
  min-width: unset;
  border: none;
  box-shadow: none;
  opacity: 0.85;
}

.error-page .image-section img:hover {
  transform: none;
  box-shadow: none;
}

.error-page .content-section {
  text-align: center;
  max-width: 380px;
}

.error-page .content-section p {
  text-align: center;
}

.error-page .return-link {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-light);
  padding-bottom: 2px;
  padding-top: 0.5rem;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.error-page .return-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}


/* ===================================
   Protections (preserved)
   =================================== */
img.protect-image {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.nocopy {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}


/* ===================================
   Responsive — Mobile
   =================================== */
@media (max-width: 768px) {
  .page-wrapper {
    padding: 0 var(--space-sm);
  }

  .site-main-body {
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md) 0;
  }

  .image-section img {
    width: 240px;
    min-width: unset;
  }

  .content-section {
    max-width: 380px;
    margin: 0 auto;
    text-align: center;
  }

  .content-section .tagline {
    font-size: 1.3rem;
  }

  .content-section p {
    font-size: 0.88rem;
    text-align: center;
  }

  p.text-in-justify {
    text-align: justify;
    text-align-last: center;
  }

  /* Hide complex overlays on small screens for performance */
  .corner-ornament {
    display: none;
  }

  #page-border {
    display: none;
  }

  .monogram-container {
    width: 34px;
    height: 34px;
  }

  .monogram-letter {
    font-size: 0.95rem;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 992px) {
  .image-section img {
    max-width: 260px;
  }

  .content-section p {
    font-size: 0.92rem;
  }
}

/* Desktop */
@media (min-width: 993px) {
  .site-main-body {
    gap: var(--space-xl);
    padding: var(--space-xl) 0;
  }
}