/* =========================================================================
 * madebycaveman — shared site styles (homepage, Solutions, MyAgents)
 * Tokens, base, header with the split Solutions control, footer, buttons.
 * Page-specific styles live with each page.
 * ========================================================================= */
:root {
  --bg-obsidian: #050507;
  --bg-elevated: #0b0c10;
  --bg-surface: #101218;
  --bg-glass: rgba(14, 16, 22, 0.78);
  --text-ivory: #f5f3ee;
  --text-secondary: #9a9aa4;
  --text-muted: #5e606a;
  --accent-amber: #e5a93c;
  --accent-amber-soft: rgba(229, 169, 60, 0.14);
  --border-hairline: rgba(255, 255, 255, 0.075);
  --border-subtle: rgba(255, 255, 255, 0.13);
  --shadow-stage: 0 36px 90px rgba(0, 0, 0, 0.78);
  --font-display: "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --gutter: clamp(18px, 3vw, 40px);
  --header-h: 64px;
}

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

html {
  background: var(--bg-obsidian);
  color: var(--text-ivory);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg-obsidian);
  color: var(--text-ivory);
  overflow-x: hidden;
}

::selection {
  background: rgba(229, 169, 60, 0.28);
  color: var(--text-ivory);
}

img {
  max-width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text-ivory);
  color: #121110;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ------------------------------------------------------------------ header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-hairline);
  transition: background 0.25s ease;
}

.header-inner {
  height: 100%;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* logo: the hand-drawn cave mark centred above the lowercase wordmark */
.brand-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px 2px;
  border-radius: 8px;
  color: var(--text-ivory);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}

.brand-link svg {
  display: block;
  width: 36px;
  height: 22px;
}

.brand-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Solutions: one pill, two targets — the word goes to the directory,
   the chevron opens the list of products. Same behaviour on every device. */
.solutions-wrap {
  position: relative;
}

.solutions-split {
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.solutions-split:hover,
.solutions-split:focus-within,
.solutions-split.is-current {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-hairline);
}

.nav-link,
.nav-chevron {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(245, 243, 238, 0.86);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-link {
  padding: 8px 6px 8px 15px;
  border-radius: 999px 0 0 999px;
}

.nav-chevron {
  padding: 8px 12px 8px 7px;
  border-radius: 0 999px 999px 0;
  position: relative;
}

/* a hairline between the two targets, so they read as two buttons in one pill */
.nav-chevron::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.nav-chevron svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.nav-chevron[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nav-link:hover,
.nav-chevron:hover,
.nav-link[aria-current="page"] {
  color: #ffffff;
}

.nav-link:focus-visible,
.nav-chevron:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}

/* touch: comfortable 44px targets */
@media (pointer: coarse) {
  .nav-link {
    min-height: 44px;
    padding-left: 16px;
  }

  .nav-chevron {
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
    padding: 0 12px;
  }
}

.solutions-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 16px;
  background: #0d0e12;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-stage);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  /* closed = out of the tab order too (visibility flips after the fade) */
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.solutions-menu.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.solution-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-ivory);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.solution-item:hover,
.solution-item:focus-visible {
  background: rgba(229, 169, 60, 0.08);
  border-color: rgba(229, 169, 60, 0.28);
  outline: none;
}

.solution-item:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-amber);
}

.solution-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.solution-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-amber);
}

.solution-item-desc {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.solution-item-arrow {
  color: var(--accent-amber);
}

.solutions-menu-all {
  display: block;
  margin: 6px 6px 2px;
  padding: 8px 8px;
  border-top: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 12.5px;
  text-decoration: none;
  border-radius: 8px;
}

.solutions-menu-all:hover,
.solutions-menu-all:focus-visible {
  color: var(--text-ivory);
  outline: none;
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 600px) {
  .solutions-wrap {
    position: static;
  }

  .solutions-menu {
    position: fixed;
    top: 62px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .brand-link {
    font-size: 14px;
  }
}

/* ----------------------------------------------------------------- buttons */
.btn {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  background: #fbf8f2;
  color: #121110;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid #fbf8f2;
  outline-offset: 4px;
}

.btn .arrow {
  transition: transform 0.2s ease;
}

.btn:hover .arrow {
  transform: translateX(3px);
}

.btn-ghost {
  background: rgba(5, 4, 3, 0.18);
  color: #fbf8f2;
  box-shadow: inset 0 0 0 1px rgba(251, 248, 242, 0.42);
  font-weight: 500;
}

.btn-ghost:hover {
  background: #fbf8f2;
  color: #121110;
}

.text-link {
  color: var(--text-ivory);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 243, 238, 0.3);
  padding-bottom: 1px;
}

.text-link:hover {
  border-bottom-color: var(--text-ivory);
}

/* ------------------------------------------------------------------ footer */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 52px var(--gutter) 60px;
  background: var(--bg-obsidian);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 28px;
}

.footer-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-ivory);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.footer-logo svg {
  width: 40px;
  height: 24px;
  display: block;
}

.footer-cta {
  padding: 12px 22px;
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
  color: var(--text-ivory);
}

.footer-links a:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 520px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }
}

/* ------------------------------------------------------------ scroll reveal
   (only when JS is running — header.html marks <html class="js">; without it, content just shows) */
.js .reveal {
  opacity: 0;
  translate: 0 18px;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), translate 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.is-in {
  opacity: 1;
  translate: 0 0;
}

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