:root {
  --scrapbook-ink: #25152e;
  --scrapbook-plum: #4c264f;
  --scrapbook-paper: #fffdf3;
  --scrapbook-canvas: #ddd0ff;
  --scrapbook-pink: #ff668f;
  --scrapbook-red: #b42348;
  --scrapbook-yellow: #ffe66d;
  --scrapbook-blue: #77d8f7;
  --scrapbook-mint: #a8e6cf;
  --scrapbook-line: 3px solid var(--scrapbook-ink);
  --scrapbook-shadow: 7px 7px 0 var(--scrapbook-ink);
}

html {
  color-scheme: light;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--scrapbook-ink) !important;
  background-color: var(--scrapbook-canvas) !important;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(37, 21, 46, 0.17) 1.3px, transparent 1.4px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 25%, transparent 25% 75%, rgba(255, 255, 255, 0.18) 75%) !important;
  background-size: 22px 22px, 44px 44px !important;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif !important;
  line-height: 1.6;
}

h1,
h2,
h3 {
  color: var(--scrapbook-red) !important;
  font-family: "Arial Black", Impact, "Trebuchet MS", sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: -0.045em !important;
  line-height: 1.08 !important;
  text-shadow: 2px 2px 0 var(--scrapbook-yellow);
  text-wrap: balance;
}

a {
  color: var(--scrapbook-red) !important;
  font-weight: 800;
  text-decoration-color: var(--scrapbook-red);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

iframe {
  max-width: 100%;
  background: #fff;
  border: var(--scrapbook-line) !important;
  box-shadow: var(--scrapbook-shadow);
}

/* Static Rails error pages stay useful when the application cannot boot. */
.rails-default-error-page {
  display: flow-root !important;
  text-align: center;
}

.rails-default-error-page .dialog {
  width: calc(100% - 2rem) !important;
  max-width: 40rem !important;
  margin: clamp(1.5rem, 6vh, 3rem) auto 0 !important;
  transform: rotate(-0.7deg);
}

.rails-default-error-page .dialog > div,
.rails-default-error-page .dialog > p {
  color: var(--scrapbook-ink) !important;
  background: var(--scrapbook-paper) !important;
  border: var(--scrapbook-line) !important;
  border-radius: 3px !important;
  box-shadow: var(--scrapbook-shadow) !important;
}

.rails-default-error-page .dialog > div {
  padding: clamp(1.25rem, 4vw, 2.5rem) !important;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 30px, rgba(119, 216, 247, 0.2) 30px, rgba(119, 216, 247, 0.2) 32px) !important;
}

.rails-default-error-page h1 {
  font-size: clamp(2rem, 8vw, 4rem) !important;
}

.rails-default-error-page .dialog > p {
  margin: 1.2rem 0 0 !important;
  padding: 1rem !important;
  background: var(--scrapbook-yellow) !important;
  font-family: "Courier New", monospace;
}

/* The standalone Oasis toy keeps its behavior, now inside the same zine shell. */
body.bg-gray-900 {
  color: var(--scrapbook-ink) !important;
}

body.bg-gray-900 > .container {
  width: calc(100% - 2rem) !important;
  max-width: 850px !important;
  margin: 2rem auto !important;
  padding: clamp(1rem, 4vw, 2rem) !important;
  background: var(--scrapbook-paper) !important;
  border: var(--scrapbook-line);
  box-shadow: 12px 12px 0 var(--scrapbook-ink);
}

body.bg-gray-900 > .container > h1 {
  color: var(--scrapbook-red) !important;
  font-size: clamp(2.4rem, 8vw, 5rem) !important;
}

body.bg-gray-900 .bg-gray-800 {
  color: var(--scrapbook-ink) !important;
  background: var(--scrapbook-yellow) !important;
  border: var(--scrapbook-line) !important;
  border-radius: 3px !important;
  box-shadow: var(--scrapbook-shadow) !important;
  transform: rotate(-0.45deg);
}

body.bg-gray-900 .bg-gray-800:nth-of-type(even) {
  background: var(--scrapbook-blue) !important;
  transform: rotate(0.55deg);
}

body.bg-gray-900 .text-yellow-400,
body.bg-gray-900 .text-white {
  color: var(--scrapbook-ink) !important;
}

/* Rickroll remains a single clear joke, presented like a pasted media card. */
body.rickroll-page {
  box-sizing: border-box;
  height: auto !important;
  min-height: 100vh;
  padding: clamp(1rem, 5vw, 4rem);
}

.rickroll-page h1 {
  padding: 0.5rem 1rem;
  background: var(--scrapbook-yellow);
  border: var(--scrapbook-line);
  box-shadow: 4px 4px 0 var(--scrapbook-ink);
  transform: rotate(-2deg);
}

/* The legacy long-form Instagram guide retains every word and metadata tag. */
body.doc-content {
  box-sizing: border-box;
  width: calc(100% - 2rem) !important;
  max-width: 800px !important;
  margin: 2rem auto !important;
  padding: clamp(1.25rem, 6vw, 4rem) !important;
  color: var(--scrapbook-ink) !important;
  background-color: var(--scrapbook-paper) !important;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(119, 216, 247, 0.15) 31px, rgba(119, 216, 247, 0.15) 33px) !important;
  border: var(--scrapbook-line);
  box-shadow: 12px 12px 0 var(--scrapbook-ink);
}

body.doc-content nav {
  margin: -1rem -1rem 1rem;
  background: var(--scrapbook-pink);
  border: var(--scrapbook-line);
  box-shadow: 3px 3px 0 var(--scrapbook-ink);
  transform: rotate(-0.5deg);
}

body.doc-content .title {
  padding-top: 0 !important;
}

body.doc-content nav a,
body.doc-content > a {
  display: inline-block;
  color: var(--scrapbook-ink) !important;
  font-family: "Courier New", monospace !important;
  font-size: clamp(1rem, 3vw, 1.35rem) !important;
}

body.doc-content p,
body.doc-content li,
body.doc-content span {
  color: var(--scrapbook-ink) !important;
  font-family: "Trebuchet MS", Arial, sans-serif !important;
  font-size: 1rem !important;
  line-height: 1.75 !important;
}

body.doc-content h1 {
  font-size: clamp(2.35rem, 7vw, 4.5rem) !important;
}

body.doc-content h2 {
  margin-top: 2.5rem !important;
  padding: 0.6rem 0.8rem !important;
  background: var(--scrapbook-yellow);
  border: 2px dashed var(--scrapbook-ink);
  font-size: clamp(1.6rem, 5vw, 2.6rem) !important;
  transform: rotate(-0.35deg);
}

body.doc-content li::marker {
  color: var(--scrapbook-red);
  font-weight: 900;
}

:focus-visible {
  outline: 4px solid var(--scrapbook-blue) !important;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px var(--scrapbook-ink) !important;
}

@media (max-width: 600px) {
  body.bg-gray-900 > .container,
  body.doc-content {
    width: calc(100% - 1rem) !important;
    margin: 1rem auto !important;
    box-shadow: 6px 6px 0 var(--scrapbook-ink);
  }

  .rickroll-page iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
