/* ============================================================
   Devina's Vietnam Birthday Bash — shared styles
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Quicksand:wght@500;600;700&display=swap");

:root {
  --cream: #fbeaf0;
  --paper: #ffffff;
  --ink: #4b1528;
  --muted: #8a5567;
  --coral: #d4537e;
  --coral-dark: #993556;
  --sunset: #ed93b1;
  --jade: #993556;
  --jade-dark: #72243e;
  --lotus: #72243e;
  --gold: #c9a15c;
  --line: #f4c0d1;
  --shadow: 0 10px 25px -12px rgba(75, 21, 40, 0.28);
  --shadow-sm: 0 4px 12px -6px rgba(75, 21, 40, 0.22);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Quicksand", "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--cream);
  background-image: radial-gradient(
      circle at 15% 8%,
      rgba(212, 83, 126, 0.14),
      transparent 45%
    ),
    radial-gradient(circle at 85% 0%, rgba(201, 161, 92, 0.12), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(114, 36, 62, 0.1), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.display {
  font-family: "Fredoka", "Quicksand", sans-serif;
  margin: 0;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Top nav ---------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 247, 234, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topnav-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.topnav-brand .flag {
  font-size: 18px;
}

.topnav-days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav-days::-webkit-scrollbar {
  display: none;
}

.topnav-days a {
  flex: none;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 2px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.topnav-days a.active {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

/* ---------- Hero (home) ---------- */

.hero {
  padding: 56px 20px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-doodles {
  font-size: 26px;
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 14px;
  opacity: 0.9;
}

.hero-doodles span:nth-child(odd) {
  display: inline-block;
  transform: rotate(-8deg);
}

.hero-doodles span:nth-child(even) {
  display: inline-block;
  transform: rotate(8deg);
}

.hero-mascot {
  width: 108px;
  height: 108px;
  margin: 0 auto 16px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  font-size: clamp(30px, 7vw, 46px);
  line-height: 1.1;
  color: var(--coral-dark);
  text-shadow: 2px 2px 0 rgba(255, 193, 69, 0.35);
}

.hero p.sub {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 600;
  color: var(--muted);
}

.hero .pill-row {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Day cards (home) ---------- */

.day-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 20px 60px;
  max-width: 680px;
  margin: 0 auto;
}

.day-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.day-card:active {
  transform: scale(0.98);
}

.day-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 6px;
  border-radius: 0 6px 6px 0;
  background: var(--card-accent, var(--coral));
}

.day-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.day-card-label {
  font-family: "Fredoka", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--card-accent, var(--coral-dark));
}

.day-card-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.day-card h2 {
  margin-top: 6px;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-card-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--gold);
  color: #5c3d00;
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: 4px;
}

.day-card p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.4;
}

.day-card-cta {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--card-accent, var(--coral-dark));
}

.home-footer {
  text-align: center;
  padding: 10px 20px 50px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Day page header ---------- */

.day-hero {
  padding: 34px 20px 10px;
  text-align: center;
}

.day-hero .emoji {
  font-size: 40px;
}

.day-hero h1 {
  margin-top: 8px;
  font-size: clamp(26px, 6vw, 34px);
  color: var(--ink);
}

.day-hero .date {
  margin-top: 4px;
  font-weight: 700;
  color: var(--coral-dark);
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.day-hero .badge {
  display: inline-block;
  margin-top: 10px;
  background: var(--gold);
  color: #5c3d00;
  font-weight: 700;
  font-size: 12.5px;
  padding: 5px 14px;
  border-radius: 999px;
}

.day-prevnext {
  display: flex;
  justify-content: space-between;
  max-width: 680px;
  margin: 22px auto 0;
  padding: 0 20px;
  font-size: 13.5px;
  font-weight: 700;
}

.day-prevnext a {
  text-decoration: none;
  color: var(--jade-dark);
  background: var(--paper);
  border: 2px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
}

.day-prevnext .spacer {
  visibility: hidden;
}

/* ---------- Timeline / DAG ---------- */

.timeline {
  max-width: 480px;
  margin: 28px auto 70px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.connector {
  align-self: center;
  width: 4px;
  height: 30px;
  background: repeating-linear-gradient(
    to bottom,
    var(--coral) 0,
    var(--coral) 6px,
    transparent 6px,
    transparent 12px
  );
  position: relative;
}

.connector::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid var(--coral);
}

.card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px -4px rgba(75, 21, 40, 0.22);
}

.card-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--jade);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.card-title {
  font-family: "Fredoka", sans-serif;
  font-size: 19px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}

