/* ==========================================================================
   Hugs & Kisses – Bear Hug Edition
   Style Sheet
   ========================================================================== */

/* ----- Font Face (self-hosted, GDPR-compliant) ----- */
/* Quicksand Variable Font – one file covers weights 300-700 */

/* Latin-Extended (German umlauts, accented chars) */
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/Quicksand-LatinExt.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* Latin (base ASCII + common symbols) */
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/Quicksand-Latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ----- CSS Variables ----- */
:root {
  --bg-pink: #fce4ec;
  --bg-mint: #e0f2f1;
  --brown-dark: #5D4037;
  --brown-text: #4E342E;
  --gold-start: #FFD54F;
  --gold-mid: #FFB74D;
  --gold-end: #FFA726;
  --btn-shadow: rgba(255, 152, 0, 0.25);
  --white: #ffffff;
  --blush: #FFB6C1;
}


/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Quicksand', 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(170deg, var(--bg-pink) 0%, #f8e8ee 35%, #e8f5f0 65%, var(--bg-mint) 100%);
  background-attachment: fixed;
  color: var(--brown-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ----- Container ----- */
.container {
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  z-index: 1;
}


/* ----- Title ----- */
.title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brown-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  user-select: none;
}

.paw {
  font-size: 0.85em;
  display: inline-block;
  transform: rotate(-12deg);
  margin-right: 0.1em;
}


/* ----- Bear Wrapper ----- */
.bear-wrapper {
  width: 220px;
  height: 260px;
  margin: 1rem auto 1.5rem;
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.2s ease;
}

.bear-wrapper:hover {
  transform: scale(1.03);
}

.bear-wrapper:active {
  transform: scale(0.97);
}

.bear-wrapper svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bear-wrapper:focus-visible {
  outline: 3px solid var(--gold-end);
  outline-offset: 6px;
  border-radius: 50%;
}


/* ----- Bear Arm Animations ----- */
.bear-right-arm {
  transform-origin: 155px 190px;
  animation: wave 2.5s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  30%      { transform: rotate(-12deg); }
  60%      { transform: rotate(8deg); }
}

.bear-left-arm {
  transform-origin: 65px 185px;
}

/* Hug animation */
.bear-wrapper.hugging .bear-right-arm {
  animation: hugRight 0.7s ease-in-out !important;
}

.bear-wrapper.hugging .bear-left-arm {
  animation: hugLeft 0.7s ease-in-out;
}

@keyframes hugRight {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(-50deg); }
  100% { transform: rotate(0deg); }
}

@keyframes hugLeft {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(40deg); }
  100% { transform: rotate(0deg); }
}

/* Bounce on hug */
.bear-wrapper.hugging {
  animation: bearBounce 0.7s ease-in-out;
}

@keyframes bearBounce {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.08) translateY(-5px); }
  50%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}


/* ----- Emoji Burst ----- */
.emoji-burst {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  pointer-events: none;
  z-index: 10;
}

.emoji-particle {
  position: absolute;
  font-size: 1.6rem;
  animation: floatUp var(--duration, 2s) ease-out forwards;
  left: var(--x, 50%);
  opacity: 0;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) translateX(0) scale(0.3) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
    transform: translateY(-15px) scale(1.1) rotate(var(--rot, 10deg));
  }
  100% {
    transform:
      translateY(var(--end-y, -200px))
      translateX(var(--end-x, 0px))
      scale(0.2)
      rotate(var(--rot-end, 45deg));
    opacity: 0;
  }
}


/* ----- Send Button ----- */
.send-btn {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.95rem 2.4rem;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--gold-start), var(--gold-mid), var(--gold-end));
  color: var(--white);
  cursor: pointer;
  box-shadow:
    0 4px 15px var(--btn-shadow),
    0 1px 3px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  outline: none;
  letter-spacing: 0.02em;
  user-select: none;
  -webkit-user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow:
    0 6px 22px rgba(255, 152, 0, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.send-btn:active {
  transform: scale(0.94);
  box-shadow:
    0 2px 8px rgba(255, 152, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.send-btn:focus-visible {
  outline: 3px solid var(--gold-end);
  outline-offset: 4px;
}

.heart-icon {
  margin-left: 0.15rem;
  display: inline-block;
}


/* ----- Message ----- */
.message {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--brown-text);
  margin-top: 1.4rem;
  line-height: 1.6;
  min-height: 1.6em;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.message.fade-out {
  opacity: 0;
}


/* ----- Counter ----- */
.counter {
  font-size: 0.8rem;
  color: var(--brown-dark);
  opacity: 0.55;
  margin-top: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  min-height: 1.2em;
}


/* ----- Footer ----- */
.footer {
  position: fixed;
  bottom: 1.2rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 1;
}

.footer a {
  color: var(--brown-text);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.footer a:hover {
  opacity: 1;
}

.dot {
  margin: 0 0.5rem;
  opacity: 0.3;
  user-select: none;
}


/* ----- Language Toggle ----- */
.lang-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brown-dark);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 100;
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: 0.05em;
}

.lang-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.85);
}

