/* Shared colors and controls for the anniversary site and games. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&display=swap');

:root {
  --bg: #faf4eb;
  --bg-subtle: #f4eae0;
  --surface: #fffbf5;
  --surface-muted: #f8efe6;
  --border-color: #ead9cf;
  --border-strong: #d8bfb3;

  --text: #382622;
  --text-soft: #6c544c;
  --text-muted: #7b6258;

  /* Muted romantic & sage accents */
  --rose: #962e47;
  --rose-hover: #7b2237;
  --rose-soft: #f7e4e6;
  --rose-border: #e7c0c6;

  --sage: #5c7464;
  --sage-soft: #edf2ee;
  --sage-border: #c9d7cd;

  --amber-soft: #f7f1e1;
  --amber-text: #82672e;
  --amber-border: #e3d3aa;

  /* Compatibility aliases for inline styles in game pages */
  --pink: var(--rose);
  --light-pink: var(--rose-soft);
  --soft-pink: var(--rose-soft);
  --blush: var(--rose-soft);
  --cream: var(--bg);
  --card-bg: var(--surface);
  --border: 1px solid var(--border-color);
  --shadow: 0 2px 10px rgba(38, 34, 32, 0.04), 0 1px 2px rgba(38, 34, 32, 0.03);
  --shadow-hover: 0 8px 24px rgba(38, 34, 32, 0.07), 0 2px 6px rgba(38, 34, 32, 0.04);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hide legacy floating-hearts container cleanly without breaking JS */
.hearts-bg {
  display: none !important;
}

/* ---- Back Button ---- */
.back-btn {
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  transition: color 0.18s, border-color 0.18s, transform 0.15s;
  z-index: 100;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.back-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* ---- Shared subtle heart divider ---- */
.subtle-heart {
  color: var(--rose);
  font-size: 0.85em;
  opacity: 0.85;
}

.hidden { display: none !important; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 4px;
}

.anniversary-page {
  background:
    radial-gradient(ellipse at 0 100%, #f4e5d8 0, transparent 48rem),
    var(--bg);
  --serif: 'Newsreader', Georgia, serif;
}

.site-width {
  width: min(100% - 6rem, 76rem);
  margin-inline: auto;
}

.site-header {
  min-height: 5.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-strong);
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.site-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  white-space: nowrap;
}

.site-mark span {
  color: var(--rose);
  font-size: 0.7em;
}

.site-header nav {
  display: flex;
  gap: clamp(0.8rem, 3.4vw, 2.6rem);
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.site-header a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--rose);
}

.site-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.cover {
  min-height: calc(100svh - 5.4rem);
  display: grid;
  grid-template-columns: 0.94fr 1.06fr;
  gap: clamp(2rem, 6.7vw, 6.4rem);
  align-items: center;
  padding-block: clamp(2.4rem, 4vw, 4rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 1.7rem;
  height: 1px;
  background-color: currentColor;
}

.cover h1,
.book h1 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.88;
}

.cover h1 {
  font-size: clamp(4.15rem, 8.8vw, 8.35rem);
  margin: 1.65rem 0 1.1rem;
}

.cover h1 em,
.book h1 em {
  color: var(--rose);
  font-weight: inherit;
}

.dedication {
  font: 500 clamp(1.42rem, 2.55vw, 2rem)/1.15 var(--serif);
  margin-bottom: 1.15rem;
}

.dedication span {
  font: 0.72em/1 Georgia, serif;
  color: var(--rose);
  vertical-align: 0.12em;
}

.cover-note {
  max-width: 37ch;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.75;
}

.cover-question {
  margin: 0.7rem 0 1.65rem;
  font: italic 1.24rem/1.35 var(--serif);
  color: var(--text);
}

.gift-button {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.8rem;
  background: var(--rose);
  color: #fffaf3;
  text-decoration: none;
  border-radius: var(--radius-pill);
  padding: 0.9rem 1.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 5px 14px #962e4730;
  transition: background-color 180ms, transform 180ms;
}

.gift-button:hover {
  background: var(--rose-hover);
  transform: translateY(-2px);
}

.gift-button span {
  font-size: 1.12em;
}

