/* ============================================
   NewNest Finance — Design Tokens
   Structured & Modern direction
   ============================================ */

:root {
  /* Color */
  --ink: #11131A;
  --ink-soft: #1B1E28;
  --paper: #F7F7F5;
  --paper-raised: #FFFFFF;
  --blue: #3D6EF5;
  --blue-deep: #2851C9;
  --blue-pale: #E8EFFE;
  --slate: #5B6472;
  --slate-light: #8B93A1;
  --line: #E2E4E8;
  --line-dark: #2A2D38;
  --mint: #2BC9A3;
  --mint-deep: #19967A;
  --mint-pale: #E3F8F2;
  --danger: #E0524A;

  /* Type */
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  /* Scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 7rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { 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;
  }
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: clamp(2.25rem, 4.5vw, 3.75rem); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.15; }
h3 { font-size: 1.25rem; line-height: 1.3; }

p { margin: 0; color: var(--slate); }

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

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

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ============================================
   Ledger texture — signature background motif
   ============================================ */

.ledger-bg {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 39px,
    rgba(255, 255, 255, 0.045) 40px
  );
}

.ledger-bg-light {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 39px,
    rgba(17, 19, 26, 0.035) 40px
  );
}

/* ============================================
   Header / Navigation
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 247, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--ink);
}

.logo-mark .mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--slate);
  padding: 6px 2px;
  position: relative;
  transition: color 0.15s var(--ease);
}

.nav-links a:hover { color: var(--ink); }

.nav-links a.active { color: var(--ink); }

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
}

.nav-cta {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.15s var(--ease);
}

.nav-cta:hover { background: var(--blue-deep); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--blue);
  color: white;
}
.btn-primary:hover { background: var(--blue-deep); }

.btn-dark {
  background: var(--ink);
  color: var(--paper);
}
.btn-dark:hover { background: var(--ink-soft); }

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

.btn-outline-light {
  background: transparent;
  color: var(--paper);
  border-color: rgba(247, 247, 245, 0.3);
}
.btn-outline-light:hover { border-color: rgba(247, 247, 245, 0.7); }

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.card-dark {
  background: var(--ink-soft);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

/* ============================================
   Sections
   ============================================ */

section { padding: var(--space-6) 0; }

.section-tight { padding: var(--space-5) 0; }

.section-dark {
  background: var(--ink);
  color: var(--paper);
}

.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--paper); }
.section-dark p { color: var(--slate-light); }

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--ink);
  color: var(--slate-light);
  padding: var(--space-5) 0 var(--space-3);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line-dark);
}

.footer-grid h4 {
  color: var(--paper);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.footer-grid a, .footer-grid p {
  display: block;
  font-size: 0.9375rem;
  color: var(--slate-light);
  margin-bottom: 10px;
  transition: color 0.15s var(--ease);
}

.footer-grid a:hover { color: var(--paper); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-3);
  font-size: 0.8125rem;
}

.footer-disclosure {
  max-width: 760px;
  font-size: 0.75rem;
  color: var(--slate-light);
  opacity: 0.7;
  margin-top: var(--space-2);
  line-height: 1.6;
}

/* ============================================
   Forms
   ============================================ */

.field {
  margin-bottom: var(--space-2);
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  background: var(--paper-raised);
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-pale);
}

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

/* ============================================
   Utility
   ============================================ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: center; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-3); }
.flex-center { display: flex; align-items: center; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.text-center { text-align: center; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--mint-pale);
  color: var(--mint-deep);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .field-row { grid-template-columns: 1fr; }
  .services-lead, .services-secondary, .advisor-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 720px) {
  .nav-links { 
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; }
  .nav-cta { text-align: center; }
  .nav-toggle { display: flex; }
  section { padding: var(--space-5) 0; }
  .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
}
