/* ============================================================
   RAY Services — custom styles
   Editorial / financial-magazine aesthetic
   ============================================================ */

:root {
  --ink: #0a1733;
  --ink-soft: #1a2849;
  --ink-light: #2d3d5e;
  --gold: #c9a961;
  --gold-deep: #a88748;
  --gold-soft: #e2c98a;
  --cream: #f5efe2;
  --cream-soft: #faf6ec;
  --paper: #fdfaf3;
  --rule: #d8cfb8;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Instrument Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-feature-settings: "ss01", "ss02";
}

::selection { background: var(--ink); color: var(--gold-soft); }

/* ---------- Typography ---------- */

.font-display, h1, h2, h3, h4, .display {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "SOFT" 30, "opsz" 144, "wght" 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h1, .display-xl { font-variation-settings: "SOFT" 30, "opsz" 144, "wght" 380; }

em, .italic-display {
  font-style: italic;
  font-variation-settings: "SOFT" 60, "opsz" 144, "wght" 380;
}

.eyebrow {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.numeral {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 0, "opsz" 144, "wght" 300;
  font-feature-settings: "lnum", "tnum";
  letter-spacing: -0.04em;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-feature-settings: "ss01";
}

/* ---------- Background texture ---------- */

.cream-grain {
  background-color: var(--cream);
  background-image:
    radial-gradient(rgba(10, 23, 51, 0.025) 1px, transparent 1px),
    radial-gradient(rgba(10, 23, 51, 0.018) 1px, transparent 1px);
  background-size: 28px 28px, 56px 56px;
  background-position: 0 0, 14px 14px;
}

.ink-grain {
  background-color: var(--ink);
  background-image:
    radial-gradient(rgba(201, 169, 97, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---------- Hairline rules ---------- */

.rule { border-color: var(--rule); }
.rule-ink { border-color: rgba(10, 23, 51, 0.12); }
.rule-cream { border-color: rgba(245, 239, 226, 0.12); }
.rule-gold { border-color: var(--gold); }

.rule-double {
  border-top: 1px solid var(--rule);
  box-shadow: 0 4px 0 -3px var(--rule);
}

/* ---------- Slideshow ---------- */

.slideshow {
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1000ms var(--ease), transform 1000ms var(--ease);
  transform: scale(1.015);
  display: flex;
  flex-direction: column;
  padding: 2.5rem 2.5rem 7rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .slide { padding: 3rem 3.5rem 7.5rem; }
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.slide-meta {
  position: relative;
  z-index: 2;
}

.slide-content {
  position: relative;
  z-index: 2;
  margin-top: auto;
  margin-bottom: 1.5rem;
  max-width: 100%;
}

@media (min-width: 600px) {
  .slide-content { max-width: 92%; }
}

.slide-illustration {
  position: absolute;
  top: 4.5rem;
  right: 1rem;
  width: 48%;
  max-width: 280px;
  height: auto;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  opacity: 0.95;
}

@media (min-width: 768px) {
  .slide-illustration {
    top: 5rem;
    right: 1.5rem;
    width: 46%;
    max-width: 340px;
  }
}

@media (max-width: 540px) {
  .slide-illustration {
    width: 50%;
    opacity: 0.45;
    top: 30%;
  }
}

.slide-controls {
  position: absolute;
  bottom: 1.75rem;
  left: 2.5rem;
  right: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}

@media (min-width: 768px) {
  .slide-controls {
    bottom: 2rem;
    left: 3.5rem;
    right: 3.5rem;
  }
}

.slide-headline {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144, "wght" 360;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--cream-soft);
}

.slide-headline em {
  font-variation-settings: "SOFT" 80, "opsz" 144, "wght" 360;
  color: var(--gold-soft);
}

.slide-decor {
  position: absolute;
  pointer-events: none;
  opacity: 0.16;
}

.slide-decor.top-right {
  top: -8%;
  right: -8%;
  width: 50%;
  aspect-ratio: 1;
  border: 1px solid var(--gold);
  border-radius: 50%;
}

.slide-decor.bottom-left {
  bottom: 12%;
  left: -10%;
  width: 30%;
  aspect-ratio: 1;
  border: 1px solid var(--gold);
}

.slide-decor.diag {
  bottom: 20%;
  right: 8%;
  width: 1px;
  height: 30%;
  background: var(--gold);
  transform: rotate(20deg);
  transform-origin: bottom;
}

.slide-dots button {
  width: 28px;
  height: 1px;
  background: rgba(245, 239, 226, 0.3);
  transition: background 400ms var(--ease), height 400ms var(--ease);
}

.slide-dots button.is-active {
  background: var(--gold);
  height: 2px;
}

.slide-arrow {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(201, 169, 97, 0.4);
  display: grid;
  place-items: center;
  color: var(--gold-soft);
  transition: all 300ms var(--ease);
  border-radius: 50%;
}

.slide-arrow:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

/* ---------- Service index rows ---------- */

.service-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: baseline;
  gap: 2rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--rule);
  transition: background 600ms var(--ease), color 600ms var(--ease), padding 600ms var(--ease);
  position: relative;
  cursor: pointer;
}

@media (min-width: 768px) {
  .service-row { grid-template-columns: 100px 1fr 2fr auto; gap: 3rem; padding: 2.5rem 2rem; }
}

.service-row:last-child { border-bottom: 1px solid var(--rule); }

.service-row .row-num {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 0, "opsz" 144, "wght" 300;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--gold-deep);
  transition: color 600ms var(--ease);
}

.service-row .row-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144, "wght" 400;
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.service-row .row-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-light);
  transition: color 600ms var(--ease);
}

