/* ─── reset + base ─────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; height: 100%; }
body {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  line-height: 1.6;
  color: #f5ebd9;
  background: #0a0604;
  overflow-x: hidden;
  min-height: 100%;
}
em { font-style: italic; color: #d4a574; }
a { color: inherit; }
img { display: block; max-width: 100%; }

:root {
  --cream: #f5ebd9;
  --cream-dark: #e8dac3;
  --ink: #2c2520;
  --ink-soft: #5a4a3f;
  --dusty-rose: #c4636b;
  --sage: #7a9b7e;
  --brass: #b08968;
  --gold: #d4a574;
}

/* ─── PRELOADER ─────────────────────────────────────────────── */
.preloader {
  position: fixed; inset: 0; z-index: 10000;
  background: radial-gradient(ellipse at center, #2a1f17 0%, #0a0604 70%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-paw {
  width: 80px; height: 80px;
  animation: pawPulse 1.4s ease-in-out infinite;
  filter: drop-shadow(0 0 16px rgba(240,168,184,0.4));
}
.preloader-paw svg { width: 100%; height: 100%; }
@keyframes pawPulse {
  0%, 100% { transform: scale(0.92) rotate(-5deg); opacity: 0.85; }
  50%      { transform: scale(1.08) rotate(5deg);  opacity: 1; }
}
.preloader-text {
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--gold);
  margin-top: 1.5rem;
  opacity: 0.85;
}
.preloader-bar {
  width: 200px; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  margin-top: 1.2rem;
  overflow: hidden;
}
.preloader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--dusty-rose));
  transition: width 0.3s ease;
}

/* ─── 3D Canvas ─────────────────────────────────────────────── */
#webgl {
  position: fixed; inset: 0;
  z-index: 0;
  width: 100vw !important; height: 100vh !important;
  display: block;
  pointer-events: none;
}

.ambient-glow {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 70%, rgba(255,180,80,0.06) 0%, transparent 35%),
    radial-gradient(circle at 70% 30%, rgba(155,189,218,0.04) 0%, transparent 40%);
  mix-blend-mode: screen;
}

/* ─── PAW RAIN ──────────────────────────────────────────────── */
.paw-rain { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.paw-drop {
  position: absolute;
  top: -80px;
  opacity: 0;
  animation: pawFall var(--dur, 8s) linear forwards;
  filter: drop-shadow(0 3px 8px rgba(200,100,120,0.3));
}
.paw-drop svg { width: 100%; height: 100%; }
@keyframes pawFall {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.5); }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.55; }
  100% { opacity: 0; transform: translate(var(--drift, 0), 110vh) rotate(360deg) scale(1); }
}

/* ─── AUDIO TOGGLE ──────────────────────────────────────────── */
.audio-toggle {
  position: fixed;
  top: 1.5rem; right: 1.5rem;
  z-index: 100;
  width: 44px; height: 44px;
  background: rgba(245, 235, 217, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 235, 217, 0.18);
  border-radius: 50%;
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}
.audio-toggle:hover { background: rgba(245, 235, 217, 0.2); transform: scale(1.05); }
.audio-toggle .icon-sound-on { display: none; }
.audio-toggle.playing .icon-sound-on { display: block; }
.audio-toggle.playing .icon-sound-off { display: none; }

/* ─── MAIN LAYOUT ───────────────────────────────────────────── */
main {
  position: relative;
  z-index: 10;
}

section {
  min-height: 100vh;
  padding: 8vh 5vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* ─── HERO ──────────────────────────────────────────────────── */
.hero {
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.15) 100%);
}
.hero-content { max-width: 720px; }
.kicker {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  opacity: 0.85;
}
.title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3.5rem, 11vw, 7.5rem);
  line-height: 0.92;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.title em { color: var(--gold); font-style: italic; }
.sub {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: rgba(245,235,217,0.78);
  font-style: italic;
  margin-bottom: 4rem;
}
.hero-hint {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: 'Caveat', cursive; font-size: 1.1rem;
  color: rgba(245,235,217,0.55);
  letter-spacing: 0.05em;
  animation: hintFade 3s ease-in-out infinite alternate;
}
.hint-arrow { animation: hintBounce 1.6s ease-in-out infinite; }
@keyframes hintBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes hintFade { from { opacity: 0.5; } to { opacity: 0.9; } }

/* ─── MEET MAZAKI ───────────────────────────────────────────── */
.meet {
  align-items: flex-start;
  padding-left: 8vw;
  padding-right: 50vw;
}
.meet-content {
  background: rgba(15, 10, 6, 0.5);
  backdrop-filter: blur(8px);
  padding: 2.5rem 2.8rem;
  border-radius: 12px;
  border-left: 3px solid var(--gold);
  max-width: 480px;
}
.dialogue-name {
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 0.8rem;
  letter-spacing: 0.05em;
}
.dialogue {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--cream);
}

/* ─── SECTION TITLES ────────────────────────────────────────── */
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 0.5rem;
  text-align: center;
  text-shadow: 0 0 30px rgba(0,0,0,0.5);
}
.section-sub {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  color: var(--gold);
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0.85;
}

