html {
  height: 100%;
  width: 100%;
  scroll-behavior: smooth;
}

:root {
  --bg: #fcfbf8;
  --text: #1f1f1f;
  --muted: #6b6b6b;
  --link: #0f5cc0;
  --link-hover: #083b7a;
  --border: rgba(0, 0, 0, 0.08);
  --card-bg: #ffffff;
  --lisy-blue: #00c2ff;
  --max-width: 760px;
}

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

body {
  margin: 0;
  padding: 0 22px 80px;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.78;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  opacity: 0;
  animation: pageFade 0.7s ease forwards;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 2rem;
}

p,
li {
  max-width: 38em;
}

p {
  margin: 0 0 1.2rem;
}

ul,
ol {
  padding-left: 1.2rem;
  margin: 0 0 1.5rem;
}

ul {
  list-style: disc;
}

li {
  margin-bottom: 0.65rem;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 0.15em;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

a:active {
  opacity: 0.8;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.4rem 0;
}

em {
  font-style: italic;
  color: #555;
}

small,
.muted {
  color: var(--muted);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 251, 248, 0.92);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: saturate(120%) blur(8px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
  gap: 1rem;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--lisy-blue);
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(0, 194, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 194, 255, 0.06);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.lang-chip:hover {
  border-color: var(--lisy-blue);
  background: rgba(0, 194, 255, 0.12);
  text-decoration: none;
  transform: translateY(-1px);
}

.top-nav {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 0.98rem;
}

.top-nav a {
  text-decoration: none;
  color: #666;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.top-nav a:hover {
  color: var(--lisy-blue);
  border-bottom-color: var(--lisy-blue);
  text-decoration: none;
}

/* Intro polish */
.container > p:first-of-type {
  font-size: 1.08em;
}

/* Main images */
.main-image {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 14px;
  margin: 1rem 0 1.6rem;
  display: block;
  background: #f8f8f8;
}

/* Buttons */
.contact-button,
.fancy-button {
  display: inline-block;
  background: #0066cc;
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-weight: 600;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
  margin: 1rem 0;
  box-shadow: 0 8px 24px rgba(0, 102, 204, 0.12);
}

.contact-button:hover,
.fancy-button:hover {
  background: #0052a3;
  text-decoration: none;
  transform: translateY(-1px);
}

.fancy-button {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  text-align: center;
  display: block;
  margin: 2rem 0;
  font-size: 1.2rem;
}

.contact-wrap {
  text-align: center;
}

.kofi-widget {
  margin: 1.6rem 0;
  text-align: center;
}

/* Video / embeds */
.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  margin: 2rem 0;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

iframe {
  max-width: 100%;
  border-radius: 12px;
}

.soundcloud-credit {
  font-size: 10px;
  color: #999;
  line-break: anywhere;
  word-break: normal;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: Interstate, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Garuda, Verdana, Tahoma, sans-serif;
  font-weight: 100;
  margin-top: 0.4rem;
}

.soundcloud-credit a {
  color: #999;
  text-decoration: none;
}

/* Social */
.social-icons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin: 2rem 0 0;
  align-items: center;
}

.social-icons a {
  text-decoration: none;
  transition: transform 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icons a:hover {
  transform: scale(1.08);
  text-decoration: none;
}

.social-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
}

/* Carousel */
.carousel-container {
  position: relative;
  max-width: 100%;
  margin: 2rem 0;
  overflow: hidden;
  border-radius: 14px;
  background: #f8f8f8;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-image {
  width: 100%;
  height: 360px;
  object-fit: contain;
  flex-shrink: 0;
  background: #f8f8f8;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(22, 22, 22, 0.68);
  color: white;
  border: none;
  padding: 12px 16px;
  font-size: 24px;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.25s ease, transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.92;
}

.carousel-btn:hover {
  background: rgba(22, 22, 22, 0.9);
}

.prev-btn {
  left: 10px;
}

.next-btn {
  right: 10px;
}

/* Emoji animation helpers */
.emoji-pop {
  display: inline-block;
  transform-origin: center bottom;
  will-change: transform;
}

.emoji-bounce {
  animation: emojiBounce 0.85s cubic-bezier(.2, .8, .2, 1) 1;
}

.emoji-wave {
  transform-origin: 70% 70%;
  animation: handWave 1.4s ease-in-out 1;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 0 18px 56px;
    font-size: 18px;
    line-height: 1.72;
  }

  .container {
    padding-top: 1.2rem;
  }

  .main-image {
    max-height: 320px;
  }

  .carousel-image {
    height: 280px;
  }

  .carousel-btn {
    padding: 10px 14px;
    font-size: 20px;
  }
}

@media (max-width: 520px) {
  .header-inner {
    padding: 0.55rem 0;
    gap: 0.75rem;
  }

  .top-nav {
    gap: 0.8rem;
    font-size: 0.92rem;
  }

  .lang-chip {
    font-size: 0.9rem;
    padding: 0.34rem 0.52rem;
  }
}

@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes emojiBounce {
  0%   { transform: translateY(0) scale(1); }
  20%  { transform: translateY(-7px) scale(1.06); }
  38%  { transform: translateY(0) scale(0.98); }
  55%  { transform: translateY(-3px) scale(1.02); }
  72%  { transform: translateY(0) scale(1); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes handWave {
  0%   { transform: rotate(0deg); }
  12%  { transform: rotate(16deg); }
  24%  { transform: rotate(-10deg); }
  36%  { transform: rotate(16deg); }
  48%  { transform: rotate(-6deg); }
  60%  { transform: rotate(12deg); }
  72%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}
