/* The site's look follows the app: its grouped backgrounds, accent and profile cover. */

:root {
  color-scheme: light dark;
  --bg: #efeff4;
  --card: #ffffff;
  --text: #000000;
  --secondary: #8e8e93;
  --separator: rgba(60, 60, 67, 0.16);
  --accent: #0088ff;
  --placeholder: #e4e4e9;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1d;
    --text: #ffffff;
    --secondary: #8d8e93;
    --separator: rgba(84, 84, 88, 0.5);
    --accent: #3e88f7;
    --placeholder: #2c2c2e;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

h1, h2, p {
  margin: 0;
}

/* The app icon's logo. */
.logo {
  width: 30px;
  height: 30px;
  flex: none;
}

.top {
  width: 100%;
  max-width: 400px;
  display: flex;
  justify-content: center;
  padding: 20px 0 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

main {
  width: 100%;
  max-width: 400px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

footer {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 28px 0 calc(24px + env(safe-area-inset-bottom));
  font-size: 13px;
}

footer a {
  color: var(--secondary);
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin: 20px;
  padding: 0 20px;
  border-radius: 25px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.button:active {
  opacity: 0.75;
}

.get {
  margin-top: 16px;
  text-align: center;
  font-size: 15px;
}

.avatar {
  position: relative;
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--placeholder);
}

/* No photo: the first letter on the app's default avatar blue. */
.avatar.letter {
  display: grid;
  place-items: center;
  background: linear-gradient(#72d5fd, #2a9ef1);
  color: #ffffff;
  font-size: 40px;
  font-weight: 600;
}

/* The badge after a name, as the app draws it: a box 20/16 of the name's size, with the Emoji Status at 85%
   of it, or the gold Premium badge filling it. */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  margin-inline-start: 4px;
  vertical-align: -0.22em;
  font-size: 1em;
  line-height: 1;
}

span.badge {
  font-size: 1.0625em;
  width: 1.176em;
  height: 1.176em;
  vertical-align: -0.12em;
}

.badge.premium {
  fill: #fec007;
}

.username {
  color: var(--secondary);
}

.glass {
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* Profile: the cover in the profile color, lighter at the bottom, with a glow behind the avatar and
   the background emoji around it. */

.profile .head {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 0;
  text-align: center;
}

.profile.has-cover .head {
  padding-bottom: 24px;
  background: linear-gradient(to top, var(--cover-0), var(--cover-1));
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .profile.has-cover .head {
    background: linear-gradient(to top, var(--cover-dark-0), var(--cover-dark-1));
  }
}

.glow,
.pattern {
  position: absolute;
  left: 50%;
  top: 80px;
}

.glow {
  width: 300px;
  height: 300px;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.256) 20%, rgba(255, 255, 255, 0.144) 40%, rgba(255, 255, 255, 0.064) 60%, rgba(255, 255, 255, 0.016) 80%, transparent);
}

.pattern span {
  position: absolute;
  translate: -50% -50%;
  line-height: 1;
  filter: brightness(0);
  mix-blend-mode: overlay;
}

.profile .name {
  position: relative;
  margin-top: 14px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.profile .username {
  position: relative;
  margin-top: 2px;
}

.profile.has-cover .username {
  color: rgba(255, 255, 255, 0.75);
}

.bio {
  padding: 16px 24px 0;
  text-wrap: pretty;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Post and story: the author, then what they shared. The author is one line, as in the app's post header:
   the name, then @username in the secondary color, then the badge, left to right in every language. The name
   is left out when it's the username; a long one is cut short, never the badge. */

.author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 0;
}

.author .avatar {
  width: 40px;
  height: 40px;
}

.author .avatar.letter {
  font-size: 17px;
}

.identity {
  display: flex;
  align-items: center;
  min-width: 0;
}

.handle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handle .name {
  font-weight: 600;
}

.identity .badge {
  flex: none;
}

.text {
  padding: 12px 20px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Media shows only as its ThumbHash, blurred. */

.media,
.frame {
  position: relative;
  overflow: hidden;
  background: var(--placeholder);
}

/* The width is set so the height limit doesn't narrow a tall picture through its aspect ratio. */
.media {
  width: calc(100% - 40px);
  max-height: 60vh;
  margin: 14px 20px 0;
  border-radius: 18px;
  /* Safari doesn't round a blurred child through overflow: hidden. */
  clip-path: inset(0 round 18px);
}

.media canvas,
.frame canvas {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(10px) saturate(1.15);
}

.kind {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.kind svg {
  width: 26px;
  height: 26px;
}

.count {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

/* Story: the viewer's frame, with its progress bar and author over the top. */

.frame {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 64vh;
  margin: 0;
  clip-path: inset(0 round 28px 28px 0 0);
}

/* The bar sits clear of the frame's rounded corners. */
.overlay {
  position: absolute;
  inset: 0 0 auto;
  padding: 16px 16px 32px;
  background: linear-gradient(rgba(0, 0, 0, 0.32), transparent);
  color: #ffffff;
}

.progress {
  height: 3px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.9);
}

.overlay .author {
  gap: 10px;
  padding: 12px 0 0;
}

.overlay .avatar {
  width: 32px;
  height: 32px;
}

.overlay .identity {
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.overlay .username {
  color: rgba(255, 255, 255, 0.8);
}

/* Not found */

.empty {
  padding-top: 36px;
  text-align: center;
}

.symbol {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--placeholder);
  color: var(--secondary);
}

.symbol svg {
  width: 32px;
  height: 32px;
}

.empty h1 {
  padding: 0 24px;
  font-size: 22px;
  font-weight: 600;
}

.empty p {
  padding: 8px 24px 0;
  text-wrap: pretty;
  color: var(--secondary);
}

.empty .button {
  margin-top: 24px;
}

/* Home: the app, then what it does as a grouped list. */

.home-page .top {
  display: none;
}

.home-page main {
  padding-top: 48px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero .logo {
  width: 108px;
  height: 108px;
  margin-bottom: 20px;
  border-radius: 50%;
  box-shadow: 0 12px 32px rgba(0, 136, 255, 0.28);
}

.hero h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 600;
}

.lede {
  margin-top: 6px;
  color: var(--secondary);
}

.hero .button {
  width: 100%;
  max-width: 280px;
  margin: 28px 0 0;
}

.features {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  border-radius: 26px;
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.features li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
}

.features li + li::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 64px 0;
  height: 0.5px;
  background: var(--separator);
}

.glyph {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--glyph);
  color: #ffffff;
}

.glyph svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.features h2 {
  font-size: 17px;
  font-weight: 600;
}

.features p {
  margin-top: 1px;
  color: var(--secondary);
  font-size: 15px;
}
