/* webgram skin. phone on a messy desk, not a saas dashboard. */

@import url("https://fonts.googleapis.com/css2?family=Lilita+One&family=Patrick+Hand&display=swap");

:root {
  --ink: #1c1410;
  --cream: #f6efe4;
  --paper: #fffaf3;
  --desk: #5c3a28;
  --desk2: #6e4632;
  --ring: #e07a5f;
  --ring2: #f2cc8f;
  --tape: #f4e1b5;
  --sticker: #81b29a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: repeating-linear-gradient(
    90deg,
    var(--desk) 0px,
    var(--desk) 16px,
    var(--desk2) 16px,
    var(--desk2) 32px
  );
  font-family: "Patrick Hand", cursive;
}

/* grain so it doesnt look like a clean figma file */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.desk {
  min-height: 100vh;
  padding: 48px 16px 72px;
  position: relative;
}

.desk::after {
  content: "new tab :D";
  position: absolute;
  top: 16px;
  left: 18px;
  transform: rotate(-9deg);
  background: var(--ring2);
  color: var(--ink);
  padding: 6px 12px;
  font-family: "Lilita One", cursive;
  box-shadow: 3px 3px 0 var(--ink);
  z-index: 2;
}

.phone {
  width: min(390px, 100%);
  margin: 0 auto;
  background: var(--paper);
  border: 10px solid #2a211c;
  border-radius: 38px;
  min-height: 640px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transform: rotate(-1.15deg);
  box-shadow: 14px 20px 0 rgba(0, 0, 0, 0.28);
}

/* tape at the top. i ran out of real tape. */
.phone::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 28%;
  width: 44%;
  height: 20px;
  background: var(--tape);
  transform: rotate(-2deg);
  opacity: 0.9;
  z-index: 3;
}

.phone::after {
  content: "not ig";
  position: absolute;
  right: -8px;
  bottom: 88px;
  transform: rotate(12deg);
  background: var(--sticker);
  color: var(--paper);
  padding: 4px 8px;
  font-family: "Lilita One", cursive;
  font-size: 0.75rem;
  box-shadow: 2px 2px 0 var(--ink);
  z-index: 4;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 28px 18px 10px;
  border-bottom: 2px dashed #d9cbb8;
  flex-shrink: 0;
}

.logo {
  margin: 0;
  font-family: "Lilita One", cursive;
  font-size: 2rem;
  letter-spacing: 0.4px;
  transform: rotate(-3.5deg);
}

.clock {
  margin: 0;
  font-family: "Lilita One", cursive;
  font-size: 1.15rem;
  letter-spacing: 0.3px;
}

.stories {
  display: flex;
  gap: 8px;
  padding: 14px 14px 8px;
  overflow-x: auto;
  flex-shrink: 0;
}

.story {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 68px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.story-ring {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  border-radius: 50%;
  border: 3px solid transparent;
  background:
    linear-gradient(var(--cream), var(--cream)) padding-box,
    conic-gradient(from 210deg, var(--ring), var(--ring2), var(--sticker), var(--ring)) border-box;
  font-family: "Lilita One", cursive;
  font-size: 0.7rem;
  color: var(--ink);
}

@keyframes ring-spin {
  from {
    transform: rotate(0deg) scale(1.04);
  }
  to {
    transform: rotate(360deg) scale(1.04);
  }
}

.story:hover .story-ring,
.story:focus-visible .story-ring {
  animation: ring-spin 0.8s ease;
}

.story:active .story-ring {
  transform: scale(0.94);
}

.story:nth-child(2) .story-ring {
  transform: rotate(7deg);
}
.story:nth-child(3) .story-ring {
  transform: rotate(-4deg);
}
.story:nth-child(5) .story-ring {
  transform: rotate(5deg);
}

.story-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.1;
  text-align: center;
}

.search {
  padding: 10px 16px 8px;
  flex-shrink: 0;
}