.lang-btn:active {
  transform: scale(0.95);
}


/* ----- Ambient Hearts ----- */
.ambient-heart {
  position: fixed;
  font-size: var(--size, 1.2rem);
  opacity: 0;
  animation: ambientFloat var(--duration, 15s) linear infinite;
  animation-delay: var(--delay, 0s);
  left: var(--x, 50%);
  bottom: -3rem;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

@keyframes ambientFloat {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  8% {
    opacity: 0.12;
  }
  85% {
    opacity: 0.12;
  }
  100% {
    transform: translateY(-105vh) translateX(var(--drift, 20px)) rotate(var(--spin, 180deg));
    opacity: 0;
  }
}


/* ----- About / Legal Pages ----- */
.about-container {
  max-width: 520px;
  padding-top: 3rem;
}

.legal-page {
  text-align: left;
  max-width: 100%;
}

.legal-page .title {
  text-align: left;
}

.legal-page .back-link {
  text-align: left;
}

.about-text {
  text-align: left;
  line-height: 1.8;
  font-size: 0.95rem;
}

.about-text p {
  margin-bottom: 1rem;
}

.legal-text h2 {
  font-size: 1.05rem;
  color: var(--brown-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-text ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-text li {
  margin-bottom: 0.25rem;
}

.legal-text a {
  color: var(--brown-dark);
}

.back-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--brown-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.back-link:hover {
  opacity: 1;
}


/* ----- Article / Content Hub Pages ----- */
.about-container.article-page {
  max-width: 640px;
}

.article-text h2 {
  font-size: 1.15rem;
  color: var(--brown-dark);
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.article-text h3 {
  font-size: 1rem;
  color: var(--brown-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}

.article-text p {
  margin-bottom: 1rem;
}

.article-text ul,
.article-text ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-text li {
  margin-bottom: 0.3rem;
}

.article-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.article-text th,
.article-text td {
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(93, 64, 55, 0.15);
  text-align: left;
}

.article-text th {
  background: rgba(93, 64, 55, 0.06);
  font-weight: 700;
  color: var(--brown-dark);
}

.article-text a {
  color: var(--brown-dark);
  text-decoration: underline;
}

.article-text strong {
  color: var(--brown-dark);
}

.article-text em {
  font-style: italic;
}

.article-text hr {
  border: none;
  border-top: 1px solid rgba(93, 64, 55, 0.12);
  margin: 2rem 0;
}

.related-link {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.related-link a {
  color: var(--brown-dark);
}


/* ----- Responsive ----- */
@media (max-width: 480px) {
  .title {
    font-size: 1.45rem;
  }

  .bear-wrapper {
    width: 180px;
    height: 220px;
  }

  .send-btn {
    font-size: 1.05rem;
    padding: 0.85rem 2rem;
  }

  .message {
    font-size: 0.88rem;
  }

  .container {
    padding: 1.5rem 1.2rem;
  }
}

@media (max-width: 360px) {
  .title {
    font-size: 1.3rem;
  }

  .bear-wrapper {
    width: 155px;
    height: 190px;
  }
}

/* Tall phones – push things up slightly */
@media (min-height: 800px) {
  .container {
    padding-top: 1rem;
  }
}

/* Landscape */
@media (max-height: 500px) and (orientation: landscape) {
  .bear-wrapper {
    width: 140px;
    height: 170px;
    margin: 0.5rem auto 1rem;
  }

  .title {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
  }

  .message {
    margin-top: 0.8rem;
  }

  .footer {
    position: static;
    margin-top: 0.8rem;
  }
}


/* ----- Prefers Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ambient-heart {
    display: none;
  }
}
