/* Tweefle — NeoCon Twitter Wall Recreation
   Faithful to the original 2009 trade show display:
   sky gradient, drifting clouds, colorful floating tweet bubbles

   LAYERS (back to front):
   z-index 1    — .tweefle-sky  (clouds, background)
   z-index 100  — .tweefle-banner (archive nav bar)
   z-index 1000 — #tweefle-wall (tweet content)
   z-index 2000 — .tweefle-overlay (about modal)  */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: Helvetica, Arial, "Helvetica Neue", Geneva, sans-serif;
}

body {
  background: linear-gradient(180deg, #eaf6fc 0%, #d0ebf8 20%, #a8daf0 45%, #7ec8e3 70%, #6bbdd9 100%);
  color: #fff;
}

/* === Archive Banner (z-index 100) === */

.tweefle-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 13px;
  color: #4a6a7a;
}

.tweefle-banner a {
  color: #2980b9;
  text-decoration: none;
  font-weight: 500;
}

.tweefle-banner a:hover {
  text-decoration: underline;
}

/* === Sky Background Layer (z-index 1) === */
/* 6 rows of clouds spread evenly across the viewport.
   Each row is 200vw wide with clouds duplicated for seamless looping.
   The entire row animates horizontally as one strip. */

.tweefle-sky {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.cloud-row {
  position: absolute;
  left: 0;
  width: 200vw;
  height: 140px;
}

.cl {
  position: absolute;
  top: 0;
  pointer-events: none;
}

.cl--big    { width: 433px; height: 132px; }
.cl--medium { width: 274px; height: 76px; top: 20px; }
.cl--small  { width: 170px; height: 27px; top: 40px; }

/* Row positions — 6 rows spread evenly across the viewport */
.row1 { top: 2%;  opacity: 0.5;  animation: drift-r 45s linear infinite; }
.row2 { top: 18%; opacity: 0.4;  animation: drift-l 38s linear infinite; animation-delay: -12s; }
.row3 { top: 36%; opacity: 0.55; animation: drift-r 50s linear infinite; animation-delay: -20s; }
.row4 { top: 52%; opacity: 0.35; animation: drift-l 35s linear infinite; animation-delay: -8s; }
.row5 { top: 70%; opacity: 0.45; animation: drift-r 42s linear infinite; animation-delay: -25s; }
.row6 { top: 86%; opacity: 0.3;  animation: drift-l 40s linear infinite; animation-delay: -15s; }

/* Drift right: row slides left so clouds appear to move right */
@keyframes drift-r {
  from { transform: translateX(0); }
  to   { transform: translateX(-100vw); }
}

/* Drift left: row slides right so clouds appear to move left */
@keyframes drift-l {
  from { transform: translateX(-100vw); }
  to   { transform: translateX(0); }
}

/* === Tweet Wall — floats above the sky, centered === */

#tweefle-wall {
  position: fixed;
  z-index: 1000;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  bottom: 0;
  overflow: hidden;
  padding: 0 16px 0;
  display: flex;
  flex-direction: column;
}

.tweefle-header {
  text-align: center;
  padding: 14px 20px 16px;
}

.tweefle-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow:
    0 2px 4px rgba(0, 40, 80, 0.5),
    0 4px 30px rgba(0, 60, 120, 0.4);
  letter-spacing: -0.02em;
  pointer-events: none;
}

.tweefle-header-dp {
  font-size: 1.15rem;
  font-weight: 600;
  color: #E20134;
  margin-top: 6px;
  text-shadow:
    0 1px 3px rgba(0, 40, 80, 0.4),
    0 2px 12px rgba(0, 60, 120, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tweefle-header-dp a {
  color: #E20134;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tweefle-header-dp a:hover {
  text-decoration: underline;
}

.tweefle-dp-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.tweefle-header-about {
  font-size: 0.95rem;
  font-weight: 700;
  color: #3294D6;
  margin-top: 6px;
  cursor: pointer;
}

.tweefle-header-about:hover {
  text-decoration: underline;
}

/* Stream area — vertical scroll of tweet cards */
#tweefle-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 40px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#tweefle-stream::-webkit-scrollbar {
  display: none;
}

/* === Tweet Card (white, vertical stream) === */

.tweefle-tweet {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 16px 18px 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px rgba(0, 40, 80, 0.12);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tweefle-tweet.visible {
  opacity: 1;
  transform: translateY(0);
}

.tweefle-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  float: left;
  margin-right: 12px;
  margin-top: 2px;
  background: #e8f4f8;
  border: 2px solid rgba(0, 0, 0, 0.06);
}

.tweefle-avatar--fallback {
  background: #4a9cc7;
  object-fit: contain;
  padding: 2px;
  border-color: #3a8ab5;
}

.tweefle-content {
  overflow: hidden;
}

.tweefle-username {
  font-weight: 700;
  font-size: 13px;
  color: #2980b9;
  display: block;
  margin-bottom: 3px;
}

.tweefle-text {
  font-size: 15px;
  line-height: 1.4;
  color: #2a3a4a;
  word-wrap: break-word;
}

.tweefle-tweet-image {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin-top: 10px;
}

.tweefle-tweet-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.tweefle-tweet-link:hover .tweefle-username {
  text-decoration: underline;
}

.tweefle-time {
  display: block;
  font-size: 11px;
  color: #8aa0b0;
  margin-top: 6px;
}

/* === About Modal Overlay (z-index 2000) === */

.tweefle-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 40, 80, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.tweefle-overlay-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tweefle-modal {
  background: #fff;
  border-radius: 18px;
  padding: 36px 32px 28px;
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 40, 80, 0.3);
  animation: tweefle-modal-in 0.3s ease-out;
}

