* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background: #fff;
  color: #000;
  min-height: 100vh;
}

#wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#content {
  margin: 0 auto;
  max-width: 1010px;
  padding: calc(var(--ticker-height, 35px) + env(safe-area-inset-top) + 30px) 30px 30px; /* Offset for sticky ticker */
  flex: 1;
}

#content::after {
  content: "";
  display: table;
  clear: both;
}

header {
  background-color: #001e5a;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  margin: 0;
}

#ticker {
  position: fixed; /* Sticky ticker */
  top: calc(var(--ticker-offset, 0px) + env(safe-area-inset-top)); /* Dynamic offset for address bar */
  width: 100%;
  background-color: #ce2b2b;
  color: white;
  font-size: 1rem;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  z-index: 10; /* Above other content */
}

#ticker a {
  position: absolute;
  width: auto;
  text-align: center;
  text-decoration: none;
  color: inherit;
  line-height: 24px;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.8s ease, opacity 0.8s ease;
  padding: 0 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

#ticker a span {
  font-weight: 700;
}

#ticker a.active {
  opacity: 1;
  transform: translateY(0);
}

#ticker a.exiting {
  opacity: 0;
  transform: translateY(-100%);
}

#nav-bar {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1010px;
  margin: 0 auto;
  padding: calc(var(--ticker-height, 35px) + 2px) 15px 2px; /* Offset for sticky ticker */
  justify-content: flex-start;
  gap: 36px;
}

#nav-logo {
  height: 55px;
  padding: 10px 0;
}

#nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 55px;
  flex: 1 1 auto;
  min-width: 0;
}

#nav-item ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  gap: 24px;
}

#nav-item a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: all 0.2s ease;
}

#subscribe {
  background-color: #ce2b2b;
  color: white;
  font-weight: bold;
  padding: 6px 16px 6px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  margin-left: auto;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

#subscribe-dot {
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  animation: blink 3s infinite;
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

#hero {
  float: left;
  margin-right: 40px;
  width: 450px;
}

#hero img {
  border-radius: 10px;
  width: 450px;
  height: 450px;
  object-fit: cover;
  margin-top: 20px;
}

h1 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 2.5rem;
  color: #004390;
  margin-top: 0;
}

#article {
  overflow: hidden;
}

#article p {
  margin: 0 0 1.4em;
  font-size: 1.05rem;
}

#article strong {
  font-weight: 700;
}

#buy {
  text-align: center;
  margin: 20px auto;
  width: 100%;
}

#buy a {
  text-decoration: none;
}

#buy img {
  width: 180px;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

#buy p {
  font-weight: bold;
  color: #004390;
}

#pepe {
  position: fixed;
  top: calc(65svh + env(safe-area-inset-top));
  right: 0;
  transform: translateZ(0) translateX(100%);
  transition: transform 0.8s ease;
  max-width: 100px;
  height: auto;
  cursor: pointer;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  -webkit-backface-visibility: hidden;
}

#aww-reveal {
  position: fixed;
  top: calc(60svh + env(safe-area-inset-top));
  right: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#aww-reveal img {
  height: 150px;
}

@keyframes pepePoof {
  0%   { opacity: 1; transform: scale(1) rotate(0deg); }
  30%  { opacity: 1; transform: scale(1.15) rotate(3deg); }
  60%  { opacity: 0.5; transform: scale(0.9) rotate(-5deg); }
  100% { opacity: 0; transform: scale(0) rotate(15deg); }
}

@keyframes awwAppear {
  0%   { opacity: 0; transform: scale(0.92) translateY(0); }
  40%  { opacity: 0.8; transform: scale(0.97) translateY(-3px); }
  100% { opacity: 1; transform: scale(1) translateY(-8px); }
}

@keyframes awwFadeAway {
  0%   { opacity: 1; transform: scale(1) translateY(-8px); }
  40%  { opacity: 0.8; transform: scale(0.97) translateY(-3px); }
  100% { opacity: 0; transform: scale(0.92) translateY(0); }
}

#pepe.poof {
  animation: pepePoof 0.6s ease-out forwards;
}

#aww-reveal.magic {
  animation: awwAppear 0.8s ease-in-out forwards;
}

#aww-reveal.fadeout {
  animation: awwFadeAway 0.8s ease-out forwards;
}

footer {
  flex-shrink: 0;
  font-size: 0.9rem;
  text-align: center;
  padding: 10px 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: #fff;
}

#socials {
  margin-bottom: 10px;
  text-align: center;
}

.social-icon {
  padding: 0 10px 10px;
  display: inline-block;
  vertical-align: middle;
}

.social-icon img.social-img {
  width: 35px;
  height: 35px;
  display: block;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.social-icon img.social-img-hover:hover {
  transform: scale(1.1);
}

.social-icon img:hover {
  transform: scale(1.1);
}

@media only screen and (max-width: 1010px) {
  #hero {
    float: left;
    margin-right: 40px;
    width: 450px;
  }
  #hero img {
    width: 450px;
    height: 450px;
    object-fit: cover;
  }
  #article {
    overflow: initial;
  }
}

@media only screen and (max-width: 800px) {
  #hero {
    float: none;
    text-align: center;
    margin: 0 auto 20px;
    width: 450px;
  }
  #hero img {
    width: 450px;
    height: auto;
  }
  #article {
    width: 100%;
  }
}

@media only screen and (max-width: 600px) {
  #nav-item {
    display: none;
  }
  #nav-item ul {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    gap: 4px 24px;
  }
  #content {
    max-width: 85%;
    padding: calc(var(--ticker-height, 35px) + env(safe-area-inset-top) + 5px) 5px 30px; /* Adjusted for sticky ticker */
  }
  #hero {
    margin-bottom: 20px;
    width: 100%;
  }
  #hero img {
    width: 100%;
    max-width: 450px;
    height: auto;
  }
  #article {
    width: 100%;
  }
}