/* ===== Kingsferry Capital — shared design system ===== */
:root {
  --navy: #162638;
  --navy-deep: #101c2a;
  --gold: #af915f;
  --cream: #fce1b6;
  --paper: #fcfcfc;
  --stone: #f4f2ee;
  --ink: #101418;
  --muted: #5b6470;
  --hairline-dark: rgba(252, 225, 182, 0.16);
  --hairline-light: rgba(16, 20, 24, 0.12);
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-weight: 450;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--gold); color: var(--navy-deep); }

/* ---------- Navigation ---------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  transition: background 0.45s ease, padding 0.45s ease, box-shadow 0.45s ease;
}
nav.scrolled, nav.solid {
  background: rgba(16, 28, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 48px;
  box-shadow: 0 1px 0 var(--hairline-dark);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  position: relative;
}
/* star traced from the original Kingsferry logo (multi-point burst) */
.brand .star {
  width: 20px; height: 20px; flex: none;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .star { transform: rotate(72deg); }
.brand .wordmark {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.32em;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.brand .wordmark em { font-style: normal; color: var(--gold); transition: color 0.3s ease; }
.brand:hover .wordmark { color: var(--cream); }
.brand:hover .wordmark em { color: #fff; }
.nav-links { display: flex; gap: 44px; list-style: none; }
.nav-links a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255,255,255,0.72);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: #fff; }

/* ---------- Sub-page hero ---------- */
.page-hero {
  background: var(--navy);
  padding: 200px 0 110px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 78% 0%, rgba(175, 145, 95, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 55% at 8% 100%, rgba(252, 225, 182, 0.05), transparent 55%);
  pointer-events: none;
}
.page-hero .wrap { position: relative; }
.page-hero .eyebrow { margin-bottom: 36px; }
.page-hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(44px, 5.6vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 16ch;
}
.page-hero h1 em { font-style: italic; color: var(--cream); }
.page-hero .lede {
  margin-top: 40px;
  max-width: 46ch;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255,255,255,0.62);
  font-weight: 400;
}

/* ---------- Shared scaffolding ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 48px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow .rule { width: 56px; height: 1px; background: var(--gold); opacity: 0.6; }
.sec-label {
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 64px;
}
.sec-label .num { font-family: var(--serif); font-style: italic; font-size: 15px; letter-spacing: 0; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline-light);
  transition: border-color 0.3s ease, color 0.3s ease;
}
.text-link svg { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.text-link:hover { color: var(--gold); border-color: var(--gold); }
.text-link:hover svg { transform: translateX(5px); }

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }

/* ---------- Footer ---------- */
footer { background: var(--navy); padding: 90px 0 40px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 64px;
  padding-bottom: 72px;
}
.footer-brand .star { width: 24px; height: 24px; }
.footer-brand .wordmark { font-size: 15px; }
.footer-brand p {
  margin-top: 22px;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,0.5);
  max-width: 38ch;
  font-weight: 400;
}
.footer-col h4 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 14px; }
.footer-col a {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 400;
}
.footer-col a:hover { color: var(--cream); }
.footer-bottom {
  border-top: 1px solid var(--hairline-dark);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom small { font-size: 12px; color: rgba(255,255,255,0.38); font-weight: 400; }
.footer-bottom a { font-size: 12px; color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.3s; }
.footer-bottom a:hover { color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  nav { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 24px 18px; }
  nav.scrolled, nav.solid { padding: 14px 24px 12px; }
  .nav-links { gap: 26px; }
  .nav-links a { font-size: 11px; letter-spacing: 0.12em; }
  .brand .wordmark { font-size: 11px; letter-spacing: 0.22em; }
  .wrap { padding: 0 24px; }
  .page-hero { padding: 150px 0 80px; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ===== Terms gate (first-visit modal) ===== */
.terms-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 28, 42, 0.78);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.terms-gate.show { opacity: 1; }
.terms-gate.hide { opacity: 0; pointer-events: none; }
.terms-gate-panel {
  background: var(--paper);
  width: min(760px, 100%);
  max-height: min(82vh, 900px);
  display: flex;
  flex-direction: column;
  transform: translateY(24px);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 40px 90px rgba(16, 28, 42, 0.45);
}
.terms-gate.show .terms-gate-panel { transform: translateY(0); }
.terms-gate-head {
  padding: 36px 44px 24px;
  border-bottom: 1px solid var(--hairline-light);
}
.terms-gate-head .eyebrow { color: var(--gold); margin-bottom: 14px; }
.terms-gate-head .eyebrow .rule { background: var(--gold); }
.terms-gate-head h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}
.terms-gate-head h2 em { font-style: italic; color: var(--gold); }
.terms-gate-body {
  padding: 28px 44px;
  overflow-y: auto;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}
.terms-gate-body .terms-intro { color: var(--ink); }
.terms-gate-body .terms-notice {
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
  margin: 18px 0;
}
.terms-gate-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  color: var(--ink);
  margin: 30px 0 10px;
  letter-spacing: -0.01em;
}
.terms-gate-body h2 .tnum {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
  font-size: 15px;
  margin-right: 12px;
}
.terms-gate-body p { margin: 0 0 14px; }
.terms-gate-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 44px 32px;
  border-top: 1px solid var(--hairline-light);
  background: var(--stone);
}
.terms-gate-actions button {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 15px 26px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.terms-gate-agree { background: var(--navy); color: var(--cream); }
.terms-gate-agree:hover { background: var(--gold); color: var(--navy-deep); }
.terms-gate-decline {
  background: transparent;
  color: var(--muted);
  border-color: var(--hairline-light) !important;
}
.terms-gate-decline:hover { color: var(--ink); border-color: var(--ink) !important; }
body.terms-gate-open { overflow: hidden; }

@media (max-width: 900px) {
  .terms-gate { padding: 14px; }
  .terms-gate-head { padding: 26px 24px 18px; }
  .terms-gate-body { padding: 20px 24px; }
  .terms-gate-actions { padding: 18px 24px 22px; flex-direction: column; }
  .terms-gate-actions button { width: 100%; }
}
