body {
  font-family: "Source Serif 4", "Georgia", serif;
  margin: auto;
  padding: 2rem 1.5rem;
  max-width: 860px;
  text-align: left;
  background-color: #fff;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
  color: #333;
  transition: background-color 0.3s ease, color 0.3s ease;
}

@media (max-width: 480px) {
  body {
    padding: 1.5rem 1rem;
  }
}

details > div {
  padding: 1em;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b {
  color: #111;
  font-family: "Apple Garamond", "Garamond", "Source Serif 4", serif;
}

h1 { font-weight: 600; }
h2 { font-weight: 600; }

a {
  color: #667eea;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.7;
}

.title {
  text-decoration: none;
  border: 0;
}

.title h1 {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (max-width: 480px) {
  .title h1 {
    font-size: 1.8rem;
  }
}

.title span {
  font-weight: 400;
}

.bear::before {
  content: "ᕦʕ •ᴥ•ʔᕤ";
  font-weight: 400;
}

.bear:hover::before {
  content: "ᕙʕ ಠᴥಠʔᕗ";
  font-weight: 400;
}

/* Landing page */
.home-main {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  max-width: none;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.home-main .landing {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 0 2rem;
  max-width: 900px;
  animation: landingFadeIn 1.2s ease both;
}

.home-main .landing-image-wrap {
  animation: landingSlideUp 1s ease 0.1s both;
}

.home-main .landing-text {
  animation: landingSlideUp 1s ease 0.3s both;
}

@keyframes landingFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes landingSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .home-main .landing,
  .home-main .landing-image-wrap,
  .home-main .landing-text {
    animation: none;
  }
}

.landing {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 0 2rem;
  max-width: 900px;
}

.landing-image-wrap {
  flex-shrink: 0;
  text-align: center;
}

.landing-image {
  width: clamp(260px, 38vw, 440px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.landing-caption {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #999;
  font-style: italic;
  letter-spacing: 0.02em;
  min-height: 1.2em;
}

.landing-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

.landing-name {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
  line-height: 1.1;
  color: #111;
}

.landing-question {
  font-size: 0.95rem;
  font-style: italic;
  color: #777;
  line-height: 1.4;
  cursor: pointer;
  transition: opacity 0.3s ease;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.6rem;
  white-space: normal;
}

.landing-question:hover {
  opacity: 0.6;
}

.landing-question.fade-out {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.landing-nav {
  display: flex;
  gap: 1.5rem;
}

.landing-nav a {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  transition: color 0.2s ease;
}

.landing-nav a:hover {
  color: #667eea;
  opacity: 1;
}

/* Landing dark colors handled by reveal.js inline styles */

@media (max-width: 640px) {
  .landing {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    padding: 0 1rem;
  }
  .landing-text {
    align-items: center;
  }
  .landing-name {
    font-size: 1.5rem;
  }
  .landing-question {
    font-size: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: max-content;
    max-width: 90vw;
  }
  .landing-image {
    width: clamp(180px, 55vw, 280px);
  }
  .landing-nav {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Contact icons — fixed bottom right */
.contact-icons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 14px;
  z-index: 998;
  align-items: center;
}

.contact-icons a {
  color: #bbb;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.contact-icons a:hover {
  color: #667eea;
  opacity: 1;
}

body.dark-mode .contact-icons a,
body.unlocked-bg .contact-icons a {
  color: #555;
}
body.dark-mode .contact-icons a:hover,
body.unlocked-bg .contact-icons a:hover {
  color: #667eea;
}

nav a {
  margin-right: 14px;
  font-size: 0.9rem;
  color: #666;
  transition: color 0.2s ease;
}

nav a:hover {
  color: #111;
  opacity: 1;
}

textarea,
input:not([type="submit"]) {
  background-color: inherit;
  color: inherit;
  border: 1px dashed;
  padding: 5px;
  font-size: 16px;
}

.full-width textarea,
.full-width input:not([type="submit"], [type="checkbox"], [type="radio"]) {
  width: calc(100% - 15px);
}

.nav-image {
  height: 3.14rem;
  border-radius: 12.5%;
}

textarea:required,
input:required:not([type="submit"]) {
  border: 1px solid;
}

textarea.full-screen {
  position: fixed;
  background-color: white;
  top: -2px;
  bottom: -2px;
  left: 0;
  width: calc(100vw - 30px);
  max-width: 720px;
  border: 10px solid;
  border-width: 10px calc(50vw - 370px);
}

@media only screen and (max-width: 750px) {
  textarea.full-screen {
    border-width: 10px;
  }
}

button.floating {
  position: fixed;
  bottom: 20px;
  right: 25px;
}

button#toggle-full-screen {
  float: right;
}

content {
  line-height: 1.6;
}

table {
  width: 100%;
}

hr {
  border: none;
  border-top: 1px solid #e0e0e0;
}

/* hr dark colors handled by .dark-mode/.unlocked-bg rules */

figure img,
figure video,
.centered {
  width: 60%;
  margin: 0 auto;
  display: block;
}

figure figcaption {
  text-align: center;
  font-size: 0.8em;
  padding-top: 0.5em;
}

code {
  font-family: monospace;
  background-color: #2e3e4e;
  color: #eee;
  border-radius: 3px;
  padding: 2px 5px 2px 5px;
}

blockquote {
  border-left: 2px solid #ddd;
  color: #555;
  padding-left: 20px;
  font-style: italic;
  margin-left: 0;
}

footer {
  padding: 25px 0;
  text-align: left;
}

.helptext {
  color: #777;
  font-size: small;
}

.errorlist {
  color: #eba613;
  font-size: small;
}

.footnotes {
  font-size: small;
}

#id_favicon {
  width: 20px;
  text-align: center;
}

#date-range,
#initial-values,
#import-contacts {
  display: none;
}

#date-range:target,
#initial-values:target,
#import-contacts:target {
  display: block;
}

/* dashboard post list and analytics */
ul.post-list {
  list-style-type: none;
  padding: unset;
}

ul.post-list li {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px dashed;
}

ul.post-list li span {
  flex: 0 0 130px;
}

ul.post-list li span.number {
  flex: 0 0 50px;
}

ul.post-list li a {
  flex: max-content;
}

ul.post-list li small {
  text-align: right;
  flex: 0 0 115px;
}

/* blog posts */
ul.blog-posts {
  list-style-type: none;
  padding: unset;
}

ul.blog-posts li {
  display: flex;
  align-items: baseline;
}

ul.blog-posts li span {
  flex: 0 0 130px;
}

ul.blog-posts li span:first-child {
  color: #999;
  font-size: 0.85rem;
}

ul.blog-posts li span:first-child i {
  font-style: normal;
}

ul.blog-posts li a {
  font-size: 1rem;
}

a.page-link.active {
  font-weight: 600;
}

/* discovery feed */
ul.discover-posts {
  list-style-type: none;
  padding: unset;
}

ul.discover-posts li {
  display: flex;
  line-height: 1.2;
}

ul.discover-posts li span {
  flex: 0 0 40px;
}

ul.discover-posts li a:visited {
  color: #8b6fcb;
}

ul.discover-posts li div {
  padding-bottom: 8px;
}

ul.discover-posts li small {
  color: #777 !important;
}

ul.discover-posts li small a {
  color: #777 !important;
}

.highlight,
.code,
pre {
  background-color: #2e3e4e;
  color: #eee;
  border-radius: 3px;
  overflow: auto;
}

pre {
  padding: 1em;
  padding-top: 0.3em;
  margin: 0;
}

.highlight code,
pre code {
  padding: 0;
}

/* Dark mode styles — applied via .dark-mode class, not system preference */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode strong,
body.dark-mode b {
  color: #eee;
}
body.dark-mode a {
  color: #667eea;
}
body.dark-mode nav a {
  color: #999;
}
body.dark-mode nav a:hover {
  color: #eee;
}
body.dark-mode code,
body.dark-mode .highlight,
body.dark-mode .code {
  background-color: #2a2a2a;
}
body.dark-mode pre code {
  color: #ddd;
}
body.dark-mode blockquote {
  border-left-color: #444;
  color: #ccc;
}
body.dark-mode .helptext {
  color: #aaa;
}

/* Unlocked/starry mode inherits same text styles */
body.unlocked-bg h1,
body.unlocked-bg h2,
body.unlocked-bg h3,
body.unlocked-bg h4,
body.unlocked-bg h5,
body.unlocked-bg h6,
body.unlocked-bg strong,
body.unlocked-bg b {
  color: #eee;
}
body.unlocked-bg a {
  color: #667eea;
}
body.unlocked-bg nav a {
  color: #999;
}
body.unlocked-bg nav a:hover {
  color: #eee;
}
body.unlocked-bg code,
body.unlocked-bg .highlight,
body.unlocked-bg .code {
  background-color: #2a2a2a;
}
body.unlocked-bg pre code {
  color: #ddd;
}
body.unlocked-bg blockquote {
  border-left-color: #444;
  color: #ccc;
}
body.unlocked-bg .helptext {
  color: #aaa;
}

ul.blog-posts {
  padding-bottom: 0.61803rem;
}

ul.blog-posts li {
  padding-top: 0.61803rem;
}

@media (max-width: 640px) {
  ul.blog-posts li {
    flex-wrap: wrap;
    gap: 0;
  }
  ul.blog-posts li span {
    flex: 0 0 auto;
  }
  ul.blog-posts li span:first-child {
    flex: 0 0 100%;
    font-size: 0.75rem;
    margin-bottom: 0.15rem;
  }
  ul.blog-posts li a {
    font-size: 0.95rem;
  }
  ul.blog-posts li span:last-child {
    display: none;
  }
}

small a {
  padding-right: 0.61803rem;
}

hr {
  border: none;
  border-top: 1px solid #e0e0e0;
}

/* hr dark colors handled by .dark-mode/.unlocked-bg rules */

small a {
  padding-right: 0.61803rem;
}

.bottom-footer {
  padding: 50px;
  text-align: center;
}

.highlight .hll {
  background-color: #373b41;
}
.highlight .c {
  color: #969896;
} /* Comment */
.highlight .err {
  color: #cc6666;
} /* Error */
.highlight .k {
  color: #b294bb;
} /* Keyword */
.highlight .l {
  color: #de935f;
} /* Literal */
.highlight .n,
.highlight .h {
  color: #ffffff;
} /* Name */
.highlight .o {
  color: #8abeb7;
} /* Operator */
.highlight .p {
  color: #ffffff;
} /* Punctuation */
.highlight .cm {
  color: #969896;
} /* Comment.Multiline */
.highlight .cp {
  color: #969896;
} /* Comment.Preproc */
.highlight .c1 {
  color: #969896;
} /* Comment.Single */
.highlight .cs {
  color: #969896;
} /* Comment.Special */
.highlight .gd {
  color: #cc6666;
} /* Generic.Deleted */
.highlight .ge {
  font-style: italic;
} /* Generic.Emph */
.highlight .gh {
  color: #ffffff;
  font-weight: bold;
} /* Generic.Heading */
.highlight .gi {
  color: #b5bd68;
} /* Generic.Inserted */
.highlight .gp {
  color: #969896;
  font-weight: bold;
} /* Generic.Prompt */
.highlight .gs {
  font-weight: bold;
} /* Generic.Strong */
.highlight .gu {
  color: #8abeb7;
  font-weight: bold;
} /* Generic.Subheading */
.highlight .kc {
  color: #b294bb;
} /* Keyword.Constant */
.highlight .kd {
  color: #b294bb;
} /* Keyword.Declaration */
.highlight .kn {
  color: #8abeb7;
} /* Keyword.Namespace */
.highlight .kp {
  color: #b294bb;
} /* Keyword.Pseudo */
.highlight .kr {
  color: #b294bb;
} /* Keyword.Reserved */
.highlight .kt {
  color: #f0c674;
} /* Keyword.Type */
.highlight .ld {
  color: #b5bd68;
} /* Literal.Date */
.highlight .m {
  color: #de935f;
} /* Literal.Number */
.highlight .s {
  color: #b5bd68;
} /* Literal.String */
.highlight .na {
  color: #81a2be;
} /* Name.Attribute */
.highlight .nb {
  color: #ffffff;
} /* Name.Builtin */
.highlight .nc {
  color: #f0c674;
} /* Name.Class */
.highlight .no {
  color: #cc6666;
} /* Name.Constant */
.highlight .nd {
  color: #8abeb7;
} /* Name.Decorator */
.highlight .ni {
  color: #ffffff;
} /* Name.Entity */
.highlight .ne {
  color: #cc6666;
} /* Name.Exception */
.highlight .nf {
  color: #81a2be;
} /* Name.Function */
.highlight .nl {
  color: #ffffff;
} /* Name.Label */
.highlight .nn {
  color: #f0c674;
} /* Name.Namespace */
.highlight .nx {
  color: #81a2be;
} /* Name.Other */
.highlight .py {
  color: #ffffff;
} /* Name.Property */
.highlight .nt {
  color: #8abeb7;
} /* Name.Tag */
.highlight .nv {
  color: #cc6666;
} /* Name.Variable */
.highlight .ow {
  color: #8abeb7;
} /* Operator.Word */
.highlight .w {
  color: #ffffff;
} /* Text.Whitespace */
.highlight .mf {
  color: #de935f;
} /* Literal.Number.Float */
.highlight .mh {
  color: #de935f;
} /* Literal.Number.Hex */
.highlight .mi {
  color: #de935f;
} /* Literal.Number.Integer */
.highlight .mo {
  color: #de935f;
} /* Literal.Number.Oct */
.highlight .sb {
  color: #b5bd68;
} /* Literal.String.Backtick */
.highlight .sc {
  color: #ffffff;
} /* Literal.String.Char */
.highlight .sd {
  color: #969896;
} /* Literal.String.Doc */
.highlight .s2 {
  color: #b5bd68;
} /* Literal.String.Double */
.highlight .se {
  color: #de935f;
} /* Literal.String.Escape */
.highlight .sh {
  color: #b5bd68;
} /* Literal.String.Heredoc */
.highlight .si {
  color: #de935f;
} /* Literal.String.Interpol */
.highlight .sx {
  color: #b5bd68;
} /* Literal.String.Other */
.highlight .sr {
  color: #b5bd68;
} /* Literal.String.Regex */
.highlight .s1 {
  color: #b5bd68;
} /* Literal.String.Single */
.highlight .ss {
  color: #b5bd68;
} /* Literal.String.Symbol */
.highlight .bp {
  color: #ffffff;
} /* Name.Builtin.Pseudo */
.highlight .vc {
  color: #cc6666;
} /* Name.Variable.Class */
.highlight .vg {
  color: #cc6666;
} /* Name.Variable.Global */
.highlight .vi {
  color: #cc6666;
} /* Name.Variable.Instance */
.highlight .il {
  color: #de935f;
} /* Literal.Number.Integer.Long */

/* Citation block */
.citation-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: #999;
  list-style: none;
  display: inline;
}
.citation-details summary::-webkit-details-marker {
  display: none;
}
.citation-details summary:hover {
  color: #667eea;
}
.citation-details[open] {
  flex-basis: 100%;
}
pre.citation {
  background-color: #f5f5f5;
  border: 1px solid #e5e7eb;
  color: #888;
  font-size: 0.8rem;
  padding: 0.75em 1em;
  margin-top: 0.5em;
  line-height: 1.5;
}
pre.citation code {
  background: transparent;
  color: inherit;
}
body.dark-mode pre.citation,
body.unlocked-bg pre.citation {
  background-color: #242424;
  border-color: #333;
  color: #888;
}

/* Copy Code block */
.code-link {
  color: #ffffff80;
  font-size: smaller;
  margin-right: 1em;
}

.code-link:hover {
  color: #f0c674;
}

.code-div {
  margin-bottom: 1em;
}

pre.collapsed {
  max-height: 300px;
}

.page-links-container {
  margin-top: 1em;
}

.table-of-contents {
  margin-top: 1em;
}

#blog-contents > img,
#blog-contents > p > img,
#blog-contents > svg {
  width: 80%;
  display: block;
  margin: auto;
  padding: 1em 0 1em 0;

  text {
    font-size: 25px;
    text-anchor: middle;
  }
}

