/* ── Fonts ─────────────────────────────────────────── */
@font-face {
  font-family: "Euclid Circular A";
  src: url("FONTS/EuclidCircularA-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A";
  src: url("FONTS/EuclidCircularA-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ────────────────────────────────────────── */
:root {
  --brand: #896e4b;
  --brand-srgb: color(srgb 0.5385 0.4312 0.2955);
  --gold: #d4a843;
  --bg: #f5f0e8;
  --ink: #2a2318;
  --ink-muted: #5c5348;
  --bubble-border: 0; /*var(--brand);*/
  --bubble-bg: #fff;
  --font: "Euclid Circular A", system-ui, -apple-system, sans-serif;
  --radius: 24px;
  --touch: 48px;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

body.bubble-open { overflow: hidden; }

/* ── Page layout ───────────────────────────────────── */
.app {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding:
    max(24px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  padding-bottom: max(25dvh, env(safe-area-inset-bottom));
}

.logo-wrap {
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

/* ── DAILIES ───────────────────────────────────────── */
.dailies {
  margin: 0;
  font-size: clamp(3rem, 13vw, 7rem);
  font-weight: 300;
  letter-spacing: 0.18em;
  line-height: 1;
  color: var(--brand);
  color: var(--brand-srgb);
  display: flex;
  justify-content: center;
}

.letter {
  display: inline-block;
  opacity: 0;
  cursor: pointer;
  transition: color 0.22s ease;
  padding: 0 0.01em;
  -webkit-tap-highlight-color: transparent;
}

.letter.is-visible {
  animation: fadeSlideIn 0.48s ease forwards;
  animation-delay: calc(var(--i) * 0.11s);
}

@media (hover: hover) {
  .letter:hover {
    color: var(--gold);
  }
}

.letter:active {
  color: var(--gold);
}

.letter.is-visited {
  color: var(--gold);
  opacity: 0.72;
}

.letter.is-visited:hover,
.letter.is-visited:active {
  opacity: 1;
}

/* ── TOTAL 1® ──────────────────────────────────────── */
.total {
  margin: 0.15em 0 0;
  font-size: clamp(1.4rem, 5.5vw, 3rem);
  font-weight: 500;
  letter-spacing: 0.35em;
  line-height: 1;
  color: var(--brand);
  color: var(--brand-srgb);
  opacity: 0;
}

.total.is-visible {
  animation: fadeIn 0.55s ease forwards;
  animation-delay: 0.15s;
}

.total sup {
  font-size: 0.45em;
  vertical-align: super;
  letter-spacing: 0;
}

/* ── Keyframes ─────────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bubblePop {
  from { opacity: 0; transform: scale(0.96) translateY(-14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .letter.is-visible,
  .total.is-visible {
    animation: none;
    opacity: 1;
  }
}

/* ── Bubble overlay ────────────────────────────────── */
.bubble-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.bubble-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bubble-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 35, 24, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Bubble card ───────────────────────────────────── */
.bubble-wrap {
  --bubble-gap: 15px;
  position: absolute;
  top: var(--bubble-gap);
  left: var(--bubble-gap);
  right: var(--bubble-gap);
  bottom: var(--bubble-bottom, 30%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  animation: bubblePop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.bubble-overlay:not(.is-open) .bubble-wrap {
  animation: none;
}

.bubble {
  position: relative;
  border-radius: var(--radius);
  border: 3px solid var(--bubble-border);
  background: var(--bubble-bg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(42, 35, 24, 0.14);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("IMG/background-plane.jpg") center / cover no-repeat;
  opacity: 1;
  pointer-events: none;
  border-radius: inherit;
}

.bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
  border-radius: inherit;
}

/* ── Bubble tail (bottom, pointing down to letter) ── */
.bubble__tail {
  position: relative;
  flex-shrink: 0;
  height: 22px;
  left: var(--tail-x, 50%);
  transform: translateX(-50%);
  width: 0;
  z-index: 2;
  filter: drop-shadow(0 3px 3px rgba(42, 35, 24, 0.08));
}

.bubble__tail::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-top: 23px solid var(--bubble-border);
}

.bubble__tail::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  border-left: 19px solid transparent;
  border-right: 19px solid transparent;
  border-top: 20px solid #4c321e;
}

/* ── Bubble content ────────────────────────────────── */
.bubble__content {
  position: relative;
  padding: clamp(20px, 5vw, 32px);
  z-index: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.bubble__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: var(--touch);
  height: var(--touch);
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: background 0.2s ease;
}

.bubble__close:hover {
  background: rgba(255, 255, 255, 0.30);
}

.bubble__close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.bubble__title {
  margin: 0 0 0.7rem;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
}

.bubble__body {
  font-size: clamp(0.88rem, 3.2vw, 1rem);
  font-weight: 300;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
}

.bubble__body p { margin: 0 0 0.9rem; }
.bubble__body p:last-child { margin-bottom: 0; }

.bubble__body ul {
  margin: 0.5rem 0 0.9rem;
  padding-left: 1.2rem;
}

.bubble__body li { margin-bottom: 0.35rem; }
.bubble__body li:last-child { margin-bottom: 0; }

.bubble__body strong {
  font-weight: 500;
  color: #fff;
}

.bubble__body h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}

.bubble__body h3:first-child { margin-top: 0; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 380px) {
  .dailies {
    letter-spacing: 0.10em;
  }

  .total {
    letter-spacing: 0.22em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bubble-wrap {
    animation: none;
  }

  .bubble-overlay {
    transition: none;
  }
}
