/* Soft baby-pink palette with warm undertones, dark-red lettering, Helvetica. */
:root {
  --bg-pink: #ffe5ed;        /* page background — Primary 50, softest pink */
  --bg-pink-deep: #ffbdd2;   /* header/footer/sidebar — Primary 100 */
  --bg-card: #fff5f8;        /* article surface — near-white, pink tint */
  --dark-red: #960f55;       /* primary lettering — Primary 900, deep berry */
  --dark-red-bright: #bc165c;/* links — Primary 800 */
  --dark-red-soft: #d11a5f;  /* meta / muted lettering — Primary 700 */
  --accent: #e71e63;         /* accents (blockquote, hr) — Primary 600 */
  --splash-red: #7a0a1a;     /* splash title — true deep red, max contrast on pink */
}

/* ==========================================================================
   Cross-document view transitions — Chrome 126+ / Safari 18+ get a soft
   ~0.9s crossfade between pages with a gentle cubic-bezier so the
   splash-to-index, index-to-article, and article-to-archives navigations
   feel warm and continuous rather than abrupt. Browsers without support
   fall back to instant navigation; the destination still has its own
   entrance fade so the difference is graceful.
   ========================================================================== */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.9s;
  animation-timing-function: cubic-bezier(0.32, 0.72, 0.34, 1);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.001s;
  }
}

/* ==========================================================================
   Soft pink aura — fixed full-viewport pseudo-element with several
   heavily-blurred radial gradients that drift on a slow loop. Sits above
   the flat body background but below the page overlays, so all overlays
   inherit the glow when their own backgrounds are transparent.
   ========================================================================== */
body::before {
  content: "";
  position: fixed;
  inset: -15%;
  pointer-events: none;
  background:
    /* Bright white-pink highlight, upper-left */
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.95) 0%, transparent 38%),
    /* Saturated Primary-200 glow, upper-right */
    radial-gradient(circle at 84% 26%, rgba(255, 145, 180, 0.85) 0%, transparent 42%),
    /* Hotter pink anchor, lower-right */
    radial-gradient(circle at 72% 86%, rgba(255, 105, 165, 0.7) 0%, transparent 48%),
    /* Soft cushion, lower-left */
    radial-gradient(circle at 8% 76%, rgba(255, 200, 220, 0.95) 0%, transparent 44%),
    /* Center bloom for overall warmth */
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.45) 0%, transparent 55%);
  filter: blur(28px);
  animation: prncss-aura 18s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes prncss-aura {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%  { transform: translate(-4%, 3%) scale(1.08) rotate(2deg); }
  66%  { transform: translate(3%, -2%) scale(1.12) rotate(-1.5deg); }
  100% { transform: translate(5%, -4%) scale(1.16) rotate(2.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}

/* ==========================================================================
   FOUC guard — when any of our overlays is present, hide every other
   top-level body child so the underlying Hexo theme layout never flashes
   between page navigations. The pink body background is a belt-and-braces
   safeguard for any sub-frame paint before :has() resolves.
   ========================================================================== */
body:has(#prncss-splash),
body:has(#prncss-index),
body:has(#prncss-article) {
  background-color: var(--bg-pink);
}
body:has(#prncss-splash) > *:not(#prncss-splash):not(.prncss-banner):not(script):not(style):not(noscript),
body:has(#prncss-index) > *:not(#prncss-index):not(.prncss-banner):not(script):not(style):not(noscript),
body:has(#prncss-article) > *:not(#prncss-article):not(.prncss-banner):not(script):not(style):not(noscript) {
  display: none !important;
}

/* ==========================================================================
   Welcome-page splash
   When #prncss-splash is present (home page only), it covers everything.
   ========================================================================== */
#prncss-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  color: var(--splash-red);
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.5s ease-out;
}
#prncss-splash .prncss-line {
  display: block;
  font-size: clamp(2rem, 11vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}
#prncss-splash #prncss-enter {
  margin-top: clamp(1.5rem, 6vw, 3rem);
  font-size: clamp(0.75rem, 3vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: lowercase;
  opacity: 0;
  animation: prncss-enter-fade 0.9s ease-out 2s forwards;
  color: var(--splash-red);
}
@keyframes prncss-enter-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 0.75; transform: translateY(0); }
}
/* When splash is shown, lock body scroll so chrome behind it can't peek */
body:has(#prncss-splash) {
  overflow: hidden;
}

/* ==========================================================================
   Persistent brand banner — sits above page overlays. Tap to return to splash.
   Always static — no scatter, drift, or sparkle.
   ========================================================================== */
.prncss-banner {
  position: fixed;
  top: clamp(0.75rem, 2.5vh, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  color: var(--splash-red);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1.05;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease-out;
}
.prncss-banner .prncss-banner__line {
  font-size: clamp(0.65rem, 2.4vw, 0.9rem);
  display: block;
}
.prncss-banner:hover,
.prncss-banner:focus {
  opacity: 0.65;
  outline: none;
}

/* ==========================================================================
   Archive (article index) — placeholder list, blank pink page.
   ========================================================================== */
#prncss-index {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  color: var(--splash-red);
  text-align: center;
  overflow-y: auto;
  padding: clamp(5.5rem, 14vh, 7rem) 1.5rem 4rem;
  -webkit-tap-highlight-color: transparent;
}
#prncss-index .prncss-index-list {
  list-style: none;
  padding: 0;
  margin: 0;
  /* Soft welcome — list rises gently after the cross-page crossfade. */
  animation: prncss-index-enter 1s cubic-bezier(0.32, 0.72, 0.34, 1) 0.15s both;
}
@keyframes prncss-index-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #prncss-index .prncss-index-list {
    animation: none;
  }
}
#prncss-index .prncss-index-item {
  font-size: clamp(0.75rem, 3vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: lowercase;
  margin: 1.4em 0;
  color: var(--splash-red);
}
#prncss-index .prncss-index-item::before {
  content: "\2661"; /* ♡ — white heart suit */
  margin-right: 0.6em;
  letter-spacing: normal;
  display: inline-block;
}
#prncss-index .prncss-index-link {
  color: var(--splash-red) !important;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