@media (max-width: 640px) {
  #blog-contents > img,
  #blog-contents > p > img,
  #blog-contents > svg {
    width: 100%;
  }
  figure img,
  figure video,
  .centered {
    width: 100%;
  }
}

.color-a-stroke {
  stroke: #ff0000;
  @media (prefers-color-scheme: dark) {
    stroke: #ff0000;
  }
}
.color-a-fill {
  fill: #ff0000;
  @media (prefers-color-scheme: dark) {
    fill: #ff0000;
  }
}
.color-a {
  color: #ff0000;
  @media (prefers-color-scheme: dark) {
    color: #ff0000;
  }
}
.color-b-stroke {
  stroke: #00aa23;
  @media (prefers-color-scheme: dark) {
    stroke: #00aa23;
  }
}
.color-b-fill {
  fill: #00aa23;
  @media (prefers-color-scheme: dark) {
    fill: #00aa23;
  }
}
.color-b {
  color: #00aa23;
  @media (prefers-color-scheme: dark) {
    color: #00aa23;
  }
}
.color-c-stroke {
  stroke: #17009e;
  @media (prefers-color-scheme: dark) {
    stroke: #8c81cc;
  }
}
.color-c-fill {
  fill: #17009e;
  @media (prefers-color-scheme: dark) {
    fill: #8c81cc;
  }
}
.color-c {
  color: #17009e;
  @media (prefers-color-scheme: dark) {
    color: #8c81cc;
  }
}
.color-d-stroke {
  stroke: #ff00ff;
  @media (prefers-color-scheme: dark) {
    stroke: #ff00ff;
  }
}
.color-d-fill {
  fill: #ff00ff;
  @media (prefers-color-scheme: dark) {
    fill: #ff00ff;
  }
}
.color-d {
  color: #ff00ff;
  @media (prefers-color-scheme: dark) {
    color: #ff00ff;
  }
}
.color-e-stroke {
  stroke: #55d5d5;
  @media (prefers-color-scheme: dark) {
    stroke: #55d5d5;
  }
}
.color-e-fill {
  fill: #55d5d5;
  @media (prefers-color-scheme: dark) {
    fill: #55d5d5;
  }
}
.color-e {
  color: #55d5d5;
  @media (prefers-color-scheme: dark) {
    color: #55d5d5;
  }
}
.color-f-stroke {
  stroke: #f7a949;
  @media (prefers-color-scheme: dark) {
    stroke: #f7a949;
  }
}
.color-f-fill {
  fill: #f7a949;
  @media (prefers-color-scheme: dark) {
    fill: #f7a949;
  }
}
.color-f {
  color: #f7a949;
  @media (prefers-color-scheme: dark) {
    color: #f7a949;
  }
}
.color-g-stroke {
  stroke: #891eca;
  @media (prefers-color-scheme: dark) {
    stroke: #a463cd;
  }
}
.color-g-fill {
  fill: #891eca;
  @media (prefers-color-scheme: dark) {
    fill: #a463cd;
  }
}
.color-g {
  color: #891eca;
  @media (prefers-color-scheme: dark) {
    color: #a463cd;
  }
}
.color-h-stroke {
  stroke: #353639;
  @media (prefers-color-scheme: dark) {
    stroke: #bdc2d1;
  }
}
.color-h-fill {
  fill: #353639;
  @media (prefers-color-scheme: dark) {
    fill: #bdc2d1;
  }
}
.color-h {
  color: #353639;
  @media (prefers-color-scheme: dark) {
    color: #bdc2d1;
  }
}
.color-i-stroke {
  stroke: #bc201e;
  @media (prefers-color-scheme: dark) {
    stroke: #cc5d5b;
  }
}
.color-i-fill {
  fill: #bc201e;
  @media (prefers-color-scheme: dark) {
    fill: #cc5d5b;
  }
}
.color-i {
  color: #bc201e;
  @media (prefers-color-scheme: dark) {
    color: #cc5d5b;
  }
}
.color-j-stroke {
  stroke: #696b94;
  @media (prefers-color-scheme: dark) {
    stroke: #696b94;
  }
}
.color-j-fill {
  fill: #696b94;
  @media (prefers-color-scheme: dark) {
    fill: #696b94;
  }
}
.color-j {
  color: #696b94;
  @media (prefers-color-scheme: dark) {
    color: #696b94;
  }
}

