/* =========================================================
   DATAVERSE PRECISION ANALYTICS — Stylesheet
   Design language: precision instrumentation / technical drafting
   Corner calibration brackets, coordinate ticks, signal-line motif
   ========================================================= */

:root{
  /* ---- Color tokens (light) ----
     Blue and deep-blue extracted directly from the Dataverse logo mark. */
  --paper:      #ffffff;
  --surface:    #f6f8fc;
  --ink:        #10173a;
  --blue:       #3946a2;   /* logo deep blue — headings accent, primary buttons */
  --blue-bright:#2fa0e0;   /* logo bright blue — links, icons, highlights */
  --blue-deep:  #262f78;   /* darkened deep blue — hover states */
  --blue-tint:  #eaf4fc;
  --slate:      #4a5570;
  --slate-soft: #7c869c;
  --line:       rgba(16, 23, 58, 0.13);
  --shadow:     0 24px 60px -32px rgba(16, 23, 58, 0.35);

  /* ---- Type ---- */
  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --radius: 3px;
  --header-h: 76px;
  --edge: 14px; /* bracket corner length */
}

[data-theme="dark"]{
  --paper:      #08090c;
  --surface:    #101319;
  --ink:        #f3f5fa;
  --blue:       #6f8de8;   /* lightened logo deep blue for contrast on black */
  --blue-bright:#4fbaf0;   /* logo bright blue, boosted for dark contrast */
  --blue-deep:  #98acf5;
  --blue-tint:  #121c30;
  --slate:      #b6bfd4;
  --slate-soft: #7f89a0;
  --line:       rgba(255, 255, 255, 0.16);
  --shadow:     0 24px 70px -32px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after{ box-sizing: border-box; }

html{
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

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

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

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

h1, h2, h3{
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

h1{ font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 700; }
h2{ font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 600; }
h3{ font-size: 1.15rem; font-weight: 600; }

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

.mono{ font-family: var(--font-mono); }

.skip-link{
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  z-index: 999;
}
.skip-link:focus{ left: 12px; top: 12px; }

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

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1em;
}
.eyebrow::before{
  content: '';
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--blue-bright);
  flex-shrink: 0;
}

.lede{
  max-width: 620px;
  font-size: 1.05rem;
}

.section-inner{
  max-width: 1160px;
  margin: 0 auto;
  padding: 120px 32px;
}

/* ---------- Corner calibration bracket (signature element) ---------- */
.bracket{
  position: relative;
  padding: 28px;
  background-image:
    linear-gradient(to right, var(--blue) 2px, transparent 2px),
    linear-gradient(to bottom, var(--blue) 2px, transparent 2px),
    linear-gradient(to left, var(--blue) 2px, transparent 2px),
    linear-gradient(to bottom, var(--blue) 2px, transparent 2px),
    linear-gradient(to right, var(--blue) 2px, transparent 2px),
    linear-gradient(to top, var(--blue) 2px, transparent 2px),
    linear-gradient(to left, var(--blue) 2px, transparent 2px),
    linear-gradient(to top, var(--blue) 2px, transparent 2px);
  background-repeat: no-repeat;
  background-size:
    var(--edge) 2px, 2px var(--edge),
    var(--edge) 2px, 2px var(--edge),
    var(--edge) 2px, 2px var(--edge),
    var(--edge) 2px, 2px var(--edge);
  background-position:
    top left, top left,
    top right, top right,
    bottom left, bottom left,
    bottom right, bottom right;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .3s ease;
}
.site-header.scrolled{
  border-bottom-color: var(--line);
}

.header-inner{
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .04em;
  font-size: .95rem;
  color: var(--ink);
}
.brand-mark{ color: var(--blue); display: flex; }
.brand-text{ display: flex; flex-direction: column; line-height: 1.15; }
.brand-text em{
  font-style: normal;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .58rem;
  letter-spacing: .1em;
  color: var(--slate-soft);
  text-transform: uppercase;
}

.nav{
  display: flex;
  gap: 34px;
}
.nav a{
  font-size: .92rem;
  font-weight: 500;
  color: var(--slate);
  position: relative;
  padding: 6px 0;
  transition: color .2s ease;
}
.nav a::after{
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--blue-bright);
  transition: width .25s ease;
}
.nav a:hover{ color: var(--ink); }
.nav a:hover::after{ width: 100%; }

.header-actions{ display: flex; align-items: center; gap: 10px; }

.icon-btn{
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.icon-btn:hover{ border-color: var(--blue-bright); color: var(--blue-bright); }

#themeToggle .icon-moon{ display: none; }
[data-theme="dark"] #themeToggle .icon-sun{ display: none; }
[data-theme="dark"] #themeToggle .icon-moon{ display: block; }

.nav-toggle{
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}
.nav-toggle span{
  position: absolute;
  left: 10px; right: 10px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .25s ease, opacity .25s ease, top .25s ease;
}
.nav-toggle span:nth-child(1){ top: 14px; }
.nav-toggle span:nth-child(2){ top: 18.5px; }
.nav-toggle span:nth-child(3){ top: 23px; }
.nav-toggle.open span:nth-child(1){ top: 18.5px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2){ opacity: 0; }
.nav-toggle.open span:nth-child(3){ top: 18.5px; transform: rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero{
  padding: 64px 28px 40px;
  background:
    linear-gradient(var(--paper), var(--paper)),
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 64px);
  background-blend-mode: normal;
  position: relative;
}
[data-theme="dark"] .hero{ opacity: 1; }
.hero::before{
  content:'';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 64px);
  opacity: .35;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 40%, transparent 90%);
  pointer-events: none;
}

