:root {
  --page-bg: #f5e5dc;
  --page-text: #493b3b;
  --page-muted: #866b70;
  --page-border: rgba(112, 78, 76, 0.2);
  --button-bg: #865c6a;
  --button-text: #ffffff;
  --paper: #fffaf1;
  --romantic-shadow: 0 18px 45px rgba(90, 60, 67, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page-bg);
  color: var(--page-text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(255, 249, 226, 0.85), transparent 30%),
    radial-gradient(ellipse at 88% 82%, rgba(226, 183, 197, 0.45), transparent 34%),
    linear-gradient(135deg, #f8e9dc, #f4dce1 55%, #ece2ee);
}

body.home-page {
  background:
    radial-gradient(ellipse at 15% 15%, rgba(255, 255, 255, 0.95), transparent 30%),
    radial-gradient(ellipse at 88% 82%, rgba(255, 211, 224, 0.62), transparent 34%),
    linear-gradient(135deg, #fffafd, #fce8ef 58%, #f8dce7);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate {
  position: relative;
  width: min(100%, 420px);
  padding: 70px 40px 38px;
  border: 1px solid rgba(219, 154, 177, 0.55);
  border-radius: 12px;
  background: #fffafd;
  box-shadow:
    0 18px 50px rgba(165, 92, 119, 0.16),
    inset 0 0 0 6px #ffffff,
    inset 0 0 0 7px rgba(224, 164, 184, 0.52),
    inset 0 0 0 11px #fffafd,
    inset 0 0 0 12px rgba(224, 164, 184, 0.38);
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--page-muted);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gate .eyebrow {
  color: #b66f89;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.gate h1 {
  margin-bottom: 14px;
  color: #985b73;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  font-style: italic;
  letter-spacing: -0.05em;
}

.gate-subtitle {
  margin: 0 0 22px;
  color: #b66f89;
  font-family: "Caveat", cursive;
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  line-height: 1.2;
}

.gate-intro {
  margin: 0 0 24px;
  color: #a87587;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 12px;
}

input,
button {
  min-height: 48px;
  border-radius: 8px;
  font: inherit;
}

input {
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(148, 105, 114, 0.28);
  background: #fffdfb;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid var(--page-muted);
  outline-offset: 3px;
}

.gate button {
  padding: 0 18px;
  border: 0;
  background: #d184a0;
  color: var(--button-text);
  cursor: pointer;
}

button:hover {
  opacity: 0.85;
}

.error-message {
  min-height: 1.4em;
  margin: 0;
  color: hsl(323, 57%, 77%);
  font-size: 0.9rem;
  
}

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

.blank-canvas {
  position: relative;
  width: 100%;
  min-height: 70vh;
  overflow: hidden;
  border: 1px solid rgba(148, 105, 114, 0.25);
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(255, 255, 255, 0.75), transparent 32%),
    linear-gradient(145deg, #fff8f1, #f8e5e7 65%, #f3e7ed);
  box-shadow: var(--romantic-shadow);
}

.blank-canvas::before,
.blank-canvas::after {
  position: absolute;
  color: rgba(157, 101, 121, 0.25);
  font-family: Georgia, "Times New Roman", serif;
  pointer-events: none;
}

.blank-canvas::before {
  top: 24px;
  right: 7%;
  font-size: 3rem;
  content: "♡";
}

.blank-canvas::after {
  bottom: 20px;
  left: 7%;
  font-size: 2rem;
  content: "✧";
}

.protected-content {
  display: grid;
  min-height: 70vh;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 80px 24px 24px;
  text-align: center;
}

.protected-content h1 {
  margin-bottom: 12px;
  color: #684957;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-style: italic;
  letter-spacing: 0;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.page-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid rgba(134, 92, 106, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.88);
  box-shadow: 0 5px 14px rgba(90, 60, 67, 0.1);
  color: #704b5a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.page-link:focus-visible {
  outline: 3px solid var(--page-muted);
  outline-offset: 3px;
}

.page-link:hover {
  transform: translateY(-2px);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(90, 60, 67, 0.16);
}

.content-page {
  position: relative;
  width: min(100%, 720px);
  min-height: 70vh;
  padding: clamp(88px, 10vw, 112px) clamp(24px, 6vw, 56px) 48px;
  border: 1px solid #e6d8c8;
  border-radius: 8px 18px 18px 8px;
  background:
    linear-gradient(90deg, rgba(116, 79, 56, 0.07), transparent 2rem),
    repeating-linear-gradient(0deg, transparent 0, transparent 35px, rgba(122, 102, 77, 0.025) 36px),
    var(--paper);
  box-shadow: var(--romantic-shadow), inset 5px 0 0 rgba(155, 112, 116, 0.12);
  text-align: center;
}

.content-page h1 {
  margin-bottom: 12px;
  color: #684957;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-style: italic;
  letter-spacing: -0.02em;
}

.content-page p {
  color: var(--page-muted);
  line-height: 1.7;
}

.story-page {
  position: relative;
  width: min(100%, 900px);
  min-height: 100vh;
  padding: clamp(80px, 10vw, 112px) clamp(28px, 9vw, 104px);
  border: 1px solid #d5c6a9;
  border-left: 12px solid #805b50;
  border-radius: 6px 18px 18px 6px;
  background:
    linear-gradient(90deg, rgba(116, 79, 56, 0.08), transparent 3.5rem),
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(122, 102, 77, 0.035) 32px),
    #fffaf0;
  box-shadow:
    0 2px 4px rgba(44, 32, 24, 0.12),
    12px 16px 30px rgba(44, 32, 24, 0.18);
  color: #382d26;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
}

.story-page .eyebrow {
  color: #8a6855;
}

.story-page p {
  font-family: "Caveat", cursive;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

.story-page h1 {
  color: #493329;
  font-family: Georgia, "Times New Roman", serif;
  font-variant: small-caps;
  letter-spacing: 0.03em;
}

.story-page > h1 {
  color: #985b73;
  font-family: "Caveat", cursive;
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-variant: normal;
  font-weight: 400;
  letter-spacing: 0;
}

.story-page h1:not(:first-of-type) {
  margin: 3.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid #c9b797;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}

.story-page p:not(.eyebrow) {
  margin: 0;
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid rgba(145, 119, 83, 0.3);
  color: #493f35;
  text-align: left;
  text-indent: 2em;
  line-height: 1.7;
}

.story-page .back-button {
  background: #fffaf0;
}

.photo-album {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 24px;
  margin-top: 32px;
  padding: 18px;
  border: 1px solid rgba(134, 92, 106, 0.15);
  border-radius: 12px;
  background: rgba(245, 232, 224, 0.48);
}

.photo-slot {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 10px 10px 28px;
  border: 1px solid #eadfd4;
  background: #fffdf9;
  box-shadow: 0 5px 14px rgba(74, 52, 48, 0.14);
  object-fit: cover;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.photo-slot:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.photo-slot:nth-child(even) {
  transform: rotate(1.5deg);
}

.photo-slot:hover {
  z-index: 1;
  transform: rotate(0) scale(1.03);
  box-shadow: 0 10px 22px rgba(74, 52, 48, 0.2);
}

.home-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: 0 6px 16px rgba(90, 60, 67, 0.18);
  font-family: Georgia, "Times New Roman", serif;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.home-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 20px rgba(90, 60, 67, 0.24);
}

.home-link:focus-visible {
  outline: 3px solid var(--page-muted);
  outline-offset: 3px;
}

.back-button {
  display: grid;
  position: absolute;
  top: 16px;
  left: 16px;
  width: 48px;
  min-height: 48px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(134, 92, 106, 0.24);
  border-radius: 10px 4px 4px 10px;
  background: var(--paper);
  box-shadow: 0 4px 12px rgba(90, 60, 67, 0.12);
  color: #704b5a;
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.back-button::before {
  position: absolute;
  inset: 3px;
  border: 1px dotted rgba(134, 92, 106, 0.55);
  border-radius: 7px 3px 3px 7px;
  content: "";
  pointer-events: none;
}

.back-button span {
  position: relative;
}

.back-button:hover {
  transform: translateX(-2px);
  box-shadow: 0 6px 16px rgba(90, 60, 67, 0.18);
}

.blank-canvas[hidden] {
  position: absolute;
  width: 200px;
  height: 200px;
  background: var(--page-bg);
  border: 1px solid var(--page-border); 
}

@media (max-width: 520px) {
  .page-shell {
    padding: 16px;
  }

  .gate {
    padding: 70px 26px 30px;
  }

  .protected-content {
    padding-inline: 18px;
  }

  .content-page {
    padding-inline: 20px;
  }

  .photo-album {
    gap: 16px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
