/* =========================================
   Ghibli Garden Theme (site-wide)
   ========================================= */

:root{
  --cream: #f6f1e9;
  --ink: #243225;
  --moss: #2f5a41;
  --leaf: #4e8a6b;
  --fern: #79a98c;
  --ochre: #e0a21b;
  --shadow: 0 10px 30px rgba(16, 30, 24, .20);

  --panel: rgba(255,255,255,.72);
  --panel-strong: rgba(255,255,255,.9);

  --maxw: 1100px;
  --radius: 18px;
}

/* reset */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* base */
body{
  font-family: "Playfair Display", Georgia, serif;
  color: var(--ink);
  background: #dce8dc; /* site background = soft pastel green */
  line-height: 1.65;
}

/* Safe-area for notched devices */
@supports (padding: max(0px)){
  body{
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}

/* nav */
.nav{
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(6px);
  background: #FFDCE8; /* muted pastel pink */
  border-bottom: 1px solid rgba(36,50,37,.10);
}
.nav nav{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .6rem 1rem;
  display: flex; gap: 1.25rem; justify-content: center;
  font-size: .98rem; letter-spacing: .2px;
  color: var(--moss);
}

/* Safe-area top padding for sticky nav on iPhone */
@supports (padding: max(0px)){
  .nav{ padding-top: max(0px, env(safe-area-inset-top)); }
}

/* Nav pills */
.nav a{
  padding: .45rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: background .2s ease, box-shadow .2s ease, transform .04s ease;
}
.nav a:hover{
  background: rgba(255,255,255,.98);
  box-shadow: 0 2px 10px rgba(0,0,0,.10);
  transform: translateY(-1px);
}
.nav a:focus-visible{
  outline: none;
  box-shadow:
    0 2px 10px rgba(0,0,0,.10),
    0 0 0 3px rgba(255,255,255,.9),
    0 0 0 5px rgba(47,90,65,.25);
}

/* hero */
.hero{
  position: relative;
  min-height: 72vh;
  display: grid; place-items: center;
  text-align: center;
  isolation: isolate;
  overflow: clip;
}
.hero::before{
  content: "";
  position: absolute; inset: 0;
  background: url("assets/background.png") center/cover no-repeat;
  z-index: -2;
}
.hero::after{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.32), rgba(0,0,0,.20));
  z-index: -1;
}
.hero .date{
  color: #fff; opacity: .9; font-size: .9rem; letter-spacing: .22rem; margin: 0 0 .75rem;
}

.names{
  display:flex; align-items:center; justify-content:center; flex-wrap:wrap;
  gap:1.5rem; font-weight:700;
  font-size:clamp(2.8rem, 8vw, 6.2rem);
  line-height:1; color:#fff; margin:0; text-align:center;
}
.names .x{ color: color-mix(in oklab, #fff, var(--ochre) 45%); font-size:1.2em; font-weight:400; line-height:1; }

/* content */
main{ max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1rem; }

.section{
  margin: 2rem 0;
  background: var(--panel);
  border: 1px solid rgba(47,90,65,.12);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem;
  backdrop-filter: blur(2px);
  box-shadow: var(--shadow);
}
.section h2{ font-weight: 600; color: var(--moss); margin: 0 0 .5rem; }
.section p, .section li{ color: color-mix(in oklab, var(--ink), #000 8%); }
.section ul{ margin: .5rem 0 0 1.2rem; }
.section alt{ background: var(--panel-strong); border-color: rgba(176,109,60,.18); }

.cta{ text-align: center; }

/* buttons */
.btn{
  display: inline-block;
  padding: .7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--ochre), black 12%);
  background: var(--ochre);
  color: #2c2100; font-weight: 600;
  transition: transform .04s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow); filter: brightness(1.05); }

.section a{ color: var(--leaf); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.section a:hover{ color: color-mix(in oklab, var(--leaf), black 15%); }

/* footer */
.footer{ text-align: center; color: color-mix(in oklab, var(--moss), black 10%); padding: 2rem 1rem 2.5rem; }
@supports (padding: max(0px)){
  .footer{ padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); }
}

/* mobile hero background */
@media (max-width: 768px){
  .hero::before{ background: url("assets/background-mobile.png") center/cover no-repeat; }
}

/* ===== count-up timer (Our Story uses) ===== */
.since-timer { margin-top: .75rem; }

.time-grid{
  display:flex;
  align-items:baseline;
  justify-content:center;
  gap:.6rem;
  user-select:none;
  flex-wrap:wrap;
}

.time-seg{
  position: relative;
  text-align:center;
  min-width: 110px;
  padding-right: 1.2rem;
  margin-right: .2rem;
}

.big{
  font-weight:700;
  font-size: clamp(2.2rem, 6vw, 7rem);
  line-height: 1;
  color: color-mix(in oklab, var(--ink), #000 0%);
  text-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.label{
  font-size:.9rem;
  color: color-mix(in oklab, var(--moss), black 15%);
  letter-spacing:.06em;
  margin-top:.25rem;
}

.colon{ display: none !important; }
.sep{ display: none !important; }

.time-seg:not(:last-child)::after{
  content: ":";
  position: absolute;
  right: .2rem;
  top: 0;
  transform: translateY(.15em);
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 6rem);
  line-height: 1;
  color: color-mix(in oklab, var(--ink), #000 0%);
  pointer-events: none;
}

/* existing mobile tweaks */
@media (max-width: 520px){
  .time-seg{ min-width:84px; }
}
@media (max-width: 480px){
  .since-timer{ padding-top: .6rem; padding-bottom: .6rem; }
  .big{ font-size: clamp(1.9rem, 6.8vw, 2.7rem); }
  .time-grid{ gap: .35rem; }
  .time-seg{ min-width: 66px; padding-right: .7rem; }
  .time-seg:not(:last-child)::after{
    font-size: clamp(1.1rem, 4.8vw, 1.5rem);
    right: 0;
    transform: translateY(.05em);
  }
}
@media (max-width: 393px){
  .since-timer{ padding-top: .65rem; padding-bottom: .65rem; }
  .time-grid{ gap:.15rem; }
  .time-seg{ min-width:auto; padding-right:.6rem; margin-right:.06rem; }
  .big{ font-size: clamp(1.2rem, 5.6vw, 1.6rem); text-shadow:none; }
  .label{ font-size:.65rem; margin-top:.12rem; }
  .time-seg:not(:last-child)::after{
    font-size: .98rem;
    right: -.02rem;
    transform: translateY(0);
  }
}
@media (max-width: 390px){
  .time-grid{ gap:.12rem; }
  .time-seg{ padding-right:.5rem; margin-right:.04rem; }
  .time-seg:not(:last-child)::after{
    font-size: .94rem;
    right: -.04rem;
  }
}

/* Our Story Hero Section */
.our-story-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  isolation: isolate;
  overflow: hidden;
}
.our-story-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: url("assets/ourstory-bg.jpg") center/cover no-repeat;
  z-index: -2;
}
.our-story-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: -1;
}
.our-story-hero .hero-content { color: #fff; z-index: 1; }
.our-story-hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin: 0; }

