/* ============================================================
   The One With Priyansshi — theme
   Friends-inspired palette, paper, coffee, and a lot of purple.
   ============================================================ */

:root {
  --plum-950: #1b1127;
  --plum-900: #271738;
  --plum-800: #35214d;
  --plum-700: #452c64;
  --plum-600: #5a3d7f;
  --plum-500: #7456a0;
  --plum-400: #9278ba;
  --plum-300: #b7a3d3;

  --gold: #f2c14e;
  --gold-2: #f7d57e;
  --gold-3: #fbe8b0;
  --gold-deep: #b98a2d;

  --cream: #f7eddb;
  --cream-2: #eddcbe;
  --paper: #fbf5e8;
  --paper-2: #f3e8d3;

  --coffee: #3b2a20;
  --coffee-2: #5b4334;
  --coffee-3: #7b604d;
  --muted: #8b7664;

  --brick: #a34d3f;
  --brick-2: #813b31;
  --teal: #3d7d75;
  --teal-2: #2c5e58;
  --red: #c94b4b;
  --blue: #4e7aa8;
  --green: #5e8a60;

  --ink: #2a211d;
  --line: rgba(59, 42, 32, 0.18);

  --font-display: "Fredoka", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-hand: "Caveat", "Segoe Print", cursive;
  --font-mono: "Courier Prime", "Courier New", monospace;

  --shadow-sm: 0 2px 0 rgba(27, 17, 39, 0.14);
  --shadow-md: 0 14px 34px rgba(15, 8, 25, 0.28);
  --shadow-lg: 0 30px 80px rgba(9, 4, 16, 0.46);
  --shadow-paper: 0 1px 0 #fff8ec inset, 0 14px 30px rgba(20, 11, 30, 0.22);

  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 28px;

  --header-h: 68px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--plum-950);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

body.no-scroll {
  overflow: hidden;
}

img,
svg {
  max-width: 100%;
}

img {
  display: block;
}

[hidden] {
  display: none !important;
}

.image-fallback {
  position: relative;
  overflow: hidden;
}
.image-fallback > img.image-missing {
  opacity: 0 !important;
  visibility: hidden;
}
.image-fallback__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: rgba(247, 237, 219, 0.7);
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.15;
  text-align: center;
}
.day-portrait .image-fallback__label,
.gift-note .image-fallback__label,
.day-card__photo .image-fallback__label {
  color: rgba(59, 42, 32, 0.6);
}
.day-card__photo .image-fallback__label {
  color: rgba(247, 237, 219, 0.78);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
figure {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.01em;
}

::selection {
  background: var(--gold);
  color: var(--plum-900);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 10000;
  padding: 12px 18px;
  border-radius: 0 0 12px 12px;
  background: var(--gold);
  color: var(--plum-900);
  font-weight: 800;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ----- textures & overlays ----- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 9989;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 38%, transparent 40%, rgba(10, 5, 17, 0.38) 100%),
    linear-gradient(to bottom, rgba(10, 5, 17, 0.2), transparent 16%, transparent 82%, rgba(10, 5, 17, 0.42));
}

.brick-bg {
  background-color: var(--plum-800);
  background-image:
    radial-gradient(ellipse at 50% 110%, rgba(242, 193, 78, 0.12), transparent 55%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(160deg, rgba(94, 57, 127, 0.35), rgba(23, 12, 35, 0.55));
  background-size: auto, 84px 34px, 84px 34px, auto;
}

.paper-texture {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 22% 30%, rgba(255, 255, 255, 0.7), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(191, 160, 115, 0.1), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23p)' opacity='.05'/%3E%3C/svg%3E");
}

