/* ==========================================================================
   HAVEN BUSINESS ADVISORS — Design tokens
   Concept: "The Horizon Ledger" — a safe harbor rendered through the
   vocabulary of a ledger: hairline rules, tabular figures, a steady
   beacon on the horizon. Sharp, modern, unmistakably financial.
   ========================================================================== */

:root {
  /* Color */
  --ink: #10242e;          /* primary text */
  --harbor: #0b1f2a;       /* deep harbor-at-night, dark section bg */
  --harbor-2: #14313f;     /* slightly lighter harbor, for depth */
  --paper: #f2f4f3;        /* light section bg, cool off-white */
  --paper-2: #e8ebe8;      /* subtle contrast panel on paper */
  --beacon: #e8a94b;       /* lighthouse amber — primary accent */
  --beacon-dim: #c98a34;
  --water: #2f6f62;        /* harbor water green — secondary accent */
  --water-dim: #24564c;
  --line: #c9d1cd;         /* hairline on paper */
  --line-dark: rgba(242, 244, 243, 0.18); /* hairline on harbor */
  --white: #ffffff;
  --ink-soft: rgba(16, 36, 46, 0.68);
  --paper-soft: rgba(242, 244, 243, 0.72);

  /* Type */
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  /* Layout */
  --max-w: 1180px;
  --pad: clamp(20px, 5vw, 64px);
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--water);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}
.on-dark .eyebrow { color: var(--beacon); }

.mono-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 13px 22px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--water); border-color: var(--water); }
.btn-beacon {
  background: var(--beacon);
  color: var(--harbor);
  border-color: var(--beacon);
}
.btn-beacon:hover { background: var(--white); border-color: var(--white); }
.on-dark .btn {
  border-color: var(--line-dark);
  color: var(--paper);
}
.on-dark .btn:hover { border-color: var(--beacon); color: var(--beacon); }
.btn-arrow { font-size: 15px; transition: transform 0.2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper-soft);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.logo .wordmark span { color: var(--beacon-dim); }
.logo .subline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

.main-nav { display: flex; align-items: center; gap: 36px; }
.nav-links { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  border-color: var(--beacon-dim);
  color: var(--beacon-dim);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 20px;
  position: relative;
  padding: 0;
}
.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }
.nav-toggle.is-open span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { top: 9px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    inset: 76px 0 0 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    padding: 30px var(--pad);
    gap: 26px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .main-nav.is-open { opacity: 1; transform: translateY(0); visibility: visible; }
  .nav-links { flex-direction: column; gap: 22px; }
  .nav-links a { font-size: 16px; }
}

/* ==========================================================================
   Section scaffolding
   ========================================================================== */
section { padding: 96px 0; }
@media (max-width: 720px) { section { padding: 64px 0; } }

.on-dark { background: var(--harbor); color: var(--paper); }
.on-dark h1, .on-dark h2, .on-dark h3 { color: var(--white); }
.on-dark p { color: rgba(242, 244, 243, 0.72); }

.on-paper-2 { background: var(--paper-2); }

.hr-ledger {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}
.on-dark .hr-ledger { border-top-color: var(--line-dark); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); max-width: 620px; margin: 0; }
.section-head .lede { max-width: 380px; color: var(--ink-soft); margin: 0; }
.on-dark .section-head .lede { color: rgba(242,244,243,0.65); }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: var(--harbor);
  color: var(--paper);
  padding: 120px 0 0;
  overflow: hidden;
  position: relative;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: end;
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
}
.hero h1 {
  font-size: clamp(38px, 5.6vw, 68px);
  color: var(--white);
  max-width: 15ch;
}
.hero .lede {
  font-size: 18px;
  color: rgba(242, 244, 243, 0.75);
  max-width: 46ch;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }

.hero-figures {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--line-dark);
  padding-left: 28px;
  margin-bottom: 56px;
}
.hero-figure .num {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--beacon);
  display: block;
}
.hero-figure .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(242, 244, 243, 0.55);
}

/* Horizon ledger signature element */
.horizon {
  position: relative;
  height: 96px;
  border-top: 1px solid var(--line-dark);
}
.horizon-ticks {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
}
.horizon-ticks span {
  width: 1px;
  height: 8px;
  background: var(--line-dark);
  margin-top: 0;
}
.horizon-ticks span:nth-child(5n) { height: 14px; background: rgba(242,244,243,0.34); }
.beacon-dot {
  position: absolute;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--beacon);
  box-shadow: 0 0 0 0 rgba(232, 169, 75, 0.5);
  animation: beacon-travel 7s ease-in-out infinite, beacon-pulse 2.4s ease-in-out infinite;
}
@keyframes beacon-travel {
  0%   { left: 2%; }
  45%  { left: 63%; }
  55%  { left: 63%; }
  100% { left: 2%; }
}
@keyframes beacon-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 169, 75, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(232, 169, 75, 0); }
}