/* ─── CASES INTRO ───────────────────────────────────────────── */
.cases-intro { align-items: center; text-align: center; }
.cases-intro-content { max-width: 720px; }

/* ─── GALLERY ──────────────────────────────────────────────── */
.gallery-section {
  background: rgba(15, 10, 6, 0.55);
  backdrop-filter: blur(12px);
  padding: 8vh 5vw;
}
.filters {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.6rem 0.8rem;
  max-width: 900px; margin: 0 auto 3rem;
}
.filter-chip {
  font-family: 'Caveat', cursive; font-size: 1.05rem;
  background: rgba(245,235,217,0.08); color: var(--cream);
  border: 1.5px solid rgba(245,235,217,0.18);
  padding: 0.4rem 1rem; border-radius: 999px;
  transition: all 0.3s;
  cursor: pointer;
}
.filter-chip:hover { background: rgba(245,235,217,0.18); transform: translateY(-1px); }
.filter-chip.active {
  background: var(--gold); color: var(--ink); border-color: var(--gold);
}
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.6rem;
  max-width: 1300px; margin: 0 auto;
}
.loading {
  grid-column: 1 / -1; text-align: center;
  font-family: 'Caveat', cursive; font-size: 1.4rem;
  color: rgba(245,235,217,0.55); padding: 4rem 0;
}
.case-card {
  background: rgba(245,235,217,0.06);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  border: 1px solid rgba(245,235,217,0.1);
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
  display: flex; flex-direction: column;
  text-decoration: none;
  color: var(--cream);
  /* stagger entrance */
  animation: cardIn 0.7s ease both;
  animation-delay: calc(var(--i, 0) * 0.04s);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.case-card:hover {
  transform: translateY(-8px) rotate(-0.6deg);
  box-shadow: 0 18px 40px rgba(196,99,107,0.3);
  border-color: rgba(212,165,116,0.4);
}
.case-thumb { aspect-ratio: 1; overflow: hidden; background: rgba(0,0,0,0.3); }
.case-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.case-card:hover .case-thumb img { transform: scale(1.08); }
.case-meta { padding: 1rem 1.1rem; }
.case-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem; font-weight: 400;
  line-height: 1.25; margin-bottom: 0.4rem;
}
.case-niches {
  font-family: 'Caveat', cursive;
  font-size: 0.95rem; color: var(--gold);
  opacity: 0.75;
}
.all-cta { text-align: center; margin-top: 4rem; }
.gallery-toggle-wrap {
  display: flex; justify-content: center;
  margin-top: 3rem;
}
.gallery-toggle-wrap .btn { font-size: 1.15rem; padding: 0.8rem 2.2rem; }

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 0.9rem 1.8rem;
  font-family: 'Caveat', cursive; font-size: 1.2rem;
  letter-spacing: 0.04em; text-decoration: none; border-radius: 999px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer; border: none;
}
.btn-primary {
  background: var(--gold); color: var(--ink);
  box-shadow: 0 6px 16px rgba(212,165,116,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(212,165,116,0.5); }
.btn-ghost {
  background: transparent; color: var(--cream);
  border: 1.5px solid var(--cream);
}
.btn-ghost:hover { background: var(--cream); color: var(--ink); }

/* ─── TEA LEAVES QUIZ ───────────────────────────────────────── */
.tealeaves {
  align-items: center;
  background: rgba(15, 10, 6, 0.5);
  backdrop-filter: blur(12px);
}
.tealeaves-inner { max-width: 760px; margin: 0 auto; text-align: center; width: 100%; }
.tealeaves-stage { position: relative; margin: 2.5rem auto 1.5rem; display: flex; justify-content: center; }
.tea-step {
  position: absolute; top: 0; left: 0; right: 0;
  opacity: 0; pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.5s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.tea-step.active { position: relative; opacity: 1; pointer-events: auto; transform: translateY(0); }
.quiz-num {
  font-family: 'Caveat', cursive; color: var(--dusty-rose);
  margin-right: 0.5rem; font-size: 1.4rem;
}
.quiz-q {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  color: var(--cream); margin-bottom: 2rem; line-height: 1.4;
}
.quiz-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  max-width: 640px; margin: 0 auto;
}
.quiz-option {
  background: rgba(245,235,217,0.08);
  border: 1.5px solid rgba(245,235,217,0.18);
  padding: 1.1rem 1.4rem; border-radius: 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; font-style: italic;
  color: var(--cream); text-align: left;
  transition: all 0.25s; cursor: pointer;
}
.quiz-option:hover {
  background: var(--gold); color: var(--ink); border-color: var(--gold);
  transform: translateY(-2px) scale(1.01);
}
.quiz-progress {
  display: flex; justify-content: center; gap: 0.6rem; margin-top: 2rem;
}
.quiz-progress .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(245,235,217,0.15);
  border: 1.5px solid rgba(245,235,217,0.3);
  transition: all 0.3s;
}
.quiz-progress .dot.active { background: var(--gold); border-color: var(--gold); transform: scale(1.3); }
.quiz-progress .dot.done   { background: var(--dusty-rose); border-color: var(--dusty-rose); }
.result-card {
  display: grid; grid-template-columns: 200px 1fr; gap: 2rem;
  background: rgba(245,235,217,0.06);
  padding: 2rem; border-radius: 12px;
  text-align: left; align-items: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid rgba(245,235,217,0.15);
}
.result-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.result-meta h3 { font-family: 'DM Serif Display', serif; font-size: 1.6rem; margin-bottom: 0.8rem; }
.result-meta p { color: rgba(245,235,217,0.78); font-style: italic; margin-bottom: 1.2rem; }
.quiz-actions { display: flex; justify-content: center; gap: 1rem; }

