/* =========================================================
   GRAFT marketing site, shared components
   Header, footer, install module. Extracted from
   draft-v4-hybrid.html. Shared infrastructure, linked by
   every page. Depends on tokens.css + base.css.

   A11y note: min-height 44px added to interactive controls
   (header CTA, device toggle, newsletter button) to meet the
   44x44 touch-target rule and the PART 2 Lighthouse gate.
   This is the only deliberate deviation from pixel-exact v4.
   No colour, copy, font, or token value was changed.
   ========================================================= */

/* ============ HEADER ============ */
.hd {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: rgba(8, 8, 8, 0.7);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s var(--ease-out), background 0.3s;
}
.hd.hide { transform: translateY(-100%); }
.hd-logo {
  display: inline-flex; align-items: center;
  min-height: 44px; /* touch target */
}
.hd-logo img {
  height: 30px; width: auto;
  display: block;
  transition: transform 0.4s var(--ease-spring);
}
.hd-logo:hover img { transform: scale(1.05); }
.hd-nav { display: flex; align-items: center; gap: 28px; }
.hd-nav a:not(.hd-cta) {
  font-size: 14px; color: var(--dim);
  transition: color 0.2s;
  position: relative;
  display: inline-flex; align-items: center;
  min-height: 44px; /* touch target */
}
.hd-nav a:not(.hd-cta)::after {
  content: ""; position: absolute;
  bottom: 8px; left: 0;
  width: 0; height: 1px;
  background: var(--lime);
  transition: width 0.3s var(--ease-out);
}
.hd-nav a:not(.hd-cta):hover { color: var(--text); }
.hd-nav a:not(.hd-cta):hover::after { width: 100%; }

.hd-cta {
  background: var(--lime); color: var(--bg);
  padding: 9px 18px; border-radius: 6px;
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.02em;
  transition: all 0.25s var(--ease);
  box-shadow: 0 0 0 0 var(--lime-glow);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center;
  min-height: 44px; /* touch target */
}
.hd-cta::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease-out);
}
.hd-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--lime-glow);
}
.hd-cta:hover::before { transform: translateX(100%); }

/* ============ INSTALL MODULE ============ */
.install { padding: 120px 0; }
.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
  gap: 0;
  align-items: center;
}
/* The decorative phone demo is hidden site-wide (owner call, 2026-07-07):
   it read as an empty mock and undersold the app. The install module now
   runs as a single centred column. Re-enable by restoring the two-column
   grid above and removing the two display:none rules below; a stronger
   comeback would put a real screenshot (assets/screens/dashboard.png)
   inside the phone. */
.install-phone { display: none; }
.install-grid > div:has(.install-phone) { display: none; }
.install h2 { margin-bottom: 20px; }
.install-sub {
  font-size: 18px; color: var(--dim);
  margin-bottom: 28px;
  max-width: 460px;
}
/* Primary "Open GRAFT" action: opening the app is the main action; the device steps
   below are the supporting "keep it on your home screen" detail. */
.install-open-row { margin-bottom: 32px; }
.install-device-toggle {
  display: inline-flex;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px;
  margin-bottom: 36px;
  position: relative;
}
.install-device-toggle button {
  padding: 8px 18px;
  font-size: 13px; font-weight: 700;
  color: var(--dim);
  border-radius: 100px;
  transition: color 0.3s, transform 0.3s var(--ease-spring);
  position: relative; z-index: 2;
  min-height: 44px; /* touch target */
}
.install-device-toggle button.active {
  background: var(--lime); color: var(--bg);
  box-shadow: 0 4px 12px var(--lime-glow);
  transform: scale(1.03);
}
.install-steps { display: grid; gap: 16px; }
.install-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 18px;
  padding: 18px 20px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.install-step::before {
  content: ""; position: absolute;
  left: 0; top: 0; bottom: 0; width: 0;
  background: var(--lime); opacity: 0.06;
  transition: width 0.4s var(--ease-out);
}
.install-step:hover::before { width: 100%; }
.install-step:hover { border-color: var(--lime); transform: translateX(6px); }
.install-step-num {
  width: 36px; height: 36px;
  background: var(--lime-soft);
  border: 1px solid var(--lime-glow);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--lime);
  position: relative; z-index: 1;
}
.install-step-text { font-size: 16px; padding-top: 6px; position: relative; z-index: 1; }
.install-step-text .quiet { display: block; color: var(--dim); font-size: 13px; margin-top: 4px; }

