@import url('https://fonts.googleapis.com/css2?family=Handlee&display=swap');

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

body {
  min-height: 100vh;
  margin: 0;
  background-color: peru;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Handlee', cursive;
  transition: background-color 0.6s ease;
}

/* ── Splash ── */

#splash {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #1C0A00;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.6s ease;
}

#splash.hide {
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  padding: 40px;
  max-width: 620px;
}

.splash-ciudad {
  font-family: 'Handlee', cursive;
  font-size: 16px;
  color: #C8903A;
  letter-spacing: 8px;
  margin: 0 0 16px;
  opacity: 0;
  animation: splash-text-up 0.6s ease 0.3s forwards;
}

.splash-main {
  font-family: 'Handlee', cursive;
  font-size: clamp(32px, 6vw, 62px);
  color: #F5E6D3;
  margin: 0 0 28px;
  line-height: 1.2;
  opacity: 0;
  animation: splash-text-up 0.6s ease 0.7s forwards;
}

.splash-list {
  font-family: 'Handlee', cursive;
  font-size: clamp(15px, 2.2vw, 20px);
  color: #C8903A;
  letter-spacing: 2px;
  margin: 0 0 24px;
  opacity: 0;
  animation: splash-text-up 0.6s ease 1.1s forwards;
}

.splash-nope {
  font-family: 'Handlee', cursive;
  font-size: clamp(17px, 2.8vw, 26px);
  color: rgba(255,255,255,0.35);
  margin: 0 0 52px;
  text-decoration: line-through;
  text-decoration-color: rgba(220, 80, 60, 0.7);
  text-decoration-thickness: 2px;
  opacity: 0;
  animation: splash-text-up 0.6s ease 1.5s forwards;
}

.splash-hint {
  display: block;
  font-family: 'Handlee', cursive;
  font-size: 13px;
  color: rgba(255,255,255,0.2);
  letter-spacing: 3px;
  opacity: 0;
  animation: splash-text-up 0.6s ease 2.0s forwards;
}

@keyframes splash-text-up {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Color button ── */

#button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 0.35s ease, border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  padding: 0;
}

#button:hover {
  transform: scale(1.2) rotate(40deg);
  border-color: rgba(255,255,255,0.9);
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
}

/* ── Header ── */

.header {
  display: flex;
  justify-content: center;
  padding: 28px 40px 8px;
}

.page-title {
  font-family: 'Handlee', cursive;
  font-size: 22px;
  margin: 0;
  letter-spacing: 3px;
  color: rgba(0,0,0,0.55);
  text-transform: lowercase;
}

/* ── Grid ── */

.main {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 20px 40px 40px;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 220px);
  gap: 28px;
  justify-content: center;
}

/* ── Coffee card ── */

