/* ThriveWell NFC card — design tokens from /company/brand-design.md
   Distilled subset: parchment + ink + Blueprint + Amber. No industry pops on this surface. */

:root {
  /* Paper + Ink */
  --paper-0: #FBFAF2;
  --paper-1: #F5F0E4;
  --paper-2: #E9E1CE;
  --paper-3: #D8CEB6;
  --ink-2: #7D8BA0;
  --ink-1: #475569;
  --ink-0: #1E293B;

  /* Brand */
  --blueprint-700: #142749;
  --blueprint-600: #1E3A6B;
  --blueprint-500: #2D519A;
  --amber-600: #9A6A2A;
  --amber-500: #C78D3E;
  --night: #0C1A2E;

  /* Type */
  --font-display: "Archivo Black", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* Spacing */
  --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 80px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper-1);
  color: var(--ink-0);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

/* ───── Recipient page (index.html) ───── */

.card {
  min-height: 100vh;
  min-height: 100svh; /* small viewport on mobile, dodges chrome UI */
  display: flex;
  flex-direction: column;
  background: var(--paper-1);
}

/* Hero — Blueprint-duotone per brand-design.md §3.2 (canonical pattern).
   Grayscale photo via `filter` on the <img>, Blueprint multiply via `::after`
   on the container. Filter belongs on the IMAGE, never the container — keeps
   overlaid text/captions crisp. */
.hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-5) var(--sp-7);
  overflow: hidden;
  background: var(--night);
}
img.hero__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: contrast(1.05) brightness(1.0);
  z-index: 0;
}
.hero--duotone-blueprint::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--blueprint-600);
  mix-blend-mode: multiply;
  opacity: 0.88;
  pointer-events: none;
  z-index: 1;
}
.hero__gradient {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,26,46,0) 0%, rgba(12,26,46,0.55) 100%);
  z-index: 2;
}
.hero__lockup,
.hero__headline { position: relative; z-index: 2; }

.hero__lockup { width: 200px; max-width: 60vw; }
.hero__lockup img { width: 100%; height: auto; }

.hero__headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 8.6vw, 3rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  color: var(--paper-0);
  text-transform: uppercase;
  max-width: 14ch;
  margin: 0;
}
.hero__headline em {
  font-style: italic;
  color: var(--amber-500); /* on duotone surface */
  font-weight: 900;
}

/* Identity + buttons — parchment ground */
.identity {
  background: var(--paper-1);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  border-top: 1px solid var(--paper-3);
}
.identity__name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink-0);
  margin: 0 0 4px;
}
.identity__title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink-1);
  letter-spacing: 0;
  margin: 0 0 var(--sp-5);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Buttons — §7.1 */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-height: 52px;
  padding: 14px 24px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 3px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary {
  background: var(--blueprint-600);
  color: var(--paper-0);
  border-color: var(--blueprint-600);
}
.btn--primary:hover, .btn--primary:active {
  background: var(--blueprint-700);
  border-color: var(--blueprint-700);
}
.btn--secondary {
  background: transparent;
  color: var(--ink-0);
  border-color: var(--ink-0);
}
.btn--secondary:hover, .btn--secondary:active {
  background: var(--ink-0);
  color: var(--paper-0);
}

/* Footer contact line */
.meta {
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  background: var(--paper-1);
  font-size: 0.85rem;
  color: var(--ink-1);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--paper-3);
}
.meta a {
  color: var(--ink-1);
  text-decoration: none;
  border-bottom: 1.5px solid var(--amber-600);
  padding-bottom: 1px;
}
.meta a:hover { color: var(--blueprint-600); }

/* Focus states — §7.15 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--blueprint-600);
  outline-offset: 3px;
  border-radius: 2px;
}
.hero :focus-visible { outline-color: var(--amber-500); }

/* ───── Sender PWA (share.html) ───── */

.sender {
  min-height: 100vh; min-height: 100svh;
  background: var(--night);
  color: var(--paper-0);
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
}
.sender__lockup { width: 200px; max-width: 60vw; margin-bottom: var(--sp-7); }