.card-title .icon {
  font-size: 22px;
}

.card-place {
  margin-top: 4px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--coral-dark);
}

.card-location {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-desc {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
}

.card--has-sticker {
  padding-right: 148px;
}

.card-image-wrap--below {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.card-image-wrap--below .card-image {
  max-width: 128px;
  max-height: 128px;
  width: auto;
  height: auto;
  object-fit: contain;
  --base-rot: 0deg;
  transform: rotate(var(--base-rot));
}

.card-image-wrap--corner {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 120px;
  height: 120px;
}

.card-image-wrap--corner .card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top;
  --base-rot: 6deg;
  transform: rotate(var(--base-rot));
  filter: drop-shadow(0 3px 5px rgba(75, 21, 40, 0.25));
}

.card-image--video {
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  border: 3px solid var(--paper);
}

.card-image:not(.card-image--video):hover,
.card-image:not(.card-image--video):active {
  animation: sticker-wiggle 0.5s ease;
}

@keyframes sticker-wiggle {
  0% {
    transform: rotate(var(--base-rot));
  }
  25% {
    transform: rotate(calc(var(--base-rot) - 10deg));
  }
  50% {
    transform: rotate(calc(var(--base-rot) + 10deg));
  }
  75% {
    transform: rotate(calc(var(--base-rot) - 6deg));
  }
  100% {
    transform: rotate(var(--base-rot));
  }
}

.card-link {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
  color: #fff;
  background: var(--coral);
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.card-link:active {
  background: var(--coral-dark);
}

/* Fork / branch */

.fork {
  width: 100%;
}

.fork-label-row {
  display: flex;
  justify-content: center;
  margin: 2px 0 2px;
}

.fork-label {
  background: var(--lotus);
  color: #fff;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.fork-time {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.fork-split-svg,
.fork-merge-svg {
  width: 100%;
  height: 34px;
  display: block;
  overflow: visible;
}

.fork-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fork-option .card {
  height: 100%;
}

.fork-option .card--has-sticker {
  padding-right: 56px;
}

.fork-option .card-image-wrap--corner {
  width: 40px;
  height: 40px;
  top: 10px;
  right: 10px;
}

.fork-or {
  display: none;
}

@media (max-width: 420px) {
  .fork-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .card {
    padding: 14px 14px;
  }
  .card--has-sticker {
    padding-right: 128px;
  }
  .card-title {
    font-size: 16.5px;
  }
  .card-desc {
    font-size: 13px;
  }
}

.end-cap {
  align-self: center;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.end-cap::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--coral);
  border-radius: 2px;
}

/* ---------- Confetti (homepage entrance) ---------- */

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -60px;
  line-height: 1;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}

@keyframes confetti-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--drift), 105vh) rotate(var(--spin));
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-layer {
    display: none;
  }
}

/* ---------- Password gate ---------- */

body.pw-locked > *:not(.pw-gate-overlay) {
  display: none !important;
}

.pw-gate-overlay {
  position: fixed;
  inset: 0;
  min-height: 100vh;
  z-index: 9999;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pw-gate-overlay:empty {
  background: var(--cream);
}

.pw-gate-box {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 28px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.pw-gate-emoji {
  font-size: 34px;
  margin-bottom: 8px;
}

.pw-gate-box h1 {
  font-family: "Fredoka", sans-serif;
  font-size: 21px;
  color: var(--ink);
}

.pw-gate-box p {
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.pw-gate-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pw-gate-input {
  padding: 12px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  font-size: 15px;
  font-family: "Quicksand", sans-serif;
  text-align: center;
  color: var(--ink);
  background: var(--cream);
}

.pw-gate-input:focus {
  outline: none;
  border-color: var(--coral);
}

.pw-gate-form button {
  background: var(--coral);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  font-family: "Quicksand", sans-serif;
  cursor: pointer;
}

.pw-gate-form button:active {
  background: var(--coral-dark);
}

.pw-gate-error {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--coral-dark);
}
