/* ============================================================
   Harva Solutions — styles
   Palette and layout inspired by the deep-tech, editorial feel
   of safely.bio. Recolour by editing the tokens in :root.
   ============================================================ */

:root {
  /* colour */
  --bg:        #f4f2ea;   /* warm cream page */
  --bg-card:   #ffffff;   /* floating cards */
  --bg-panel:  #ece9dd;   /* subtle inset panels */
  --bg-ink:    #16160f;   /* near-black sections */
  --ink:       #17170f;   /* primary text */
  --ink-soft:  #57594e;   /* muted text */
  --ink-faint: #8a8b7f;   /* labels on cream */
  --line:      #e3e0d2;   /* hairline borders */
  --line-ink:  #2c2c22;   /* borders on dark */

  --accent:      #2d6a5a; /* deep sage-teal */
  --accent-deep: #1f4c40;
  --accent-soft: #d6e4db; /* pale sage wash */
  --accent-mist: #e8f0ea;

  /* chain node hues (echo of the reference site's coloured tags) */
  --n-green: #2f8f6b;
  --n-teal:  #2aa4b0;
  --n-amber: #d08a2c;
  --n-plum:  #7a4f7d;

  /* type */
  --f-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --f-body:    "Inter", system-ui, -apple-system, sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  /* geometry */
  --maxw: 1120px;
  --radius: 14px;
  --radius-lg: 22px;
  --gap: clamp(1rem, 3vw, 2rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
p { margin: 0; }

/* ---------- layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.section { padding-block: var(--section-y); }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.eyebrow::before { content: "#"; color: var(--accent); font-weight: 500; }
.lead { color: var(--ink-soft); font-size: 1.06rem; max-width: 46ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--f-body); font-weight: 500; font-size: 0.95rem;
  padding: 0.8rem 1.35rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #f4f2ea; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); }
.arrow::after { content: "→"; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 700;
}
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a.link { font-size: 0.95rem; color: var(--ink-soft); }
.nav-links a.link:hover { color: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 0.4rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; transition: .2s; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-blob {
  position: absolute; top: -160px; right: -120px; width: 520px; height: 520px;
  background: radial-gradient(circle at 40% 40%, var(--accent-soft), transparent 62%);
  filter: blur(6px); z-index: 0; pointer-events: none;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center; padding-block: clamp(3rem, 7vw, 5.5rem);
}
.hero h1 { font-size: clamp(2.7rem, 6.2vw, 4.6rem); margin: 1.1rem 0 1.3rem; }
.hero h1 .accent { color: var(--accent); }
.hero-cta { display: flex; gap: 0.75rem; margin-top: 1.8rem; flex-wrap: wrap; }

/* ---------- hero product card ---------- */
.panel {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: 0 30px 60px -30px rgba(20,20,10,.25);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 0.74rem; color: var(--ink-soft);
}
.panel-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 0.5rem; }
.pipeline { display: grid; grid-template-columns: 1fr 1fr; }
.pipeline .col-src { border-right: 1px solid var(--line); padding: 0.5rem; }
.pipeline .col-out { padding: 0.9rem 1rem; background: var(--accent-mist); }
.src-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.65rem; border-radius: 9px; font-size: 0.86rem;
}
.src-row + .src-row { margin-top: 2px; }
.src-row .name { display: flex; align-items: center; gap: 0.55rem; }
.src-row .swatch { width: 9px; height: 9px; border-radius: 3px; }
.src-row.active { background: var(--bg-panel); }
.tag {
  font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: .04em;
  padding: 0.12rem 0.45rem; border-radius: 5px; text-transform: lowercase;
}
.tag.sync { background: #e4efe7; color: var(--accent-deep); }
.tag.map  { background: #eef0e2; color: #6b6a2c; }
.tag.live { background: #e2eef0; color: #1f6470; }
.out-title { font-family: var(--f-display); font-weight: 700; font-size: 1.02rem; }
.out-sub { font-family: var(--f-mono); font-size: 0.7rem; color: var(--ink-soft); margin-top: 0.15rem; }
.out-list { margin-top: 0.9rem; display: grid; gap: 0.5rem; }
.out-item { display: flex; align-items: center; justify-content: space-between; font-size: 0.82rem; }
.out-item .k { color: var(--ink-soft); font-family: var(--f-mono); font-size: 0.74rem; }
.out-item .v { display: inline-flex; align-items: center; gap: 0.4rem; }
.check { color: var(--accent); font-weight: 700; }

/* ---------- value strip ---------- */
.value {
  border-block: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.value .cell { padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.25rem, 3vw, 2rem); }
.value .cell + .cell { border-left: 1px solid var(--line); }
.value .big { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.02em; }
.value .small { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 0.5rem; }

/* ---------- stages ---------- */
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 5vw, 3.4rem); }
.section-head h2 { font-size: clamp(1.9rem, 4.4vw, 3rem); margin: 0.8rem 0 1rem; }
.stages { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage { background: var(--bg); padding: clamp(1.6rem, 3.4vw, 2.4rem); }
.stage .num { font-family: var(--f-mono); font-size: 0.78rem; color: var(--accent); letter-spacing: .12em; }
.stage h3 { font-size: 1.4rem; margin: 0.7rem 0 0.15rem; }
.stage .role { font-family: var(--f-mono); font-size: 0.74rem; color: var(--ink-faint); text-transform: lowercase; }
.stage p { color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.9rem; }

/* ---------- trust (dark) ---------- */
.dark { background: var(--bg-ink); color: #e9e7db; }
.dark .eyebrow { color: #9a9a8c; }
.dark .section-head h2 { color: #f4f2ea; }
.trust-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.trust-list { display: grid; gap: 1.4rem; }
.trust-item { display: grid; grid-template-columns: 20px 1fr; gap: 0.9rem; }
.trust-item .hash { font-family: var(--f-mono); color: var(--accent); }
.trust-item p { color: #bdbcb0; font-size: 0.96rem; margin-top: 0.3rem; }
.trust-item h4 { font-family: var(--f-display); font-size: 1.05rem; color: #f4f2ea; }
.chain {
  background: #1d1d15; border: 1px solid var(--line-ink); border-radius: var(--radius);
  padding: 1.4rem; font-family: var(--f-mono); font-size: 0.8rem;
}
.chain-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0; color: #cfcec2; }
.chain-row .glyph { color: #6d6d5f; }
.chain-row .hex { margin-left: auto; color: #83837600; }
.chain-row .node { color: #f4f2ea; }
.chain-row .swatch { width: 10px; height: 10px; border-radius: 3px; }
.chain-foot { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line-ink); color: #83837a; font-size: 0.72rem; }

/* ---------- code / the work ---------- */
.code-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.code {
  background: var(--bg-ink); color: #d7d6c8; border-radius: var(--radius);
  font-family: var(--f-mono); font-size: 0.82rem; line-height: 1.75; overflow: hidden;
  border: 1px solid var(--line-ink);
}
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line-ink); color: #9a9a8c; font-size: 0.72rem; }
.code-body { padding: 1.1rem 1.2rem; white-space: pre; overflow-x: auto; }
.code-body .c { color: #7e8a6f; }
.code-body .k { color: #8fd0b6; }
.code-body .s { color: #d9c58a; }
.code-body .ok { color: #7fbf9a; }

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; }
.marquee-track { display: flex; gap: 3rem; padding: 1.1rem 0; width: max-content; animation: slide 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); display: inline-flex; gap: 3rem; }
.marquee-track span::after { content: "·"; color: var(--accent); }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- contact / CTA ---------- */
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.form { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.field input, .field textarea {
  font-family: var(--f-body); font-size: 0.98rem; color: var(--ink);
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.75rem 0.85rem; width: 100%; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-mist); }
.form-note { font-size: 0.85rem; color: var(--ink-soft); }
.form-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- team ---------- */
.team { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.member { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 700;
  color: var(--accent-deep); font-size: 1.3rem; border: 1px solid var(--line);
}
.member h3 { font-size: 1.2rem; margin: 1rem 0 0.2rem; }
.member .role { font-family: var(--f-mono); font-size: 0.74rem; color: var(--accent); text-transform: lowercase; }
.member p { color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.7rem; }

/* ---------- prose (about) ---------- */
.prose { max-width: 62ch; }
.prose p { color: var(--ink-soft); font-size: 1.05rem; margin-top: 1.1rem; }
.prose p:first-child { margin-top: 0; }
.prose .big-line { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.2rem); color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(2.5rem, 5vw, 4rem); }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer .tagline { color: var(--ink-soft); max-width: 30ch; margin-top: 0.8rem; font-size: 0.95rem; }
.footer-links { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.footer-col { display: grid; gap: 0.5rem; }
.footer-col .h { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.3rem; }
.footer-col a, .footer-col span { font-size: 0.9rem; color: var(--ink-soft); }
.footer-col a:hover { color: var(--ink); }
.footer-base { margin-top: clamp(2rem, 4vw, 3rem); padding-top: 1.4rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-faint); }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid, .trust-grid, .code-grid, .cta-grid { grid-template-columns: 1fr; }
  .code-grid .code { order: 2; }
  .stages, .team { grid-template-columns: 1fr; }
  .value { grid-template-columns: 1fr; }
  .value .cell + .cell { border-left: 0; border-top: 1px solid var(--line); }
  .hero-blob { width: 360px; height: 360px; top: -120px; right: -80px; }
  .nav-links { position: fixed; inset: 68px 0 auto 0; background: var(--bg); flex-direction: column; align-items: flex-start; gap: 0; padding: 0.5rem 1.25rem 1.25rem; border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .25s ease; }
  .nav-links.open { transform: none; }
  .nav-links a.link { padding: 0.85rem 0; width: 100%; border-bottom: 1px solid var(--line); }
  .nav-links .btn { margin-top: 0.8rem; }
  .nav-toggle { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}