/* Timeline styling for Recent section */
.timeline-entry {
  display: flex;
  margin-bottom: 1.2em;
  line-height: 1.4;
}

.timeline-date {
  flex: 0 0 140px;
  font-weight: bold;
  padding-right: 20px;
}

.timeline-content {
  flex: 1;
  padding-left: 0;
}

@media (max-width: 600px) {
  .timeline-entry {
    flex-direction: column;
    margin-bottom: 1.5em;
  }
  
  .timeline-date {
    flex: none;
    margin-bottom: 0.3em;
  }
  
  .timeline-content {
    padding-left: 0;
  }
}

.light-fill {
  fill: rgb(255, 255, 255);
  @media (prefers-color-scheme: dark) {
    fill: rgb(18, 19, 20);
  }
}
.dark-fill {
  fill: rgb(18, 19, 20);
  @media (prefers-color-scheme: dark) {
    fill: rgb(255, 255, 255);
  }
}
.light-stroke {
  stroke: rgb(255, 255, 255);
  @media (prefers-color-scheme: dark) {
    stroke: rgb(18, 19, 20);
  }
}
.dark-stroke {
  stroke: rgb(18, 19, 20);
  @media (prefers-color-scheme: dark) {
    stroke: rgb(255, 255, 255);
  }
}

