/* ==========================================================================
   Happy Birthday — homepage styles
   Warm cream / beige palette, personal greeting website.
   ========================================================================== */

:root {
  /* palette */
  --cream:        #F5DEB8;
  --cream-bright: #F9E9CD;
  --cream-deep:   #EFD4A6;

  --brown-dark:   #543021;   /* main heading */
  --brown-main:   #4D3A2E;   /* body message */
  --brown-brand:  #4D3023;   /* brand text */

  --heart:        #7C3028;   /* brand heart */
  --accent:       #C75C4F;   /* muted terracotta */
  --accent-dark:  #B0493E;   /* button hover */

  --sep-line:     #D9BE97;   /* decorative separator lines */
  --hint:         #8B684B;   /* instruction text */

  --wood:         #B78550;   /* tabletop honey brown */

  /* typography */
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-sans:  Arial, Helvetica, sans-serif;

  /* motion */
  --t-fast: 200ms;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--brown-main);
  background: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

main {
  position: relative;
  z-index: 2;
}

button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--brown-dark);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Decorative photographic background layer
   ========================================================================== */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #F7E4C2 0%, #F4DAB2 46%, #EFD0A0 100%);
}

/* soft central light, keeps the greeting bright */
.scene__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 46% at 50% 34%, rgba(255, 249, 234, 0.95), rgba(255, 249, 234, 0) 68%);
}

/* gentle darkening toward the corners — photographic falloff */
.scene__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 14% 12%, rgba(168, 128, 84, 0.10), rgba(168, 128, 84, 0) 55%),
    radial-gradient(90% 70% at 88% 10%, rgba(168, 128, 84, 0.10), rgba(168, 128, 84, 0) 55%);
}

/* soft warm window light, top-right */
.scene__light {
  position: absolute;
  inset: 0;
  background: radial-gradient(26% 22% at 80% 8%, rgba(255, 241, 214, 0.55), rgba(255, 241, 214, 0) 70%);
}

/* subtle film grain over the whole scene */
.scene__grain {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}

/* ---- wooden tabletop ----------------------------------------------- */

.tabletop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22vh;
  min-height: 150px;
  background:
    radial-gradient(120% 110% at 0% 100%, rgba(92, 56, 24, 0.30), rgba(92, 56, 24, 0) 50%),
    radial-gradient(120% 110% at 100% 100%, rgba(92, 56, 24, 0.30), rgba(92, 56, 24, 0) 50%),
    repeating-linear-gradient(to bottom, rgba(150, 100, 48, 0.10) 0 1px, rgba(150, 100, 48, 0) 1px 10px),
    repeating-linear-gradient(to right, rgba(150, 100, 48, 0.06) 0 2px, rgba(150, 100, 48, 0) 2px 70px),
    linear-gradient(to bottom, #CE9F6C 0%, #C2915E 30%, var(--wood) 70%, #A97A44 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 240, 214, 0.5),
    inset 0 6px 14px rgba(96, 60, 26, 0.22),
    inset 0 -18px 30px rgba(70, 42, 16, 0.25);
}

.tabletop::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(to bottom, rgba(96, 60, 28, 0.28), rgba(96, 60, 28, 0));
}

/* ---- decorative scenes --------------------------------------------- */

.deco {
  position: absolute;
  bottom: 0;
  pointer-events: none;
}

.deco--left {
  left: 0;
  width: clamp(300px, 34vw, 520px);
}

.deco--right {
  right: 0;
  width: clamp(260px, 32vw, 460px);
}

.deco__art {
  display: block;
  width: 100%;
  height: auto;
}

/* right side reads slightly softer / out of focus */
.deco--right .deco__art {
  filter: blur(0.4px);
}

.deco--right .foliage {
  filter: blur(3px) saturate(0.8);
}

/* ambient motion — disabled under prefers-reduced-motion */
.candle-flame {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: flame 2.6s ease-in-out infinite;
}

.steam {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: steamRise 7s ease-in-out infinite;
}

@keyframes flame {
  0%, 100% { transform: scale(1);    opacity: 0.95; }
  50%      { transform: scale(1.06); opacity: 1;    }
}

@keyframes steamRise {
  0%, 100% { transform: translateY(0);    opacity: 0.25; }
  50%      { transform: translateY(-6px); opacity: 0.45; }
}

/* ==========================================================================
   Header / brand
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 30px clamp(28px, 5vw, 80px) 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--brown-brand);
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: 0.2px;
}

.brand__heart {
  width: 29px;
  height: 29px;
  fill: var(--heart);
  flex: none;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(40px, 8vh, 84px) 24px 0;
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(46px, 5.3vw, 78px);
  line-height: 1.12;
  letter-spacing: 0.3px;
  color: var(--brown-dark);
}

/* ---- decorative separator: line · heart · line ---------------------- */

.hero__separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 32px;
}

