/* ==========================================================================
   Onyx Haven Labs — styles
   Dark, understated technical identity: charcoal/near-black, white/gray
   type, restrained copper accent. No frameworks.
   ========================================================================== */

:root {
  --bg: #0b0b0c;
  --bg-raised: #121214;
  --bg-card: #17171a;
  --border: #2a2a2e;
  --text: #f2f1ee;
  --text-muted: #a6a5a1;
  --text-dim: #83827b;
  --accent: #c98a4b;
  --accent-soft: rgba(201, 138, 75, 0.14);
  --accent-strong: #e0a568;
  --focus: #e0a568;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1280px;
  --radius: 10px;
  --radius-lg: 16px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.25rem;
  --space-5: 3.25rem;
  --space-6: 4.5rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3 { line-height: 1.15; font-weight: 650; letter-spacing: -0.01em; margin: 0; }

p { margin: 0 0 1em; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #14100b;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

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

/* ---------------------------------- Header ---------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 12, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
}

.wordmark-mark { color: var(--accent); flex-shrink: 0; }

.wordmark-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.wordmark-text.small { font-size: 0.85rem; }

.wordmark-accent { color: var(--accent); }

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

.primary-nav a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.primary-nav a:hover,
.primary-nav a:focus-visible { color: var(--text); }

.nav-cta {
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 18px;
  margin: 0 auto;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------- Hero ---------------------------------- */

.hero {
  position: relative;
  padding: var(--space-6) 0 var(--space-5);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 980px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  color: var(--text);
  margin-bottom: var(--space-3);
}

.hero-lede {
  font-size: 1.1rem;
  max-width: 68ch;
  margin-bottom: var(--space-4);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------------------------------- Buttons ---------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #14100b;
}
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.btn-large { padding: 1rem 2rem; font-size: 1.05rem; }

/* ---------------------------------- Positioning band ---------------------------------- */

.positioning {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}

.positioning-statement {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  color: var(--text);
  font-weight: 500;
  max-width: 920px;
  line-height: 1.5;
}

/* ---------------------------------- Section shared ---------------------------------- */

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

/* Offset anchor-jump targets so section headings never land under the
   sticky, blurred header (nav clicks and scrollIntoView both respect this). */
#services, #examples, #about, #contact {
  scroll-margin-top: 88px;
}

.section-heading {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--text);
  margin-bottom: var(--space-1);
}

.section-sub {
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: var(--space-4);
}

/* ---------------------------------- Services ---------------------------------- */

.services { border-bottom: 1px solid var(--border); }

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* 5 cards in a 3-column grid leaves a ragged last row — let the final
   card fill the remaining two tracks instead of leaving an empty gap. */
.service-card:last-child {
  grid-column: span 2;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.service-card h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.service-intro {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0 0 0.9rem;
}

.service-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.service-list li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.93rem;
}
.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.services-footnote {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.92rem;
  max-width: 75ch;
}

/* ---------------------------------- Examples (how I help) ---------------------------------- */

.examples { border-bottom: 1px solid var(--border); }

.examples-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.examples-col h3 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.examples-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.examples-list li {
  position: relative;
  padding: 0.85rem 1rem 0.85rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
}
.examples-list li::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  top: 1rem;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

/* ---------------------------------- About ---------------------------------- */

.about { border-bottom: 1px solid var(--border); }

.about-inner { max-width: 820px; }

.about-lede {
  font-size: 1.08rem;
  color: var(--text);
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: var(--space-4);
}

.fact {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  background: var(--bg-card);
}

.fact-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.fact-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------------------------------- Contact ---------------------------------- */

.contact { text-align: center; }

.contact-inner { max-width: 620px; margin: 0 auto; }

.contact .section-sub { margin-left: auto; margin-right: auto; }

/* ---------------------------------- Footer ---------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-4) 0;
  background: var(--bg-raised);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}

.footer-brand p {
  font-size: 0.85rem;
  margin-top: 0.4rem;
  color: var(--text-dim);
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
}
.footer-nav a {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.footer-nav a:hover { color: var(--accent); }

.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-dim);
  width: 100%;
  text-align: center;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

/* ---------------------------------- Reveal-on-scroll ---------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .service-card { transition: none; }
}

/* ---------------------------------- Responsive ---------------------------------- */

@media (max-width: 960px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .examples-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}

@media (max-width: 720px) {
  .hide-mobile { display: none; }

  .nav-toggle { display: flex; }

  .primary-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    display: none;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a {
    padding: 0.75rem 0;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
  .primary-nav a:last-child { border-bottom: none; }
  .nav-cta {
    border: none;
    padding: 0.75rem 0;
    border-radius: 0;
  }

  .service-grid { grid-template-columns: 1fr; }
  /* grid-column: span 2 on the last card would otherwise force an implicit
     second column here even with a single 1fr track, breaking the
     single-column mobile stack — reset it back to normal flow. */
  .service-card:last-child { grid-column: auto; }
  .about-facts { grid-template-columns: 1fr; }

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

  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-nav { flex-wrap: wrap; }
}
