/*
 * PASTEL ANIMATED NOTEBOOK — STYLESHEET
 * Edit warna, ukuran, dan posisi tulisan di file ini bila diperlukan.
 */

:root {
  --cream: #fff5e5;
  --paper: #ffffff;
  --pink: #ffc7c7;
  --ink: #8e6c63;
  --muted-ink: #b18d83;
  --button-pink: #f5a8a9;
  --button-cream: #f7e3d2;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

button { font: inherit; }

.app {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  padding: 26px 14px 22px;
}

.intro {
  margin: 0 0 17px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: #bd8b80;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

h1 {
  margin: 0;
  color: #946f66;
  font-size: clamp(19px, 4vw, 27px);
  font-weight: 700;
}

.subtitle {
  margin: 5px 0 0;
  color: var(--muted-ink);
  font-size: 12px;
}

.notebook-wrap {
  width: min(100%, 900px);
  perspective: 1800px;
}

.notebook {
  position: relative;
  width: 100%;
  aspect-ratio: 1414 / 2000;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  background: var(--paper);
  box-shadow: 0 16px 42px rgb(153 112 93 / 10%);
  --page-flip-duration: 1050ms;
}

.artwork {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
}

.writing-area {
  position: absolute;
  z-index: 2;
  top: 15.1%;
  left: 25.7%;
  display: grid;
  width: 60.2%;
  height: 59.1%;
  grid-template-rows: repeat(var(--lines-per-page, 11), minmax(0, 1fr));
  transition: opacity 140ms ease;
}

.text-line {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: flex-end;
  overflow: hidden;
  padding: 0 2px 0.35cqw;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: clamp(10px, 2.2cqw, 16px);
  font-weight: 600;
  line-height: 1.12;
  white-space: pre;
}

.text-line::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: max(1px, 0.12cqw);
  background: var(--pink);
  content: "";
  pointer-events: none;
}

.notebook.is-turning .writing-area { opacity: 0; }


.falling-layer {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.falling-emoji {
  position: absolute;
  top: -8%;
  font-size: var(--fall-size, 20px);
  opacity: 0;
  filter: drop-shadow(0 2px 2px rgb(185 128 126 / 12%));
  animation: romantic-fall var(--fall-duration, 9s) ease-in forwards;
  animation-delay: var(--fall-delay, 0s);
  will-change: transform, opacity;
}

@keyframes romantic-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -8%, 0) rotate(-18deg) scale(.78);
  }
  12% { opacity: .82; }
  72% { opacity: .72; }
  100% {
    opacity: 0;
    opacity: 0;
    transform: translate3d(var(--fall-drift, 25px), 112vh, 0) rotate(28deg) scale(1.08);
  }
}

.control-button.audio-button {
  background: #f8e8e4;
  color: #926f65;
}

.page-number {
  position: absolute;
  z-index: 3;
  right: 14.4%;
  bottom: 7.4%;
  color: #c9a49a;
  font-size: clamp(8px, 1.45cqw, 11px);
  font-weight: 700;
  opacity: 0.65;
}

.page-turn {
  position: absolute;
  z-index: 8;
  inset: 0;
  overflow: hidden;
  transform: rotateY(0deg);
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  animation: page-flip var(--page-flip-duration) cubic-bezier(0.65, 0.02, 0.35, 1) forwards;
  box-shadow: 9px 0 25px rgb(110 78 66 / 13%);
}

.page-turn::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f7e9da, #fffaf4);
  content: "";
  transform: rotateY(180deg);
  backface-visibility: hidden;
}

.page-turn__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
}

.page-turn__writing {
  position: absolute;
  z-index: 2;
  top: 15.1%;
  left: 25.7%;
  display: grid;
  width: 60.2%;
  height: 59.1%;
  grid-template-rows: repeat(var(--lines-per-page, 11), minmax(0, 1fr));
}

.page-turn__line {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: flex-end;
  overflow: hidden;
  padding: 0 2px 0.35cqw;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: clamp(10px, 2.2cqw, 16px);
  font-weight: 600;
  line-height: 1.12;
  white-space: pre;
}

