/* Ahoy — design tokens. Daylight palette; see DESIGN_SYSTEM.md and D-22. */
:root {
  /* ground: warm paper, not white, and ink rather than pure black */
  --bg: #fbf8f3;
  --bg-2: #f5efe6;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-2: #f3ede4;
  --border: rgba(40, 32, 26, 0.13);
  --border-strong: rgba(40, 32, 26, 0.26);
  --text: #1d1b26;
  --dim: #615c6e;
  --faint: #948e9f;

  /* two accents with two jobs:
     signal = you, alive, safe, the brand mark
     ember  = other people, warmth, proximity
     Darkened from the dark-theme values so they still carry on a light ground. */
  --signal: #00a26a;
  --signal-soft: rgba(0, 162, 106, 0.13);
  --ember: #e4551f;
  --ember-glow: #ff7a45;
  --ember-soft: rgba(228, 85, 31, 0.10);
  --halo: #6c5ce7;
  --amber: #b07400;
  --rose: #d22f52;
  --on-accent: #ffffff;

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --maxw: 1120px;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 720px at 50% -12%, #ffffff 0%, transparent 62%),
    radial-gradient(820px 620px at 92% 8%, rgba(228, 85, 31, 0.09) 0%, transparent 58%),
    radial-gradient(760px 560px at 4% 42%, rgba(0, 162, 106, 0.07) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Fine grain. Flat digital black is the thing that makes a dark UI feel cheap. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

a { color: var(--ember); text-decoration: none; }
a:hover { color: var(--ember-glow); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.025em; margin: 0; }
h1 { font-size: clamp(38px, 7vw, 70px); font-weight: 700; }
h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 600; margin-bottom: 16px; }
h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
p { margin: 0 0 16px; }
.lead { font-size: clamp(17px, 2.1vw, 21px); color: var(--dim); max-width: 58ch; }
.dim { color: var(--dim); }
.small { font-size: 14px; }
code { font-size: .92em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

/* ---------- brand ---------- */
/* The wordmark is set with wide tracking: the letters of NEAR stand far apart.
   The joke is the point — see DESIGN_SYSTEM.md §9. */
/* The mark IS the O. The wordmark contains the app icon, so the icon on a home screen and
   the name on a page teach each other. */
.brand {
  display: inline-flex; align-items: center;
  font-family: var(--display); font-weight: 700; font-size: 20px;
  letter-spacing: 0.12em; color: var(--text);
}
.brand .wm-a, .brand .wm-b { line-height: 1; }
.brand .mark { margin: 0 0.14em 0 0.06em; }
.brand .mark {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--signal); flex: none;
  box-shadow: 0 0 0 4px var(--signal-soft), 0 2px 10px rgba(0, 162, 106, 0.3);
}
.brand.lg { font-size: 26px; }
.brand.lg .mark { width: 14px; height: 14px; }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 243, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
nav .wrap { display: flex; align-items: center; gap: 28px; height: 66px; }
nav .links { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
nav .links a { color: var(--dim); }
nav .links a:hover { color: var(--text); }
@media (max-width: 780px) { nav .links a.hide-sm { display: none; } }

/* ---------- hero ---------- */
.hero { padding: 92px 0 64px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); border: 1px solid var(--border); background: var(--surface);
  padding: 7px 14px; border-radius: 999px; margin-bottom: 26px;
}
.eyebrow .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 24px; border-radius: var(--r-sm); font-weight: 600; font-size: 16px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .16s ease, transform .16s ease, background .16s ease, box-shadow .16s ease;
  cursor: pointer; font-family: inherit;
}
.btn:hover { border-color: var(--ember); color: var(--text); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--ember-glow), var(--ember));
  border-color: transparent; color: var(--on-accent);
  box-shadow: 0 8px 22px rgba(228, 85, 31, 0.24);
}
.btn-primary:hover { color: var(--on-accent); box-shadow: 0 12px 28px rgba(228, 85, 31, 0.32); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- the proximity field ---------- */
.field-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 600px;
  margin: 0 auto;
}
.field-wrap.tight { max-width: 100%; }

.pfield { position: absolute; inset: 0; }