.cover-album {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  aspect-ratio: 1.05;
  border: 1px solid #e1baba;
  border-radius: 9px;
  background:
    radial-gradient(ellipse at 20% 13%, #f6e1dc 0, transparent 55%),
    radial-gradient(ellipse at 90% 90%, #dfabaf 0, transparent 70%),
    #efc9ca;
  box-shadow: 0 1.2rem 3.2rem #9c625724;
}

.cover-album::before {
  content: '';
  position: absolute;
  inset: 0.85rem;
  border: 1px solid #9c495640;
  border-radius: 4px;
}

.polaroid {
  background: #fff9ee;
  position: absolute;
  padding: 1.9% 1.9% 6%;
  box-shadow: 0 0.8rem 1.6rem #4f28274a;
}

.polaroid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 0.94;
  object-fit: cover;
}

.polaroid-front {
  width: 55%;
  left: 12%;
  top: 16%;
  transform: rotate(-9deg);
  padding-bottom: 2.3%;
}

.polaroid-front img {
  object-position: 50% 68%;
}

.polaroid-front::before {
  content: '';
  position: absolute;
  width: 33%;
  height: 9%;
  left: 34%;
  top: -4%;
  transform: rotate(3deg);
  background: #e9d7b9ce;
}

.polaroid-front figcaption {
  text-align: center;
  margin-top: 6%;
  color: var(--text);
  font: italic clamp(0.95rem, 4.3cqi, 1.55rem)/1.15 var(--serif);
}

.polaroid-front figcaption span {
  color: var(--rose);
  font-style: normal;
}

.polaroid-back {
  width: 41%;
  right: 11%;
  top: 29%;
  transform: rotate(12deg);
}

.polaroid-back img {
  object-position: 50% 70%;
}

.album-heart,
.album-star {
  position: absolute;
  color: var(--rose);
  line-height: 1;
  pointer-events: none;
  font-family: Georgia, serif;
}

.album-heart {
  right: 10%;
  bottom: 10%;
  font-size: 11cqi;
  transform: rotate(14deg);
}

.album-star {
  right: 17%;
  top: 12%;
  font-size: 8cqi;
}

.book {
  padding-block: clamp(2.25rem, 5.5vw, 5rem);
}

.book-intro {
  margin-bottom: clamp(1.65rem, 3.75vw, 3rem);
}

.book h1 {
  font-size: clamp(3.25rem, 7.5vw, 6.7rem);
}

.book-intro p {
  margin-top: 0.75rem;
  color: var(--text-soft);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.book-card {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  padding: clamp(1.05rem, 2.1vw, 1.7rem);
  min-height: 14rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 180ms, border-color 180ms, box-shadow 180ms;
}

.book-card:hover {
  border-color: var(--rose);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.book-icon {
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  height: 2.6rem;
  border-radius: 8px;
  background: var(--rose-soft);
  color: var(--rose);
  font: 500 1.4rem/1 var(--serif);
  margin-bottom: 0.9rem;
}

.book-card h2 {
  font: 500 1.6rem/1.05 var(--serif);
}

.book-card p {
  margin: 0.45rem 0 1.05rem;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.book-action {
  margin-top: auto;
  color: var(--rose);
  font-size: 0.81rem;
  font-weight: 700;
}

.book-action span {
  margin-left: 0.25rem;
}

.book-story {
  grid-column: 1 / -1;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 0.35rem;
  align-items: center;
  background: var(--rose-soft);
  border-color: var(--rose-border);
}

.book-story .book-icon {
  grid-row: 1 / 4;
  margin: 0;
  background: var(--rose);
  color: var(--surface);
}

.book-story p { margin: 0; }

@media (min-width: 45rem) {
  .book-story { grid-template-columns: auto minmax(0, 1fr) auto; }
  .book-story .book-icon,
  .book-story .book-action { grid-row: 1 / 3; }
  .book-story p { grid-column: 2; }
  .book-story .book-action { grid-column: 3; margin: 0; }
}

@media (max-width: 62rem) {
  .site-width { width: calc(100% - 3rem); }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 45rem) {
  .site-width { width: calc(100% - 2.5rem); }
  .site-header { min-height: 4.3rem; }
  .site-mark { font-size: 1.25rem; }
  .site-header nav { font-size: 0.8rem; }
  .cover { grid-template-columns: 1fr; gap: 2.25rem; min-height: auto; }
  .cover h1 { font-size: clamp(4.1rem, 13vw, 6.3rem); }
  .cover-album { width: min(100%, 30rem); }
  .book-card { min-height: 0; }
}

@media (max-width: 23rem) {
  .site-width { width: calc(100% - 2rem); }
  .site-mark { font-size: 1.1rem; }
  .site-header nav { gap: 0.65rem; font-size: 0.75rem; }
  .book-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .gift-button, .book-card, .back-btn { transition: none; }
  .gift-button:hover, .book-card:hover, .back-btn:hover { transform: none; }
}
