/* styles.css — Restyle v3: “Love Letter / Scrapbook” layout + warm blush palette
   Swap your whole styles.css with this. (index.html + script.js can stay.) */

*, *::before, *::after { box-sizing: border-box; }
html, body {
  min-height: 100%;
}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: #2a1d27;
  overflow-x:hidden;

  /* warm paper + blush */
  background:
    radial-gradient(900px 700px at 15% 15%, rgba(255, 165, 206, .38), transparent 55%),
    radial-gradient(900px 700px at 85% 10%, rgba(255, 214, 165, .34), transparent 58%),
    radial-gradient(900px 700px at 55% 95%, rgba(189, 208, 255, .34), transparent 60%),
    linear-gradient(180deg, #fff6fb, #fff 45%, #fff6fb);
}

/* ---- palette ---- */
:root{
  --paper: rgba(255,255,255,.82);
  --paper2: rgba(255,255,255,.62);
  --ink: #2a1d27;
  --muted: rgba(42, 29, 39, .68);

  --stroke: rgba(42, 29, 39, .14);
  --stroke2: rgba(42, 29, 39, .22);

  --blush: #ff6fae;
  --peach: #ffb37a;
  --sky: #7aa7ff;
  --plum: #7a3cff;

  --shadow: 0 20px 60px rgba(32, 12, 24, .18);
  --shadow2: 0 12px 34px rgba(32, 12, 24, .14);
}

button{ font: inherit; }

/* ===== background elements (still used by your HTML) ===== */
.bg{ position: fixed; inset:0; pointer-events:none; z-index:0; }
.stars{
  position:absolute; inset:0;
  opacity:.55;
  background:
    radial-gradient(2px 2px at 12% 20%, rgba(42,29,39,.18), transparent 60%),
    radial-gradient(2px 2px at 25% 75%, rgba(42,29,39,.14), transparent 60%),
    radial-gradient(2px 2px at 70% 30%, rgba(42,29,39,.16), transparent 60%),
    radial-gradient(2px 2px at 88% 78%, rgba(42,29,39,.12), transparent 60%),
    radial-gradient(1px 1px at 55% 50%, rgba(42,29,39,.12), transparent 60%);
  filter: blur(.2px);
  animation: drift 12s ease-in-out infinite;
}
@keyframes drift{
  0%,100%{ transform: translateY(0); opacity:.45; }
  50%{ transform: translateY(-6px); opacity:.62; }
}

/* keep blobs but make them subtle + “watercolor” */
.blob{
  position:absolute;
  width: 58vmax; height: 58vmax;
  border-radius: 999px;
  filter: blur(60px);
  opacity: .22;
  animation: blobFloat 22s ease-in-out infinite;
}
.blob.b1{ left:-20vmax; top:-25vmax; background: radial-gradient(circle at 30% 30%, rgba(255,111,174,.85), transparent 60%); }
.blob.b2{ right:-24vmax; top:-22vmax; background: radial-gradient(circle at 30% 30%, rgba(255,179,122,.75), transparent 60%); animation-duration: 26s; }
.blob.b3{ left:10vmax; bottom:-32vmax; background: radial-gradient(circle at 30% 30%, rgba(122,167,255,.70), transparent 60%); animation-duration: 28s; }
@keyframes blobFloat{
  0%,100%{ transform: translate(0,0) scale(1); }
  40%{ transform: translate(3vmax,2vmax) scale(1.03); }
  70%{ transform: translate(-2vmax,3vmax) scale(.98); }
}
.grain{ display:none; }

.glow{
  position:absolute;
  width: 520px; height: 520px;
  left: 0; top: 0;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle at center, rgba(255,111,174,.18), rgba(122,167,255,.12), transparent 62%);
  filter: blur(18px);
  opacity: .7;
  transition: opacity .25s ease;
}

/* ===== layout restyle ===== */
.wrap{
  position:relative;
  z-index:1;
  min-height:100%;
  display:grid;
  place-items:center;
  padding: 34px 16px 70px;
}

