/* rongan.me/social — light, warm, crisp.
   Two hard rules, learned in production:
   1. System fonts only — zero font requests inside Instagram/TikTok webviews.
      ui-rounded/SF Pro Rounded matches the apps' own design system.
   2. No filter/backdrop-filter anywhere. WKWebView lets blurred children
      escape border-radius clipping (the old avatar-glow corner artifact).
      Gradients and box-shadows only. */

:root {
  --paper: #fbfaf7;
  --card: #ffffff;
  --hairline: #e8e6df;
  --ink: #191c23;
  --muted: #5d6370;
  --faint: #9095a2;
  --indigo: #4f59f5;
  --amber: #f59e0b;
  --radius-card: 24px;
  --display: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", system-ui, sans-serif;
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(50rem 30rem at 14% -12rem, rgba(79, 89, 245, 0.08), transparent 68%),
    radial-gradient(44rem 26rem at 88% -10rem, rgba(245, 158, 11, 0.07), transparent 66%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.page {
  max-width: 26.5rem;
  margin: 0 auto;
  padding: calc(3rem + env(safe-area-inset-top)) calc(1.25rem + env(safe-area-inset-right))
    calc(2.5rem + env(safe-area-inset-bottom)) calc(1.25rem + env(safe-area-inset-left));
}

/* Header */
.who { text-align: center; }

/* The photo sits in a dawn ring, with the three platform chips floating
   around it like stickers: TikTok + Instagram left, YouTube right. */
.halo {
  position: relative;
  width: 96px;
  margin: 0 auto 1.1rem;
}
.halo .avatar { margin: 0; }

.chip {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--hairline);
  box-shadow:
    0 1px 2px rgba(25, 28, 35, 0.05),
    0 12px 26px -14px rgba(25, 28, 35, 0.3);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chip:hover {
  transform: rotate(var(--tilt, 0deg)) translateY(-2px) scale(1.06);
  box-shadow:
    0 2px 4px rgba(25, 28, 35, 0.05),
    0 16px 30px -14px rgba(25, 28, 35, 0.35);
}
.chip:active { transform: rotate(var(--tilt, 0deg)) scale(0.94); }
.chip svg { width: 21px; height: 21px; display: block; }
/* TikTok's viewBox carries padding for the cyan/red offset copies */
.chip-tiktok svg { width: 23px; height: 23px; }

.chip-tiktok { right: calc(100% + 14px); top: -12px; --tilt: -8deg; }
.chip-instagram { right: calc(100% + 18px); bottom: -8px; --tilt: 6deg; }
.chip-youtube { left: calc(100% + 14px); top: 20px; --tilt: 8deg; }

/* The photo sits in a dawn ring — indigo (PillsCheck, morning) turning amber
   (MyEvening, dusk). Also the one shape everyone arriving from a story
   already knows how to read: "this is the person from the video". */
.avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 1.1rem;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--indigo), #8a5cf0 26%, var(--amber) 50%, #8a5cf0 74%, var(--indigo));
  box-shadow: 0 14px 30px -16px rgba(64, 70, 176, 0.5);
  display: grid;
}
.avatar img,
.avatar .monogram {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--paper);
  display: block;
}
.avatar img { object-fit: cover; }
.avatar .monogram {
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #5a63ff, var(--indigo));
  color: #fff;
  font-family: var(--display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
}

.who h1 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.who .tagline {
  margin: 0 auto;
  max-width: 24em;
  color: var(--muted);
  font-size: 0.96875rem;
}

/* App cards — App Store rows in daylight */
.apps { display: grid; gap: 0.9rem; margin-top: 2.1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  box-shadow:
    0 1px 2px rgba(25, 28, 35, 0.04),
    0 20px 44px -28px rgba(25, 28, 35, 0.16);
}

.card-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
}

/* Real app icons, iOS corner ratio, hairline ring so the light PillsCheck
   icon still separates from the white card. */
