:root {
  color-scheme: light;
  --paper: #fff9ed;
  --paper-deep: #f4ead7;
  --white: #fffdf8;
  --ink: #351837;
  --ink-soft: #684c63;
  --plum: #592154;
  --plum-deep: #41163f;
  --coral: #d5482f;
  --orange: #f07b32;
  --gold: #a66f13;
  --teal: #146d69;
  --line: #dac9ae;
  --shadow: 0 10px 26px rgba(65, 22, 63, .11);
  background: var(--paper);
  color: var(--ink);
  font: 100%/1.4 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--paper); padding-bottom: 5.25rem; }
button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.review-ribbon {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 1.7rem;
  padding: .35rem .7rem;
  background: var(--plum-deep);
  color: #fff;
  text-align: center;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.passport-shell { width: min(100%, 45rem); margin: auto; padding: 0 .85rem 2rem; }
.topbar { height: 3.55rem; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; min-height: 2.75rem; gap: .5rem; text-decoration: none; }
.brand img { border-radius: 50%; box-shadow: 0 3px 10px rgba(53, 24, 55, .16); }
.brand span { display: grid; line-height: 1; }
.brand strong { font: 800 1rem Georgia, serif; }
.brand small { margin-top: .18rem; color: var(--coral); font-size: .6rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: .45rem; }
.language-button, .profile-avatar {
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--plum);
  font-size: .75rem;
  font-weight: 900;
  text-decoration: none;
}
.profile-avatar img { width: 2.35rem; height: 2.35rem; border-radius: 50%; object-fit: cover; }