.ticker-wrap {
  border-top: 1px solid var(--line-dark);
  overflow: hidden;
  padding: 16px 0;
  margin-top: 32px;
}
.ticker {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(242, 244, 243, 0.5);
  animation: ticker-scroll 32s linear infinite;
  width: max-content;
}
.ticker span { display: inline-flex; align-items: center; gap: 10px; }
.ticker .up { color: var(--beacon); }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ==========================================================================
   Cards / grids
   ========================================================================== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper);
  padding: 40px 34px;
  transition: background 0.2s ease;
}
.card:hover { background: var(--white); }
.card .card-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--beacon-dim);
  margin-bottom: 20px;
  display: block;
}
.card h3 { font-size: 21px; margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 15px; margin-bottom: 0; }

/* Stats band */
.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
@media (max-width: 760px) { .stats-band { grid-template-columns: repeat(2, 1fr); gap: 36px; } }
.stat .num {
  font-family: var(--font-mono);
  font-size: clamp(30px, 3.4vw, 44px);
  color: var(--beacon);
  display: block;
  margin-bottom: 8px;
}
.stat .label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(242, 244, 243, 0.55);
}

/* Process (legitimate sequence -> numbered) */
.process-list { border-top: 1px solid var(--line); }
.process-item {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  gap: 24px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
@media (max-width: 760px) {
  .process-item { grid-template-columns: 50px 1fr; }
  .process-item .process-desc { grid-column: 1 / -1; padding-left: 74px; margin-top: -14px; }
}
.process-item .step-num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--beacon-dim);
}
.process-item h3 { font-size: 22px; margin: 0; }
.process-item p { color: var(--ink-soft); margin: 0; font-size: 15px; }

/* CTA band */
.cta-band {
  background: var(--water);
  color: var(--white);
  text-align: left;
}
.cta-band h2 { color: var(--white); font-size: clamp(28px, 4vw, 44px); max-width: 18ch; }
.cta-band .cta-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.cta-band p { color: rgba(255,255,255,0.78); }
.cta-band .btn { border-color: rgba(255,255,255,0.5); color: var(--white); }
.cta-band .btn-beacon { border-color: var(--beacon); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--harbor); color: rgba(242,244,243,0.7); padding-top: 72px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  margin-bottom: 18px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a:hover { color: var(--beacon); }
.footer-brand .wordmark { font-family: var(--font-display); font-size: 22px; color: var(--white); font-weight: 700; }
.footer-brand p { max-width: 32ch; margin-top: 14px; font-size: 14px; }
.footer-bottom {
  border-top: 1px solid var(--line-dark);
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   Page hero (interior pages)
   ========================================================================== */
.page-hero { background: var(--harbor); color: var(--paper); padding: 84px 0 60px; }
.page-hero h1 { color: var(--white); font-size: clamp(34px, 5vw, 54px); max-width: 20ch; }
.page-hero .lede { max-width: 56ch; color: rgba(242,244,243,0.72); font-size: 17px; margin-bottom: 0; }

/* ==========================================================================
   Services page
   ========================================================================== */
.service-detail {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 760px) { .service-detail { grid-template-columns: 1fr; gap: 16px; } }
.service-detail .service-index { font-family: var(--font-mono); font-size: 13px; color: var(--beacon-dim); }
.service-detail h3 { font-size: 26px; margin-top: 8px; }
.service-detail ul { margin: 18px 0 0; padding-left: 18px; color: var(--ink-soft); }
.service-detail li { margin-bottom: 8px; font-size: 15px; }

/* ==========================================================================
   About page
   ========================================================================== */
.value-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 700px) { .value-list { grid-template-columns: 1fr; } }

.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 860px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .team-grid { grid-template-columns: 1fr; } }
.team-card .avatar {
  aspect-ratio: 1;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.team-card h3 { font-size: 18px; margin-bottom: 2px; }
.team-card .role { font-family: var(--font-mono); font-size: 12px; color: var(--water); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; display: block; }
.team-card p { font-size: 14px; color: var(--ink-soft); }

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }

.contact-info dl { margin: 0; }
.contact-info dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--water);
  margin-top: 28px;
}
.contact-info dt:first-child { margin-top: 0; }
.contact-info dd { margin: 6px 0 0; font-size: 17px; }

.form-field { margin-bottom: 22px; }
.form-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--ink-soft);
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  border-radius: var(--radius);
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--water);
}
.form-field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 13px; color: var(--ink-soft); margin-top: 18px; }
.form-success {
  display: none;
  border: 1px solid var(--water);
  background: rgba(47, 111, 98, 0.08);
  padding: 16px 18px;
  font-size: 14px;
  border-radius: var(--radius);
  margin-top: 20px;
}
.form-success.is-visible { display: block; }
.form-error {
  display: none;
  border: 1px solid #b3462c;
  background: rgba(179, 70, 44, 0.08);
  color: #8a3520;
  padding: 16px 18px;
  font-size: 14px;
  border-radius: var(--radius);
  margin-top: 20px;
}
.form-error.is-visible { display: block; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Focus visibility everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--water);
  outline-offset: 2px;
}