.container-cafe {
  position: relative;
  width: 220px;
  height: 260px;
  text-align: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.container-cafe:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.container-cafe > p {
  position: relative;
  font-family: 'Handlee', cursive;
  font-size: 20px;
  margin: 14px 0 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(0,0,0,0.75);
  z-index: 1;
}

/* ── Cup SVG ── */

.taza {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s;
}

.taza svg {
  width: 80%;
  height: 80%;
}

.container-cafe:hover .taza {
  opacity: 0.15;
}

.cup {
  stroke: #D0A5FF;
}

.manija {
  stroke: #D0A5FF;
}

/* ── Info panel (flip-in on hover) ── */

.info {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  transition: transform 0.45s ease;
  transform-origin: left center;
  transform: perspective(1000px) rotateY(-90deg);
  pointer-events: none;
}

.container-cafe:hover .info {
  transform: perspective(1000px) rotateY(0deg);
  pointer-events: auto;
}

.container-detalle {
  background: rgba(255,255,255,0.92);
  border-radius: 12px;
  width: 90%;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.detalle ul {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.detalle ul li {
  font-family: 'Handlee', cursive;
  font-size: 13px;
  padding: 2px 0;
  color: #3a1a00;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.detalle ul li:last-child {
  border-bottom: none;
}

/* ── Fill animations ── */

#cafe-expreso    { animation: liquido-espresso       3s ease-out forwards; animation-iteration-count: 3; }
#cafe-jarrito    { animation: liquido-doble          3s ease-out forwards; animation-iteration-count: 3; }

#cafe-cortado    { animation: liquido-doble          3s ease-out forwards; animation-iteration-count: 3; }
#leche-cortado   { animation: liquido-layer-40       3s ease-out forwards; animation-iteration-count: 3; }

#cafe-cafeleche  { animation: liquido-doble          3s ease-out forwards; animation-iteration-count: 3; }
#leche-cafeleche { animation: liquido-layer-40       3s ease-out forwards; animation-iteration-count: 3; }

#leche-lagrima   { animation: liquido-doble          3s ease-out forwards; animation-iteration-count: 3; }
#cafe-lagrima    { animation: liquido-layer-70       3s ease-out forwards; animation-iteration-count: 3; }

#cafe-cappuccino  { animation: liquido-doble          3s ease-out forwards; animation-iteration-count: 3; }
#leche-cappuccino { animation: liquido-layer-38       3s ease-out forwards; animation-iteration-count: 3; }
#espuma-cappuccino{ animation: liquido-layer-68       3s ease-out forwards; animation-iteration-count: 3; }

#cafe-americano   { animation: liquido-doble          3s ease-out forwards; animation-iteration-count: 3; }
#agua-americano   { animation: liquido-layer-35       3s ease-out forwards; animation-iteration-count: 3; }

#leche-submarino  { animation: liquido-doble          3s ease-out forwards; animation-iteration-count: 3; }
#choco-submarino  { animation: liquido-choco-drop     3s ease-out forwards; animation-iteration-count: 3; }

@keyframes liquido-doble    { 0% { clip-path: inset(100% 0 0 0); } 100% { clip-path: inset(0); } }
@keyframes liquido-espresso { 0% { clip-path: inset(100% 0 0 0); } 100% { clip-path: inset(50% 0 0 0); } }

@keyframes liquido-layer-35 { 0%, 35% { clip-path: inset(100% 0 0 0); } 100% { clip-path: inset(0); } }
@keyframes liquido-layer-38 { 0%, 38% { clip-path: inset(100% 0 0 0); } 100% { clip-path: inset(0); } }
@keyframes liquido-layer-40 { 0%, 40% { clip-path: inset(100% 0 0 0); } 100% { clip-path: inset(0); } }
@keyframes liquido-layer-68 { 0%, 68% { clip-path: inset(100% 0 0 0); } 100% { clip-path: inset(0); } }
@keyframes liquido-layer-70 { 0%, 70% { clip-path: inset(100% 0 0 0); } 100% { clip-path: inset(0); } }

@keyframes liquido-choco-drop {
  0%, 40% { clip-path: inset(0 0 100% 0); }
  100%    { clip-path: inset(0); }
}

/* ── Steam ── */

.steam {
  stroke: rgba(255, 248, 240, 0.55);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: steam-rise 2.5s ease-in-out infinite;
}

.s1 { animation-delay: 0s; }
.s2 { animation-delay: 0.85s; }
.s3 { animation-delay: 1.7s; }

@keyframes steam-rise {
  0%   { opacity: 0;    transform: translateY(0)     scaleX(0.8); }
  20%  { opacity: 0.55; }
  80%  { opacity: 0.3;  transform: translateY(-10px) scaleX(1.1); }
  100% { opacity: 0;    transform: translateY(-14px) scaleX(0.9); }
}

/* ── Footer ── */

footer {
  width: 100%;
  padding: 16px 0 20px;
  text-align: center;
}

.social-footer {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#frase {
  font-family: 'Handlee', cursive;
  font-size: 15px;
  color: rgba(0,0,0,0.5);
  margin: 0 0 6px;
  font-style: italic;
  letter-spacing: 0.5px;
  opacity: 1;
  transition: opacity 0.6s ease;
}

#frase.fade {
  opacity: 0;
}

.social-footer h2 {
  font-family: 'Handlee', cursive;
  font-size: 16px;
  margin: 0;
  color: rgba(0,0,0,0.5);
  letter-spacing: 2px;
}

.social-icons {
  display: flex;
  gap: 6px;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.25);
  color: rgba(0,0,0,0.6);
  text-decoration: none;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}

.social-icons a svg {
  width: 16px;
  height: 16px;
}

.social-icons a:hover {
  background: rgba(255,255,255,0.65);
  color: #3a1a00;
  transform: translateY(-3px);
}

/* ── Responsive ── */

@media (max-width: 980px) {
  .grid-container {
    grid-template-columns: repeat(2, 220px);
  }
}

@media (max-width: 520px) {
  .grid-container {
    grid-template-columns: repeat(2, 160px);
  }

  .container-cafe {
    width: 160px;
    height: 200px;
  }
}