/* Puzzle Easter Egg */
#puzzle-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
}

.puzzle-icon {
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.3s ease, color 0.3s ease;
  padding: 8px;
  color: inherit;
}

.puzzle-icon:hover {
  opacity: 0.8;
}

.puzzle-board {
  position: relative;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  padding: 4px;
}

body.dark-mode .puzzle-board,
body.unlocked-bg .puzzle-board {
  background: rgba(255, 255, 255, 0.08);
}

.puzzle-tile {
  position: absolute;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #667eea;
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: left 0.15s ease, top 0.15s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.puzzle-tile:hover {
  background: #5a6fd6;
}

body.dark-mode .puzzle-tile,
body.unlocked-bg .puzzle-tile {
  background: #7b8ef0;
}
body.dark-mode .puzzle-tile:hover,
body.unlocked-bg .puzzle-tile:hover {
  background: #6a7de0;
}

.puzzle-tile.puzzle-solved {
  background: #48c774;
  box-shadow: 0 0 12px rgba(72, 199, 116, 0.6);
  animation: puzzlePulse 0.6s ease;
}

@keyframes puzzlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.puzzle-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #666;
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}

.puzzle-close:hover {
  background: #888;
}

/* Ambient canvas + toggle */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}

#ambient-canvas.active {
  opacity: 1;
}


