/* ==========================================================================
   HANVEX — Global Stylesheet
   Consulting & Technology Firm
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  /* Color tokens */
  --ink: #14171F;
  --navy: #1B2A4A;
  --navy-light: #2E4470;
  --gold: #B8874B;
  --gold-light: #D6AD78;
  --paper: #FFFFFF;
  --offwhite: #F7F6F3;
  --gray: #5B5F6B;
  --gray-light: #8B8F99;
  --line: #E4E2DC;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Layout */
  --max-width: 1180px;
  --header-h: 78px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

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

@media (max-width: 640px) {
  .container { padding: 0 20px; }
}

/* ==========================================================================
   Reading progress bar
   ========================================================================== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  z-index: 1200;
  transition: width 0.08s linear;
}

/* ==========================================================================
   Header — textured top border + navigation
   ========================================================================== */
.texture-strip {
  height: 7px;
  width: 100%;
  background-image: repeating-linear-gradient(
      -45deg,
      var(--offwhite) 0px,
      var(--offwhite) 2px,
      var(--paper) 2px,
      var(--paper) 5px
    ),
    linear-gradient(90deg, var(--navy) 0%, var(--gold) 50%, var(--navy) 100%);
  background-blend-mode: normal;
  position: relative;
}
.texture-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(20, 23, 31, 0.05) 0px,
    rgba(20, 23, 31, 0.05) 1px,
    transparent 1px,
    transparent 6px
  );
}

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

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
}
.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}
@media (max-width: 480px) {
  .brand-logo { height: 30px; }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--navy);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gold);
}

.nav-cta {
  display: inline-block;
  padding: 10px 22px;
  background: var(--navy);
  color: var(--paper) !important;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 2px;
  transition: background 0.2s ease;
}
.nav-cta:hover { background: var(--ink); }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
  .menu-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 24px;
    gap: 0;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.22s ease;
  }
  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links {
    flex-direction: column;
    gap: 0;
  }
  .nav-links a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--offwhite);
  }
  .nav-cta { margin-top: 16px; text-align: center; }
}

/* ==========================================================================
   Typography helpers
   ========================================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.35rem; }

p { color: var(--gray); }
.lede {
  font-size: 1.15rem;
  color: var(--gray);
  max-width: 620px;
}

.section {
  padding: 96px 0;
}
.section-alt { background: var(--offwhite); }
@media (max-width: 640px) {
  .section { padding: 64px 0; }
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 2px;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--navy);
  color: var(--paper);
}
.btn-primary:hover { background: var(--ink); transform: translateY(-1px); }
.btn-outline {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }

/* ==========================================================================
   Hero (systems-grid signature motif)
   ========================================================================== */
.hero {
  position: relative;
  padding: 110px 0 100px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-grid-motif {
  position: absolute;
  top: 0; right: -10%;
  width: 60%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 680px;
}
.hero h1 { margin-bottom: 24px; }
.hero .lede { margin-bottom: 36px; }
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 72px;
  flex-wrap: wrap;
}
.hero-stat .num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--navy);
  font-weight: 600;
}
.hero-stat .label {
  font-size: 0.82rem;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   Page hero (interior pages — shorter)
   ========================================================================== */
.page-hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
  background: var(--offwhite);
}
.page-hero h1 { margin-bottom: 16px; }

/* ==========================================================================
   Cards & Grids
   ========================================================================== */
.grid {
  display: grid;
  gap: 28px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 32px 28px;
  border-radius: 3px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: var(--navy);
  transform: translateY(-3px);
}
.card .icon {
  width: 40px; height: 40px;
  border-radius: 2px;
  background: var(--offwhite);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  color: var(--navy);
  font-family: var(--font-mono);
  font-weight: 500;
}
.card h3 { margin-bottom: 10px; font-size: 1.1rem; }
.card p { font-size: 0.94rem; }

.pillar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}
.pillar-link .arrow { transition: transform 0.2s ease; }
.card:hover .pillar-link .arrow { transform: translateX(4px); }

/* ==========================================================================
   Home: overview links to other pages
   ========================================================================== */
.overview-card {
  padding: 40px 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  position: relative;
}
.overview-card .index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-light);
  margin-bottom: 22px;
  display: block;
}

/* ==========================================================================
   Services grid page
   ========================================================================== */
.service-card {
  padding: 28px 24px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.service-card h3 {
  font-size: 1.02rem;
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: 8px;
}
.service-card p { font-size: 0.88rem; }
.service-card .tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

/* ==========================================================================
   Insights page
   ========================================================================== */
.insights-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 9px 18px;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray);
  border-radius: 20px;
  transition: all 0.2s ease;
}
.filter-chip.active,
.filter-chip:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--offwhite);
}