.hero { padding: .05rem 0 .55rem; }
.eyebrow, .progress-label, .event-kicker, .benefit-kicker {
  margin: 0 0 .2rem;
  color: var(--plum);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero h1 { margin: 0; color: var(--plum-deep); font: 900 clamp(2rem, 10vw, 3.4rem)/.94 Georgia, serif; letter-spacing: -.045em; }
.hero-copy { margin: .35rem 0 .55rem; color: var(--ink-soft); font-size: .78rem; font-weight: 650; }

.next-event {
  display: grid;
  grid-template-columns: 5.15rem minmax(0, 1fr);
  gap: .6rem;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
  box-shadow: var(--shadow);
}
.event-art { width: 5.15rem; height: 7.65rem; border-radius: .72rem; object-fit: cover; }
.event-details { min-width: 0; align-self: center; padding-left: .55rem; border-left: 1px dashed #c5a873; }
.event-details h2 { margin: 0; color: var(--plum-deep); font: 900 1.2rem/1.05 Georgia, serif; }
.event-meta, .event-host { margin: .18rem 0 0; color: var(--ink-soft); font-size: .66rem; }
.event-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.readiness { display: flex; align-items: flex-start; gap: .35rem; margin-top: .35rem; color: var(--teal); font-size: .61rem; font-weight: 850; line-height: 1.2; }
.ready-dot { flex: 0 0 auto; width: .45rem; height: .45rem; margin-top: .08rem; border-radius: 50%; background: var(--teal); }
.checkin-button {
  width: 100%;
  min-height: 2.75rem;
  margin-top: .45rem;
  padding: .55rem .65rem;
  border: 1px solid #8e281b;
  border-radius: .72rem;
  background: #ae3827;
  box-shadow: 0 6px 16px rgba(174, 56, 39, .2);
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
}
.checkin-button[disabled], .checkin-button[aria-disabled="true"] { opacity: .58; cursor: wait; }
.privacy-note { margin: .35rem .2rem 0; color: var(--ink-soft); font-size: .6rem; text-align: center; }
.privacy-note button { min-height: 2.75rem; padding: 0 .25rem; border: 0; background: transparent; color: var(--plum); font-size: inherit; font-weight: 900; text-decoration: underline; }

.progress-card {
  display: grid;
  grid-template-columns: 1fr 3rem;
  gap: .15rem .65rem;
  margin: 0 0 .5rem;
  padding: .65rem .75rem;
  border: 1px solid #caa96d;
  border-radius: 1rem;
  background: #fff5dd;
  box-shadow: var(--shadow);
}
.progress-card h2 { margin: 0; font: 700 .84rem/1.05 Georgia, serif; }
.progress-card h2 strong { color: var(--plum-deep); font-size: 1.35rem; }
.progress-orbit {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  align-items: baseline;
  justify-content: center;
  align-self: center;
  width: 3rem;
  aspect-ratio: 1;
  border: .22rem solid var(--gold);
  border-radius: 50%;
  background: var(--white);
  font-weight: 900;
}
.progress-orbit span { font-size: 1.2rem; }
.progress-orbit small { font-size: .58rem; }
.progress-track { grid-column: 1; height: .42rem; margin-top: .25rem; overflow: hidden; border-radius: 999px; background: #e5d7c0; }
.progress-track span { display: block; width: 75%; height: 100%; border-radius: inherit; background: var(--coral); }
.mini-seals { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(8, 1fr); align-items: start; gap: .28rem; margin-top: .28rem; }
.mini-seals img, .mini-seals span { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 50%; }
.mini-seals img { height: auto; object-fit: contain; }
.mini-seals span { border: 1px dashed #9a876f; background: var(--paper-deep); color: var(--ink-soft); font-size: .58rem; font-weight: 900; }
.unlock-line { grid-column: 1 / -1; margin: .2rem 0 0; color: var(--ink-soft); font-size: .65rem; }
.unlock-line strong { color: var(--plum); }

.value-rail { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-bottom: .55rem; }
.proof-card, .reward-card { min-width: 0; min-height: 6rem; padding: .58rem; border-radius: .85rem; }
.proof-card { display: grid; align-content: center; border: 1px solid rgba(20, 109, 105, .3); background: #edf7f3; }
.avatar-stack { display: flex; margin-bottom: .35rem; }
.avatar-stack img { width: 1.65rem; height: 1.65rem; margin-left: -.35rem; border: .1rem solid var(--paper); border-radius: 50%; object-fit: cover; }
.avatar-stack img:first-child { margin-left: 0; }
.proof-card > div:last-child, .reward-card > div { display: grid; min-width: 0; }
.sample-tag { color: var(--plum); font-size: .5rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.proof-card strong { color: var(--teal); font-size: .68rem; line-height: 1.15; }
.proof-card span:last-child { color: var(--ink-soft); font-size: .58rem; line-height: 1.2; }
.reward-card { display: grid; align-content: space-between; border: 1px solid #caa96d; background: #fff3d2; }
.reward-card strong { margin-top: .16rem; color: var(--plum-deep); font: 800 .73rem/1.12 Georgia, serif; }
.secondary-button { min-height: 2.75rem; padding: .42rem .55rem; border: .1rem solid var(--plum); border-radius: .62rem; background: transparent; color: var(--plum); font-size: .66rem; font-weight: 900; }

.quest-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; margin: .55rem 0; padding: .25rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--paper-deep); }
.quest-tab { min-height: 2.75rem; padding: .35rem .2rem; border: 0; border-radius: .65rem; background: transparent; color: var(--ink-soft); font-size: .64rem; font-weight: 900; }
.quest-tab.is-active { background: var(--plum); color: #fff; }
.quest-panel { animation: panel-in .2s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(.25rem); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; margin: .8rem 0 .55rem; }
.section-heading h2 { margin: 0; color: var(--plum-deep); font: 900 1.3rem/1 Georgia, serif; }
.count-pill { flex: 0 0 auto; padding: .28rem .5rem; border: 1px solid rgba(89, 33, 84, .18); border-radius: 999px; background: #fff; color: var(--plum); font-size: .65rem; font-weight: 900; }

.stamp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: .42rem; }
.stamp-card { min-width: 0; margin: 0; padding: .3rem; border: 1px solid var(--line); border-radius: .72rem; background: var(--white); }
.stamp-card img, .locked-slot { display: block; width: 100%; aspect-ratio: 1; border-radius: .6rem; }
.stamp-card img { height: auto; object-fit: contain; filter: drop-shadow(0 .2rem .22rem rgba(65, 22, 63, .12)); }
.locked-slot { display: grid; place-content: center; gap: .12rem; border: .1rem dashed #9a876f; background: var(--paper-deep); color: var(--ink-soft); text-align: center; }
.locked-slot strong { font-size: .58rem; }
.locked-slot span { font-size: .52rem; }
.stamp-card figcaption { display: grid; gap: .08rem; margin-top: .3rem; }
.stamp-card figcaption strong { min-height: 2.25em; overflow: hidden; color: var(--plum-deep); font-size: .57rem; line-height: 1.12; }
.stamp-card figcaption span, .stamp-card figcaption small { overflow: hidden; color: var(--ink-soft); font-size: .48rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.stamp-card figcaption small { color: var(--teal); font-weight: 800; }
.stamp-card.is-locked { border-style: dashed; background: rgba(244, 234, 215, .55); }

.benefit-card { margin-top: .8rem; padding: .8rem; border: 1px solid #caa96d; border-radius: .85rem; background: #fff4d7; }
.benefit-card h2 { margin: 0; color: var(--plum-deep); font: 900 1.1rem/1.05 Georgia, serif; }
.benefit-card p:not(.benefit-kicker) { margin: .35rem 0; color: var(--ink-soft); font-size: .72rem; }
.panel-copy { margin: -.1rem 0 .8rem; color: var(--ink-soft); font-size: .78rem; }
.week-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .38rem; }
.week { display: grid; gap: .2rem; padding: .6rem .2rem; border: 1px solid var(--line); border-radius: .7rem; text-align: center; }
.week span { color: var(--ink-soft); font-size: .6rem; }
.week strong { font-size: .58rem; }
.week.is-done { background: var(--teal); color: #fff; }
.week.is-done span { color: #fff; }
.week.is-next { border: .12rem dashed var(--coral); background: #fff3df; color: var(--plum); }
.pair-card { display: grid; grid-template-columns: 1fr 1.4rem 1fr; align-items: center; padding: .7rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--white); }
.person { display: grid; justify-items: center; gap: .3rem; text-align: center; }
.person img { border-radius: 50%; filter: grayscale(.8); opacity: .64; }
.person.is-done img { filter: none; opacity: 1; box-shadow: 0 0 0 .18rem rgba(20, 109, 105, .18); }
.person span { display: grid; }
.person strong { font-size: .7rem; }
.person small { color: var(--ink-soft); font-size: .54rem; }
.pair-line { height: .1rem; border-top: .1rem dashed var(--line); }

.profile-strip { display: grid; grid-template-columns: 3.25rem 1fr; gap: .65rem; margin: 1rem 0 0; padding: .85rem; border-radius: .9rem; background: var(--plum); color: #fff; }
.profile-strip > img { width: 3.25rem; height: 3.25rem; border: .14rem solid rgba(255, 255, 255, .5); border-radius: 50%; object-fit: cover; }
.profile-strip h2 { margin: 0; font: 800 .9rem/1.15 Georgia, serif; }
.profile-strip p:not(.eyebrow) { margin: .25rem 0 0; color: #f2e9f1; font-size: .62rem; }
.profile-strip .eyebrow { color: #fff; }
.profile-strip > a { grid-column: 2; justify-self: start; display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .66rem; font-weight: 900; }

.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); padding: .4rem max(.4rem, env(safe-area-inset-right)) calc(.4rem + env(safe-area-inset-bottom)) max(.4rem, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255, 253, 248, .97); backdrop-filter: blur(14px); }
.bottom-nav a { display: grid; place-items: center; min-height: 2.75rem; border-radius: .65rem; color: var(--ink-soft); font-size: .6rem; font-weight: 800; text-decoration: none; }
.bottom-nav a.is-current { background: var(--plum); color: #fff; }

.status-dialog, .terms-dialog { width: min(calc(100% - 2rem), 25rem); padding: 1.1rem; border: 1px solid var(--line); border-radius: 1.2rem; background: var(--paper); box-shadow: 0 24px 80px rgba(37, 13, 35, .3); color: var(--ink); }
dialog::backdrop { background: rgba(35, 13, 34, .58); backdrop-filter: blur(5px); }
.dialog-close { float: right; min-height: 2.75rem; padding: .4rem .65rem; border: 0; background: transparent; color: var(--ink-soft); font-size: .68rem; font-weight: 900; }
.status-art { display: grid; place-items: center; clear: both; }
.status-art img { width: 7rem; aspect-ratio: 1; border-radius: 50%; object-fit: contain; }
.status-dialog h2, .terms-dialog h2 { margin: .12rem 0; color: var(--plum-deep); font: 900 1.5rem/1.05 Georgia, serif; }
.status-dialog p:not(.eyebrow), .terms-dialog li { color: var(--ink-soft); font-size: .78rem; }
.dialog-note { font-size: .64rem !important; text-align: center; }
.terms-dialog ul { padding-left: 1.1rem; }
.terms-dialog li + li { margin-top: .5rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.checkin-button:focus-visible, .secondary-button:focus-visible, .quest-tab:focus-visible, a:focus-visible, button:focus-visible { outline: .2rem solid var(--teal); outline-offset: .14rem; }

@media (min-width: 38rem) {
  .passport-shell { padding-inline: 1.4rem; }
  .next-event { grid-template-columns: 7rem minmax(0, 1fr); }
  .event-art { width: 7rem; height: 10.4rem; }
  .event-details h2 { font-size: 1.55rem; }
  .value-rail { grid-template-columns: 1.15fr 1fr; }
  .proof-card, .reward-card { min-height: 5.5rem; }
  .stamp-card figcaption strong { font-size: .7rem; }
  .stamp-card figcaption span, .stamp-card figcaption small { font-size: .56rem; }
  .bottom-nav { left: 50%; width: min(100%, 45rem); transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 1rem 1rem 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .quest-panel { animation: none; }
}