/* View toggle — replaces puzzle icon after solve */
.view-toggle {
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.3s ease, color 0.3s ease;
  padding: 8px;
  color: inherit;
}

.view-toggle:hover {
  opacity: 0.8;
}

@media (max-width: 480px) {
  #puzzle-container {
    top: 12px;
    right: 12px;
  }
  .puzzle-icon {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  body.dark-mode .puzzle-icon,
  body.unlocked-bg .puzzle-icon {
    background: rgba(0, 0, 0, 0.6);
  }
  .contact-icons {
    bottom: 12px;
    right: 12px;
    gap: 10px;
    background: rgba(255, 255, 255, 0.85);
    padding: 6px 10px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  body.dark-mode .contact-icons,
  body.unlocked-bg .contact-icons {
    background: rgba(0, 0, 0, 0.6);
  }
  .contact-icons a svg {
    width: 14px;
    height: 14px;
  }
}

/* Puzzle expanded wrapper */
.puzzle-expanded {
  position: relative;
}

.puzzle-pw-row {
  margin-top: 8px;
}

.puzzle-pw-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 8px;
  font-size: 11px;
  font-family: monospace;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  outline: none;
}

.puzzle-pw-input::placeholder {
  font-style: italic;
}

.puzzle-pw-input:focus {
  border-color: #667eea;
}

body.dark-mode .puzzle-pw-input,
body.unlocked-bg .puzzle-pw-input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ddd;
}

