:root {
  --ink: #0d1713;
  --ink-soft: #14231d;
  --paper: #f1efe8;
  --paper-deep: #e1ded3;
  --lime: #d7ff39;
  --mint: #91f6c3;
  --orange: #ff693d;
  --muted: #8e958f;
  --line: rgba(13, 23, 19, 0.13);
  --shadow: 0 28px 70px rgba(9, 16, 13, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(215, 255, 57, 0.16), transparent 26rem),
    linear-gradient(135deg, #101b17 0%, #162c23 52%, #0d1713 100%);
  font-family: "Manrope", sans-serif;
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.2;
  pointer-events: none;
}

.ambient-one { top: -13rem; left: -12rem; background: var(--lime); }
.ambient-two { right: -16rem; bottom: -10rem; background: var(--mint); }

.app-shell {
  position: relative;
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 22px 112px;
  background:
    linear-gradient(rgba(241, 239, 232, 0.97), rgba(241, 239, 232, 0.985)),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(13, 23, 19, 0.025) 32px);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  background: linear-gradient(var(--paper) 76%, rgba(241, 239, 232, 0));
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-decoration: none;
}

.brand-mark { position: relative; width: 27px; height: 25px; }
.brand-mark i { position: absolute; display: block; width: 11px; height: 22px; background: var(--ink); transform: skew(-17deg); }
.brand-mark i:first-child { left: 2px; top: 0; }
.brand-mark i:last-child { right: 2px; bottom: 0; height: 15px; background: var(--orange); }

.avatar {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font: 500 11px "DM Mono", monospace;
  cursor: pointer;
}

