/* ============================================================================
   SENECA INCOME FUND — GLOBAL STYLESHEET
   ----------------------------------------------------------------------------
   A black, old-world, private-members aesthetic.
   Edit the design tokens in :root to retheme the entire site at once.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------------------- */
:root {
  /* Surfaces — near-black, never pure #000, for depth */
  --ink:        #0a0a0b;
  --ink-2:      #101012;   /* very slightly raised panels */
  --ink-3:      #15151820; /* translucent fill */

  /* Typography colors — ivory, not stark white */
  --ivory:      #ece7da;
  --ivory-dim:  rgba(236, 231, 218, 0.60);
  --ivory-faint:rgba(236, 231, 218, 0.34);
  --ivory-ghost:rgba(236, 231, 218, 0.14);

  /* Lines / charcoal borders */
  --line:       rgba(236, 231, 218, 0.12);
  --line-soft:  rgba(236, 231, 218, 0.07);

  /* Fonts */
  --font-gothic: 'UnifrakturMaguntia', 'Times New Roman', serif;
  --font-title:  'Cloister Black', 'Old English Text MT', 'UnifrakturMaguntia', serif;
  --font-script: 'Sacramento', cursive;
  --font-display:'Cormorant Garamond', Georgia, serif;
  --font-body:   'EB Garamond', Georgia, serif;
  --quote-font:  var(--font-display);

  /* Spacing rhythm */
  --pad-x: clamp(1.5rem, 6vw, 7rem);
  --maxw:  780px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------------------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0.01em;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Atmospheric vignette baked into the page background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,0.045), transparent 60%),
    radial-gradient(140% 120% at 50% 120%, rgba(0,0,0,0.6), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

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

/* ---------------------------------------------------------------------------
   3. ATMOSPHERIC GRAIN (injected by script.js as #grain)
   ------------------------------------------------------------------------- */
#grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.045;
  mix-blend-mode: screen;
}

/* ---------------------------------------------------------------------------
   4. PAGE-TRANSITION CURTAIN (injected by script.js as #curtain)
   ------------------------------------------------------------------------- */
#curtain {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 9500;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.9s var(--ease);
}
body.loaded #curtain { opacity: 0; }
body.leaving #curtain { opacity: 1; transition: opacity 0.5s var(--ease); }

/* ---------------------------------------------------------------------------
   5. TYPOGRAPHY HELPERS
   ------------------------------------------------------------------------- */
.gothic {
  font-family: var(--font-gothic);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
}
.script {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1;
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ivory-faint);
  font-weight: 500;
}
.lead {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.55;
  color: var(--ivory);
}
p { color: var(--ivory-dim); }
p + p { margin-top: 1.25rem; }

/* ---------------------------------------------------------------------------
   6. CONTENT WRAPPERS
   ------------------------------------------------------------------------- */
.wrap   { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }
.wrap-wide { max-width: 1080px; }
main    { position: relative; z-index: 1; }

