:root {
  --bg: #0a0a0a;
  --surface: #151515;
  --line: #2a2a2a;
  --text: #f2f2f2;
  --muted: #9b9b9b;
  --gold: #d4af37;
  --ring: 1px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  animation: enter .45s ease-out both;
}

@keyframes enter { from { opacity: 0; } to { opacity: 1; } }

/* Top bar */
.bar { display: flex; justify-content: space-between; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.icon-btn:active { transform: scale(.94); }

/* Menu */
.menu {
  position: absolute;
  top: calc(max(16px, env(safe-area-inset-top)) + 52px);
  left: 20px;
  z-index: 10;
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.menu.open { opacity: 1; visibility: visible; transform: none; }

.menu > * {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
}
.menu > *:active { background: #202020; }

/* Profile */
.profile { margin-top: 28px; text-align: center; }

.logo {
  width: 132px;
  height: 132px;
  margin: 0 auto;
  padding: 4px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: block;
  background: none;
  cursor: zoom-in;
  -webkit-appearance: none;
  appearance: none;
}
.logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

h1 { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; font-size: 1.5rem; font-weight: 700; letter-spacing: .01em; }
.tagline { margin-top: 4px; font-size: .9375rem; color: var(--muted); }

/* Links */
.links {
  display: grid;
  gap: 12px;
  margin-top: 32px;
  padding: 0;
  list-style: none;
}

.link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 0 20px;
  border: var(--ring) solid var(--gold);
  border-radius: 16px;
  background: var(--surface);
  font-size: 1.0625rem;
  font-weight: 600;
  transition: transform .15s ease, border-color .15s ease;
}
.link svg { width: 26px; height: 26px; flex: none; fill: currentColor; }
.link:active { transform: scale(.98); background: #1c1c1c; }

@media (hover: hover) {
  .icon-btn:hover { border-color: var(--gold); }
}

/* Footer */
.foot {
  margin-top: auto;
  padding-top: 48px;
  font-size: .8125rem;
  color: var(--muted);
  text-align: center;
}

/* Dialogs */
dialog {
  width: min(92vw, 440px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, .72); }

.inner { padding: 24px; }
.inner h2 { margin-bottom: 14px; font-size: 1.25rem; }
.inner p { margin-bottom: 14px; line-height: 1.65; color: #d6d6d6; }

.mail { color: var(--gold); font-weight: 600; word-break: break-all; }

.close {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1d1d1d;
  cursor: pointer;
}
.close:active { transform: scale(.98); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: #0a0a0a;
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Buttons and confirm panel */
.actions { display: flex; gap: 12px; }
.inner .actions { margin-top: 6px; }

.btn {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1d1d1d;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { border-color: var(--gold); background: var(--gold); color: #0a0a0a; }

/* Logo viewer */
dialog.viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #000;
}
dialog.viewer[open] { display: flex; flex-direction: column; }
.viewer .top { display: flex; justify-content: flex-end; padding: max(12px, env(safe-area-inset-top)) 16px 0; }
.viewer .actions { padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }

.stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}
.stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.verified { flex: none; width: 22px; height: 22px; }

/* Tap animation */
.link, .icon-btn, .menu > *, .btn, .logo, .close { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: var(--gold);
  opacity: .35;
  pointer-events: none;
  transform: scale(0);
  animation: ripple .55s ease-out forwards;
}
.btn.primary .ripple { background: #fff; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Panels open with a short pop */
dialog[open] { animation: pop .24s cubic-bezier(.2, .9, .3, 1.15); }
dialog[open]::backdrop { animation: fade .24s ease-out; }
dialog.viewer[open] { animation: fade .2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
