:root {
  --ground: #F4F7F5;
  --surface: #FFFFFF;
  --ink: #0F1F1A;
  --muted: #4B5E57;
  --line: #D3DDD8;
  --primary: #047857;
  --primary-hover: #03543C;
  --primary-soft: #ECFDF5;
  --amber: #F59E0B;
  --field: #DCE8E1;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --ml: "Noto Sans Malayalam", "Nirmala UI", "Kartika", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 8px; }

.top {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 24px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.wordmark .to { color: var(--primary); }

.hero {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  color: #065F46;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 6.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 13ch;
  text-wrap: balance;
}
.lede {
  margin: 22px 0 0;
  max-width: 34em;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--muted);
}

.ml {
  margin: 26px 0 0;
  padding: 16px 18px;
  border-left: 4px solid var(--primary);
  background: var(--surface);
  border-radius: 0 14px 14px 0;
  max-width: 36em;
  font-family: var(--ml);
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}
.ml p { margin: 0; }
.ml-head { color: var(--ink); font-weight: 600; font-size: 18px; margin-bottom: 4px !important; }

.invite { margin: 28px 0 12px; font-weight: 500; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.btn:hover { border-color: var(--primary); color: var(--ink); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #FFFFFF; }

.art { display: flex; justify-content: center; }
.art svg { width: 100%; max-width: 420px; height: auto; overflow: visible; }
.field rect { fill: var(--field); }
.tile { fill: var(--primary); }
.mod { fill: #FFFFFF; }
.go { fill: var(--amber); }

/* The one orchestrated moment: the QR "T" assembles, then the amber "go" lands. */
.mod, .go { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .copy > * { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .copy > *:nth-child(2) { animation-delay: .06s; }
  .copy > *:nth-child(3) { animation-delay: .12s; }
  .copy > *:nth-child(4) { animation-delay: .18s; }
  .copy > *:nth-child(5) { animation-delay: .24s; }
  .copy > *:nth-child(6) { animation-delay: .30s; }
  .tile { animation: fade .6s ease both .1s; }
  .mod { animation: snap .5s cubic-bezier(.3,1.4,.5,1) both; }
  .m1 { animation-delay: .45s; } .m2 { animation-delay: .55s; } .m3 { animation-delay: .65s; }
  .m4 { animation-delay: .78s; } .m5 { animation-delay: .9s; }
  .go { animation: drop .7s cubic-bezier(.3,1.6,.5,1) both 1.2s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes snap { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-60px) scale(.6); } 70% { opacity: 1; transform: translateY(4px) scale(1.05); } 100% { transform: none; } }

.foot {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 24px max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.foot p { margin: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .art { order: -1; justify-content: flex-start; }
  .art svg { max-width: 200px; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .top { padding-left: 18px; padding-right: 18px; }
  .hero, .foot { padding-left: 18px; padding-right: 18px; }
  .btn { width: 100%; justify-content: center; }
  .wordmark { font-size: 23px; }
}

/* 404 */
.lost { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 72px 24px; }
.lost h1 { max-width: none; font-size: clamp(36px, 6vw, 56px); }
.lost p { color: var(--muted); max-width: 32em; }