.service-row .row-cta {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
  transition: color 600ms var(--ease), transform 600ms var(--ease);
  white-space: nowrap;
}

.service-row:hover {
  background: var(--ink);
  color: var(--cream-soft);
  padding-left: 2.5rem;
}
@media (min-width: 768px) {
  .service-row:hover { padding-left: 3rem; }
}

.service-row:hover .row-num,
.service-row:hover .row-cta { color: var(--gold-soft); }
.service-row:hover .row-desc { color: rgba(245, 239, 226, 0.7); }
.service-row:hover .row-cta { transform: translateX(8px); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1.6rem;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: all 400ms var(--ease);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: var(--cream-soft);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.btn-gold:hover {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--cream-soft);
}

.btn-ghost-cream {
  background: transparent;
  color: var(--cream-soft);
  border-color: rgba(245, 239, 226, 0.4);
}
.btn-ghost-cream:hover {
  background: var(--cream-soft);
  color: var(--ink);
  border-color: var(--cream-soft);
}

.btn .arrow {
  display: inline-block;
  transition: transform 400ms var(--ease);
}
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Pull quote ---------- */

.pullquote {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 70, "opsz" 144, "wght" 320;
  font-style: italic;
  font-size: clamp(2rem, 5.5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.pullquote::before, .pullquote::after {
  font-style: normal;
  color: var(--gold);
  font-variation-settings: "SOFT" 30, "opsz" 144, "wght" 300;
}
.pullquote::before { content: "\201C"; margin-right: 0.1em; }
.pullquote::after { content: "\201D"; margin-left: 0.1em; }

/* ---------- Stats strip ---------- */

.stat-cell {
  padding: 2.5rem 1.5rem;
  border-left: 1px solid rgba(245, 239, 226, 0.18);
  position: relative;
}
.stat-cell:first-child { border-left: none; }

.stat-num {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144, "wght" 320;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--gold-soft);
}

.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 239, 226, 0.6);
  margin-top: 1rem;
  line-height: 1.4;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.is-visible > *:nth-child(8) { transition-delay: 560ms; }
.reveal-stagger.is-visible > *:nth-child(9) { transition-delay: 640ms; }

/* ---------- Service detail blocks ---------- */

.service-block {
  border-top: 1px solid var(--rule);
  padding: 5rem 0;
}

.service-num-large {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 0, "opsz" 144, "wght" 300;
  font-size: clamp(5rem, 12vw, 9rem);
  letter-spacing: -0.05em;
  line-height: 0.85;
  color: var(--gold);
}

.au-callout {
  background: var(--paper);
  border-left: 3px solid var(--gold);
  padding: 1.5rem 1.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.au-callout .au-tag {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ---------- Founder card ---------- */

.founder-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 500ms var(--ease), border-color 500ms var(--ease);
}

.founder-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.founder-mark {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 50, "opsz" 144, "wght" 300;
  font-style: italic;
  font-size: 7rem;
  line-height: 1;
  color: var(--gold);
  letter-spacing: -0.04em;
}

/* ---------- Form ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.field input,
.field select,
.field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 0;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 300ms var(--ease);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-bottom-color: var(--gold);
}

.field textarea { resize: vertical; min-height: 120px; }

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%230a1733' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.5rem;
}

/* ---------- Brand mark ---------- */

.brand-mark {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144, "wght" 500;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand-mark .dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  margin: 0 0.35em 0.15em;
  vertical-align: middle;
}

/* ---------- Nav ---------- */

.nav-link {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 300ms var(--ease);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--gold);
  transition: width 400ms var(--ease);
}

.nav-link:hover::after,
.nav-link.is-current::after { width: 100%; }

.nav-link.is-current { color: var(--ink); }

/* ---------- Diagonal flourish ---------- */

.flourish-line {
  display: block;
  width: 1px;
  height: 60px;
  background: var(--gold);
  margin: 0 auto;
}

.flourish-line.diag {
  transform: rotate(15deg);
  height: 80px;
}

/* ---------- Mobile menu ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--ink);
  color: var(--cream-soft);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu a {
  font-family: 'Fraunces', serif;
  font-variation-settings: "SOFT" 30, "opsz" 144, "wght" 380;
  font-size: 2.5rem;
  color: var(--cream-soft);
  letter-spacing: -0.02em;
}

.mobile-menu a:hover { color: var(--gold-soft); }

/* ---------- Responsive tweaks ---------- */

@media (max-width: 767px) {
  .service-row { grid-template-columns: 60px 1fr; gap: 1rem; padding: 1.75rem 1rem; }
  .service-row .row-desc { display: none; }
  .service-row .row-cta { display: none; }
  .service-row:hover { padding-left: 1.5rem; }
}