.view { display: none; animation: reveal 430ms ease both; }
.view.active { display: block; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow-row, .section-heading, .pass-topline, .pass-footer, .credential-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow, .reader-label, .status-chip, .prototype-note, .pass-state, .duration, .data-note > span {
  font: 500 10px "DM Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-dot { color: #496258; font: 500 10px "DM Mono", monospace; letter-spacing: 0.04em; }
.live-dot i, .credential-status i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #43bc7e; box-shadow: 0 0 0 4px rgba(67, 188, 126, 0.13); }

.hero-copy { padding: 40px 0 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(40px, 11vw, 54px); line-height: 0.98; letter-spacing: -0.055em; }
h1 em, .page-title em { color: #48655a; font-family: Georgia, serif; font-weight: 400; }
.hero-copy p { max-width: 330px; color: #667069; font-size: 14px; line-height: 1.65; }

.member-pass {
  position: relative;
  min-height: 226px;
  padding: 23px;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 83% 80%, rgba(215, 255, 57, 0.4), transparent 32%),
    linear-gradient(145deg, #101c17, #1e3a2e 70%, #315f49);
  border-radius: 26px;
  box-shadow: 0 24px 48px rgba(13, 23, 19, 0.26);
  transform: perspective(800px) rotateX(1deg) rotateY(-1deg);
}

.member-pass::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  pointer-events: none;
}

.pass-glow { position: absolute; right: -70px; bottom: -105px; width: 220px; height: 220px; border: 1px solid rgba(215, 255, 57, 0.3); border-radius: 50%; box-shadow: 0 0 0 34px rgba(215, 255, 57, 0.05), 0 0 0 70px rgba(215, 255, 57, 0.035); }
.mini-brand { font: 600 10px "DM Mono", monospace; letter-spacing: 0.13em; }
.mini-brand i { display: inline-block; width: 7px; height: 13px; margin-right: 5px; background: var(--lime); transform: skew(-17deg); vertical-align: -2px; }
.pass-state { padding: 7px 9px; border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; color: rgba(255,255,255,0.72); }
.pass-member { position: relative; z-index: 2; margin-top: 48px; }
.pass-member p { margin-bottom: 5px; color: rgba(255,255,255,0.55); font: 500 9px "DM Mono", monospace; letter-spacing: 0.12em; }
.pass-member strong { display: block; font-size: 23px; letter-spacing: -0.03em; }
.pass-member span { color: rgba(255,255,255,0.62); font-size: 11px; }
.pass-footer { position: relative; z-index: 2; margin-top: 31px; }
.nfc-glyph { display: flex; align-items: center; gap: 3px; transform: rotate(90deg); }
.nfc-glyph i { width: 4px; border: 1.5px solid var(--lime); border-right: 0; border-radius: 6px 0 0 6px; }
.nfc-glyph i:nth-child(1) { height: 6px; }
.nfc-glyph i:nth-child(2) { height: 12px; }
.nfc-glyph i:nth-child(3) { height: 18px; }
.pass-code, .wallet-preview-code { display: flex; align-items: stretch; gap: 3px; height: 25px; }
.pass-code i, .wallet-preview-code i { width: 2px; background: rgba(255,255,255,0.75); }
.pass-code i:nth-child(3n), .wallet-preview-code i:nth-child(3n) { width: 5px; }

.wallet-button {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,0.52);
  cursor: pointer;
}
.wallet-icon { width: 34px; height: 26px; margin-right: 12px; border: 2px solid var(--ink); border-radius: 7px; box-shadow: inset 0 7px 0 var(--lime); }
.wallet-button span:nth-child(2) { display: flex; flex: 1; flex-direction: column; align-items: flex-start; }
.wallet-button small { color: #737b76; font-size: 9px; }
.wallet-button strong { font-size: 13px; }
.wallet-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.prototype-note { margin: 9px 4px 0; color: #7a817c; font-size: 8px; line-height: 1.5; letter-spacing: 0.05em; text-transform: none; }

.scan-section { padding-top: 56px; }
.section-heading { margin-bottom: 17px; align-items: flex-end; }
.section-heading h2 { margin: 6px 0 0; font-size: 24px; letter-spacing: -0.04em; }
.status-chip { padding: 7px 10px; border-radius: 999px; background: var(--ink); color: white; }

.scanner-card { position: relative; min-height: 230px; overflow: hidden; border-radius: 24px; background: #d9ddd2; }
.scanner-copy { position: relative; z-index: 3; width: 67%; padding: 24px; }
.scanner-copy strong { display: block; margin: 18px 0 8px; font-size: 21px; line-height: 1.1; letter-spacing: -0.04em; }
.scanner-copy p { color: #647068; font-size: 11px; line-height: 1.55; }
.scanner-visual { position: absolute; right: -18px; bottom: -34px; width: 210px; height: 210px; }
.reader-device { position: absolute; z-index: 2; right: 39px; bottom: 35px; width: 94px; height: 132px; border: 1px solid rgba(255,255,255,0.6); border-radius: 24px; background: linear-gradient(160deg, #21332b, #08110d); box-shadow: 0 22px 35px rgba(15, 31, 24, 0.32); transform: rotate(10deg); }
.reader-light { position: absolute; top: 14px; right: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.reader-logo { position: absolute; top: 40px; left: 36px; width: 24px; height: 28px; }
.reader-logo i { position: absolute; width: 9px; height: 26px; background: white; transform: skew(-17deg); }
.reader-logo i:last-child { right: 0; bottom: 0; height: 17px; background: var(--lime); }
.reader-waves { position: absolute; left: 34px; bottom: 18px; display: flex; align-items: center; gap: 3px; }
.reader-waves i { width: 4px; border: 1px solid rgba(255,255,255,0.6); border-left: 0; border-radius: 0 5px 5px 0; }
.reader-waves i:nth-child(1) { height: 5px; }
.reader-waves i:nth-child(2) { height: 10px; }
.reader-waves i:nth-child(3) { height: 15px; }
.scan-ripple { position: absolute; right: 0; bottom: 0; border: 1px solid rgba(13,23,19,0.1); border-radius: 50%; }
.ripple-one { width: 160px; height: 160px; }
.ripple-two { right: -28px; bottom: -28px; width: 215px; height: 215px; }
.scanner-card.scanning .scan-ripple { animation: pulse-ring 900ms ease-out infinite; border-color: rgba(215,255,57,0.8); }
.scanner-card.success { background: #c8f0d8; }
.scanner-card.success .reader-light { background: white; box-shadow: 0 0 15px white; }
@keyframes pulse-ring { from { transform: scale(0.7); opacity: 1; } to { transform: scale(1.12); opacity: 0; } }

.scan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.scan-button { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 1px 10px; padding: 15px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: transparent; cursor: pointer; transition: 180ms ease; }
.scan-button:hover { background: white; transform: translateY(-2px); }
.scan-button > span { grid-row: 1 / 3; color: #88918b; font: 500 9px "DM Mono", monospace; }
.scan-button strong { font-size: 13px; }
.scan-button small { color: #78817b; font-size: 9px; }

.current-visit { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding: 17px; border-radius: 16px; background: var(--ink); color: white; }
.current-visit > div:first-child { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.pulse-icon { grid-row: 1 / 3; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(215,255,57,0.13); }
.current-visit p { margin: 0; color: var(--lime); font: 500 8px "DM Mono", monospace; letter-spacing: 0.1em; }
.current-visit strong { font-size: 10px; font-weight: 500; }
.visit-timer { font: 500 15px "DM Mono", monospace; }
.hidden { display: none !important; }

.page-title { margin: 20px 0 32px; }
.credential-card { padding: 20px; border-radius: 20px; background: var(--ink); color: white; }
.credential-status { justify-content: flex-start; margin-bottom: 28px; color: rgba(255,255,255,0.66); font: 500 9px "DM Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.credential-card > div:nth-child(2) { display: inline-block; }
.credential-card p { margin-bottom: 5px; color: rgba(255,255,255,0.45); font: 500 8px "DM Mono", monospace; letter-spacing: 0.1em; }
.credential-card strong { font: 500 17px "DM Mono", monospace; }
.credential-card button { float: right; padding: 8px 11px; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; background: transparent; color: white; font-size: 10px; cursor: pointer; }
.setup-list { margin-top: 36px; }
.setup-list article { display: grid; grid-template-columns: 30px 1fr auto; gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); }
.step-number { color: #8d958f; font: 500 9px "DM Mono", monospace; }
.setup-list strong { font-size: 14px; }
.setup-list p { margin: 6px 0 0; color: #747c77; font-size: 11px; line-height: 1.55; }
.step-check { color: #2a8c60; }
.text-button { align-self: start; padding: 0 0 3px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; font-size: 10px; cursor: pointer; }

.visit-summary { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; min-height: 175px; padding: 20px; overflow: hidden; border-radius: 22px; background: var(--ink); color: white; }
.visit-summary > div { position: relative; z-index: 2; }
.visit-summary span { display: block; margin-bottom: 5px; color: rgba(255,255,255,0.5); font: 500 8px "DM Mono", monospace; letter-spacing: 0.1em; }
.visit-summary strong { font-size: 35px; letter-spacing: -0.05em; }
.visit-summary small { margin-left: 5px; color: rgba(255,255,255,0.55); font-size: 9px; }
.visit-summary svg { position: absolute; right: 0; bottom: 0; left: 0; width: 100%; height: 80px; }
.chart-fill { fill: rgba(215,255,57,0.09); }
.chart-line { fill: none; stroke: var(--lime); stroke-width: 2; }
.timeline { margin-top: 30px; }
.visit-row { display: grid; grid-template-columns: 38px 13px 1fr auto; gap: 10px; min-height: 76px; }
.date-block strong, .date-block span { display: block; text-align: center; }
.date-block strong { font: 500 18px "DM Mono", monospace; }
.date-block span { color: #8c948f; font: 500 8px "DM Mono", monospace; letter-spacing: 0.1em; }
.visit-line { position: relative; width: 1px; height: 100%; background: var(--line); }
.visit-line i { position: absolute; top: 5px; left: -3px; width: 7px; height: 7px; border: 2px solid var(--paper); border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.visit-data strong, .visit-data span { display: block; }
.visit-data strong { margin: 1px 0 6px; font-size: 12px; }
.visit-data span { color: #7b837e; font-size: 9px; }
.duration { padding-top: 4px; font-size: 8px; }
.duration.alert { color: #c3573e; }
.muted-row { opacity: 0.62; }

.privacy-intro { margin: -12px 0 28px; color: #69726c; font-size: 13px; line-height: 1.65; }
.privacy-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,0.36); }
.setting-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #dfe2d8; font: 500 13px "DM Mono", monospace; }
.setting-row strong { font-size: 12px; }
.setting-row p { margin: 3px 0 0; color: #727a75; font-size: 9px; line-height: 1.45; }
.toggle { position: relative; width: 40px; height: 24px; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #c7cbc4; cursor: pointer; transition: 160ms ease; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,0.15); transition: 160ms ease; }
.toggle input:checked + span { background: var(--ink); }
.toggle input:checked + span::after { transform: translateX(16px); background: var(--lime); }
.data-note { margin-top: 22px; padding: 18px; border-left: 3px solid var(--lime); background: #e5e3da; }
.data-note p { margin: 8px 0 0; color: #626a65; font-size: 10px; line-height: 1.6; }
.danger-link { margin-top: 28px; padding: 0 0 3px; border: 0; border-bottom: 1px solid #b85842; background: transparent; color: #b85842; font-size: 10px; cursor: pointer; }

.bottom-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 460px); height: 82px; margin: auto; padding: 9px 14px 14px; border-top: 1px solid var(--line); background: rgba(241,239,232,0.94); backdrop-filter: blur(16px); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; background: transparent; color: #858c87; cursor: pointer; }
.bottom-nav button.active { color: var(--ink); }
.bottom-nav small { font-size: 9px; font-weight: 700; }
.nav-icon { position: relative; display: block; width: 19px; height: 19px; }
.home-icon { border: 1.8px solid currentColor; border-radius: 5px 5px 8px 8px; clip-path: polygon(0 35%, 50% 0, 100% 35%, 100% 100%, 0 100%); }
.pass-icon { border: 1.8px solid currentColor; border-radius: 4px; }
.pass-icon::after { content: ""; position: absolute; top: 5px; right: 3px; bottom: 5px; left: 3px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.visits-icon { border: 1.8px solid currentColor; border-radius: 50%; }
.visits-icon::after { content: ""; position: absolute; top: 3px; left: 8px; width: 1px; height: 7px; background: currentColor; transform-origin: bottom; transform: rotate(35deg); }
.privacy-icon { border: 1.8px solid currentColor; border-radius: 10px 10px 7px 7px; clip-path: polygon(0 18%, 50% 0, 100% 18%, 92% 72%, 50% 100%, 8% 72%); }

.modal { width: calc(100% - 40px); max-width: 400px; padding: 28px; border: 0; border-radius: 24px; background: var(--paper); box-shadow: 0 30px 90px rgba(0,0,0,0.38); }
.modal::backdrop { background: rgba(6,14,10,0.72); backdrop-filter: blur(6px); }
.modal h2 { margin: 13px 0 10px; font-size: 28px; letter-spacing: -0.04em; }
.modal > p { color: #68716b; font-size: 11px; line-height: 1.6; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 20px; cursor: pointer; }
.wallet-preview { margin: 24px 0 18px; padding: 19px; border-radius: 20px; background: linear-gradient(145deg, #101c17, #315f49); color: white; }
.wallet-preview-top { display: flex; justify-content: space-between; }
.wallet-preview-top span { font-weight: 800; letter-spacing: 0.15em; }
.wallet-preview-top small { color: rgba(255,255,255,0.55); font: 500 7px "DM Mono", monospace; }
.wallet-preview-name { margin: 38px 0 20px; }
.wallet-preview-name span, .wallet-preview-name strong { display: block; }
.wallet-preview-name span { color: rgba(255,255,255,0.5); font: 500 7px "DM Mono", monospace; letter-spacing: 0.1em; }
.wallet-preview-name strong { margin-top: 4px; font-size: 18px; }
.wallet-preview-code { justify-content: flex-end; }
.primary-button { width: 100%; padding: 14px; border: 0; border-radius: 13px; background: var(--ink); color: white; font-size: 12px; font-weight: 700; cursor: pointer; }
.modal label { display: block; margin: 20px 0 7px; font-size: 10px; font-weight: 700; }
.modal input { width: 100%; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; outline: 0; }
.modal input:focus { border-color: #5c7a6e; box-shadow: 0 0 0 3px rgba(92,122,110,0.13); }

.toast { position: fixed; z-index: 50; right: 20px; bottom: 100px; left: 20px; max-width: 400px; margin: auto; padding: 13px 16px; border-radius: 12px; background: var(--ink); color: white; text-align: center; font-size: 11px; box-shadow: 0 15px 40px rgba(0,0,0,0.28); opacity: 0; pointer-events: none; transform: translateY(10px); transition: 220ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (min-width: 700px) {
  body { padding: 32px 0; }
  .app-shell { min-height: calc(100vh - 64px); border-radius: 34px; overflow: hidden; }
  .bottom-nav { bottom: 32px; border-radius: 0 0 34px 34px; }
  .topbar { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