/* Range bands. Soft, blurred, warm — a place, not a radar screen. */
.pfield .band {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
}
.pfield .band.b1 { /* very close */
  width: 37%; height: 37%;
  background: radial-gradient(circle, rgba(228,85,31,.09) 0%, rgba(228,85,31,.025) 60%, transparent 72%);
  border: 1px solid rgba(255,138,92,.16);
}
.pfield .band.b2 { /* nearby */
  width: 60%; height: 60%;
  background: radial-gradient(circle, transparent 62%, rgba(228,85,31,.05) 78%, transparent 88%);
  border: 1px solid rgba(40,32,26,.09);
}
.pfield .band.b3 { /* edge of range */
  width: 80%; height: 80%;
  border: 1px dashed rgba(40,32,26,.08);
}
.pfield .aura {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 54%; height: 54%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(0,162,106,.14) 0%, rgba(0,162,106,.04) 44%, transparent 70%);
  filter: blur(6px);
}

.pfield .you {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; text-align: center;
}
.pfield .you .core {
  width: 22px; height: 22px; border-radius: 50%; background: var(--signal);
  border: 3px solid #fff;
  box-shadow: 0 0 0 7px var(--signal-soft), 0 4px 14px rgba(0,162,106,.35);
}
.pfield .you .lbl {
  margin-top: 13px; font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--signal); opacity: 1; font-weight: 700;
}
.pfield .you::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--signal); opacity: .55;
  animation: sonar 4s ease-out infinite;
}
@keyframes sonar {
  0% { transform: scale(1); opacity: .5; }
  100% { transform: scale(6.5); opacity: 0; }
}

.pfield .edge-lbl {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}

/* a person */
.pp {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 7px;
  cursor: pointer; width: 78px; text-align: center;
  transition: opacity .45s ease;
}
.pp .ring {
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; color: #1c0e07; position: relative;
  transition: width .7s cubic-bezier(.16,1,.3,1), height .7s cubic-bezier(.16,1,.3,1), box-shadow .7s ease;
  animation: breathe 4.4s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.pp .nm { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.25; }
.pp .bk { font-size: 10px; color: var(--dim); letter-spacing: .04em; }
.pp.skipped { opacity: .3; }
.pp.skipped .ring { animation: none; }
.pp .badge {
  position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--signal); border: 2px solid var(--bg);
}
.pp:focus-visible { outline: 2px solid var(--ember); outline-offset: 4px; border-radius: 12px; }
/* A Bluetooth device without Ahoy (app build 58/60): grey, a «?», no glow, no breath. */
.pp.device .ring { background: #948e9f; color: #1c0e07; animation: none; }
.pp.device .nm { color: var(--dim); }
/* Nobody can see you (Ghost): you still listen, so you are drawn, but grey. */
.pfield.hidden-you .you .core { background: var(--faint); box-shadow: 0 0 0 7px rgba(148,142,159,.16); }
.pfield.hidden-you .you .lbl { color: var(--faint); }
.pfield.hidden-you .you::before { border-color: var(--faint); }
.pfield.hidden-you .aura { opacity: .25; }
@media (prefers-reduced-motion: reduce) {
  .pp .ring, .pfield .you::before { animation: none; }
}

/* ---------- sections ---------- */
section { padding: 82px 0; border-top: 1px solid var(--border); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.55));
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 26px;
  backdrop-filter: blur(6px);
}
.card .num { font-family: var(--display); font-size: 12px; color: var(--ember); letter-spacing: .12em; margin-bottom: 12px; }
.card p:last-child { margin-bottom: 0; }

.modes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.mode { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 15px; }

.kv { border-top: 1px solid var(--border); padding: 18px 0; display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
.kv strong { font-weight: 600; }
@media (max-width: 700px) { .kv { grid-template-columns: 1fr; gap: 6px; } }

details { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: 10px; }
details summary { padding: 18px 22px; cursor: pointer; font-weight: 600; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; float: right; color: var(--ember); font-size: 20px; line-height: 1; }
details[open] summary::after { content: "\2212"; }
details .body { padding: 0 22px 20px; color: var(--dim); }
details .body p:last-child { margin-bottom: 0; }

.note { border-left: 3px solid var(--amber); background: rgba(255,194,75,.055); padding: 16px 20px; border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--dim); }
.note strong { color: var(--text); }
.note.good { border-left-color: var(--signal); background: rgba(53,222,156,.055); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--dim); font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

.phase { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 20px 0; border-top: 1px solid var(--border); }
.phase .tag { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.phase .tag.now { color: var(--ember); }
.phase .tag.done { color: var(--signal); }
@media (max-width: 700px) { .phase { grid-template-columns: 1fr; gap: 4px; } }

footer { border-top: 1px solid var(--border); padding: 44px 0 64px; color: var(--dim); font-size: 14px; }
footer .row { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
footer .row a { color: var(--dim); }
footer .row a:hover { color: var(--text); }

/* ---------- hero layout ---------- */
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 64px 0 48px; }
}