.install-phone {
  width: 100%; max-width: 320px;
  aspect-ratio: 9/19;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  border: 1px solid var(--border-2);
  border-radius: 36px;
  padding: 16px 12px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 80px var(--lime-soft);
  animation: phoneFloat 6s ease-in-out infinite;
}
@keyframes phoneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.install-phone-screen {
  width: 100%; height: 100%;
  border-radius: 22px;
  background: var(--bg);
  padding: 16px 12px;
  display: flex; flex-direction: column;
  gap: 8px; position: relative;
}
.install-phone-logo {
  font-size: 13px; color: var(--lime); font-weight: 700;
  letter-spacing: 0.2em; margin-bottom: 8px;
}
.install-phone-headline {
  font-size: 17px; font-weight: 700;
  line-height: 1.1; margin-bottom: auto;
}
.install-phone-share {
  background: var(--lime); color: var(--bg);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  position: relative;
}
.install-phone-share::after {
  content: ""; position: absolute;
  inset: -6px;
  border: 2px solid var(--lime);
  border-radius: 14px;
  opacity: 0;
  animation: ripple 2s var(--ease-out) infinite;
}
@keyframes ripple {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* ============ FOOTER ============ */
.ft {
  border-top: 1px solid var(--border);
  padding: 100px 0 40px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-1) 100%);
  position: relative;
}
.ft-stamp {
  text-align: center;
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.9;
  font-weight: 700; letter-spacing: -0.035em;
  margin-bottom: 100px;
  background: linear-gradient(180deg, var(--text) 0%, var(--dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ft-stamp .dot { -webkit-text-fill-color: var(--lime); }
.ft-newsletter {
  max-width: 540px;
  margin: 0 auto 80px;
  text-align: center;
  padding: 40px 32px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  position: relative; overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.4s;
}
.ft-newsletter::before {
  content: ""; position: absolute;
  top: 0; left: 0; height: 2px; width: 0;
  background: var(--lime);
  transition: width 0.6s var(--ease-out);
}
.ft-newsletter:hover::before { width: 100%; }
.ft-newsletter:hover { border-color: var(--lime-glow); box-shadow: 0 20px 60px rgba(200, 245, 66, 0.06); }
.ft-newsletter h3 {
  font-size: 24px; font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.ft-newsletter p { font-size: 14px; color: var(--dim); margin-bottom: 24px; }
.ft-form {
  display: flex; gap: 8px;
  flex-wrap: wrap; /* status + Turnstile take their own full-width rows */
  margin-bottom: 14px;
}
.ft-form-input-wrap { flex: 1; position: relative; }
.ft-form input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-family: inherit; font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  min-height: 44px; /* touch target */
}
.ft-form-input-wrap::after {
  content: ""; position: absolute;
  bottom: 0; left: 0; height: 2px; width: 0;
  background: var(--lime);
  transition: width 0.4s var(--ease-out);
  border-radius: 0 0 10px 10px;
}
.ft-form-input-wrap:focus-within::after { width: 100%; }
.ft-form-input-wrap:focus-within input { border-color: var(--lime-glow); }
.ft-form button {
  background: var(--lime); color: var(--bg);
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 14px; font-weight: 700;
  transition: all 0.25s var(--ease);
  min-height: 44px; /* touch target */
}
.ft-form button:hover { box-shadow: 0 6px 18px var(--lime-glow); transform: translateY(-1px); }
.ft-form button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.ft-consent { font-size: 11px; color: var(--dim); }
/* Underline so the Privacy Policy link is distinguishable without relying on colour (a11y) */
.ft-consent a { text-decoration: underline; }
/* Honeypot field, off-screen, never shown to humans (wired PART 6) */
.ft-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* ARIA live region for newsletter feedback */
.ft-form-status { font-size: 13px; color: var(--lime); min-height: 1.4em; margin-bottom: 4px; flex: 1 0 100%; }
/* Cloudflare Turnstile widget sits on its own row below the input + button */
.ft-form .cf-turnstile { flex: 1 0 100%; margin-top: 4px; }
/* Brief lime border pulse on a successful signup (respects reduced-motion via base.css) */
.ft-newsletter.nt-success { animation: ntPulse 0.9s var(--ease-out); }
@keyframes ntPulse {
  0% { box-shadow: 0 0 0 0 var(--lime-glow); border-color: var(--lime); }
  100% { box-shadow: 0 0 0 12px transparent; border-color: var(--border); }
}

.ft-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.ft-col-title {
  font-size: 11px; color: var(--lime);
  font-weight: 700; letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.ft-col ul { list-style: none; }
.ft-col li { padding: 4px 0; }
.ft-col a {
  color: var(--dim); font-size: 14px;
  transition: color 0.2s;
  position: relative;
  display: inline-flex; align-items: center;
  min-height: 32px;
}
.ft-col a::after {
  content: ""; position: absolute;
  bottom: 6px; left: 0;
  width: 0; height: 1px;
  background: var(--lime);
  transition: width 0.3s var(--ease-out);
}
.ft-col a:hover { color: var(--lime); }
.ft-col a:hover::after { width: 100%; }
.ft-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--dim);
}
.ft-bottom .sep { color: var(--dimmer); margin: 0 8px; }

/* ============ RESPONSIVE (shared component breakpoints) ============ */
@media (max-width: 900px) {
  .hd { padding: 12px 16px; }
  /* Keep About + Pricing reachable from the mobile header (tighter gap + smaller text). */
  .hd-nav { gap: 16px; }
  .hd-nav a:not(.hd-cta) { font-size: 13px; }
  .issue-strip { display: none; }
  .install-grid { grid-template-columns: 1fr; gap: 48px; }
  .ft-cols { grid-template-columns: 1fr; }
  .ft-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .ft-form { flex-direction: column; }
  .install-phone { animation: none; } /* save battery on mobile */
}

/* =========================================================
   PRICING CARDS (SHARED COMPONENT)
   Used by home Module 07 AND the /pricing page (PART 4).
   Markup lives in components/_pricing-cards.html. Extracted
   verbatim from draft-v4-hybrid.html Module 07. a11y: CTA
   min-height 44px.
   ========================================================= */
.pricing { padding: 120px 0; text-align: center; }
.pricing h2 { margin-bottom: 20px; }
.pricing-sub {
  font-size: 18px; color: var(--dim);
  max-width: 600px; margin: 0 auto 60px;
}
.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: left;
}
.p-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  display: flex; flex-direction: column;
  position: relative;
  transition: all 0.4s var(--ease-out);
  overflow: hidden;
}
.p-card::before {
  content: ""; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  height: 2px; width: 0;
  background: var(--lime);
  transition: width 0.5s var(--ease-out);
}
.p-card:hover::before { width: 80%; }
.p-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-2);
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}
.p-card.featured {
  background: linear-gradient(180deg, var(--lime-soft) 0%, var(--bg-1) 60%);
  border: 1.5px solid var(--lime);
  box-shadow: 0 0 60px var(--lime-soft);
  overflow: visible; /* let the floating "Best value" badge (top:-12px) show */
}
.p-card.featured:hover {
  box-shadow: 0 30px 80px rgba(200, 245, 66, 0.18), 0 0 100px var(--lime-soft);
  transform: translateY(-10px);
}
.p-card.featured::before { background: transparent; }
.p-card-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--lime); color: var(--bg);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  box-shadow: 0 4px 16px var(--lime-glow);
  animation: badgePulse 3s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 4px 16px var(--lime-glow); }
  50% { box-shadow: 0 4px 24px var(--lime-glow), 0 0 0 4px rgba(200, 245, 66, 0.1); }
}
.p-card-title {
  font-size: 12px; color: var(--dim);
  font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.p-card-price {
  font-size: 48px; font-weight: 700;
  line-height: 1; margin-bottom: 4px;
  letter-spacing: -0.025em;
}
.p-card.featured .p-card-price { color: var(--lime); }
.p-card-period { font-size: 13px; color: var(--dim); margin-bottom: 8px; }
.p-card-note { font-size: 12px; color: var(--dim); margin-bottom: 20px; }
.p-card-feature-intro {
  font-size: 13px; color: var(--text); font-weight: 700;
  margin-bottom: 10px;
}
.p-card-features {
  list-style: none;
  font-size: 14px;
  flex: 1;
  margin-bottom: 28px;
}
.p-card-features li {
  padding: 6px 0;
  position: relative; padding-left: 24px;
  transition: padding-left 0.3s var(--ease);
}
.p-card-features li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 14px; height: 1.5px; background: var(--lime);
  transition: width 0.3s var(--ease-out);
}
.p-card:hover .p-card-features li:hover { padding-left: 28px; }
.p-card:hover .p-card-features li:hover::before { width: 18px; }
.p-card-cta {
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 14px;
  min-height: 44px; /* touch target */
  border: 1px solid var(--border-2);
  border-radius: 10px;
  font-size: 14px; font-weight: 700;
  transition: all 0.25s;
  position: relative; overflow: hidden;
}
.p-card-cta:hover { border-color: var(--lime); color: var(--lime); background: var(--lime-soft); }
.p-card.featured .p-card-cta {
  background: var(--lime); color: var(--bg); border-color: var(--lime);
}
.p-card.featured .p-card-cta:hover {
  box-shadow: 0 8px 24px var(--lime-glow);
  transform: translateY(-1px);
}
.pricing-trust {
  margin-top: 32px;
  font-size: 13px; color: var(--dim);
}
@media (max-width: 900px) {
  .pricing { padding: 80px 0; }
  .pricing-cards { grid-template-columns: 1fr; }
}
