/* =========================================================
   Béirín & Mis Atelier — Whimsical Theme
   Palette: lavender · pink · yellow · mint · warm cream
   Fonts  : Pacifico (display) · Nunito (body) · Fredoka (brand)
   ========================================================= */

/* ── Custom Properties ── */
:root {
  --bg:          #FFF9F2;
  --purple:      #9B77D4;
  --purple-lt:   #EDE0FF;
  --purple-dk:   #6B47A8;
  --pink:        #F4849A;
  --pink-lt:     #FFE8EF;
  --yellow:      #FFCC4D;
  --yellow-lt:   #FFF8D6;
  --mint:        #5DBFA0;
  --mint-lt:     #E0F7EF;
  --text:        #3D2847;
  --text-mid:    #6B4F7A;
  --text-soft:   #9B8AA8;
  --white:       #FFFFFF;
  --polaroid-bg: #FFFEF9;

  --font-display: 'Pacifico', cursive;
  --font-body:    'Nunito', system-ui, sans-serif;
  --font-brand:   'Fredoka', var(--font-body);

  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   28px;
  --radius-full: 9999px;

  --shadow-sm:  2px 3px 0 rgba(61,40,71,.06), 0 2px 8px rgba(61,40,71,.08);
  --shadow-md:  3px 5px 0 rgba(61,40,71,.08), 0 6px 24px rgba(61,40,71,.10);
  --shadow-lg:  4px 8px 0 rgba(61,40,71,.10), 0 16px 48px rgba(61,40,71,.14);
  --shadow-polaroid: 3px 4px 0 rgba(61,40,71,.10), 0 8px 32px rgba(61,40,71,.13);

  --nav-h: 72px;
  --t:     220ms ease;
  --t-bounce: 300ms cubic-bezier(.34,1.56,.64,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
main { flex: 1; }

/* ── Typography ── */
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 400;
  color: var(--text);
}

h1 { font-size: clamp(3rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; }

p { color: var(--text-mid); line-height: 1.75; }
p + p { margin-top: 1rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: .85rem;
}
.eyebrow::before, .eyebrow::after {
  content: '✦';
  font-size: .6rem;
  opacity: .6;
}

/* ── Container ── */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.8rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
  transition: transform var(--t-bounce), box-shadow var(--t);
  white-space: nowrap;
}
.btn:hover  { transform: translateY(-3px) scale(1.02); }
.btn:active { transform: translateY(0) scale(.98); }

.btn--primary {
  background: var(--purple);
  color: var(--white);
  box-shadow: 0 4px 0 var(--purple-dk), 0 6px 20px rgba(155,119,212,.35);
}
.btn--primary:hover {
  box-shadow: 0 6px 0 var(--purple-dk), 0 10px 28px rgba(155,119,212,.40);
}
.btn--primary:active {
  box-shadow: 0 2px 0 var(--purple-dk);
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--text);
}
.btn--outline:hover {
  background: var(--text);
  color: var(--white);
}

.btn--pink {
  background: var(--pink);
  color: var(--white);
  box-shadow: 0 4px 0 #C45A72, 0 6px 20px rgba(244,132,154,.35);
}
.btn--pink:hover {
  box-shadow: 0 6px 0 #C45A72, 0 10px 28px rgba(244,132,154,.40);
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 480ms ease, transform 480ms ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Animations ── */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--r, -3deg)); }
  50%       { transform: translateY(-14px) rotate(calc(var(--r, -3deg) * -1)); }
}
@keyframes spin-slow {
  to { transform: rotate(360deg); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg); }
  50%       { transform: rotate(4deg); }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(.7) rotate(var(--r, 0deg)); }
  to   { opacity: 1; transform: scale(1) rotate(var(--r, 0deg)); }
}