/* ----- type helpers ----- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: clamp(0.66rem, 1.5vw, 0.82rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.eyebrow--plain::before,
.eyebrow--plain::after {
  display: none;
}

.script {
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--gold-2);
  letter-spacing: 0.01em;
}

.lede {
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: rgba(247, 237, 219, 0.76);
  line-height: 1.65;
}

.tiny {
  font-size: 0.78rem;
  color: rgba(247, 237, 219, 0.56);
}

.muted {
  color: var(--muted);
}

.hand {
  font-family: var(--font-hand);
}

.mono {
  font-family: var(--font-mono);
}

/* ----- buttons & links ----- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  border: 2px solid var(--gold-deep);
  border-radius: 999px;
  background: var(--gold);
  color: var(--plum-900);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  box-shadow: 0 5px 0 #9a6d22, 0 12px 26px rgba(9, 4, 16, 0.24);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--gold-2);
  box-shadow: 0 7px 0 #9a6d22, 0 16px 30px rgba(9, 4, 16, 0.28);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #9a6d22, 0 6px 14px rgba(9, 4, 16, 0.2);
}

.btn--purple {
  background: var(--plum-600);
  border-color: var(--plum-900);
  color: var(--cream);
  box-shadow: 0 5px 0 var(--plum-950), 0 12px 26px rgba(9, 4, 16, 0.24);
}
.btn--purple:hover {
  background: var(--plum-500);
  box-shadow: 0 7px 0 var(--plum-950), 0 16px 30px rgba(9, 4, 16, 0.28);
}
.btn--purple:active {
  box-shadow: 0 2px 0 var(--plum-950);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(247, 237, 219, 0.38);
  color: var(--cream);
  box-shadow: none;
}
.btn--ghost:hover {
  background: rgba(247, 237, 219, 0.09);
  border-color: var(--gold);
  box-shadow: none;
}
.btn--ghost:active {
  box-shadow: none;
}

.btn--small {
  padding: 11px 20px;
  font-size: 0.88rem;
  border-width: 2px;
}

.btn--wide {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dashed currentColor;
  color: var(--gold-2);
  font-size: 0.86rem;
  transition: color 0.18s, border-color 0.18s;
}
.link-btn:hover {
  color: #fff;
  border-bottom-style: solid;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(242, 193, 78, 0.45);
  border-radius: 50%;
  color: var(--gold-2);
  background: rgba(27, 17, 39, 0.25);
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s;
}
.icon-btn:hover {
  border-color: var(--gold);
  background: rgba(242, 193, 78, 0.12);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

.exit-door-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 13px;
  border: 2px solid rgba(242, 193, 78, 0.45);
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(27, 17, 39, 0.25);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s;
}
.exit-door-btn:hover {
  border-color: var(--gold);
  background: rgba(242, 193, 78, 0.12);
  color: var(--cream);
  transform: translateY(-1px);
}
.exit-door-btn svg {
  width: 18px;
  height: 18px;
}

/* ----- header / footer ----- */

.site {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-h);
  padding: 0 clamp(18px, 4vw, 48px);
  padding-top: env(safe-area-inset-top);
  background: rgba(27, 17, 39, 0.82);
  border-bottom: 1px solid rgba(242, 193, 78, 0.2);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--cream);
  white-space: nowrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.06em;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.wordmark i {
  width: 0.32em;
  height: 0.32em;
  margin: 0 0.08em;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-0.04em);
}

.wordmark i:nth-of-type(3n + 1) {
  background: var(--red);
}
.wordmark i:nth-of-type(3n + 2) {
  background: var(--blue);
}
.wordmark i:nth-of-type(3n) {
  background: var(--gold);
}

.brand .wordmark {
  font-size: 1.02rem;
}

.brand__sub {
  padding-left: 12px;
  border-left: 1px solid rgba(247, 237, 219, 0.18);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 237, 219, 0.5);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
}

.site-nav a {
  position: relative;
  padding: 6px 0;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 237, 219, 0.66);
  transition: color 0.18s;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--cream);
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding: 30px 20px calc(26px + env(safe-area-inset-bottom));
  font-size: 0.78rem;
  color: rgba(247, 237, 219, 0.42);
  text-align: center;
}

.footer-author {
  color: var(--gold);
  font-weight: 700;
}

.footer-heart {
  color: var(--gold);
  display: inline-block;
  margin: 0 2px;
}