@media (max-width: 768px){
  .our-story-hero::before{
    background: url("assets/ourstory-bg.jpg") center 30% / cover no-repeat;
  }
}

.our-story-hero img.bg-fallback { display: none; }
@media (max-width: 768px) {
  .our-story-hero img.bg-fallback {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -3;
  }
}

/* === Polaroid collage (pictures page defaults kept) === */
.polaroid-wall{ max-width: var(--maxw); margin: 0 auto 2.5rem; padding: 0 1rem; }
.polaroid-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
  justify-items: center;
  align-items: start;
}
.polaroid{
  --tilt: 0deg;
  width: 100%; max-width: 240px;
  background: #fff;
  padding: 10px 10px 40px;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  transform: rotate(var(--tilt));
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.polaroid img{
  display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 3px;
}
.polaroid figcaption{
  margin-top: 10px; text-align: center; font-size: .95rem; color: var(--ink); opacity: .9;
}
.polaroid-grid > .polaroid:nth-child(6n + 1){ --tilt: -1.5deg; }
.polaroid-grid > .polaroid:nth-child(6n + 2){ --tilt: 1.25deg; }
.polaroid-grid > .polaroid:nth-child(6n + 3){ --tilt: -0.75deg; }
.polaroid-grid > .polaroid:nth-child(6n + 4){ --tilt: 1.8deg; }
.polaroid-grid > .polaroid:nth-child(6n + 5){ --tilt: -1.2deg; }
.polaroid-grid > .polaroid:nth-child(6n + 6){ --tilt: 0.6deg; }
.polaroid:hover{ transform: translateY(-4px) rotate(var(--tilt)); box-shadow: 0 18px 36px rgba(0,0,0,.22); filter: brightness(1.02); }
@media (prefers-reduced-motion: reduce){
  .polaroid, .polaroid:hover{ transition: none; transform: none; }
}

/* --- YouTube bubble on Home --- */

.video-embed {
  position: relative !important;
  width: 100% !important;
  max-width: 920px !important;
  margin: 0 auto !important;
  background: #fff !important;
  border: 1px solid rgba(47,90,65,.12) !important;
  border-radius: 26px !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.12) !important;
  overflow: hidden !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  aspect-ratio: 16 / 10 !important;
}

.video-embed iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 18px !important;
}

/* ✅ Guaranteed mobile override */
@media (max-width: 600px) {
  .video-embed {
    aspect-ratio: 4 / 5 !important; /* makes it taller */
    border-radius: 22px !important;
    max-width: 94% !important;
  }

  .video-embed iframe {
    border-radius: 20px !important;
  }
}

/* === Bottom Figures below video === */
.bottom-figures {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.bottom-figures img {
  max-width: 420px;
  width: 80%;
  height: auto;
  opacity: 0.95;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15));
  animation: gentleFloat 6s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* === Secret Safe Box Section === */
.secret-box {
  text-align: center;
  margin: 3rem auto;
  padding: 2rem 1rem;
}

.safe-button {
  background: #f7e9d9;
  border: 2px solid #b89f73;
  border-radius: 16px;
  padding: 0.9rem 1.4rem;
  font-family: "Playfair Display", serif;
  font-size: 1rem;
  color: #4b3b22;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: all 0.25s ease;
  position: relative;
}

.safe-button:hover {
  background: #fff7ea;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.safe-button.small {
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  margin-top: 0.5rem;
}

.secret-text {
  font-size: 1.1rem;
  margin: 1rem 0 0.75rem;
  color: color-mix(in oklab, var(--ink), #000 10%);
  opacity: 0.9;
  transition: opacity 0.4s ease;
}

.secret-text.final {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--moss);
  animation: popIn 0.8s ease forwards;
}

/* ✅ Force elements hidden on all devices */
.hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 🎮 Connect 4 Section */
.connect4-section {
  text-align: center;
  margin: 2rem auto;
  padding: 1rem;
  max-width: 600px;
  overflow: visible; /* ensure not cut off */
}

.connect4-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  justify-content: center;
  margin: 1rem auto;
  width: 100%;
  max-width: 350px;
}

.connect4-board .cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.connect4-section .btn {
  margin-top: 1rem;
}

/* 🧸🦦 Responsive fixes */
@media (max-width: 480px) {
  .connect4-board {
    max-width: 260px;
    gap: 3px;
  }
  .connect4-board .cell {
    font-size: 1.4rem;
  }
}