.search input {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--cream);
  color: var(--ink);
}

.search input:focus {
  outline: 3px solid var(--ring2);
  outline-offset: 1px;
}

.feed {
  flex: 1;
  padding: 8px 16px 88px;
  overflow-y: auto;
}

.placeholder,
.feed-status {
  margin: 12px 0 0;
  border: 2px dashed #c9b8a4;
  padding: 32px 12px;
  text-align: center;
  transform: rotate(0.7deg);
  background: rgba(246, 239, 228, 0.6);
}

.tabbar {
  display: flex;
  justify-content: space-around;
  padding: 10px 8px 18px;
  border-top: 2px solid #2a211c;
  background: var(--paper);
  position: sticky;
  bottom: 0;
  flex-shrink: 0;
  z-index: 5;
}

.tabbar a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
}

.tabbar a:hover {
  text-decoration: underline;
}

.tabbar a.is-on {
  font-family: "Lilita One", cursive;
  text-decoration: underline;
  text-decoration-style: wavy;
}

.post {
  margin: 0 0 20px;
  background: var(--cream);
  border: 2px solid var(--ink);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.18);
  cursor: pointer;
  user-select: none;
}

.post:nth-child(2n) {
  transform: rotate(-0.7deg);
}

.post:nth-child(3n) {
  transform: rotate(0.9deg);
}

.post-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 6px;
}

.post-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--ring);
  object-fit: cover;
  background: var(--ring2);
  flex: 0 0 auto;
}

.post-avatar-fallback {
  display: grid;
  place-items: center;
  font-family: "Lilita One", cursive;
  font-size: 0.85rem;
}

.post-name,
.post-handle {
  margin: 0;
  line-height: 1.15;
}

.post-name {
  font-family: "Lilita One", cursive;
  font-size: 0.95rem;
}

.post-handle {
  font-size: 0.8rem;
  opacity: 0.7;
}

.post-pic-wrap {
  position: relative;
  background: #2a211c;
}

.post-pic {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.post-heart {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 4.2rem;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  text-shadow: 3px 3px 0 var(--ink);
}

@keyframes heart-pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  35% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.post-heart.is-pop {
  animation: heart-pop 0.7s ease;
}

.post-actions {
  display: flex;
  gap: 14px;
  padding: 8px 10px 0;
}

.post-actions button {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--ink);
}

.post-actions button.is-on {
  color: var(--ring);
  font-family: "Lilita One", cursive;
}

.post-caption {
  margin: 4px 0 0;
  padding: 4px 10px 12px;
  font-size: 0.95rem;
}

.post-caption b {
  font-family: "Lilita One", cursive;
  font-weight: normal;
  margin-right: 4px;
}

.you-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 24px;
}

.you-form label,
.you-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.95rem;
}

.you-form label span {
  opacity: 0.65;
  font-size: 0.85rem;
}

.you-form input,
.you-form textarea {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--ink);
}

.you-form textarea {
  min-height: 140px;
  resize: vertical;
}

.you-row {
  display: grid;
  grid-template-columns: 52px 1fr 1fr 28px;
  gap: 4px;
  margin: 0 0 6px;
}

.you-row input {
  min-width: 0;
}

.you-form button {
  border: 2px solid var(--ink);
  background: var(--ring2);
  font-family: inherit;
  font-size: 1rem;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--ink);
}

.you-form #you-add {
  background: var(--cream);
}

.you-form .you-drop {
  padding: 0;
  background: var(--ring);
  color: var(--paper);
}

.you-form button[type="submit"] {
  font-family: "Lilita One", cursive;
}

@media (max-width: 520px) {
  .desk::after {
    display: none;
  }

  .phone {
    transform: none;
    box-shadow: 8px 12px 0 rgba(0, 0, 0, 0.22);
  }

  .you-row {
    grid-template-columns: 48px 1fr 28px;
  }

  .you-row input[name="surl"] {
    grid-column: 1 / -1;
  }
}