.page-turn__line::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: max(1px, 0.12cqw);
  background: var(--pink);
  content: "";
  pointer-events: none;
}

@keyframes page-flip {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-180deg); }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 17px;
}

.control-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 17px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform 150ms ease, opacity 150ms ease;
}

.control-button:hover { transform: translateY(-1px); }
.control-button:active { transform: translateY(1px); }

.control-button:focus-visible {
  outline: 3px solid rgb(142 108 99 / 35%);
  outline-offset: 3px;
}

.control-button:disabled {
  cursor: default;
  opacity: 0.7;
}

.control-button.primary {
  background: var(--button-pink);
  color: #ffffff;
}

.control-button.secondary {
  background: var(--button-cream);
  color: #926f65;
}

.page-status {
  width: 100%;
  margin: 1px 0 0;
  color: var(--muted-ink);
  font-size: 11px;
  text-align: center;
}

.footer-note {
  margin-top: 13px;
  color: var(--muted-ink);
  font-size: 11px;
  text-align: center;
}

.footer-note code {
  border-radius: 5px;
  padding: 2px 5px;
  background: rgb(255 255 255 / 65%);
  color: #926f65;
}

@media (max-width: 520px) {
  .app { padding: 18px 0 20px; }
  .intro { margin-bottom: 12px; padding: 0 12px; }
  .notebook-wrap { width: 100%; }
  .controls { margin-top: 13px; }
  .control-button { padding: 9px 14px; }
  .footer-note { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .page-turn { animation-duration: 1ms; }
  .control-button { transition: none; }
}

/* Entry / calendar / loading experience (v1.2.0) */
[hidden] { display: none !important; }
.screen { min-height: 100svh; }
.loading-screen, .calendar-screen { display: grid; place-items: center; padding: 22px 14px; background: #fff2df; }
.loading-card { position: relative; width: min(100%, 520px); min-height: min(780px, 90svh); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; overflow: hidden; border: 2px solid #f8dfc8; border-radius: 28px; background: #fff8ed; box-shadow: 0 18px 45px #a77d6320; }
.loading-card::before, .loading-card::after { content: "✿"; position: absolute; color: #f3a0a7; font-size: 42px; }
.loading-card::before { top: 22px; left: 24px; }.loading-card::after { top: 24px; right: 24px; }
.loading-flowers { color: #e9959d; font-size: 26px; margin-bottom: 22px; }
.loading-title { color: #754e43; font-size: clamp(38px, 10vw, 64px); font-weight: 900; letter-spacing: .02em; transform: rotate(-3deg); }
.loading-dots { display: inline-block; width: 1.2em; animation: loading-dots 1s steps(4,end) infinite; overflow: hidden; vertical-align: bottom; }
.loading-panda { margin: 28px 0 -4px; font-size: clamp(72px, 18vw, 112px); animation: panda-bob 2.2s ease-in-out infinite; }
.loading-track { position: relative; width: min(100%, 410px); height: 44px; padding: 6px; border: 5px solid #946b5d; border-radius: 999px; background: #f6d6c3; box-shadow: 0 4px 0 #d6aa93; }
.loading-fill { width: 0; height: 100%; border-radius: 999px; background: repeating-linear-gradient(125deg,#f5a5ad 0 18px,#ffc4c8 18px 36px); transition: width .24s ease; }
.loading-percent { margin: 14px 0 0; color: #7b5549; font-size: 20px; font-weight: 800; }
.loading-caption { color: #a78578; text-align: center; font-size: 13px; }
.calendar-screen { align-content: center; }
.calendar-card { position: relative; width: min(100%, 860px); min-height: min(980px, 82svh); padding: 96px clamp(22px, 5vw, 54px) 105px; overflow: hidden; border-radius: 5px; background: #fff; box-shadow: 0 14px 38px #a67d6520; }
.calendar-card::before { content: "✿"; position: absolute; top: -20px; left: -10px; color: #f5a5ad; font-size: 90px; text-shadow: 835px 0 #f5a5ad; }
.calendar-tape { position: absolute; top: 18px; left: 18%; width: 64%; height: 55px; opacity: .9; background: repeating-linear-gradient(0deg,#f9e2bb 0 14px,#fcebd0 14px 28px), repeating-linear-gradient(90deg,transparent 0 22px,#fff5df 22px 44px); }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 30px; border-bottom: 3px solid #faeadc; }
.calendar-heading h1 { margin: 0; color: #765247; font-size: clamp(27px, 6vw, 54px); }
.month-arrows { display: flex; gap: 12px; color: white; font-size: 38px; }.month-arrows span { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 13px; background: #f4a4ac; }.month-arrows span+span { background: #d9ad92; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); text-align: center; }
.calendar-weekdays { margin-top: 38px; color: #79564b; font-size: clamp(17px, 4vw, 34px); font-weight: 700; }
.calendar-days { margin-top: 18px; align-items: center; row-gap: clamp(8px, 1.5vw, 18px); color: #79564b; font-size: clamp(17px, 4vw, 32px); }
.calendar-days span,.calendar-days button { display: grid; place-items: center; min-height: clamp(42px, 7vw, 68px); }
.calendar-days .empty { min-height: clamp(20px, 4vw, 40px); }
.date-19 { justify-self: center; width: clamp(44px, 7vw, 70px); border: 0; border-radius: 13px; color: white; background: #f4a0aa; box-shadow: 0 5px 14px #ef9ca855; font: inherit; cursor: pointer; animation: date-pulse 2s ease-in-out infinite; }
.calendar-bottom-art { position: absolute; bottom: -18px; left: 0; right: 0; display: flex; align-items: end; justify-content: space-between; padding: 0 18px; font-size: clamp(42px, 8vw, 76px); pointer-events: none; }
.month-picker { width: min(100%,860px); padding: 16px 12px 0; color: #a88d7e; text-align: center; font-size: clamp(10px, 2vw, 16px); }
.month-dots { display: flex; justify-content: space-around; margin-top: 14px; }.month-dots i { width: 28px; height: 28px; border-radius: 50%; background: #fff5e6; box-shadow: 0 2px 5px #a88d7e40; }.month-dots .selected { background: #f5a4ad; box-shadow: 0 2px 10px #f5a4ad88; }
.calendar-hint { margin: 22px 0 0; color: #98796d; text-align: center; line-height: 1.7; font-size: 13px; }
.is-leaving { animation: screen-out .55s ease forwards; }.is-entering { animation: screen-in .65s ease both; }
@keyframes screen-out { to { opacity: 0; transform: scale(.97); } } @keyframes screen-in { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes date-pulse { 50% { transform: scale(1.06); box-shadow: 0 5px 20px #ef9ca877; } }
@keyframes panda-bob { 50% { transform: translateY(-9px) rotate(3deg); } }
@keyframes loading-dots { 0% { width: 0; } 100% { width: 1.2em; } }
.notebook-screen .app { width: 100%; padding-top: 18px; }
.notebook-screen .intro { margin-bottom: 12px; }
.notebook-screen .notebook-wrap { width: min(100%, 900px); }
.notebook-screen .controls { margin-bottom: 22px; }
.falling-emoji { pointer-events: none; }
@media (max-width: 560px) { .calendar-card { min-height: 76svh; padding: 86px 14px 92px; }.month-arrows span { width: 42px; height: 42px; font-size: 28px; }.calendar-weekdays { margin-top: 24px; }.calendar-bottom-art { font-size: 42px; } }
@media (prefers-reduced-motion: reduce) { .is-entering,.is-leaving,.date-19,.loading-panda { animation: none; } }

/* Responsive calendar fit — v1.2.1
   Keeps the complete calendar, month selector, and tap instruction inside
   the visible viewport without requiring browser zoom-out. */
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body { min-height: 100%; }
.calendar-screen {
  box-sizing: border-box; width: 100%; height: 100vh; height: 100svh; min-height: 0;
  overflow: hidden; grid-template-rows: minmax(0, 1fr) auto auto; align-content: stretch;
  justify-items: center; gap: clamp(5px, 1.2svh, 14px);
  padding: clamp(8px, 1.8svh, 18px) clamp(8px, 2vw, 20px);
}
.calendar-card {
  box-sizing: border-box; width: min(100%, 860px); height: 100%; min-height: 0;
  padding: clamp(54px, 8svh, 86px) clamp(14px, 4vw, 48px) clamp(68px, 9svh, 96px);
  display: grid; grid-template-rows: auto auto minmax(0, 1fr); align-self: stretch;
}
.calendar-tape { top: clamp(10px, 1.8svh, 18px); height: clamp(26px, 5svh, 50px); }
.calendar-heading { min-width: 0; gap: clamp(6px, 1.4vw, 14px); padding: 0 0 clamp(10px, 2.5svh, 24px); }
.calendar-heading h1 { min-width: 0; font-size: clamp(21px, min(5.2vw, 5.2svh), 54px); line-height: 1.08; white-space: nowrap; }
.month-arrows { flex: 0 0 auto; gap: clamp(5px, 1vw, 12px); font-size: clamp(22px, 4svh, 38px); }
.month-arrows span { width: clamp(34px, min(6vw, 6svh), 62px); height: clamp(34px, min(6vw, 6svh), 62px); border-radius: clamp(8px, 1.4vw, 13px); }
.calendar-weekdays { margin-top: clamp(10px, 2.5svh, 30px); font-size: clamp(13px, min(3.3vw, 3.6svh), 34px); line-height: 1.15; }
.calendar-days { min-height: 0; margin-top: clamp(5px, 1.4svh, 16px); grid-template-rows: repeat(6, minmax(0, 1fr)); align-items: stretch; row-gap: clamp(1px, .55svh, 7px); font-size: clamp(14px, min(3.2vw, 3.7svh), 32px); }
.calendar-days span, .calendar-days button { min-height: 0; height: 100%; }
.calendar-days .empty { min-height: 0; }
.date-19 { width: min(100%, clamp(34px, min(6.6vw, 6.2svh), 70px)); min-height: 0; aspect-ratio: 1; align-self: center; }
.calendar-bottom-art { bottom: -2px; padding-inline: clamp(8px, 1.8vw, 18px); font-size: clamp(34px, min(7vw, 8svh), 76px); }
.month-picker { box-sizing: border-box; width: min(100%, 860px); flex: 0 0 auto; padding: 0 clamp(4px, 1.2vw, 12px); font-size: clamp(9px, min(1.8vw, 1.9svh), 16px); line-height: 1.2; }
.month-labels { white-space: nowrap; letter-spacing: -.035em; }
.month-dots { margin-top: clamp(5px, 1svh, 12px); }
.month-dots i { width: clamp(13px, min(2.8vw, 2.8svh), 28px); height: clamp(13px, min(2.8vw, 2.8svh), 28px); }
.calendar-hint { flex: 0 0 auto; margin: 0; font-size: clamp(10px, min(1.8vw, 1.9svh), 13px); line-height: 1.35; }
@media (max-width: 560px) {
  .calendar-screen { gap: clamp(4px, .9svh, 8px); padding: clamp(6px, 1svh, 10px) 8px; }
  .calendar-card { width: 100%; padding: clamp(48px, 7.2svh, 66px) 10px clamp(56px, 8svh, 76px); }
  .calendar-heading { padding-bottom: clamp(8px, 1.8svh, 14px); }
  .calendar-heading h1 { font-size: clamp(20px, 5.2vw, 29px); letter-spacing: -.045em; }
  .month-arrows span { width: clamp(30px, 8.5vw, 40px); height: clamp(30px, 8.5vw, 40px); font-size: 25px; }
  .calendar-weekdays { margin-top: clamp(9px, 2svh, 17px); font-size: clamp(13px, 3.8vw, 19px); }
  .calendar-days { margin-top: clamp(4px, 1svh, 9px); font-size: clamp(14px, 4vw, 20px); row-gap: 1px; }
  .calendar-bottom-art { font-size: clamp(34px, 10vw, 48px); }
  .month-picker { font-size: clamp(8px, 2.25vw, 11px); }
  .month-dots i { width: clamp(12px, 3.3vw, 17px); height: clamp(12px, 3.3vw, 17px); }
  .calendar-hint { font-size: clamp(10px, 2.7vw, 12px); }
}
@media (max-height: 620px) {
  .calendar-screen { gap: 4px; padding-block: 5px; }
  .calendar-card { padding-top: 42px; padding-bottom: 52px; }
  .calendar-tape { height: 24px; }
  .calendar-heading { padding-bottom: 7px; }
  .calendar-weekdays { margin-top: 8px; }
  .calendar-days { margin-top: 4px; row-gap: 0; }
  .month-dots { margin-top: 4px; }
  .calendar-hint { line-height: 1.15; }
}


/* Calendar decoration + month selector refinement — v1.2.2 */
:root { color-scheme: light; }
html, body { color-scheme: light; }
.calendar-card {
  isolation: isolate;
}
.calendar-card::before {
  content: "✿";
  position: absolute;
  z-index: 1;
  top: -31px;
  left: -12px;
  color: #f5a5ad;
  font-size: clamp(48px, 6vw, 68px);
  line-height: 1;
  text-shadow: none;
  pointer-events: none;
}
.calendar-card::after {
  content: "✿";
  position: absolute;
  z-index: 1;
  top: -31px;
  right: -12px;
  color: #f5a5ad;
  font-size: clamp(48px, 6vw, 68px);
  line-height: 1;
  pointer-events: none;
}
.calendar-tape {
  z-index: 0;
  opacity: 1;
  background-color: #ffe9e7;
  background-image:
    linear-gradient(90deg, #ffffff55 50%, transparent 50%),
    linear-gradient(#ffffff55 50%, transparent 50%),
    linear-gradient(90deg, transparent 50%, #f7c6c7 50%),
    linear-gradient(transparent 50%, #f7c6c7 50%);
  background-size: 28px 28px;
  border: 1px solid #f8d6cc;
  clip-path: polygon(0 0,100% 0,98.5% 12%,100% 25%,98.5% 38%,100% 50%,98.5% 62%,100% 75%,98.5% 88%,100% 100%,0 100%,1.5% 88%,0 75%,1.5% 62%,0 50%,1.5% 38%,0 25%,1.5% 12%);
}
.calendar-heading {
  position: relative;
  z-index: 2;
}
.calendar-heading h1 {
  overflow: visible;
  flex: 1 1 auto;
}
.month-picker {
  display: grid;
  grid-template-rows: auto auto;
  gap: clamp(6px, 1svh, 12px);
}
.month-labels {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  white-space: normal;
  letter-spacing: 0;
  gap: 0;
}
.month-labels span {
  display: block;
  min-width: 0;
  text-align: center;
}
.month-dots {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  justify-items: center;
  align-items: center;
  gap: 0;
  margin-top: 0;
}
.month-dots i {
  display: block;
  width: clamp(13px, min(2.8vw, 2.8svh), 28px);
  height: clamp(13px, min(2.8vw, 2.8svh), 28px);
  border-radius: 50%;
  background: #fff5e6;
  box-shadow: 0 2px 5px #a88d7e40;
}
.month-dots i.selected {
  background: #f5a4ad;
  box-shadow: 0 2px 10px #f5a4ad88;
}
@media (max-width: 560px) {
  .calendar-card::before,
  .calendar-card::after {
    top: -25px;
    font-size: 48px;
  }
  .calendar-card::before { left: -7px; }
  .calendar-card::after { right: -7px; }
  .calendar-tape {
    left: 19%;
    width: 62%;
    height: clamp(27px, 4.2svh, 38px);
  }
  .calendar-heading h1 {
    font-size: clamp(19px, 5vw, 27px);
    letter-spacing: -.05em;
  }
  .month-labels {
    font-size: clamp(8px, 2.25vw, 11px);
  }
}