/* ═══════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  height: var(--nav-h);
  background: rgba(255,249,242,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--purple-lt);
  transition: box-shadow var(--t);
}
.nav--scrolled { box-shadow: 0 4px 0 var(--purple-lt); }

.nav__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav__brand {
  font-family: var(--font-brand);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--purple);
  letter-spacing: .02em;
  flex-shrink: 0;
  transition: color var(--t);
}
.nav__brand:hover { color: var(--purple-dk); }

.nav__links {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav__link {
  padding: .45rem 1rem;
  border-radius: var(--radius-full);
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-mid);
  transition: color var(--t), background var(--t);
}
.nav__link:hover      { color: var(--purple); background: var(--purple-lt); }
.nav__link--active    { color: var(--purple); }

.nav__link--cta {
  background: var(--yellow);
  color: var(--text) !important;
  padding: .45rem 1.1rem;
  box-shadow: 0 3px 0 #D4A000;
  transition: transform var(--t-bounce), box-shadow var(--t);
}
.nav__link--cta:hover {
  background: var(--yellow);
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #D4A000;
}

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  padding-top: var(--nav-h);
  background: linear-gradient(150deg, #F0E6FF 0%, #FFE8F4 40%, #FFF5E0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Background stars */
.hero::before {
  content: '✦  ✦  ✦  ✦  ✦  ✦  ✦  ✦  ✦  ✦  ✦  ✦';
  position: absolute;
  top: 60px;
  left: 0; right: 0;
  text-align: center;
  font-size: .6rem;
  letter-spacing: 3rem;
  color: var(--purple);
  opacity: .15;
  pointer-events: none;
}

.hero__content {
  text-align: center;
  padding: 5rem 2rem 3rem;
  max-width: 700px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero__title {
  margin-bottom: 1.25rem;
  color: var(--text);
}

.hero__title em {
  font-style: normal;
  color: var(--purple);
}

.hero__desc {
  font-size: 1.15rem;
  max-width: 520px;
  margin: 0 auto 2rem;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Full-width polaroid strip */
.hero__photos {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1rem 3rem 4rem;
  width: 100%;
  z-index: 2;
}

.hero__photo {
  flex: 0 0 auto;
  width: clamp(220px, 22vw, 320px);
  background: var(--polaroid-bg);
  padding: 12px 12px 56px;
  box-shadow: var(--shadow-polaroid);
  position: relative;
  transition: transform var(--t-bounce), box-shadow var(--t);
}
.hero__photo:hover {
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.hero__photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hero__photo--1 { transform: rotate(-6deg) translateY(10px);  animation: float 7s ease-in-out -0s   infinite; }
.hero__photo--2 { transform: rotate(4deg)  translateY(-15px); animation: float 6s ease-in-out -1.5s infinite; }
.hero__photo--3 { transform: rotate(-2deg) translateY(5px);   animation: float 8s ease-in-out -3s   infinite; }
.hero__photo--4 { transform: rotate(6deg)  translateY(-8px);  animation: float 7s ease-in-out -4.5s infinite; }
.hero__photo--5 { transform: rotate(-5deg) translateY(12px);  animation: float 6s ease-in-out -2s   infinite; }

.hero__photo-label {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-mid);
  letter-spacing: .04em;
}

/* Decorative doodles */
.hero__deco {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  color: var(--purple);
  opacity: .25;
  font-size: 1.4rem;
  animation: spin-slow 20s linear infinite;
}
.hero__deco--1 { top: 18%; left: 42%; font-size: 1.8rem; animation-direction: reverse; }
.hero__deco--2 { bottom: 22%; right: 46%; font-size: 1rem; }
.hero__deco--3 { bottom: 30%; left: 46%; color: var(--pink); font-size: 1.2rem; animation-duration: 15s; }

/* ═══════════════════════════════════════════════
   WAVE DIVIDERS
   ═══════════════════════════════════════════════ */
.wave {
  display: block;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin-bottom: -1px;
}
.wave svg { display: block; width: 100%; }

/* ═══════════════════════════════════════════════
   POLAROID CARDS  (shared: featured + gallery)
   ═══════════════════════════════════════════════ */
.polaroid-card {
  background: var(--polaroid-bg);
  padding: 10px 10px 48px;
  box-shadow: var(--shadow-polaroid);
  transform: rotate(var(--r, -2deg));
  transition: transform var(--t-bounce), box-shadow var(--t);
  cursor: pointer;
  position: relative;
}
.polaroid-card:hover {
  transform: rotate(0deg) scale(1.04) translateY(-6px);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}
.polaroid-card:focus { outline: 3px solid var(--purple); outline-offset: 4px; }

.polaroid-card__image-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--purple-lt);
}
.polaroid-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 500ms ease;
}
.polaroid-card:hover .polaroid-card__image { transform: scale(1.06); }