/* Circle reveal overlay — use inset:0 to match .home-main positioning exactly */
.reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}

.reveal-overlay .landing {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 0 2rem;
  max-width: 900px;
}

.reveal-overlay .landing-image {
  width: clamp(260px, 38vw, 440px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.reveal-overlay .landing-name {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
  line-height: 1.1;
}

.reveal-overlay .landing-nav {
  display: flex;
  gap: 1.5rem;
}

.reveal-overlay .landing-nav a {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: auto;
}

/* Click peek — shows the other state behind */
.click-peek {
  position: fixed;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 989;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.click-peek.peek-animate {
  animation: peekBounce 1.5s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes peekBounce {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  45% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 1;
  }
  55% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  80% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
  }
}

@keyframes catPeekIn {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  60% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  80% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .reveal-overlay .landing {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    padding: 0 1rem;
  }
  .reveal-overlay .landing-image {
    width: clamp(180px, 55vw, 280px);
  }
  .reveal-overlay .landing-name {
    font-size: 1.4rem;
  }
  .reveal-overlay .landing-nav {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Unlocked state — starry background */
body.unlocked-bg {
  background-color: transparent !important;
  color: #ddd;
  transition: background-color 1.25s ease, color 1.25s ease;
}

body.unlocked-bg h1,
body.unlocked-bg h2,
body.unlocked-bg h3,
body.unlocked-bg h4,
body.unlocked-bg strong,
body.unlocked-bg b {
  color: #eee;
}

body.unlocked-bg a {
  color: #8e9ef5;
}

body.unlocked-bg nav a {
  color: #aaa;
}

body.unlocked-bg .blog-posts li span:first-child {
  color: #aaa;
}

body.unlocked-bg hr {
  border-top-color: #2a2a3a;
}

body.unlocked-bg .title a {
  color: #eee;
}

/* Dark mode (chosen on homepage, persists to other pages) */
html.dark-mode { background: #1a1a1a; }
html.unlocked-bg { background: #0a0a1a; }

body.dark-mode {
  background-color: #1a1a1a !important;
  color: #ddd;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode strong,
body.dark-mode b {
  color: #eee;
}

body.dark-mode a {
  color: #8e9ef5;
}

body.dark-mode nav a {
  color: #aaa;
}

body.dark-mode .blog-posts li span:first-child {
  color: #aaa;
}

body.dark-mode hr {
  border-top-color: #333;
}

body.dark-mode .title a {
  color: #eee;
}

/* Explicit light mode — overrides prefers-color-scheme: dark media queries */
body.light-mode {
  background-color: #fff !important;
  color: #111 !important;
}
body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode h5,
body.light-mode h6,
body.light-mode strong,
body.light-mode b {
  color: #111;
}
body.light-mode a {
  color: #4a5aba;
}
body.light-mode nav a {
  color: #999;
}
body.light-mode nav a:hover {
  color: #111;
}
body.light-mode code,
body.light-mode .highlight,
body.light-mode .code {
  background-color: #f4f4f4;
}
body.light-mode pre code {
  color: #111;
}
body.light-mode blockquote {
  border-left-color: #ddd;
  color: #555;
}
body.light-mode .helptext {
  color: #666;
}
body.light-mode .title a {
  color: #111;
}
body.light-mode .blog-posts li span:first-child {
  color: #999;
}
body.light-mode hr {
  border-top-color: #e0e0e0;
}

/* Now Playing — upper left */
.now-playing {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 1.5s ease, transform 1s ease;
  pointer-events: auto;
  cursor: default;
}

/* Extra top padding when now-playing is visible on non-home pages */
body.has-now-playing {
  padding-top: 5rem;
}

.now-playing.active {
  opacity: 1;
  transform: translateY(0);
}

.np-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 16px;
}

.np-bars span {
  display: block;
  width: 2px;
  background: #667eea;
  border-radius: 1px;
  animation: npBar 0.8s ease-in-out infinite alternate;
}

.np-bars span:nth-child(1) { height: 6px; animation-delay: 0s; }
.np-bars span:nth-child(2) { height: 10px; animation-delay: 0.15s; }
.np-bars span:nth-child(3) { height: 4px; animation-delay: 0.3s; }
.np-bars span:nth-child(4) { height: 8px; animation-delay: 0.45s; }

@keyframes npBar {
  0% { height: 3px; }
  100% { height: 14px; }
}

.np-cover {
  flex-shrink: 0;
  cursor: pointer;
}

.np-cover img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  transition: opacity 0.2s ease;
}

.np-cover:hover img {
  opacity: 0.8;
}

.np-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.np-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
}

.np-title {
  font-size: 0.7rem;
  color: #999;
  font-style: italic;
}

/* Album cover overlay */
.cover-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1002;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
  cursor: pointer;
}

.cover-overlay img {
  max-width: min(80vw, 500px);
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.cover-overlay-info {
  font-size: 0.85rem;
  color: #999;
  font-style: italic;
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .cover-overlay img {
    max-width: 85vw;
    max-height: 60vh;
  }
  .cover-overlay-info {
    font-size: 0.75rem;
    padding: 0 1rem;
    text-align: center;
  }
}

/* Blog unlocked layout — split view */
main.blog-unlocked {
  display: flex;
  gap: 2rem;
  max-width: 1050px;
  transition: max-width 0.8s ease;
}

main.blog-unlocked .blog-main {
  flex: 1;
  min-width: 0;
  animation: slideLeft 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

main.blog-unlocked .blog-main img {
  max-width: 100%;
  height: auto;
}

@keyframes slideLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(0); opacity: 1; }
}

/* Secret Writings panel */
.secret-writings {
  flex: 0 0 280px;
  padding-top: 2rem;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 1.2s ease 0.3s, transform 1s ease 0.3s;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  padding-left: 2rem;
}

.secret-writings.visible {
  opacity: 1;
  transform: translateX(0);
}

.sw-header {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #999;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sw-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ccc;
  margin: 0 0 0.8rem 0;
  font-family: "Apple Garamond", "Garamond", "Source Serif 4", serif;
}

.sw-excerpt {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #aaa;
  font-style: italic;
  margin: 0 0 1.2rem 0;
  cursor: pointer;
}

.sw-dots {
  display: flex;
  gap: 2px;
}

.sw-dot {
  width: 6px;
  height: 6px;
  padding: 5px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  background-clip: content-box;
  transition: background-color 0.4s ease;
  cursor: pointer;
}

.sw-dot.active {
  background-color: #667eea;
}

/* Secret writings — light mode */
body.light-mode .secret-writings {
  border-left-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .sw-header {
  color: #999;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .sw-title {
  color: #333;
}
body.light-mode .sw-title:hover {
  color: #111;
}
body.light-mode .sw-excerpt {
  color: #666;
}
body.light-mode .sw-dot {
  background-color: rgba(0, 0, 0, 0.15);
}
body.light-mode .sw-dot.active {
  background-color: #667eea;
}
@media (max-width: 768px) {
  main.blog-unlocked {
    flex-direction: column;
    gap: 1rem;
  }
  .secret-writings {
    flex: none;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-left: 0;
    padding-top: 1.5rem;
    transform: none;
  }
  .secret-writings.visible {
    transform: none;
  }
  body.light-mode .secret-writings {
    border-top-color: rgba(0, 0, 0, 0.08);
  }
}

/* Skip button in now-playing */
.np-controls {
  display: flex;
  gap: 2px;
  align-items: center;
}

.np-prev,
.np-pause,
.np-skip {
  color: #555;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.np-prev:hover,
.np-pause:hover,
.np-skip:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

/* Hide top chrome on scroll down */
body.topbar-hidden .now-playing.active {
  transform: translateY(-80px) !important;
  opacity: 0 !important;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
body.topbar-hidden #puzzle-container,
body.topbar-hidden .reading-close {
  transform: translateY(-80px);
  opacity: 0 !important;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.now-playing.active,
#puzzle-container,
.reading-close {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (max-width: 640px) {
  .now-playing {
    top: 10px;
    left: 10px;
    gap: 8px;
    max-width: calc(100vw - 60px);
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 12px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  body.dark-mode .now-playing,
  body.unlocked-bg .now-playing {
    background: rgba(0, 0, 0, 0.6);
  }
  .np-cover img {
    width: 32px;
    height: 32px;
  }
  .np-info {
    min-width: 0;
  }
  .np-title {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40vw;
  }
  .np-label {
    font-size: 0.5rem;
  }
  .np-prev, .np-pause, .np-skip {
    padding: 2px 4px;
  }
  .np-prev svg, .np-pause svg, .np-skip svg {
    width: 11px;
    height: 11px;
  }
  body.has-now-playing {
    padding-top: 4rem;
  }
}

/* Queue / History panel */
.np-queue {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 280px;
  max-height: 360px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1101;
  cursor: default;
}

.np-queue.open {
  opacity: 1;
  transform: translateY(0);
}

body.dark-mode .np-queue {
  background: rgba(30, 30, 30, 0.95);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body.unlocked-bg .np-queue {
  background: rgba(12, 12, 30, 0.92);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.np-queue-header {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  padding: 8px 12px 4px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.np-queue-shuffle {
  cursor: pointer;
  color: #999;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1;
  display: flex;
  align-items: center;
}

.np-queue-shuffle:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

body.dark-mode .np-queue-header,
body.unlocked-bg .np-queue-header {
  color: #666;
}

.np-queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.np-queue-item:hover {
  background: rgba(102, 126, 234, 0.08);
}

body.dark-mode .np-queue-item:hover,
body.unlocked-bg .np-queue-item:hover {
  background: rgba(102, 126, 234, 0.15);
}

.np-queue-item.active {
  background: rgba(102, 126, 234, 0.1);
}

body.dark-mode .np-queue-item.active,
body.unlocked-bg .np-queue-item.active {
  background: rgba(102, 126, 234, 0.2);
}

.np-queue-cover {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}

.np-queue-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.np-queue-song {
  font-size: 0.72rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark-mode .np-queue-song {
  color: #ddd;
}

body.unlocked-bg .np-queue-song {
  color: #ccc;
}

.np-queue-artist {
  font-size: 0.62rem;
  color: #888;
}

body.dark-mode .np-queue-artist,
body.unlocked-bg .np-queue-artist {
  color: #666;
}

.np-queue-playing {
  font-size: 0.7rem;
  color: #667eea;
  flex-shrink: 0;
  margin-left: auto;
}

.np-queue-history {
  opacity: 0.65;
}

.np-queue-history:hover {
  opacity: 1;
}

/* Queue scrollbar */
.np-queue::-webkit-scrollbar {
  width: 4px;
}

.np-queue::-webkit-scrollbar-track {
  background: transparent;
}

.np-queue::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

body.dark-mode .np-queue::-webkit-scrollbar-thumb,
body.unlocked-bg .np-queue::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

/* Make np-info clickable for queue toggle */
.np-info {
  cursor: pointer;
}

.np-info:hover .np-title {
  color: #667eea;
}

@media (max-width: 480px) {
  .np-queue {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    min-width: unset;
    max-height: 55vh;
    margin-top: 0;
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
  }
  .np-queue.open {
    transform: translateY(0);
  }
}

/* Lock background scroll when reading */
body.reading-open {
  overflow: hidden;
}

/* Reading close button — shown when reading overlay is open */
.reading-close {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 8px 12px;
  color: #555;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1101;
  transition: transform 0.3s ease, opacity 0.3s ease, color 0.2s ease;
  line-height: 32px;
  box-sizing: border-box;
}
.reading-close:hover {
  color: #999;
}
body.light-mode .reading-close {
  color: #999;
}
body.light-mode .reading-close:hover {
  color: #333;
}
@media (max-width: 640px) {
  .reading-close {
    top: 10px;
    right: 10px;
  }
}

.sw-title {
  cursor: pointer;
}

.sw-title:hover {
  color: #ddd;
}

/* Full reading overlay */
.reading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  z-index: 1000;
  background: #05050f;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.5s ease;
  padding: 4rem 2rem 4rem;
  padding-bottom: env(safe-area-inset-bottom, 2rem);
  -webkit-overflow-scrolling: touch;
}

.reading-back {
  position: fixed;
  top: 28px;
  left: 28px;
  color: #555;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

.reading-back:hover {
  color: #999;
}

.reading-content {
  max-width: 720px;
  margin: 0 auto;
  color: #bbb;
  line-height: 1.85;
  font-size: 1rem;
}

.reading-content h1 {
  color: #ddd;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2.5rem;
  font-family: "Apple Garamond", "Garamond", "Source Serif 4", serif;
}

.reading-content p {
  margin-bottom: 1.3rem;
}

.reading-content ol,
.reading-content ul {
  margin: 0 0 1.3rem 1.5rem;
  padding: 0;
}

.reading-content li {
  margin-bottom: 0.4rem;
}

.reading-content hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 2.5rem 0;
}

/* Reading overlay — light mode */
body.light-mode .reading-overlay {
  background: rgba(255, 255, 255, 0.97);
}
body.light-mode .reading-content {
  color: #444;
}
body.light-mode .reading-content h1 {
  color: #111;
}
body.light-mode .reading-back {
  color: #999;
}
body.light-mode .reading-back:hover {
  color: #333;
}
body.light-mode .reading-content hr {
  border-top-color: rgba(0, 0, 0, 0.1);
}

/* Reading overlay — dark mode (not starry) */
body.dark-mode .reading-overlay {
  background: #1a1a1a;
}

/* Reading overlay — starry mode: semi-transparent so stars show through */
body.unlocked-bg .reading-overlay {
  background: rgba(5, 5, 15, 0.88);
}

@media (max-width: 640px) {
  .reading-overlay {
    padding: 5.5rem 1.2rem 6rem;
  }
  .reading-back {
    top: 16px;
    left: 16px;
    font-size: 0.8rem;
  }
  .reading-content {
    font-size: 0.95rem;
    line-height: 1.75;
  }
  .reading-content h1 {
    font-size: 1.3rem;
    margin-bottom: 2rem;
  }
}

@media (max-width: 640px) {
  body.reading-open .reading-overlay {
    padding-top: 5rem;
  }
}

/* Hide UI chrome when printing */
@media print {
  .contact-icons,
  #puzzle-container,
  .view-toggle,
  .cover-overlay,
  .floating-toc,
  nav,
  footer,
  .draft-notice,
  .post-end-rule {
    display: none !important;
  }
}

/* Hide overlay UI (eye toggle, puzzle, contact icons) on mobile post pages */
@media (max-width: 640px) {
  body.page-post .contact-icons,
  body.page-post #puzzle-container,
  body.page-post .view-toggle,
  body.page-post .cover-overlay {
    display: none !important;
  }
}