@keyframes tweefle-modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tweefle-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #7a9ab0;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.tweefle-modal-close:hover {
  color: #1a3a4a;
}

.tweefle-modal h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a3a4a;
  margin-bottom: 4px;
  text-align: center;
}

.tweefle-modal-subtitle {
  font-size: 0.9rem;
  color: #E20134;
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tweefle-modal-dp-link {
  color: #E20134;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tweefle-modal-dp-link:hover {
  text-decoration: underline;
}

.tweefle-modal-dp-icon {
  width: 18px;
  height: 18px;
}

.tweefle-modal p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #3a5a6a;
  margin-bottom: 14px;
}

.tweefle-modal-links {
  margin: 20px 0 24px;
}

.tweefle-modal-links a {
  color: #2980b9;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.tweefle-modal-links a:hover {
  text-decoration: underline;
}

.tweefle-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 20px;
}

.tweefle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tweefle-pill:hover {
  transform: translateY(-1px);
}

.tweefle-pill:active {
  transform: translateY(0);
}

.tweefle-pill--enter {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
}

.tweefle-pill--enter:hover {
  box-shadow: 0 3px 12px rgba(41, 128, 185, 0.35);
}

.tweefle-pill--video {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
}

.tweefle-pill--video:hover {
  box-shadow: 0 3px 12px rgba(231, 76, 60, 0.35);
}

.tweefle-pill--github {
  background: #24292e;
  color: #fff;
}

.tweefle-pill--github:hover {
  box-shadow: 0 3px 12px rgba(36, 41, 46, 0.35);
}

.tweefle-pill svg {
  flex-shrink: 0;
}

/* === Responsive === */

@media (max-width: 700px) {
  #tweefle-wall {
    left: 0;
    transform: none;
    width: 100%;
    padding: 0 10px 0;
    top: 5%;
  }

  .tweefle-header {
    padding: 8px 12px 10px;
  }

  .tweefle-header h1 {
    font-size: 1.8rem;
  }

  .tweefle-header-dp {
    font-size: 0.85rem;
    display: inline;
  }

  .tweefle-header-dp a {
    display: inline;
  }

  .tweefle-dp-icon {
    width: 16px;
    height: 16px;
    vertical-align: -2px;
    margin-right: 2px;
  }

  .tweefle-header-about {
    font-size: 0.85rem;
  }

  #tweefle-stream {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .tweefle-banner {
    font-size: 11px;
    padding: 5px 12px;
  }

  .tweefle-modal {
    padding: 28px 20px 22px;
    border-radius: 14px;
    text-align: center;
  }

  .tweefle-modal p,
  .tweefle-modal-links {
    text-align: left;
  }

  .tweefle-modal-actions {
    margin: 10px 0 14px;
    gap: 8px;
  }

  .tweefle-pill {
    padding: 6px 14px;
    font-size: 0.75rem;
    gap: 4px;
  }

  .tweefle-pill--github .tweefle-pill-label {
    display: none;
  }

  .tweefle-pill--github {
    padding: 6px 10px;
  }

  .tweefle-modal p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 12px;
  }

  .tweefle-modal-links a {
    font-size: 0.8rem;
  }

  .tweefle-tweet {
    max-width: 85vw;
    min-width: 200px;
    padding: 14px 16px 10px;
  }

  .tweefle-text {
    font-size: 15px;
  }

  .tweefle-avatar {
    width: 34px;
    height: 34px;
  }

}
