/* ============================================================
   CustodyIQ Labs — styles.css
   Dark, sharp, single green accent. Neutral enough to parent
   three independent brands. Mobile-first, AA-contrast.
   ============================================================ */

:root {
  /* Core palette */
  --bg:            #0c0f0e;   /* near-black, faint green cast */
  --bg-raised:     #14181a;   /* cards / raised surfaces */
  --bg-header:     rgba(12, 15, 14, 0.85);
  --border:        #232a28;   /* hairline borders */
  --border-strong: #313a37;

  --text:          #eef2f0;   /* primary text */
  --text-muted:    #9aa6a1;   /* secondary text (AA on --bg) */
  --text-faint:    #6f7b76;   /* tertiary / labels */

  /* Single accent — CustodyIQ green */
  --accent:        #3fb98a;
  --accent-hover:  #54d39f;
  --accent-ink:    #06120d;   /* text on accent fills */

  /* Per-brand accent hints (tasteful, used on card edges/tags) */
  --brand-custodyiq: #3fb98a; /* green */
  --brand-cali:      #d8584f; /* red */
  --brand-sleep:     #c4a98b; /* warm taupe */

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;

  /* Layout */
  --container: 1080px;
  --radius: 14px;
  --radius-sm: 9px;

  --space-section: 5.5rem;
}

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

html { scroll-behavior: smooth; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }

a { color: inherit; }

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

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

/* Accessibility helpers */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.wordmark-img { height: 32px; width: auto; }
.wordmark-text { display: inline-flex; align-items: baseline; }
.wordmark-strong { color: var(--text); }
.wordmark-light  { color: var(--text-muted); font-weight: 500; }

/* Under ~420px, drop the text and keep the icon for breathing room */
@media (max-width: 420px) {
  .wordmark-text { display: none; }
}

/* Visually hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.site-nav { display: flex; align-items: center; }

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.97rem;
  font-weight: 500;
  padding: 0.25rem 0;
  transition: color 0.15s ease;
}
.nav-menu a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(5.5rem, 15vw, 11rem);
  border-bottom: 1px solid var(--border);
}

/* Depth layer: green glow + faint ghosted icon watermark */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  top: -28%;
  left: 50%;
  width: min(1100px, 130%);
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(63, 185, 138, 0.22), rgba(63, 185, 138, 0.06) 55%, transparent 72%);
  filter: blur(6px);
}
.hero-watermark {
  position: absolute;
  top: 50%;
  right: -8%;
  width: clamp(360px, 48vw, 720px);
  height: auto;
  transform: translateY(-50%);
  opacity: 0.09;
  filter: grayscale(1);
  user-select: none;
}

.hero-inner {
  position: relative;
  max-width: 880px;
}
.hero-heading {
  font-size: clamp(2.6rem, 7.5vw, 5.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.6rem;
  text-wrap: balance;
}
.hero-accent { color: var(--accent); }
.hero-subhead {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 2.4rem;
}

/* Staggered entrance — fade + rise on load */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.reveal-2 { animation-delay: 0.12s; }
.reveal-3 { animation-delay: 0.24s; }

@keyframes hero-rise {
  to { opacity: 1; transform: translateY(0); }
}

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

/* ---------- Section heads ---------- */
.section-head { margin-bottom: 2.5rem; }
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 700;
}
.section-lede {
  color: var(--text-muted);
  margin: 0.7rem 0 0;
  font-size: 1.05rem;
}

/* ---------- Portfolio ---------- */
.portfolio { padding-block: var(--space-section); }

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-top: 3px solid var(--card-accent, var(--accent));
  border-radius: var(--radius);
  padding: 1.9rem 1.8rem;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
}
.card-body { flex: 1; }

.card-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--card-accent, var(--accent));
  margin: 0 0 0.9rem;
}
.card-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.card-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 0 1.6rem;
}
.card-link {
  align-self: flex-start;
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.card-link:hover {
  color: var(--card-accent, var(--accent));
  border-bottom-color: var(--card-accent, var(--accent));
}

/* Per-brand accent hints */
.card--custodyiq { --card-accent: var(--brand-custodyiq); }
.card--cali      { --card-accent: var(--brand-cali); }
.card--sleep     { --card-accent: var(--brand-sleep); }

/* ---------- About ---------- */
.about {
  padding-block: var(--space-section);
  border-top: 1px solid var(--border);
}
.about-inner { max-width: 720px; }
.about-body {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--text-muted);
  margin: 1.5rem 0 0;
}

/* ---------- Contact ---------- */
.contact {
  padding-block: var(--space-section);
  border-top: 1px solid var(--border);
}
.contact-inner { max-width: 720px; }
.contact-lede {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 1rem 0 2rem;
}
.contact-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.8rem 0 0;
  padding: 0;
}
.contact-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.contact-links a:hover { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.2rem;
}
.footer-note {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.9rem;
}

/* ---------- Responsive: tablet+ ---------- */
@media (min-width: 720px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Responsive: mobile nav ---------- */
@media (max-width: 719px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 30px -20px rgba(0, 0, 0, 0.9);

    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .site-nav.is-open .nav-menu { max-height: 320px; }

  .nav-menu li { border-top: 1px solid var(--border); }
  .nav-menu a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text);
  }

  /* Hamburger -> X when open */
  .site-nav.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-nav.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .site-nav.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}