/* shared.css — DocuLock design tokens, reset, nav, footer, mobile navigation
   Cache-bust: increment ?v= query string in all <link> tags when this file changes. */

/* ── Design tokens ───────────────────────────────────────────────── */
:root {
  --ink:          #0F0F0D;
  --ink-mid:      #4A4A44;
  --ink-light:    #9A9A8E;
  --paper:        #FAFAF8;
  --paper-tint:   #F2F2EE;
  --teal:         #0D7377;
  --teal-light:   #EEF6F6;
  --teal-mid:     #1A9A9F;
  --border:       rgba(15,15,13,0.10);
  --border-teal:  rgba(13,115,119,0.20);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Instrument Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --radius-sm:    6px;
  --radius:       12px;
  --radius-lg:    20px;
  --space-xs:  8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  48px;
  --space-xl:  80px;
  --space-2xl: 140px;
  --step-circle: 38px;
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Utilities ───────────────────────────────────────────────────── */
.container { max-width: 1440px; margin: 0 auto; padding: 0 var(--space-lg); }
section[id] { scroll-margin-top: 84px; }
.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: 12px;
  background: var(--paper); border: 1px solid var(--border);
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--ink); text-decoration: none; z-index: 999; transition: none;
}
.skip-link:focus { left: 12px; }

/* ── Nav — always-raised default (inner pages)
   index.html overrides to start transparent then adds .raised on scroll ── */
nav:not(.nav-drawer):not(.bottom-nav) {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  background: rgba(250,250,248,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
nav.raised:not(.nav-drawer):not(.bottom-nav) {
  background: rgba(250,250,248,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--teal);
  border-radius: 50%;
  animation: logo-pulse 3s 1.5s ease-in-out infinite;
}
@keyframes logo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-mid);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a[aria-current="page"] { color: var(--teal); }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teal);
  border: 1px solid var(--border-teal);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.nav-mobile-actions {
  display: none;
  align-items: center;
  gap: var(--space-xs);
}
.nav-mobile-cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teal);
  border: 1px solid var(--border-teal);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-mobile-secondary { color: var(--ink-mid); border-color: var(--border); }

/* ── Hamburger ───────────────────────────────────────────────────── */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px;
  margin-left: 4px;
  color: var(--ink);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  flex-shrink: 0;
}
.hamburger svg { display: block; pointer-events: none; }
.hamburger .bar { transition: transform 0.28s ease, opacity 0.2s ease; transform-origin: center; }
.hamburger.open .bar-mid { opacity: 0; transform: scaleX(0); }
.hamburger.open .bar-top { transform: translateY(5.25px) rotate(45deg); }
.hamburger.open .bar-bot { transform: translateY(-5.25px) rotate(-45deg); }

/* ── Nav drawer ──────────────────────────────────────────────────── */
.nav-drawer {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  z-index: 99;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(15,15,13,0.10);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s;
}
.nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.nav-drawer-list { list-style: none; }
.nav-drawer-list a {
  display: flex;
  align-items: center;
  padding: 15px var(--space-md);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-mid);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s, background 0.15s;
}
.nav-drawer-list li:last-child a { border-bottom: none; }
.drawer-login a { color: var(--teal); font-family: var(--font-mono); font-size: 0.82rem; }

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(15,15,13,0.22);
}
.nav-backdrop.open { display: block; }

/* ── Bottom nav ──────────────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 97;
  background: rgba(250,250,248,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-list {
  list-style: none;
  display: flex;
  height: 58px;
}
.bottom-nav-list li { flex: 1; }
.bottom-nav-list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: var(--ink-light);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-list a:active,
.bottom-nav-list a[aria-current="page"] { color: var(--teal); }
.bottom-nav-list .bnav-login a { color: var(--teal); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal);
  color: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 2px 16px rgba(13,115,119,0.25);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-mid);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.btn-secondary svg { transition: transform 0.2s; }
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--teal);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1.5px solid var(--border-teal);
  transition: background 0.2s;
}

/* ── Footer ──────────────────────────────────────────────────────── */
footer { padding: var(--space-lg) 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-logo { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; color: var(--ink-mid); text-decoration: none; }
.footer-copy { font-family: var(--font-mono); font-size: 0.65rem; color: var(--ink-light); letter-spacing: 0.06em; }

/* ── Focus ───────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--teal-mid); outline-offset: 3px; }
.btn-primary:focus-visible { outline-offset: 4px; border-radius: var(--radius-sm); }
.btn-secondary:focus-visible, .nav-links a:focus-visible, .nav-cta:focus-visible { border-radius: 3px; }
.nav-logo:focus-visible, .footer-logo:focus-visible { border-radius: 2px; }

/* ── Hover states (pointer devices only) ────────────────────────── */
@media (hover: hover) {
  .nav-mobile-cta:hover       { background: var(--teal); color: white; }
  .nav-mobile-secondary:hover { background: var(--paper-tint); color: var(--ink); }
  .nav-links a:hover          { color: var(--ink); }
  .nav-cta:hover              { background: var(--teal); color: white; }
  .btn-primary:hover          { background: var(--teal-mid); transform: translateY(-1px); }
  .btn-secondary:hover        { color: var(--ink); }
  .btn-secondary:hover svg    { transform: translateX(3px); }
  .btn-outline:hover          { background: var(--teal-light); }
  .hamburger:hover            { background: var(--paper-tint); }
  .nav-drawer-list a:hover    { color: var(--teal); background: var(--teal-light); }
  .bottom-nav-list a:hover    { color: var(--teal); }
}

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .nav-logo::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ── Mobile breakpoints ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .container           { padding: 0 var(--space-md); }
  .nav-links           { display: none; }
  .nav-mobile-actions  { display: flex; }
  .hamburger           { display: flex; }
  .nav-drawer          { display: block; }
  .bottom-nav          { display: block; }
  .footer-inner        { flex-direction: column; gap: var(--space-sm); text-align: center; }
  body                 { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
}
