:root {
  --paper: #f4efe5;
  --card: #fffdf8;
  --ink: #191814;
  --muted: #7a7468;
  --line: rgba(25, 24, 20, 0.1);
  --accent: #e2562b;
  --green: #2f7a52;
  --green-soft: #e7f1ea;
  --display: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui,
    sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(
      120% 72% at 92% -8%,
      rgba(226, 86, 43, 0.12),
      transparent 58%
    ),
    radial-gradient(
      100% 65% at 0% 105%,
      rgba(47, 122, 82, 0.08),
      transparent 62%
    ),
    var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.locked {
  overflow: hidden;
}

button {
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(226, 86, 43, 0.55);
  outline-offset: 3px;
}

.shell {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 22px
    calc(174px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: fade-in 0.5s ease both;
}

.brand {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

.brand span {
  color: var(--accent);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.48);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 122, 82, 0.1);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 0 12px;
}

.hero {
  text-align: center;
  animation: rise-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.name {
  margin: 0 auto;
  max-width: 100%;
  font-family: var(--display);
  font-size: clamp(2.9rem, 14.5vw, 4.6rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.055em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.name.long {
  font-size: clamp(2.2rem, 10.5vw, 3.5rem);
  letter-spacing: -0.045em;
}

.name.pop {
  animation: name-pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.timer-block {
  margin-top: clamp(32px, 5.5vh, 50px);
}

.timer-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.timer {
  margin: 6px 0 2px;
  font-family: var(--display);
  font-size: clamp(2rem, 9.5vw, 2.7rem);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.timer-since {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.proof-card {
  margin-top: clamp(28px, 5vh, 44px);
  animation: rise-in 0.6s 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.proof-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 253, 248, 0.62);
  text-align: left;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.proof-thumb {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 12px;
  object-fit: cover;
  background: #e8e1d4;
}

.proof-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.proof-eyebrow {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.proof-title {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-time {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.proof-chevron {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 26px 22px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(
    to top,
    var(--paper) 44%,
    rgba(244, 239, 229, 0.9) 72%,
    rgba(244, 239, 229, 0)
  );
  pointer-events: none;
}

.dock-inner {
  max-width: 416px;
  margin: 0 auto;
  pointer-events: auto;
}

.shoot-btn {
  width: 100%;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 20px;
  background: var(--ink);
  color: var(--card);
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow:
    0 14px 30px rgba(25, 24, 20, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 0.15s ease,
    opacity 0.2s ease;
}

.shoot-btn svg {
  width: 21px;
  height: 21px;
}

.shoot-btn:active {
  transform: scale(0.975);
}

.shoot-btn:disabled {
  opacity: 0.55;
}

.hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.offline {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 18px;
  left: 18px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 424px;
  margin: 0 auto;
  padding: 11px 13px 11px 15px;
  border-radius: 14px;
  background: #2a2721;
  color: #fff;
  font-size: 0.8rem;
  box-shadow: 0 12px 30px rgba(25, 24, 20, 0.24);
  animation: drop-in 0.3s ease both;
}

.offline button {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  padding: 6px 10px;
  background: transparent;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #0c0c0a;
  overscroll-behavior: contain;
  touch-action: none;
}

.camera-layer {
  color: #fff;
}

.camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: cover;
}

.camera-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.56),
    transparent 24%,
    transparent 62%,
    rgba(0, 0, 0, 0.72)
  );
  pointer-events: none;
}

.camera-top {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 18px;
  left: 18px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.round-btn {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.round-btn svg {
  width: 19px;
  height: 19px;
}

.round-btn-spacer {
  width: 44px;
  height: 44px;
}

.camera-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.camera-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff673d;
  box-shadow: 0 0 10px #ff673d;
}

.camera-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.83rem;
  letter-spacing: 0.01em;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.camera-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
  padding: 0 22px calc(25px + env(safe-area-inset-bottom));
}

.camera-tip {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
}

.shutter {
  width: 84px;
  height: 84px;
  padding: 6px;
  border: 4px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: transparent;
}

.shutter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.12s ease;
}

.shutter:active span {
  transform: scale(0.88);
}

.shutter:disabled {
  opacity: 0.55;
}

.camera-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}

.camera-error {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(92px + env(safe-area-inset-top)) 32px
    calc(40px + env(safe-area-inset-bottom));
  background:
    radial-gradient(
      100% 60% at 50% 18%,
      rgba(226, 86, 43, 0.15),
      transparent 65%
    ),
    #0c0c0a;
  text-align: center;
}

.camera-error-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: #ff7b51;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
}

.camera-error h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.camera-error p {
  max-width: 300px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.84rem;
  line-height: 1.5;
}

.solid-btn {
  border: 0;
  border-radius: 15px;
  padding: 15px 20px;
  background: var(--ink);
  color: var(--card);
  font-size: 0.93rem;
  font-weight: 650;
  transition:
    transform 0.15s ease,
    opacity 0.2s ease;
}

.solid-btn:active {
  transform: scale(0.98);
}

.solid-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.camera-error .solid-btn {
  min-width: 150px;
  background: #fff;
  color: #171512;
}

.preview-layer {
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 18px
    calc(18px + env(safe-area-inset-bottom));
  background:
    radial-gradient(
      90% 50% at 50% 0%,
      rgba(255, 255, 255, 0.05),
      transparent 70%
    ),
    #0c0c0a;
  color: #fff;
}

.preview-top {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.preview-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.preview-frame {
  width: 100%;
  max-width: 430px;
  overflow: hidden;
  border-radius: 20px;
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.preview-frame img {
  display: block;
  width: 100%;
  max-height: min(52dvh, 460px);
  object-fit: contain;
}

.preview-title {
  margin: 18px 0 4px;
  font-family: var(--display);
  font-size: 1.38rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.preview-sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.82rem;
  text-align: center;
}

.preview-actions {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1.55fr;
  gap: 10px;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 15px;
  padding: 15px 18px;
  background: transparent;
  color: #fff;
  font-size: 0.93rem;
  font-weight: 600;
}

.preview-actions .solid-btn {
  background: #fff;
  color: #171512;
}

.success-layer {
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 13, 11, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.success-card {
  width: 100%;
  max-width: 360px;
  padding: 30px 26px 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: var(--card);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  animation: pop-in 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.08) both;
}

.success-check {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  animation: check-in 0.5s 0.12s cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
}

.success-check svg {
  width: 32px;
  height: 32px;
}

.success-eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.success-card h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.success-text {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.success-card .solid-btn {
  width: 100%;
  border-radius: 16px;
  padding: 16px;
}

.lightbox {
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 18px
    calc(22px + env(safe-area-inset-bottom));
  background:
    radial-gradient(
      90% 50% at 50% 0%,
      rgba(255, 255, 255, 0.05),
      transparent 70%
    ),
    #0b0b09;
  color: #fff;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-weight: 600;
}

.lightbox img {
  max-width: 100%;
  max-height: 72dvh;
  margin: auto;
  border-radius: 16px;
  object-fit: contain;
}

.lightbox-date {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.76rem;
  text-align: center;
}

.toast {
  position: fixed;
  bottom: calc(112px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 80;
  max-width: calc(100vw - 40px);
  padding: 11px 16px;
  border-radius: 12px;
  background: #26231e;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 100;
  padding: 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--card);
  font-size: 0.85rem;
  text-align: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes name-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes check-in {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@media (hover: hover) {
  .proof-button:hover {
    background: rgba(255, 253, 248, 0.92);
  }

  .shoot-btn:hover {
    opacity: 0.94;
  }

  .round-btn:hover {
    background: rgba(0, 0, 0, 0.55);
  }
}

@media (min-width: 700px) {
  .shell {
    padding-bottom: 168px;
  }

  .dock {
    padding-bottom: 22px;
  }
}

@media (max-height: 650px) {
  .shell {
    padding-bottom: 154px;
  }

  .main {
    padding-top: 18px;
  }

  .timer-block {
    margin-top: 24px;
  }

  .proof-card {
    margin-top: 22px;
  }
}

@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;
  }
}