#prncss-index .prncss-index-link:hover,
#prncss-index .prncss-index-link:focus {
  opacity: 0.7;
}
body:has(#prncss-index) {
  overflow: hidden;
}

/* ==========================================================================
   Post page — scattered-letters article that assembles on tap.
   ========================================================================== */
#prncss-article {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: transparent;
  color: var(--splash-red);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* No artificial entry fade — the article is on-screen the moment its
     HTML is parsed, so any sluggishness is real sluggishness. The body's
     block children are individually hidden until `.fading`, and that's
     where the soft entrance lives. */
}
#prncss-article.settled {
  overflow-y: auto;
  cursor: default;
}
#prncss-article .prncss-article__inner {
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(5.5rem, 14vh, 7rem) 1.5rem clamp(2.5rem, 10vh, 5rem);
}
#prncss-article .prncss-article__title {
  font-size: clamp(1.75rem, 8vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 2rem 0;
  text-align: center;
  color: var(--splash-red);
}
#prncss-article .prncss-article__body {
  position: relative;
  font-size: clamp(1rem, 3.6vw, 1.05rem);
  line-height: 1.7;
}
#prncss-article .prncss-article__body p {
  margin: 0 0 1.2em 0;
}
/* The real body's block children are hidden behind the chaos overlay
   while it's running. They fade in via `.fading`, which is added partway
   through the settle so the natural-kerned text emerges through the
   still-resolving chaos. Then the overlay is removed from the DOM and
   reading happens on plain HTML — no per-letter spans. */
#prncss-article .prncss-article__body > :not(.prncss-article__effect) {
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.32, 0.72, 0.34, 1);
}
#prncss-article.fading .prncss-article__body > :not(.prncss-article__effect) {
  opacity: 1;
}
.prncss-article__effect {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  /* Inherits font, color, line-height from the body. */
  transition: opacity 0.9s cubic-bezier(0.32, 0.72, 0.34, 1);
}
#prncss-article.fading .prncss-article__effect {
  opacity: 0;
}
#prncss-article .prncss-article__back {
  display: block;
  text-align: center;
  margin: clamp(2.5rem, 9vh, 5rem) 0 0 0;
  font-size: clamp(0.75rem, 3vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: lowercase;
  color: var(--splash-red);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  /* Hidden during chaos so the escape hatch only appears once the article
     has assembled and the user is in reading mode. Always static — no
     scatter, no drift, no sparkle. */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease-out 0.3s;
}
#prncss-article.settled .prncss-article__back {
  opacity: 0.85;
  pointer-events: auto;
}
#prncss-article .prncss-article__back:hover,
#prncss-article .prncss-article__back:focus {
  opacity: 1;
}
.prncss-char {
  display: inline-block;
  transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg));
  transition: transform 2.8s cubic-bezier(0.16, 1, 0.3, 1) var(--delay, 0s);
  will-change: transform;
}
#prncss-article.settled .prncss-char {
  transform: none;
}
.prncss-char__inner {
  display: inline-block;
  /* Always-armed transition catches the wind-down when animation is removed
     (leaving the viewport, tapping to settle, or freezing) so motion fades
     smoothly to baseline instead of snapping. */
  transition:
    transform 0.7s ease-out,
    opacity 0.7s ease-out,
    text-shadow 0.7s ease-out;
}
/* Drift + sparkle run on every wrapped char while we're in the chaos
   state. We don't need a viewport gate here anymore: the universe of
   wrapped chars is bounded by viewport size at build time (JS only wraps
   blocks currently in view), so animating all of them is cheap. The
   moment `.settled` is added the animations drop and the expensive
   text-shadow paint stops, leaving the outer settle transition to run
   uncontested. */
