/* Wyng public link previews: one system for usernames, channels, groups, bots,
   sticker sets, shared folders and collectible gifts. Flat surfaces, hairline
   borders, a single accent, and a 4px spacing scale. */

@font-face {
  font-family: "Vazirmatn";
  src: url("vazirmatn-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --font: "Vazirmatn", "Vazir", Tahoma, "Segoe UI", system-ui, -apple-system, sans-serif;

  --bg: #f7f7f3;
  --surface: #fffefa;
  --surface-2: #efeee7;
  --ink: #17181a;
  --ink-2: #4c4f48;
  --ink-3: #666a5f;
  --line: #e4e3da;
  --line-2: #d2d1c6;

  --accent: #7dbb32;
  --accent-strong: #8ecb45;
  --accent-text: #476f14;
  --on-accent: #122400;
  --accent-wash: #eff6e4;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 40px;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --page: 480px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f0c;
    --surface: #161812;
    --surface-2: #1d2017;
    --ink: #efefec;
    --ink-2: #b6b9ad;
    --ink-3: #9a9e91;
    --line: #262a20;
    --line-2: #363b2d;

    --accent: #8ecb45;
    --accent-strong: #a0d95c;
    --accent-text: #a5d86a;
    --on-accent: #0f2000;
    --accent-wash: #1e2a12;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--on-accent); }

.shell {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--s5) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom));
}

.top {
  width: 100%;
  max-width: var(--page);
  padding-bottom: var(--s5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.stage {
  width: 100%;
  max-width: var(--page);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: var(--s4);
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  padding: var(--s7) var(--s7) var(--s6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s1);
  text-align: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: var(--s3);
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 32px;
  font-weight: 700;
}

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

.eyebrow {
  margin: 0;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-wash);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.8;
}

h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  margin: var(--s1) 0 0;
  font-size: clamp(21px, 5.4vw, 25px);
  line-height: 1.45;
  font-weight: 700;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.verified {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.verified path { stroke: var(--on-accent); }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.8;
}

.handle {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.8;
  direction: ltr;
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

.meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.bio {
  margin: 0;
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 2;
  white-space: pre-line;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.art {
  margin: calc(-1 * var(--s7)) calc(-1 * var(--s7)) 0;
  overflow: hidden;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface-2);
}

.art img {
  display: block;
  width: 100%;
  height: auto;
}

.actions {
  display: grid;
  gap: var(--s2);
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 var(--s5);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink-2);
}

.btn-ghost:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.fine {
  width: 100%;
  max-width: var(--page);
  margin: 0;
  padding-top: var(--s5);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.9;
  text-align: center;
}

@media (max-width: 560px) {
  .shell { padding: var(--s3) var(--s4) 0; }
  .top { padding-bottom: var(--s3); }
  .stage { padding-block: var(--s1) 0; }
  .card {
    flex: 0 0 auto;
    gap: var(--s4);
    padding: var(--s1) 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .avatar {
    width: 84px;
    height: 84px;
    font-size: 28px;
  }
  h1 { font-size: 22px; }
  .bio {
    padding-top: var(--s4);
    border-top: 1px solid var(--line);
  }
  .art {
    margin: 0;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
  }
  .btn-ghost {
    min-height: 44px;
    border-color: transparent;
    color: var(--ink-3);
    font-size: 14px;
    font-weight: 600;
  }
  .btn-ghost:hover { border-color: transparent; color: var(--ink); }
  .actions {
    position: sticky;
    bottom: 0;
    margin: 0 calc(-1 * var(--s4));
    padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  .fine { display: none; }
}

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