.article-card {
  border: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.article-thumb {
  height: 160px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  overflow: hidden;
  background: var(--navy);
}
.article-thumb svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.article-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-thumb .thumb-tag {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--paper);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(20,23,31,0.35);
  padding: 5px 10px;
  border-radius: 20px;
}
.article-body {
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-source {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gray-light);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}
.article-body h3 { font-size: 1.02rem; margin-bottom: 10px; font-family: var(--font-body); font-weight: 700; }
.article-body p { font-size: 0.88rem; flex: 1; }
.article-body .read-link {
  margin-top: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}

.insights-status {
  font-size: 0.85rem;
  color: var(--gray-light);
  margin-bottom: 24px;
  font-family: var(--font-mono);
}

/* ==========================================================================
   People page
   ========================================================================== */
.people-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 880px) {
  .people-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}
.person-card {
  border: 1px solid var(--line);
  background: var(--paper);
}
.avatar-placeholder {
  height: 240px;
  background: repeating-linear-gradient(
    135deg, #E9E7E1 0px, #E9E7E1 12px, #F1EFEA 12px, #F1EFEA 24px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-light);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.avatar-placeholder .initials {
  font-family: var(--font-display);
  font-size: 2.6rem;
  color: var(--gray-light);
}
.person-info { padding: 24px; }
.person-info h3 { margin-bottom: 4px; }
.person-role {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
}
.person-info p { font-size: 0.9rem; }

/* ==========================================================================
   About page
   ========================================================================== */
.value-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.value-row:last-child { border-bottom: 1px solid var(--line); }
.value-row h3 { color: var(--navy); }
@media (max-width: 640px) {
  .value-row { grid-template-columns: 1fr; gap: 12px; }
}

/* ==========================================================================
   Contact page / form
   ========================================================================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 880px) {
  .contact-layout { grid-template-columns: 1fr; }
}
.contact-detail {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.contact-detail:last-child { border-bottom: 1px solid var(--line); }
.contact-detail .k {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 90px;
  flex-shrink: 0;
  padding-top: 3px;
}

.form-card {
  background: var(--offwhite);
  border: 1px solid var(--line);
  padding: 40px;
}
@media (max-width: 640px) {
  .form-card { padding: 26px 20px; }
}
.form-group { margin-bottom: 22px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 0.94rem;
  color: var(--ink);
  border-radius: 2px;
  transition: border-color 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
}
.form-group textarea { resize: vertical; min-height: 130px; }
.form-note {
  font-size: 0.78rem;
  color: var(--gray-light);
  margin-top: 14px;
}
.form-success {
  display: none;
  background: var(--navy);
  color: var(--paper);
  padding: 16px 18px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  border-radius: 2px;
}
.form-success.show { display: block; }

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
  background: var(--navy);
  color: var(--paper);
  padding: 72px 0;
  text-align: center;
}
.cta-band h2 { color: var(--paper); margin-bottom: 16px; }
.cta-band p { color: rgba(255,255,255,0.7); max-width: 480px; margin: 0 auto 32px; }
.cta-band .btn-primary { background: var(--gold); color: var(--ink); }
.cta-band .btn-primary:hover { background: var(--gold-light); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.65);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--paper);
  margin-bottom: 14px;
}
.footer-grid p { color: rgba(255,255,255,0.5); font-size: 0.88rem; max-width: 280px; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  transition: color 0.2s ease;
}
.footer-col ul li a:hover { color: var(--gold-light); }
.footer-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ==========================================================================
   Floating buttons
   ========================================================================== */
.floating-buttons {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1100;
}
.fab {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(20,23,31,0.18);
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.fab-top {
  width: 44px;
  height: 44px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--navy);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}
.fab-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.fab-top:hover { border-color: var(--navy); transform: translateY(-2px); }

.fab-contact {
  width: auto;
  height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  background: var(--navy);
  color: var(--paper);
  font-size: 0.86rem;
  font-weight: 600;
  gap: 8px;
}
.fab-contact:hover { background: var(--ink); transform: translateY(-2px); }

@media (max-width: 480px) {
  .floating-buttons { right: 14px; bottom: 14px; }
  .fab-contact span.fab-label { display: none; }
  .fab-contact { width: 48px; height: 48px; padding: 0; border-radius: 50%; }
}

/* ==========================================================================
   Misc
   ========================================================================== */
.divider {
  height: 1px;
  background: var(--line);
  border: none;
  margin: 0;
}
::selection { background: var(--gold-light); color: var(--ink); }

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