#prncss-article:not(.settled) .prncss-char__inner {
  animation:
    prncss-drift var(--drift-dur, 4.5s) ease-in-out var(--drift-delay, 0s) infinite alternate,
    prncss-sparkle var(--sparkle-dur, 3.8s) ease-in-out var(--sparkle-delay, 0s) infinite;
  will-change: transform, opacity, text-shadow;
}
#prncss-article.frozen .prncss-char__inner {
  animation: none;
  transform: none;
  opacity: 1;
  text-shadow: none;
  will-change: auto;
}
#prncss-article.frozen .prncss-char {
  will-change: auto;
}
@keyframes prncss-drift {
  from {
    transform: translate(0, 0) rotate(0deg);
  }
  to {
    transform:
      translate(var(--drift-x, 0), var(--drift-y, 0))
      rotate(var(--drift-rot, 0deg));
  }
}
@keyframes prncss-sparkle {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 0 transparent;
  }
  45% {
    opacity: 0.78;
    text-shadow:
      0 0 5px rgba(255, 145, 180, 0.55),
      0 0 11px rgba(255, 145, 180, 0.35);
  }
  55% {
    opacity: 1;
    text-shadow:
      0 0 6px rgba(255, 220, 230, 0.7),
      0 0 14px rgba(255, 145, 180, 0.4);
  }
}
@media (prefers-reduced-motion: reduce) {
  .prncss-char__inner {
    animation: none;
  }
  .prncss-char {
    transition-duration: 0.5s;
  }
  /* JS short-circuits the overlay entirely in reduced-motion, so the body
     also skips its 0.9s fade-in — content is on-screen instantly. */
  #prncss-article .prncss-article__body > :not(.prncss-article__effect) {
    opacity: 1;
    transition: none;
  }
}
body:has(#prncss-article) {
  overflow: hidden;
}

html, body {
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif !important;
  background-color: var(--bg-pink) !important;
  color: var(--dark-red) !important;
}

* {
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif !important;
}

/* Keep monospace blocks readable */
code, pre, kbd, samp, tt {
  font-family: "Source Code Pro", Consolas, Monaco, Menlo, monospace !important;
  color: var(--dark-red) !important;
}

/* Header / banner */
#header, .header-inner, #banner {
  background-color: var(--bg-pink-deep) !important;
  color: var(--dark-red) !important;
}
#header a, .logo, .site-title, .site-subtitle, #banner h1, #banner h2 {
  color: var(--dark-red) !important;
}

/* Main column / articles */
.outer, .inner, #main, #content {
  background-color: transparent !important;
}
.article, .article-inner, .post, .post-block {
  background-color: var(--bg-card) !important;
  color: var(--dark-red) !important;
  box-shadow: 0 1px 3px rgba(107, 30, 30, 0.08);
}

/* Headings & titles */
h1, h2, h3, h4, h5, h6,
.article-title, .post-title, .archive-article-title,
.article-entry, .article-entry p, .article-entry li, .article-entry blockquote {
  color: var(--dark-red) !important;
}
.article-title a, .post-title a, .archive-article-title a {
  color: var(--dark-red) !important;
}

/* Meta / info / dates — slightly muted dark red */
.article-meta, .article-info, .article-date, .article-category,
.article-tag-list, .post-meta, .archive-article-date, time {
  color: var(--dark-red-soft) !important;
}

/* Links */
a, a:visited {
  color: var(--dark-red-bright) !important;
}
a:hover, a:active {
  color: var(--dark-red) !important;
}

/* Sidebar / widgets */
.sidebar, #sidebar, .widget, .widget-wrap {
  background-color: var(--bg-pink-deep) !important;
  color: var(--dark-red) !important;
  border-color: var(--dark-red-soft) !important;
}
.widget a, .sidebar a {
  color: var(--dark-red-bright) !important;
}

/* Footer */
#footer, .footer-inner {
  background-color: var(--bg-pink-deep) !important;
  color: var(--dark-red) !important;
}
#footer a {
  color: var(--dark-red-bright) !important;
}

/* Misc lettering details */
blockquote {
  border-left-color: var(--accent) !important;
  color: var(--dark-red) !important;
}
hr {
  border-color: var(--accent) !important;
}
table, th, td {
  border-color: var(--dark-red-soft) !important;
  color: var(--dark-red) !important;
}