/* ─── MOCKUPS ──────────────────────────────────────────────── */
.mockups { align-items: center; text-align: center; }
.mockup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto 0;
  width: 100%;
}
.mockup-card {
  text-decoration: none; color: var(--cream);
  background: rgba(245,235,217,0.06);
  border: 1px solid rgba(245,235,217,0.12);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transition: all 0.4s;
  display: flex; flex-direction: column;
}
.mockup-card:hover {
  transform: translateY(-8px) rotate(-0.3deg);
  box-shadow: 0 18px 40px rgba(212,165,116,0.3);
  border-color: rgba(212,165,116,0.4);
}
.mockup-img { aspect-ratio: 1; overflow: hidden; background: rgba(0,0,0,0.3); }
.mockup-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.mockup-card:hover .mockup-img img { transform: scale(1.06); }
.mockup-meta { padding: 1.2rem 1.4rem; text-align: center; }
.mockup-meta h3 { font-family: 'DM Serif Display', serif; font-size: 1.4rem; font-weight: 400; }
.mockup-meta p { font-family: 'Caveat', cursive; font-size: 1.05rem; color: var(--gold); opacity: 0.75; }

/* ─── ABOUT ─────────────────────────────────────────────────── */
.about { align-items: center; }
.about-inner {
  max-width: 720px; margin: 0 auto; text-align: center;
  background: rgba(15, 10, 6, 0.5);
  backdrop-filter: blur(8px);
  padding: 3rem 2.8rem;
  border-radius: 12px;
  border: 1px solid rgba(245,235,217,0.1);
}
.about p {
  font-size: 1.2rem; line-height: 1.7; margin-bottom: 1.5rem;
  color: rgba(245,235,217,0.85);
}
.about a {
  color: var(--gold); text-decoration: none;
  border-bottom: 1px dashed var(--gold);
}
.about a:hover { color: var(--cream); border-color: var(--cream); }

/* ─── FOOTER ───────────────────────────────────────────────── */
.footer {
  position: relative; z-index: 10;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  color: var(--cream);
  padding: 4rem 5vw 2rem;
  border-top: 1px solid rgba(245,235,217,0.1);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto 3rem;
  display: grid; grid-template-columns: 2fr 1fr; gap: 3rem;
}
.footer-logo { font-family: 'DM Serif Display', serif; font-size: 1.5rem; margin-bottom: 0.5rem; }
.footer-logo .dot { color: var(--dusty-rose); margin: 0 0.4rem; }
.footer-tagline { opacity: 0.7; font-style: italic; margin-bottom: 0.8rem; }
.footer-mail a {
  font-family: 'Caveat', cursive; font-size: 1.1rem;
  color: var(--gold); text-decoration: none; opacity: 0.85;
}
.footer-mail a:hover { opacity: 1; }
.footer-links {
  display: flex; flex-direction: column; gap: 0.8rem;
  font-family: 'Caveat', cursive; font-size: 1.2rem;
}
.footer-links a {
  color: var(--cream); text-decoration: none;
  opacity: 0.8; transition: all 0.3s;
}
.footer-links a:hover { opacity: 1; color: var(--gold); }
.footer-bottom { text-align: center; opacity: 0.4; font-size: 0.9rem; font-style: italic; }

/* ─── LIGHTBOX ─────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15, 10, 6, 0.92);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  background: rgba(255,255,255,0.1); border: none;
  color: var(--cream); font-size: 1.5rem;
  width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; transition: background 0.3s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-img {
  max-width: 60vw; max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.lightbox-meta {
  position: absolute; bottom: 3rem;
  text-align: center; color: var(--cream);
  max-width: 600px;
}
.lightbox-title { font-family: 'DM Serif Display', serif; font-size: 1.8rem; margin-bottom: 0.4rem; }
.lightbox-niches { font-family: 'Caveat', cursive; font-size: 1.1rem; color: var(--gold); margin-bottom: 1.2rem; }

/* ─── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .meet { padding-right: 5vw; }
  .meet-content { max-width: none; }
  .quiz-options { grid-template-columns: 1fr; }
  .result-card { grid-template-columns: 1fr; text-align: center; }
  .result-card img { max-width: 220px; margin: 0 auto; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 1.5rem; }
}
@media (max-width: 600px) {
  section { padding: 8vh 4vw; }
  .case-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
  .audio-toggle { top: 1rem; right: 1rem; width: 38px; height: 38px; }
}