/* NOTE: new layout uses a 2-column “sidebar + content” at desktop */
.container{
  width: min(1100px, 100%);
  display:grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

/* desktop split */
@media (min-width: 980px){
  .container{
    grid-template-columns: 360px 1fr;
    align-items: start;
  }
}

/* ===== HERO becomes a sticky “letter” sidebar ===== */
.hero{
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--paper), var(--paper2));
  box-shadow: var(--shadow);
  overflow:hidden;
  padding: 18px 18px 16px;

  transform: translateY(10px);
  opacity: 0;
  animation: rise .85s cubic-bezier(.2,.9,.2,1) .12s forwards;
}
@keyframes rise{ to{ transform: translateY(0); opacity: 1; } }

/* sticky on desktop */
@media (min-width: 980px){
  .hero{ position: sticky; top: 18px; }
}

/* tape effect */
.hero::before{
  content:"";
  position:absolute;
  top: -10px; left: 40px;
  width: 120px; height: 34px;
  background: rgba(255, 211, 232, .55);
  border: 1px solid rgba(42,29,39,.10);
  box-shadow: 0 10px 18px rgba(32,12,24,.10);
  transform: rotate(-3deg);
  border-radius: 10px;
  backdrop-filter: blur(6px);
}

/* little stamp */
.hero::after{
  content:"❤";
  position:absolute;
  right: 14px; top: 12px;
  width: 40px; height: 40px;
  display:grid; place-items:center;
  border-radius: 14px;
  border: 1px solid rgba(42,29,39,.12);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow2);
  transform: rotate(8deg);
  color: var(--blush);
}

.titleRow{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

h1{
  margin: 6px 0 0;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}
.subtitle{
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14.5px;
}

/* buttons become pill + soft */
.controls{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.btn{
  cursor:pointer;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.55);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 999px;
  display:flex; align-items:center; gap:10px;
  box-shadow: var(--shadow2);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
  position: relative;
  overflow:hidden;
  user-select: none;
}
.btn:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.72);
  border-color: var(--stroke2);
}
.btn:active{ transform: translateY(0) scale(.985); }

.btn .icon{
  width: 26px; height: 26px;
  border-radius: 999px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(255,111,174,.26), rgba(122,167,255,.18));
  border: 1px solid rgba(42,29,39,.10);
}

/* ===== chips become “handwritten tags” ===== */
.chipRow{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.chip{
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(42,29,39,.20);
  background: rgba(255,255,255,.55);
  color: rgba(42,29,39,.70);
  display:flex; align-items:center; gap:10px;
  box-shadow: 0 10px 18px rgba(32,12,24,.08);
  transform: rotate(-.5deg);
  transition: transform .18s ease;
}
.chip:nth-child(2){ transform: rotate(.8deg); }
.chip:nth-child(3){ transform: rotate(-.9deg); }
.chip:hover{ transform: translateY(-2px) rotate(0deg); }

.dot{
  width: 10px; height: 10px; border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--blush), var(--peach));
  box-shadow: 0 0 14px rgba(255,111,174,.25);
  animation: pulse 1.8s ease-in-out infinite;
}
.dot2{
  background: radial-gradient(circle at 30% 30%, var(--sky), var(--plum)) !important;
  box-shadow: 0 0 14px rgba(122,167,255,.22) !important;
}
.dot3{
  background: radial-gradient(circle at 30% 30%, var(--peach), var(--blush)) !important;
  box-shadow: 0 0 14px rgba(255,179,122,.18) !important;
}
@keyframes pulse{ 0%,100%{ transform: scale(1); opacity:.9 } 50%{ transform: scale(1.25); opacity:1 } }

/* ===== content area ===== */
.grid{
  display:grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

/* desktop: pinterest-ish tiles */
@media (min-width: 980px){
  .grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
  }
}

/* ===== cards become “notes” ===== */
.card{
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(42,29,39,.14);
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow2);
  overflow:hidden;

  transform: translateY(14px) rotate(-.2deg);
  opacity: 0;
  transition: transform .7s cubic-bezier(.2,.9,.2,1), opacity .7s cubic-bezier(.2,.9,.2,1), box-shadow .25s ease;
}
.card:nth-child(even){ transform: translateY(14px) rotate(.25deg); }
.card.inView{ transform: translateY(0) rotate(0deg); opacity: 1; }