.footer-dots {
  display: inline-flex;
  gap: 5px;
}
.footer-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.7;
}
.footer-dots i:nth-child(2) {
  background: var(--blue);
}
.footer-dots i:nth-child(3) {
  background: var(--red);
}

/* ----- views ----- */

.view {
  position: relative;
  flex: 1;
  width: 100%;
}

.view-inner {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 48px);
}

.view-enter {
  animation: viewIn 0.45s var(--ease-out) both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ----- toast ----- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 9500;
  width: min(480px, calc(100vw - 36px));
  padding: 14px 20px;
  border: 2px solid rgba(242, 193, 78, 0.55);
  border-radius: 14px;
  background: rgba(39, 23, 56, 0.96);
  color: var(--cream);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
  backdrop-filter: blur(10px);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ----- modal ----- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9400;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 8, 25, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease both;
}

.modal__card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  padding: clamp(26px, 5vw, 44px);
  border-radius: 22px;
  background-color: var(--paper);
  background-image: var(--paper-tex, none);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  animation: cardIn 0.45s var(--ease-spring) both;
}

.modal__card h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  color: var(--plum-800);
}

.modal__card p {
  margin-top: 14px;
  color: var(--coffee-2);
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(59, 42, 32, 0.08);
  color: var(--coffee);
  font-size: 1.35rem;
  line-height: 1;
}
.modal__close:hover {
  background: rgba(59, 42, 32, 0.16);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96) rotate(-0.6deg);
  }
}

/* ----- confetti canvas ----- */

.confetti {
  position: fixed;
  inset: 0;
  z-index: 9000;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ----- dev panel ----- */

.dev {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 9600;
  width: 252px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(242, 193, 78, 0.4);
  border-radius: 12px;
  background: rgba(27, 17, 39, 0.94);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}
.dev[hidden] {
  display: none;
}
.dev__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.dev__date {
  margin-bottom: 8px;
  color: var(--plum-300);
}
.dev__row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
.dev button {
  padding: 5px 8px;
  border: 1px solid rgba(247, 237, 219, 0.22);
  border-radius: 6px;
  background: rgba(247, 237, 219, 0.06);
  color: var(--cream);
  font-size: 10.5px;
}
.dev button:hover {
  border-color: var(--gold);
  background: rgba(242, 193, 78, 0.14);
}
.dev__warn {
  margin-top: 8px;
  padding: 7px;
  border-radius: 6px;
  background: rgba(201, 75, 75, 0.16);
  color: #ffd4d4;
}
.dev__ok {
  margin-top: 8px;
  color: #b8e6b8;
}
.dev input[type="date"] {
  width: 100%;
  padding: 5px;
  border: 1px solid rgba(247, 237, 219, 0.22);
  border-radius: 6px;
  background: rgba(247, 237, 219, 0.06);
  color: var(--cream);
  color-scheme: dark;
}

/* ----- misc ----- */

.tape {
  position: absolute;
  width: 92px;
  height: 28px;
  background: rgba(242, 193, 78, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  mix-blend-mode: multiply;
}
.tape--tl {
  top: -12px;
  left: -24px;
  transform: rotate(-8deg);
}
.tape--tr {
  top: -12px;
  right: -24px;
  transform: rotate(7deg);
}
.tape--bl {
  bottom: -12px;
  left: -20px;
  transform: rotate(6deg);
}
.tape--br {
  bottom: -12px;
  right: -20px;
  transform: rotate(-7deg);
}

.dot-row {
  display: inline-flex;
  gap: 6px;
}
.dot-row i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.dot-row i:nth-child(2) {
  background: var(--blue);
}
.dot-row i:nth-child(3) {
  background: var(--red);
}

/* ----- reduced motion ----- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .grain {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 60px;
  }
  .site-header {
    padding: 0 14px;
  }
  .brand__sub {
    display: none;
  }
  .site-nav {
    gap: 12px;
  }
  .site-nav a {
    font-size: 0.74rem;
  }
  .site-nav a[data-nav="home"] {
    display: none;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
  }
}