.hero-grid{
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
  padding: 56px 0 88px;
}

.hero-copy h1{ margin-bottom: .42em; }
.hero-sub{ max-width: 520px; font-size: 1.08rem; }

.hero-cta{ display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 28px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .18s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
  border: 1.5px solid transparent;
}
.btn:hover{ transform: translateY(-2px); }
.btn-primary{ background: var(--blue); color: #fff; }
.btn-primary:hover{ background: var(--blue-deep); }
.btn-ghost{ border-color: var(--line); color: var(--ink); }
.btn-ghost:hover{ border-color: var(--blue); color: var(--blue); }

.hero-visual{ display: flex; justify-content: center; }
.chart-frame{
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.chart-label{
  display: block;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--slate-soft);
  margin-bottom: 12px;
}
.chart-label .mono{ color: var(--blue-bright); }

#heroChart .tick{
  font-family: var(--font-mono);
  font-size: 8px;
  fill: var(--slate-soft);
}
#heroChart .trend-line{
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: drawLine 2.1s ease forwards .2s;
}
#heroChart .trend-ghost{ opacity: .55; }
#heroChart .data-points circle{
  opacity: 0;
  animation: fadeInPoint .4s ease forwards;
}
#heroChart .data-points circle:nth-child(1){ animation-delay: .3s; }
#heroChart .data-points circle:nth-child(2){ animation-delay: .9s; }
#heroChart .data-points circle:nth-child(3){ animation-delay: 1.4s; }
#heroChart .data-points circle:nth-child(4){ animation-delay: 1.8s; }
#heroChart .data-points circle:nth-child(5){ animation-delay: 2.1s; }

@keyframes drawLine{ to{ stroke-dashoffset: 0; } }
@keyframes fadeInPoint{ to{ opacity: 1; } }

@media (prefers-reduced-motion: reduce){
  #heroChart .trend-line{ animation: none; stroke-dashoffset: 0; }
  #heroChart .data-points circle{ animation: none; opacity: 1; }
  html{ scroll-behavior: auto; }
}

/* =========================================================
   ABOUT
   ========================================================= */
.about{ background: var(--paper); }

.pillars{
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.pillar{ background: var(--surface); }
.pillar-tag{
  display: inline-block;
  font-size: .72rem;
  color: var(--blue);
  letter-spacing: .08em;
  margin-bottom: 14px;
}
.pillar p{ font-size: .96rem; margin-bottom: 0; }

/* =========================================================
   SERVICES
   ========================================================= */
.services{ background: var(--surface); }

.service-grid{
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.service-card{
  background: var(--paper);
  transition: transform .25s ease, box-shadow .25s ease;
}
.service-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.service-icon{
  display: inline-flex;
  color: var(--blue);
  margin-bottom: 18px;
}
.service-card p{ font-size: .92rem; margin-bottom: 0; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact{ background: var(--paper); }

.contact-card{
  margin-top: 48px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 36px;
  align-items: center;
  max-width: 780px;
}

.contact-list{ list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.contact-list li{ display: flex; align-items: center; gap: 14px; }
.contact-icon{ color: var(--blue-bright); flex-shrink: 0; }
.contact-label{
  display: block;
  font-size: .66rem;
  letter-spacing: .1em;
  color: var(--slate-soft);
  margin-bottom: 3px;
}
.contact-list a{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  transition: color .2s ease;
}
.contact-list a:hover{ color: var(--blue-bright); }

.contact-divider{
  width: 1px;
  height: 100%;
  min-height: 90px;
  background: var(--line);
  justify-self: center;
}

.social-block{ text-align: left; }
.social-links{ display: flex; gap: 10px; margin-top: 10px; }

/* =========================================================
   REVEAL ANIMATION
   ========================================================= */
.reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in-view{ opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-inner{
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px 28px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
}
.footer-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  color: var(--blue);
}
.footer-brand em{ font-style: normal; color: var(--ink); font-weight: 600; }
.footer-nav{ display: flex; gap: 26px; }
.footer-nav a{ font-size: .88rem; color: var(--slate); }
.footer-nav a:hover{ color: var(--blue-bright); }
.footer-socials{ display: flex; gap: 10px; }
.footer-socials a{
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--slate);
  transition: color .2s ease, border-color .2s ease;
}
.footer-socials a:hover{ color: var(--blue-bright); border-color: var(--blue-bright); }

.footer-bottom{
  border-top: 1px solid var(--line);
  padding: 18px 28px;
  text-align: center;
  font-size: .74rem;
  color: var(--slate-soft);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; padding-top: 24px; }
  .hero-copy{ text-align: left; }
  .hero-visual{ order: -1; }
  .service-grid{ grid-template-columns: repeat(2, 1fr); }
  .pillars{ grid-template-columns: 1fr; }
  .contact-card{ grid-template-columns: 1fr; }
  .contact-divider{ width: 100%; height: 1px; min-height: 0; }
}

@media (max-width: 760px){
  .nav{
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .nav.open{ max-height: 320px; }
  .nav a{
    padding: 16px 28px;
    border-top: 1px solid var(--line);
  }
  .nav-toggle{ display: block; }
  .section-inner{ padding: 84px 22px; }
  .service-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 480px){
  .hero{ padding-top: 24px; }
  .hero-cta{ flex-direction: column; align-items: stretch; }
  .btn{ text-align: center; }
}