.polaroid-card__label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0 10px 12px;
  text-align: center;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 800;
  color: var(--text-mid);
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.polaroid-card__overlay {
  position: absolute;
  inset: 10px 10px 48px;
  background: rgba(61,40,71,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t);
}
.polaroid-card:hover .polaroid-card__overlay { opacity: 1; }

.polaroid-card__view {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.92);
  color: var(--text);
  padding: .5rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: .82rem;
  font-weight: 700;
}

/* Rotation variants via nth-child */
.polaroid-card:nth-child(5n+1) { --r: -3deg; }
.polaroid-card:nth-child(5n+2) { --r:  2deg; }
.polaroid-card:nth-child(5n+3) { --r: -1.5deg; }
.polaroid-card:nth-child(5n+4) { --r:  3.5deg; }
.polaroid-card:nth-child(5n+5) { --r: -2.5deg; }

/* ═══════════════════════════════════════════════
   FEATURED (homepage preview)
   ═══════════════════════════════════════════════ */
.featured {
  background: var(--bg);
  padding: 5rem 0 4rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header h2 { margin-top: .25rem; }

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2rem;
  align-items: start;
}

/* Stagger every other card down for a scattered look */
.featured-grid .polaroid-card:nth-child(even) {
  margin-top: 1.8rem;
}

.section-footer {
  text-align: center;
  margin-top: 3rem;
}

.featured-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 3rem;
  color: var(--text-soft);
}

/* ═══════════════════════════════════════════════
   STORY
   ═══════════════════════════════════════════════ */
.story {
  background: var(--mint-lt);
  padding: 6rem 0;
}

.story__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.story__image-wrap {
  position: relative;
}

.story__polaroid {
  background: var(--polaroid-bg);
  padding: 12px 12px 56px;
  box-shadow: var(--shadow-polaroid);
  transform: rotate(-4deg);
  max-width: 380px;
  margin: 0 auto;
}
.story__polaroid img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: center top;
}
.story__polaroid-label {
  position: absolute;
  bottom: 12px;
  left: 0; right: 0;
  text-align: center;
  font-size: .82rem;
  font-weight: 800;
  color: var(--text-mid);
}

/* Sticker decoration on the polaroid */
.story__sticker {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 72px;
  height: 72px;
  background: var(--yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 3px 0 #D4A000;
  animation: wiggle 3s ease-in-out infinite;
  z-index: 2;
}

.story__content h2 { margin-bottom: 1.25rem; }
.story__content p  { margin-bottom: 1rem; }
.story__content .btn { margin-top: 1.5rem; }

/* ═══════════════════════════════════════════════
   ORDER CTA
   ═══════════════════════════════════════════════ */
.order {
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--purple-lt) 0%, var(--pink-lt) 100%);
  position: relative;
  overflow: hidden;
}

/* Big decorative circle */
.order::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  top: -200px; right: -150px;
  pointer-events: none;
}

