:root {
  --bg: #11080b;
  --cream: #f6efe6;
  --gold: #c6a57a;
  --muted: #d3c0b6;
  --line: rgba(246, 239, 230, 0.14);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100dvh;
  color: var(--cream);
  font-family: Manrope, "Segoe UI", sans-serif;
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

::selection { background: #c6a57a; color: #1a0c10; }

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(920px 540px at 50% -12%, rgba(176, 78, 96, 0.32), transparent 58%),
    radial-gradient(680px 460px at 112% 108%, rgba(198, 165, 122, 0.16), transparent 52%),
    radial-gradient(520px 320px at -12% 86%, rgba(120, 36, 58, 0.22), transparent 50%);
}

.wrap {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(440px, 100%);
  margin: 0 auto;
  padding:
    max(36px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(32px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
}

.eyebrow {
  margin: 0 0 26px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px 1px;
  border: 1px solid rgba(198, 165, 122, 0.55);
  border-radius: 999px;
  letter-spacing: 0.08em;
  vertical-align: 1px;
}

.mark {
  width: 78px;
  height: 78px;
  margin: 0 auto 22px;
  border: 1px solid rgba(198, 165, 122, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 48px;
  line-height: 1;
  color: var(--cream);
  box-shadow: inset 0 0 0 5px rgba(17, 8, 11, 0.55);
}

.mark span { display: block; transform: translateY(-0.08em); }

h1 {
  margin: 0;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(48px, 13vw, 68px);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.tagline, .lede, .empty {
  margin: 16px auto 0;
  max-width: 34ch;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.rule {
  width: 72px;
  height: 1px;
  margin: 26px auto;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.links, .recent, .checks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links { display: grid; gap: 10px; }

.btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px 18px;
  border-radius: 18px;
  border: 1px solid rgba(246, 239, 230, 0.14);
  background: rgba(246, 239, 230, 0.04);
  color: var(--cream);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.btn-primary {
  min-height: 66px;
  justify-content: center;
  border-color: transparent;
  border-radius: 999px;
  background: var(--cream);
  color: #1a0c10;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.btn-ic {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: none;
}

.glyph {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 28px;
  line-height: 1;
  transform: translateY(-0.06em);
}

.btn-ic svg { width: 22px; height: 22px; display: block; }

.btn-copy { display: flex; flex-direction: column; min-width: 0; }

.btn-primary .btn-copy { align-items: center; text-align: center; }

.btn-primary .btn-hint { opacity: 0.75; }

.btn-label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.011em;
  line-height: 1.2;
}

.btn-hint {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.68;
}

button.btn-primary { font-weight: 600; font-size: 16px; }

.btn:focus-visible, .field:focus-visible, .linkbtn:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn:active { transform: translateY(1px); }

@media (hover: hover) {
  .btn:hover { border-color: rgba(246, 239, 230, 0.32); }
  .btn-primary:hover { background: #fff8f1; }
}

form.gate { margin-top: 28px; }

.fine {
  margin: 14px 0 0;
  text-align: center;
  color: rgba(211, 192, 182, 0.82);
  font-size: 13px;
  line-height: 1.45;
}

.field {
  display: block;
  width: 100%;
  margin: 8px 0 12px;
  padding: 16px 18px;
  border-radius: 999px;
  border: 1px solid rgba(246, 239, 230, 0.16);
  background: rgba(0, 0, 0, 0.22);
  color: var(--cream);
  font: inherit;
  font-size: 16px;
}

.debug {
  margin: 28px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--gold);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body[data-page="admin"] .wrap {
  width: min(720px, 100%);
  justify-content: flex-start;
  padding-top: max(28px, env(safe-area-inset-top));
}

body[data-page="admin"] h1 { font-size: clamp(42px, 10vw, 56px); }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 8px;
}

.toolbar a, .linkbtn {
  color: var(--gold);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
}

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.cols, .stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 16px;
  align-items: center;
}

.cols {
  margin: 22px 0 8px;
  padding: 0 16px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stat {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(246, 239, 230, 0.035);
}

.stat b {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 18px;
}

.sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

h2 {
  margin: 32px 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 32px;
}

.recent { margin-top: 12px; display: grid; gap: 0; }

.recent li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.recent strong { color: var(--cream); font-weight: 600; }

.checks { margin: 10px 0 0; display: grid; gap: 6px; }
.checks a { color: var(--cream); }

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}

body[data-page="home"] {
  background: #6b3548;
}

body[data-page="home"] .bg { display: none; }

body[data-page="home"] .wrap {
  width: min(480px, 100%);
  justify-content: flex-start;
  padding: 0 0 max(18px, env(safe-area-inset-bottom));
}

body[data-page="home"] h1 {
  font-family: Manrope, "Segoe UI", sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0.2px;
  text-align: center;
}

.profile { background: #6b3548; }

.cover {
  aspect-ratio: 1;
  background: #4a2432;
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet {
  position: relative;
  margin-top: -30px;
  padding: 22px 16px 8px;
  border-radius: 30px 30px 0 0;
  background: #6b3548;
}

.handle, .bio {
  margin: 4px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 16px;
  line-height: 1.35;
}

.bio { margin-top: 8px; font-size: 15px; }

body[data-page="home"] .lede,
body[data-page="home"] .fine {
  color: rgba(255, 255, 255, 0.78);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.soc {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
}

.soc svg { width: 22px; height: 22px; display: block; }

.soc-instagram { background: linear-gradient(135deg, #f9ce34, #ee2a7b 55%, #6228d7); }
.soc-tiktok, .soc-threads, .soc-link { background: #111; }
.soc-youtube { background: #ff0033; }
.soc-vk, .soc-telegram { background: #2787f5; }
.soc-message { background: #2a2a2a; }

.socials .glyph {
  color: #fff;
  font-size: 26px;
}

.feature {
  position: relative;
  display: block;
  min-height: 220px;
  margin: 18px 0 0;
  border-radius: 18px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: #2a1218;
}

.feature img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
}

.feature-ic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(255, 255, 255, 0.94);
  color: #1a0c10;
}

.feature-ic svg { width: 15px; height: 15px; display: block; }

.feature-copy { display: flex; flex-direction: column; min-width: 0; }

.feature-label {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.feature-hint { font-size: 13px; opacity: 0.85; }

.feature-empty {
  display: grid;
  place-items: center;
  padding: 28px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.45;
}

.feature-empty::after { display: none; }

body[data-page="home"] form.gate { margin-top: 18px; }

body[data-page="home"] .btn-primary { width: 100%; }

body[data-page="home"] .debug { margin-bottom: 12px; }

.avatar-preview {
  width: 96px;
  height: 96px;
  margin: 14px 0 0;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #2a1218;
}

.avatar-form { margin-top: 12px; }

.avatar-form input[type="file"] {
  display: block;
  width: 100%;
  margin: 8px 0 12px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
}

.avatar-form .btn-primary { width: 100%; }