.sep-line {
  width: 180px;
  height: 2px;
  background: var(--sep-line);
}

.sep-heart {
  width: 36px;
  height: 36px;
  fill: var(--accent);
  flex: none;
}

/* ---- message --------------------------------------------------------- */

.hero__message {
  margin-top: 36px;
  max-width: 640px;
  font-size: clamp(20px, 2vw, 29px);
  line-height: 1.62;
  color: var(--brown-main);
}

/* ---- reveal button ---------------------------------------------------- */

.reveal-btn {
  margin-top: clamp(36px, 5vh, 52px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 480px;
  max-width: calc(100% - 40px);
  height: 96px;
  border: none;
  border-radius: 15px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(150, 70, 40, 0.25);
  transition:
    transform var(--t-fast) ease,
    box-shadow var(--t-fast) ease,
    background-color var(--t-fast) ease;
}

.reveal-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(150, 70, 40, 0.30);
}

.reveal-btn:active,
.reveal-btn.is-pressed {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 6px 12px rgba(150, 70, 40, 0.25);
}

.reveal-btn__icon {
  width: 30px;
  height: 30px;
  flex: none;
}

/* ---- instruction ------------------------------------------------------ */

.hero__hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 26px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 21px;
  color: var(--hint);
}

.hint-arrow {
  width: 30px;
  height: 30px;
  flex: none;
}

/* ==========================================================================
   Cake reveal (popup overlay over the button)
   ========================================================================== */

.no-scroll {
  overflow: hidden;
}

.cake-reveal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.cake-reveal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.cake-reveal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(84, 48, 33, 0.38);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.cake-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: 22px;
  text-align: center;
  background: #FBF3E0;
  border: 1px solid #E6D5B6;
  border-radius: 20px;
  box-shadow:
    0 24px 60px rgba(60, 35, 18, 0.35),
    0 2px 8px rgba(60, 35, 18, 0.12);
  transform: scale(0.94) translateY(8px);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.3s ease;
}

.cake-reveal.is-open .cake-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.cake-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(160, 120, 70, 0.18);
  color: var(--brown-dark);
  cursor: pointer;
  transition: background var(--t-fast) ease, transform var(--t-fast) ease;
}

.cake-card__close:hover {
  background: rgba(160, 120, 70, 0.32);
}

.cake-card__close:active {
  transform: scale(0.96);
}

.cake-art {
  display: block;
  width: 100%;
  max-width: 480px;
  max-height: 60vh;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
  background: #F7EFDF;
  box-shadow:
    0 6px 16px rgba(120, 75, 35, 0.12),
    0 1px 3px rgba(120, 75, 35, 0.10);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1280px) {
  .hero__title { font-size: clamp(44px, 5vw, 72px); }
  .reveal-btn { width: 460px; height: 92px; font-size: 30px; }
  .deco--left { width: clamp(280px, 30vw, 460px); }
}

@media (max-width: 1024px) {
  .site-header { padding: 26px clamp(24px, 4vw, 48px) 30px; }
  .reveal-btn { width: 440px; height: 88px; }
  .deco--left { width: clamp(240px, 28vw, 400px); }
  .deco--right { width: clamp(220px, 26vw, 380px); }
}

@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding-top: 24px;
  }
  .hero__title { font-size: clamp(44px, 7vw, 56px); }
  .hero__message { font-size: 24px; }
  .sep-line { width: 120px; }
}

@media (max-width: 640px) {
  .hero { padding-top: 30px; }
  .hero__title { font-size: clamp(42px, 11vw, 50px); }
  .hero__separator { gap: 16px; margin-top: 24px; }
  .sep-line { width: 84px; }
  .sep-heart { width: 30px; height: 30px; }
  .hero__message { font-size: 21px; line-height: 1.6; margin-top: 28px; }

  .reveal-btn {
    width: calc(100% - 40px);
    max-width: 480px;
    height: 72px;
    font-size: 24px;
    gap: 12px;
    margin-top: 36px;
  }
  .reveal-btn__icon { width: 24px; height: 24px; }

  .hero__hint { font-size: 19px; margin-top: 22px; }

  /* decorative scenes are hidden on small screens to protect readability */
  .deco--left,
  .deco--right { display: none; }

  .site-header { padding: 20px 20px 24px; }

  /* keep the tabletop low so the hint stays on the light wall behind it */
  .tabletop { height: 14vh; min-height: 120px; }

  .cake-card { padding: 18px 16px 20px; }
}

@media (max-width: 420px) {
  /* compact spacing so the whole greeting stays above the tabletop on short screens */
  .hero { padding-top: 18px; }
  .hero__title { line-height: 1.05; }
  .hero__separator { margin-top: 18px; }
  .hero__message { margin-top: 22px; }
  .reveal-btn { margin-top: 28px; }
  .hero__hint { margin-top: 18px; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cake-reveal,
  .cake-card,
  .hero {
    transition: none;
  }
}