.order__content {
  text-align: center;
  max-width: 580px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.order h2 { margin-bottom: 1rem; }
.order > .container > .order__content > p { margin-bottom: 2.5rem; }

.order__channels {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.order__channel {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.6rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: .92rem;
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow-md);
  transition: transform var(--t-bounce), box-shadow var(--t);
}
.order__channel:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-lg);
}

.order__channel--ig   { border-top: 4px solid var(--pink); }
.order__channel--fb   { border-top: 4px solid var(--purple); }
.order__channel--mail { border-top: 4px solid var(--mint); }

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
  background: var(--text);
  padding: 2.5rem 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__brand {
  font-family: var(--font-brand);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--purple-lt);
}

.footer__nav {
  display: flex;
  gap: 1.25rem;
}
.footer__nav a {
  font-size: .88rem;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  transition: color var(--t);
}
.footer__nav a:hover { color: var(--yellow); }

.footer__copy {
  font-size: .82rem;
  color: rgba(255,255,255,.3);
}

/* ═══════════════════════════════════════════════
   GALLERY PAGE
   ═══════════════════════════════════════════════ */
.page-hero {
  padding: calc(var(--nav-h) + 3.5rem) 0 3.5rem;
  text-align: center;
  background: linear-gradient(150deg, #F0E6FF 0%, #FFE8F4 60%, #FFF5E0 100%);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '✦  ✦  ✦  ✦  ✦  ✦  ✦  ✦  ✦  ✦';
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  text-align: center;
  font-size: .55rem;
  letter-spacing: 2.5rem;
  color: var(--purple);
  opacity: .2;
}
.page-hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-bottom: .75rem; }
.page-hero p  { font-size: 1.05rem; max-width: 480px; margin: 0 auto; }

.gallery-section { padding: 4rem 0 6rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2.5rem;
  align-items: start;
}

.gallery-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem;
  color: var(--text-soft);
  font-size: 1.05rem;
}

/* ═══════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30,14,46,.90);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.lightbox.active { opacity: 1; pointer-events: all; }
body.lightbox-open { overflow: hidden; }

.lightbox__figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(90vw, 780px);
  max-height: 90vh;
}

.lightbox__image {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 4px 8px 0 rgba(0,0,0,.3), 0 20px 60px rgba(0,0,0,.4);
  display: block;
}

.lightbox__caption {
  margin-top: 1rem;
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
}

.lightbox__btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.2);
  color: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), transform var(--t);
}
.lightbox__btn:hover {
  background: var(--purple);
  transform: translateY(-50%) scale(1.1);
}
.lightbox__prev { left:  clamp(12px,3vw,32px); }
.lightbox__next { right: clamp(12px,3vw,32px); }

.lightbox__close {
  position: fixed;
  top: 20px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.2);
  color: white;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), transform var(--t);
}
.lightbox__close:hover {
  background: var(--pink);
  transform: scale(1.1) rotate(90deg);
}

.lightbox__counter {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.45);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero { min-height: auto; padding-bottom: 2rem; }
  .hero__content { padding: 3rem 24px 2rem; }
  .hero__photos {
    gap: 1rem;
    padding: 0 1rem 3rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero__photo { width: clamp(130px, 40vw, 180px); }

  .story__grid     { grid-template-columns: 1fr; gap: 3rem; }
  .story__content  { text-align: center; }
  .story__content .btn { margin-left: auto; margin-right: auto; }
  .story__polaroid { max-width: 280px; }

  .featured-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .featured-grid .polaroid-card:nth-child(even) { margin-top: 1.2rem; }

  .nav__links { display: none; }

  .footer__inner { flex-direction: column; text-align: center; }
  .footer__nav   { justify-content: center; }
}

@media (max-width: 600px) {
  .featured-grid { grid-template-columns: 1fr 1fr; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

  .order__channels { flex-direction: column; align-items: center; }
  .order__channel  { width: 100%; max-width: 280px; justify-content: center; }

  .lightbox__btn { display: none; }
}

@media (max-width: 400px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