/* ---------------------------------------------------------------------------
   7. TOP NAVIGATION
   ------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.5rem, 5vw, 4rem);
  transition: background 0.6s var(--ease), border-color 0.6s var(--ease), padding 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10,10,11,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.nav__brand {
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ivory);
  opacity: 0.9;
  transition: opacity 0.4s var(--ease);
}
.nav__brand:hover { opacity: 1; }

.nav__links { display: flex; gap: clamp(1.4rem, 3vw, 2.8rem); align-items: center; }
.nav__links a {
  font-family: var(--font-body);
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.4s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--ivory);
  transition: width 0.45s var(--ease);
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--ivory); }
.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after { width: 100%; }

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 24px; height: 1px;
  background: var(--ivory);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.nav.open .nav__toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.open .nav__toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2.2rem;
    background: rgba(8,8,9,0.97);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease);
  }
  .nav.open .nav__links { opacity: 1; pointer-events: auto; }
  .nav__links a { font-size: 1rem; letter-spacing: 0.3em; }
}

/* ---------------------------------------------------------------------------
   8. HERO (Home)
   ------------------------------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(4.5rem, 9vh, 6rem) var(--pad-x) clamp(3rem, 6vh, 4rem);
  position: relative;
}
/* soft glow pooled behind the statue */
.hero::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: min(70vw, 620px);
  height: min(70vw, 620px);
  transform: translate(-50%, -48%);
  background: radial-gradient(circle, rgba(255,253,245,0.10), transparent 62%);
  filter: blur(8px);
  pointer-events: none;
}
.hero__title {
  font-family: var(--font-title);
  font-weight: 400;
  letter-spacing: 0;
  font-size: clamp(2.2rem, 6.6vw, 4.4rem);
  line-height: 1.0;
  margin-bottom: clamp(0.6rem, 1.6vw, 1.1rem);
  position: relative;
  text-shadow: 0 0 40px rgba(236,231,218,0.10);
  white-space: nowrap;
  text-align: center;
}
.hero__statue {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: auto;
  max-width: min(72vw, 360px);
  max-height: 38vh;
  object-fit: contain;
  position: relative;
  filter: drop-shadow(0 0 28px rgba(236,231,218,0.08));
}
.hero__quote {
  font-family: var(--font-script);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1;
  margin-top: clamp(1rem, 2vw, 1.5rem);
  color: var(--ivory);
}
.hero__welcome {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  letter-spacing: 0.16em;
  color: var(--ivory-dim);
  margin-top: 0.9rem;
}
/* Pair the quote with "Welcome." — same typeface as .hero__welcome */
.hero__welcome-font {
  font-family: var(--font-display);
  font-style: italic;
}
/* Shared quote style — uniform across every page (high-contrast Roman serif) */
.seneca-quote,
.hero__quote {
  font-family: "Cormorant Garamond", "Bodoni 72", "Didot", Georgia, serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.14em;
  line-height: 1.25;
  color: #f4efe6;
}
.hero__cta { margin-top: clamp(1.4rem, 2.6vw, 1.9rem); }

/* scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 0.8rem; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.64rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ivory-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.scroll-hint::after {
  content: "";
  width: 1px; height: 18px;
  background: linear-gradient(var(--ivory-faint), transparent);
  animation: drift 2.6s var(--ease) infinite;
}
@keyframes drift { 0%,100% { opacity: 0.3; transform: scaleY(0.7); } 50% { opacity: 1; transform: scaleY(1); } }

/* ---------------------------------------------------------------------------
   9. BUTTONS / LINKS
   ------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.76rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ivory);
  padding: 1rem 2.6rem;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.5s var(--ease), border-color 0.5s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ivory);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
  z-index: -1;
}
.btn:hover { color: var(--ink); border-color: var(--ivory); }
.btn:hover::before { transform: scaleX(1); }
.btn span { position: relative; z-index: 1; }

.link-quiet {
  font-family: var(--font-body);
  font-size: 0.76rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.link-quiet:hover { color: var(--ivory); border-color: var(--ivory); }

/* ---------------------------------------------------------------------------
   10. INTERIOR PAGE HEADER
   ------------------------------------------------------------------------- */
.page-head {
  padding: clamp(8rem, 16vh, 12rem) var(--pad-x) clamp(3rem, 6vw, 5rem);
  text-align: center;
  position: relative;
}
.page-head .eyebrow { display: block; margin-bottom: 1.4rem; }
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.page-head .rule {
  width: 56px; height: 1px;
  background: var(--line);
  margin: 2.2rem auto 0;
}

/* ---------------------------------------------------------------------------
   11. CONTENT SECTIONS
   ------------------------------------------------------------------------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--first { padding-top: 0; }

.measure { max-width: 680px; margin-inline: auto; }
.measure p { font-size: 1.08rem; }

.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ivory-faint);
  margin-bottom: 1.6rem;
  display: block;
}

.founders {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--ivory-dim);
}

/* Pull-quote block */
.pull {
  text-align: center;
  padding: clamp(3rem, 7vw, 5rem) var(--pad-x);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin: clamp(2rem,5vw,4rem) 0;
}
.pull .script,
.pull .seneca-quote {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
}

/* Stat strip (Opportunity) */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  margin: 2.5rem 0;
}
.stats .stat {
  background: var(--ink);
  padding: 2.2rem 1.4rem;
  text-align: center;
}
.stats .stat b {
  display: block;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--ivory);
  line-height: 1;
  margin-bottom: 0.6rem;
}
.stats .stat span {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--ivory-faint);
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   12. FINANCIAL TERMS TABLE (Origination)
   ------------------------------------------------------------------------- */