.sender__main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--sp-6);
}

.sender__kicker {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber-500);
  border-bottom: 1.5px solid var(--amber-500);
  padding-bottom: 4px;
}

.sender__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 12vw, 3.6rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--paper-0);
  margin: 0;
  max-width: 12ch;
}
.sender__title em {
  font-style: italic;
  color: var(--amber-500);
  font-weight: 900;
}

.sender__tapbtn {
  width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--blueprint-600);
  color: var(--paper-0);
  border: 4px solid var(--amber-500);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: var(--sp-2);
  transition: transform 120ms ease, background 120ms ease, box-shadow 200ms ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
}
.sender__tapbtn:active { transform: scale(0.96); }
.sender__tapbtn[data-state="writing"] {
  background: var(--blueprint-700);
  box-shadow: 0 0 0 0 rgba(199, 141, 62, 0.6);
  animation: pulse 1.4s ease-out infinite;
}
.sender__tapbtn[data-state="success"] {
  background: var(--amber-500);
  color: var(--night);
  border-color: var(--paper-0);
}
.sender__tapbtn[data-state="error"] {
  background: #9B2A1F;
  border-color: #9B2A1F;
}
.sender__tapbtn[data-state="unsupported"] {
  background: transparent;
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.42);
  cursor: not-allowed;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(199, 141, 62, 0.55), 0 12px 36px rgba(0,0,0,0.45); }
  70%  { box-shadow: 0 0 0 28px rgba(199, 141, 62, 0), 0 12px 36px rgba(0,0,0,0.45); }
  100% { box-shadow: 0 0 0 0 rgba(199, 141, 62, 0), 0 12px 36px rgba(0,0,0,0.45); }
}

.sender__status {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.78);
  max-width: 24ch;
  min-height: 3em;
  margin: 0;
}
.sender__status strong { color: var(--paper-0); font-weight: 700; }
.sender__status .error { color: #D67A6E; }

.sender__foot {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.42);
  letter-spacing: 0.04em;
}
.sender__foot a {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  border-bottom: 1.5px solid var(--amber-500);
  padding-bottom: 1px;
}

/* QR fallback button + overlay (sender PWA) */
.sender__qrbtn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.3);
  color: var(--paper-1);
  padding: 10px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.sender__qrbtn:hover, .sender__qrbtn:active {
  border-color: var(--amber-500);
  color: var(--amber-500);
}

.qr-overlay {
  position: fixed; inset: 0;
  background: rgba(12, 26, 46, 0.94);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5);
}
.qr-overlay[hidden] { display: none; }
.qr-overlay__panel {
  background: var(--paper-1);
  border-radius: 6px;
  padding: var(--sp-7) var(--sp-5) var(--sp-5);
  width: 100%; max-width: 380px;
  position: relative;
  text-align: center;
}
.qr-overlay__close {
  position: absolute; top: 4px; right: 4px;
  width: 44px; height: 44px;
  background: transparent; border: none;
  color: var(--ink-1);
  font-size: 28px; line-height: 1;
  cursor: pointer;
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
.qr-overlay__close:hover { color: var(--ink-0); }
.qr-overlay__code {
  margin: 0 auto var(--sp-4);
  max-width: 280px;
  background: #ffffff;
  padding: 12px;
  border-radius: 3px;
}
.qr-overlay__code svg {
  width: 100%; height: auto; display: block;
}
.qr-overlay__label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-0);
  margin: 0 0 6px;
}
.qr-overlay__hint {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-1);
  margin: 0;
}

@media (min-width: 640px) {
  .hero { padding: var(--sp-6) var(--sp-7) var(--sp-8); min-height: 65vh; }
  .hero__headline { font-size: clamp(2.4rem, 6vw, 3.4rem); max-width: 16ch; }
  .identity, .meta { padding-left: var(--sp-7); padding-right: var(--sp-7); }
  .actions { flex-direction: row; }
  .actions .btn { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sender__tapbtn[data-state="writing"] { animation: none; }
  * { transition: none !important; }
}