/* color strip on top like a notebook */
.card::before{
  content:"";
  position:absolute; left:0; top:0; right:0;
  height: 10px;
  background: linear-gradient(90deg, rgba(255,111,174,.75), rgba(255,179,122,.65), rgba(122,167,255,.65));
}

/* hover lift */
.card:hover{
  transform: translateY(-4px) rotate(0deg);
  box-shadow: 0 22px 55px rgba(32,12,24,.20);
}

/* spotlight becomes a cute glow */
.card.spotlight{
  box-shadow:
    0 22px 55px rgba(32,12,24,.20),
    0 0 0 2px rgba(255,111,174,.18),
    0 0 30px rgba(255,111,174,.16);
}

/* header with icon “sticker” */
.cardHead{
  padding: 18px 16px 8px;
  display:flex;
  gap: 12px;
  align-items:flex-start;
}
.badge{
  width: 40px; height: 40px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(255,111,174,.22), rgba(122,167,255,.16));
  border: 1px solid rgba(42,29,39,.14);
  box-shadow: 0 14px 26px rgba(32,12,24,.12);
  transform: rotate(-4deg);
}
.cardTitle{
  font-weight: 820;
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-size: 16px;
  color: var(--ink);
  margin-top: 2px;
}

/* body */
.cardBody{
  padding: 0 16px 18px;
  color: rgba(42,29,39,.72);
  line-height: 1.7;
  font-size: 15px;
}
.cardBody p{ margin: 0 0 10px; }
.cardBody p:last-child{ margin-bottom: 0; }

/* reveal text */
.reveal{
  opacity: 0;
  transform: translateY(10px);
  animation: reveal .6s cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes reveal{ to{ opacity: 1; transform: translateY(0); } }

/* footer now spans full width on desktop */
.footer{
  border: 1px solid rgba(42,29,39,.14);
  border-radius: 18px;
  padding: 14px 14px;
  background: rgba(255,255,255,.70);
  box-shadow: var(--shadow2);
  text-align:center;
  color: rgba(42,29,39,.70);
  line-height: 1.6;
}
@media (min-width: 980px){
  .footer{ grid-column: 1 / -1; }
}

/* ===== FX layer stays compatible ===== */
.fxLayer{ position: fixed; inset:0; pointer-events:none; z-index: 10; overflow: hidden; }

.confetti{
  position:absolute;
  width:10px; height:14px;
  border-radius: 3px;
  opacity:.95;
  animation: fall 1200ms cubic-bezier(.2,.7,.2,1) forwards;
  filter: drop-shadow(0 10px 18px rgba(32,12,24,.18));
}
@keyframes fall{
  0%{ transform: translate3d(var(--x), var(--y), 0) rotate(0deg); opacity: 1; }
  100%{ transform: translate3d(calc(var(--x) + var(--dx)), calc(var(--y) + var(--dy)), 0) rotate(520deg); opacity: 0; }
}
.sparkle{
  position:absolute;
  width:8px; height:8px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(255,255,255,.1) 60%, transparent 70%);
  animation: pop 650ms ease-out forwards;
  filter: drop-shadow(0 10px 22px rgba(255,255,255,.18));
}
@keyframes pop{
  0%{ transform: translate(var(--x), var(--y)) scale(.2); opacity: 0; }
  40%{ opacity: 1; transform: translate(var(--x), var(--y)) scale(1.2); }
  100%{ opacity: 0; transform: translate(var(--x), var(--y)) scale(.6); }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce){
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .blob, .stars, .glow { display:none !important; }
}

/* ===== MOBILE OPTIMIZATION ===== */

@media (max-width: 768px) {

  .container {
    grid-template-columns: 1fr;
  }

  .hero {
    position: relative;
    top: 0;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 14px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .cardTitle {
    font-size: 15px;
  }

  .cardBody {
    font-size: 14px;
  }

}