.app-icon {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 18px -10px rgba(25, 28, 35, 0.3);
}
.app-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(25, 28, 35, 0.08);
}
.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.app-icon.fallback {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent));
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .app-icon.fallback { background: var(--accent); }
}
.app-icon.fallback svg { width: 30px; height: 30px; display: block; }

.card-head { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; }
.card-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-head .soon {
  margin-left: auto;
  color: #b45309;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.card-tag { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.90625rem; line-height: 1.45; }

.card-actions {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  margin-top: 1.1rem;
}
.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 50px;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 18px; flex: none; margin-top: -2px; }
.btn-store {
  /* white top-light over the app accent — crisp without color-mix */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 55%),
    var(--accent, var(--indigo));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 22px -12px rgba(25, 28, 35, 0.5);
}
.btn-store:hover { filter: brightness(1.05); }
.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--hairline);
  box-shadow: 0 1px 2px rgba(25, 28, 35, 0.04);
}
.btn-ghost:hover { border-color: #d8d5cc; }

/* Shown only if an App Store handoff fails inside an in-app browser */
.webview-hint {
  margin-top: 0.7rem;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  background: #fdf3e0;
  border: 1px solid #f0d7a3;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.5;
  display: grid;
  gap: 0.3rem;
}
.webview-hint strong { font-weight: 650; }
.webview-hint .dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e6ddc7;
  font-weight: 700;
  line-height: 1.25;
}

/* Curved arrow at the top-right of the viewport, shown together with the
   webview hint. Points up at the in-app browser's ⋯ button, which lives in
   the app chrome just above the page. Purely decorative: no pointer events,
   removes itself after a few seconds. */
.corner-pointer {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 6px);
  right: 14px;
  width: 56px;
  height: 76px;
  color: var(--ink);
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  animation: pointer-in 0.3s ease-out forwards;
}
.corner-pointer svg { width: 100%; height: 100%; display: block; }
.corner-pointer.fade { transition: opacity 0.6s ease; opacity: 0 !important; }
@keyframes pointer-in {
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .corner-pointer svg { animation: pointer-bob 1.2s ease-in-out infinite; }
  @keyframes pointer-bob {
    0%, 100% { transform: translateY(5px); }
    50% { transform: translateY(-2px); }
  }
}

/* Footer */
.colophon {
  margin-top: 2.4rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}
.colophon p { margin: 0.2rem 0; }
.colophon a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.colophon a:hover { color: var(--ink); }

/* Privacy page */
.prose { text-align: left; }
.prose .back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
}
.prose .back:hover { color: var(--ink); }
.prose h1 {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.prose .updated {
  margin: 0 0 1.6rem;
  color: var(--faint);
  font-size: 0.8125rem;
}
.prose h2 {
  margin: 1.7rem 0 0.4rem;
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.prose p,
.prose li {
  margin: 0.4rem 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { margin: 0.4rem 0; padding-left: 1.15rem; }
.prose a { color: var(--ink); }
.prose .colophon { text-align: center; }

.noscript { color: var(--muted); text-align: center; }
.noscript a { color: var(--ink); }

a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* Entry animation */
@media (prefers-reduced-motion: no-preference) {
  .who, .card, .colophon {
    opacity: 0;
    transform: translateY(8px);
    animation: rise 0.45s ease-out forwards;
  }
  .card:nth-child(1) { animation-delay: 0.07s; }
  .card:nth-child(2) { animation-delay: 0.14s; }
  .card:nth-child(3) { animation-delay: 0.21s; }
  .colophon { animation-delay: 0.32s; }
  @keyframes rise {
    to { opacity: 1; transform: none; }
  }
  /* Chips pop in after the header rises. `backwards` (not `forwards`) so the
     filled keyframe releases the transform and hover/active still work. */
  .chip { animation: pop 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.3) backwards; }
  .chip-tiktok { animation-delay: 0.18s; }
  .chip-instagram { animation-delay: 0.26s; }
  .chip-youtube { animation-delay: 0.34s; }
  @keyframes pop {
    from { opacity: 0; transform: rotate(var(--tilt, 0deg)) scale(0.4); }
  }
}
