/* Site-wide day / night theme. Night (dark) is the default look. */

.theme-toggle {
  position: fixed; top: 1.1rem; right: 1.1rem; z-index: 120;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .8rem; border-radius: 999px;
  background: rgba(11, 16, 33, .9); color: #dbe6f5;
  border: 1px solid rgba(0, 229, 255, .3);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: "Inter", "Mukta", "Segoe UI", system-ui, sans-serif;
  font-size: .82rem; font-weight: 700; letter-spacing: .04em; line-height: 1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.theme-toggle:hover { box-shadow: 0 0 18px rgba(0, 240, 255, .4); color: #00e5ff; }
.theme-toggle:focus-visible { outline: 2px solid #00e5ff; outline-offset: 2px; }
.theme-toggle .t-icon { font-size: 1rem; line-height: 1; }
.theme-toggle .t-sun { display: none; }

html[data-theme="day"] .theme-toggle {
  background: #fff; color: #16233a; border-color: rgba(20, 40, 70, .22);
}
html[data-theme="day"] .theme-toggle:hover {
  color: #00778f; box-shadow: 0 10px 26px -18px rgba(20, 40, 70, .6);
}
html[data-theme="day"] .theme-toggle .t-sun { display: inline; }
html[data-theme="day"] .theme-toggle .t-moon { display: none; }

/* Single post pages */
html[data-theme="day"] {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #eef3fa;
  --line: rgba(20, 40, 70, .16);
  --cyan: #00778f;
  --pink: #b3165f;
  --text: #16233a;
  --muted: #55688a;
}
html[data-theme="day"] body { background: #f4f7fb; color: #16233a; }
html[data-theme="day"] a { color: #00778f; }
html[data-theme="day"] a:hover { color: #005f70; }
html[data-theme="day"] header.post-head {
  background: rgba(255, 255, 255, .92); border-bottom-color: rgba(20, 40, 70, .14);
}
html[data-theme="day"] .brand { color: #0d1a2b; text-shadow: none; }
html[data-theme="day"] .back { color: #55688a; border-color: rgba(20, 40, 70, .22); }
html[data-theme="day"] .back:hover { color: #00778f; border-color: #00778f; }
html[data-theme="day"] h1.post-title { color: #0d1a2b; }
html[data-theme="day"] .post-body {
  background: #ffffff; border-color: rgba(20, 40, 70, .14);
  box-shadow: 0 20px 50px -34px rgba(20, 40, 70, .45);
}
html[data-theme="day"] .post-body h1,
html[data-theme="day"] .post-body h2,
html[data-theme="day"] .post-body h3,
html[data-theme="day"] .post-body h4 { color: #0d1a2b; }
html[data-theme="day"] .post-body pre {
  background: #eef3fa; color: #16233a; border-color: rgba(20, 40, 70, .16);
}
html[data-theme="day"] .post-body code { background: rgba(0, 119, 143, .1); color: #0d3f4a; }
html[data-theme="day"] .post-body pre code { background: none; color: inherit; }
html[data-theme="day"] .post-body blockquote {
  background: rgba(0, 119, 143, .06); color: #25384f; border-left-color: #00778f;
}
html[data-theme="day"] .post-body th,
html[data-theme="day"] .post-body td { border-color: rgba(20, 40, 70, .16); }
html[data-theme="day"] .post-body thead th { background: rgba(0, 119, 143, .08); color: #0d1a2b; }
html[data-theme="day"] .post-body tbody tr:nth-child(even) { background: rgba(20, 40, 70, .03); }
html[data-theme="day"] .tag { color: #b3165f; border-color: rgba(179, 22, 95, .4); }
html[data-theme="day"] .free-tools {
  background: rgba(0, 119, 143, .06); border-color: rgba(0, 119, 143, .26);
  border-left-color: #00778f;
}
html[data-theme="day"] .free-tools .ft-title { color: #16233a !important; }
html[data-theme="day"] .post-foot a { color: #16233a; border-color: rgba(20, 40, 70, .18); }
html[data-theme="day"] .post-foot a:hover { color: #00778f; border-color: #00778f; }
html[data-theme="day"] footer.site-foot { border-top-color: rgba(20, 40, 70, .14); color: #55688a; }

@media (max-width: 520px) {
  .theme-toggle { top: .7rem; right: .7rem; padding: .42rem .62rem; font-size: .74rem; }
}

/* Keep the toggle inside the post header so it never covers the back link */
header.post-head .theme-toggle {
  position: static; flex: 0 0 auto; margin-left: .6rem;
  padding: .32rem .7rem; font-size: .74rem;
}
@media (max-width: 520px) {
  header.post-head .theme-toggle { top: auto; right: auto; padding: .3rem .55rem; }
}

/* Static info pages (pages.css): about, contact, policy pages, profile */
html[data-theme="day"] {
  --ink: #1b1430;
  --soft: rgba(27, 20, 48, .72);
  --line: rgba(27, 20, 48, .14);
  --glass: rgba(255, 255, 255, .84);
  --pink: #8b2fb0;
  --shadow: 0 24px 54px -34px rgba(27, 20, 48, .35);
}
html[data-theme="day"] body {
  background: linear-gradient(135deg, #eef2ff 0%, #f8edff 45%, #fdeaf6 100%) fixed;
  color: #1b1430;
}
html[data-theme="day"] body::before {
  background:
    radial-gradient(circle at 12% 8%, rgba(91, 33, 182, .10), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(162, 28, 175, .14), transparent 50%);
}
html[data-theme="day"] a { color: #7c2ea8; }
html[data-theme="day"] a:hover { color: #4c1d95; }
html[data-theme="day"] .brand,
html[data-theme="day"] .brand:hover { color: #1b1430; }
html[data-theme="day"] .brand-mark { filter: brightness(0); }
html[data-theme="day"] .brand-text span { color: rgba(27, 20, 48, .65); }
html[data-theme="day"] .topnav a {
  color: #1b1430; background: rgba(27, 20, 48, .06); border-color: rgba(27, 20, 48, .16);
}
html[data-theme="day"] .topnav a:hover { background: rgba(27, 20, 48, .12); }
html[data-theme="day"] .topnav a[aria-current="page"] {
  background: rgba(91, 33, 182, .14); border-color: rgba(91, 33, 182, .42);
}
html[data-theme="day"] .card {
  background: rgba(255, 255, 255, .84); border-color: rgba(27, 20, 48, .10);
  box-shadow: 0 24px 54px -34px rgba(27, 20, 48, .35);
}
html[data-theme="day"] .card::after {
  background: radial-gradient(ellipse at top left, rgba(91, 33, 182, .08), transparent 60%);
}
html[data-theme="day"] p,
html[data-theme="day"] ul,
html[data-theme="day"] ol { color: rgba(27, 20, 48, .86); }
html[data-theme="day"] p.lead,
html[data-theme="day"] strong { color: #1b1430; }
html[data-theme="day"] .avatar {
  border-color: rgba(27, 20, 48, .18); background: rgba(91, 33, 182, .08);
}
html[data-theme="day"] .avatar-initials { color: rgba(27, 20, 48, .8); }
html[data-theme="day"] .pill {
  color: #1b1430; background: rgba(91, 33, 182, .08); border-color: rgba(91, 33, 182, .2);
}
html[data-theme="day"] .info {
  background: rgba(27, 20, 48, .05); border-color: rgba(27, 20, 48, .12);
}
html[data-theme="day"] .socials a {
  color: #1b1430; background: rgba(27, 20, 48, .06); border-color: rgba(27, 20, 48, .14);
}
html[data-theme="day"] .socials a:hover { background: rgba(27, 20, 48, .12); }
html[data-theme="day"] .btn {
  color: #1b1430; background: rgba(27, 20, 48, .08); border-color: rgba(27, 20, 48, .2);
}
html[data-theme="day"] .btn:hover { background: rgba(27, 20, 48, .14); color: #1b1430; }
html[data-theme="day"] .btn-solid { background: #5b21b6; color: #fff; border-color: transparent; }
html[data-theme="day"] .btn-solid:hover { background: #4c1d95; color: #fff; }
html[data-theme="day"] .page-footer { color: rgba(27, 20, 48, .72); }
html[data-theme="day"] .page-footer a { color: #1b1430; }
html[data-theme="day"] .page-footer .visit-pill {
  color: #1b1430; background: rgba(27, 20, 48, .06);
}
html[data-theme="day"] .updated { color: rgba(27, 20, 48, .65); }

/* info pages: toggle sits in the top bar, not floating over the nav */
.topbar .theme-toggle { position: static; flex: 0 0 auto; margin-left: .2rem; padding: .34rem .7rem; font-size: .76rem; }