.terms {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}
.terms .row {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.terms .row dt {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ivory-faint);
}
.terms .row dd {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.15rem;
  color: var(--ivory);
}
.terms .rate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
.terms .rate-grid div {
  display: flex; justify-content: space-between;
  gap: 1rem;
  font-size: 1rem;
  color: var(--ivory-dim);
}
.terms .rate-grid b {
  font-family: var(--font-display);
  color: var(--ivory);
  font-weight: 400;
}
@media (max-width: 600px) {
  .terms .row { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* Why Seneca — comparison */
.why {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  margin-top: 1.5rem;
}
.why > div { background: var(--ink); padding: 2.2rem; }
.why h4 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.why .old h4 { color: var(--ivory-faint); }
.why .new h4 { color: var(--ivory); }
.why ul { list-style: none; }
.why li {
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  padding-left: 1.6rem;
}
.why li:last-child { border-bottom: 0; }
.why li::before {
  content: "—";
  position: absolute; left: 0;
  color: var(--ivory-faint);
}
.why .old li { color: var(--ivory-faint); }
.why .new li { color: var(--ivory); }
.why .new li::before { content: "·"; font-size: 1.4em; line-height: 0.8; }
@media (max-width: 680px) { .why { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------------
   13. CONTACT
   ------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 2rem; position: relative; }
.field label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ivory-faint);
  margin-bottom: 0.7rem;
}
.field input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 1.25rem;
  padding: 0.5rem 0;
  transition: border-color 0.4s var(--ease);
}
.field input::placeholder { color: var(--ivory-ghost); }
.field input:focus { outline: none; border-color: var(--ivory); }
.field .error {
  display: block;
  min-height: 1rem;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #c98b8b;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.field.invalid input { border-color: #8f5b5b; }
.field.invalid .error { opacity: 1; }

.contact-detail { font-family: var(--font-display); }
.contact-detail .name {
  font-size: 1.4rem; font-weight: 400; color: var(--ivory); margin-bottom: 1rem;
}
.contact-detail a, .contact-detail p { color: var(--ivory-dim); font-size: 1.1rem; display: block; }
.contact-detail a:hover { color: var(--ivory); }

/* success message */
.form-success {
  display: none;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--ivory);
  padding: 2rem 0;
}
.form-success.show { display: block; animation: fadeUp 1s var(--ease) both; }

/* ---------------------------------------------------------------------------
   14. FOOTER
   ------------------------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-soft);
  margin-top: clamp(4rem, 10vw, 8rem);
  padding: clamp(3rem, 7vw, 5rem) var(--pad-x) 2.5rem;
}
.footer__inner {
  max-width: 1080px; margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: 2.5rem;
  justify-content: space-between; align-items: flex-start;
}
.footer__brand {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--ivory);
  line-height: 1;
}
.footer__brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ivory-faint);
  margin-top: 0.9rem;
}
.footer__nav { display: flex; flex-direction: column; gap: 0.9rem; }
.footer__nav a {
  font-family: var(--font-body);
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  transition: color 0.4s var(--ease);
}
.footer__nav a:hover { color: var(--ivory); }
.footer__contact { font-family: var(--font-display); color: var(--ivory-dim); font-size: 0.98rem; }
.footer__contact a:hover { color: var(--ivory); }

.legal {
  max-width: 1080px;
  margin: clamp(2.5rem,6vw,4rem) auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  line-height: 2;
  color: var(--ivory-faint);
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   15. SCROLL-REVEAL & HERO SEQUENCE ANIMATIONS
   ------------------------------------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* generic scroll reveal (set by script.js IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Hero entrance — staggered. ORDER OF APPEARANCE: statue → title → quote → welcome → button.
   Items start hidden and animate via these delays once body.loaded is set. */
.hero__statue,
.hero__title,
.hero__quote,
.hero__welcome,
.hero__cta,
.scroll-hint { opacity: 0; }

body.loaded .hero__statue  { animation: fadeUp 1.6s var(--ease) 0.25s both; }
body.loaded .hero__title   { animation: fadeUp 1.4s var(--ease) 1.15s both; }
body.loaded .hero__quote   { animation: fadeUp 1.4s var(--ease) 1.85s both; }
body.loaded .hero__welcome { animation: fadeUp 1.3s var(--ease) 2.45s both; }
body.loaded .hero__cta     { animation: fadeUp 1.3s var(--ease) 2.95s both; }
body.loaded .scroll-hint   { animation: fadeIn 1.5s var(--ease) 3.6s both; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .hero__statue, .hero__title, .hero__quote, .hero__welcome, .hero__cta, .scroll-hint { opacity: 1; }
  .reveal { opacity: 1; transform: none; }
  #curtain { display: none; }
}
