.navbar-container { visibility: hidden; pointer-events: none; }

body,
body.dark-mode,
body.light-mode,
.page-container {
  background: transparent !important;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif !important;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  inset: 0;
  background: url("/images/night-balcony.jpg") center 42% / cover no-repeat;
  filter: saturate(0.82) brightness(0.58);
  animation: scene-drift 42s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(ellipse 42% 36% at 18% 22%, rgb(70 120 160 / 0.16), transparent 68%),
    radial-gradient(ellipse 36% 32% at 82% 78%, rgb(30 60 100 / 0.14), transparent 70%),
    linear-gradient(180deg, rgb(4 8 14 / 0.28), rgb(4 8 14 / 0.46));
  animation: scene-glow 16s ease-in-out infinite alternate;
}

body.light-mode::before {
  background-image: url("/images/night-balcony.jpg");
  filter: saturate(0.8) brightness(0.78);
}

.home-banner-background {
  transform: none !important;
}

.home-banner-background img {
  filter: saturate(0.82) brightness(0.72);
  object-position: center 42%;
}

@media (max-width: 860px) {
  .home-banner-background {
    background: url("/images/night-balcony-phone.jpg") center / cover no-repeat;
    filter: saturate(0.82) brightness(0.72);
  }

  .home-banner-background img { opacity: 0; }

  body::before,
  body.light-mode::before {
    background-image: url("/images/night-balcony-phone.jpg");
    background-position: center center;
  }

  .home-banner-container .content { transform: translateY(-14vh); }
}

body.light-mode::after {
  background:
    radial-gradient(ellipse 42% 36% at 18% 22%, rgb(255 255 255 / 0.35), transparent 68%),
    linear-gradient(180deg, rgb(255 255 255 / 0.12), rgb(232 240 246 / 0.28));
}

.page-container { position: relative; z-index: 1; }

html.dark,
body.dark-mode {
  --background-color: rgb(6 10 16 / 0.38) !important;
  --background-color-transparent: rgb(6 10 16 / 0.32) !important;
  --background-color-transparent-15: rgb(6 10 16 / 0.16) !important;
  --background-color-transparent-40: rgb(6 10 16 / 0.26) !important;
  --background-color-transparent-80: rgb(6 10 16 / 0.42) !important;
  --second-background-color: rgb(8 12 18 / 0.36) !important;
  --third-background-color: rgb(8 12 18 / 0.3) !important;
  --third-background-color-transparent: rgb(6 10 16 / 0.28) !important;
}

.toc-content-container { display: none !important; }

body.dark-mode .article-content-container,
body.dark-mode .info-card,
body.dark-mode .home-article-item,
body.dark-mode .sidebar-links,
body.dark-mode .sidebar-content,
body.dark-mode .page-template-container,
body.dark-mode footer.footer,
body.dark-mode .article-title-cover {
  background: rgb(6 10 16 / 0.34) !important;
  border: 1px solid rgb(214 228 240 / 0.1) !important;
  box-shadow: 0 18px 40px -28px rgb(0 0 0 / 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  color: #e7f1f8;
}

body.dark-mode .article-content-container {
  background: rgb(6 10 16 / 0.37) !important;
}

.post-page-container.show-toc .article-content-container {
  width: min(980px, calc(100% - 2rem)) !important;
  max-width: none !important;
  margin-inline: auto;
}

body.dark-mode footer.footer {
  border: 0;
  border-top: 1px solid rgb(214 228 240 / 0.12);
  border-radius: 0;
}

.sidebar-links,
.sidebar-content {
  animation: journal-card-in 0.7s ease both;
}

.sidebar-content { animation-delay: 0.12s; }

.sidebar-links .site-info {
  background: transparent !important;
  border-bottom: 1px solid rgb(214 228 240 / 0.12);
}

.sidebar-links .links {
  border-radius: 12px;
  transition: transform 0.28s ease, background-color 0.28s ease;
}

.sidebar-links .links:hover {
  transform: translateX(6px);
  background: rgb(158 196 222 / 0.16) !important;
}

.home-article-item {
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.home-article-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px -22px rgb(90 150 190 / 0.45) !important;
}

body.dark-mode .markdown-body table tr,
body.dark-mode .markdown-body td,
body.dark-mode .markdown-body th {
  background: transparent !important;
  color: #e7f1f8;
  border-color: rgb(214 228 240 / 0.1) !important;
}

body.dark-mode .markdown-body thead th,
body.dark-mode .markdown-body tr:nth-child(2n) {
  background: rgb(255 255 255 / 0.04) !important;
}

.markdown-body .table-scroll {
  width: 100%;
  max-width: 100%;
  margin: 1.15rem 0 1.6rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgb(214 228 240 / 0.18);
  border-radius: 14px;
}

.markdown-body .table-scroll table {
  width: 100% !important;
  border-collapse: collapse;
  font-size: 0.95rem !important;
  line-height: 1.45 !important;
}

.markdown-body .table-scroll:has(th:nth-child(5)) table {
  width: 100% !important;
  min-width: 28rem;
  table-layout: fixed !important;
}

.markdown-body .table-scroll th,
.markdown-body .table-scroll td {
  padding: 0.7rem 1rem !important;
  text-align: left;
  vertical-align: top;
  white-space: normal !important;
  overflow-wrap: break-word;
  border-bottom: 1px solid rgb(214 228 240 / 0.12) !important;
}

.markdown-body .table-scroll:has(th:nth-child(5)) th:nth-child(1),
.markdown-body .table-scroll:has(th:nth-child(5)) td:nth-child(1) { width: 16%; }
.markdown-body .table-scroll:has(th:nth-child(5)) th:nth-child(2),
.markdown-body .table-scroll:has(th:nth-child(5)) td:nth-child(2) { width: 34%; }
.markdown-body .table-scroll:has(th:nth-child(5)) th:nth-child(3),
.markdown-body .table-scroll:has(th:nth-child(5)) td:nth-child(3) { width: 18%; white-space: nowrap !important; }
.markdown-body .table-scroll:has(th:nth-child(5)) th:nth-child(4),
.markdown-body .table-scroll:has(th:nth-child(5)) td:nth-child(4) { width: 22%; }
.markdown-body .table-scroll:has(th:nth-child(5)) th:nth-child(5),
.markdown-body .table-scroll:has(th:nth-child(5)) td:nth-child(5) { width: 12%; white-space: nowrap !important; }

.markdown-body .table-scroll thead th {
  font-size: 0.72rem !important;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d7e4ef;
}

@media (max-width: 780px) {
  .right-side-tools-container { display: none !important; }

  .post-page-container,
  .article-content-container,
  .markdown-body {
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .markdown-body .table-scroll {
    overflow-x: auto !important;
  }

  .markdown-body .table-scroll th,
  .markdown-body .table-scroll td {
    padding: 0.55rem 0.65rem !important;
    font-size: 0.875rem !important;
  }
}

@keyframes journal-card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after { animation: none; }
}

@keyframes scene-drift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.025) translate3d(-0.6%, -0.4%, 0); }
}

@keyframes scene-glow {
  0% { opacity: 0.72; transform: translate3d(0, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, -1.5%, 0); }
}

.journal-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0 clamp(0.8rem, 2.5vw, 1.6rem);
  color: #f4f0e6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  pointer-events: none;
  animation: journal-nav-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.journal-nav a,
.journal-nav button { pointer-events: auto; }

.journal-brand {
  justify-self: start;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: #d5e4f0;
  text-decoration: none;
}

.journal-brand .user { color: #9ec4de; }
.journal-brand .dim { opacity: 0.55; }
.journal-brand .path { color: #f4f0e6; }
.journal-caret {
  display: inline-block;
  margin-left: 0.2ch;
  color: #9ec4de;
  animation: journal-caret 1.05s steps(1) infinite;
}

.journal-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.28rem;
  list-style: none;
  border-radius: 999px;
  background: rgb(6 10 16 / 0.28);
  border: 1px solid rgb(214 228 240 / 0.14);
  box-shadow: 0 10px 28px -16px rgb(0 0 0 / 0.65);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.journal-links a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  font-size: 0.82rem;
  opacity: 0.78;
  transition: opacity 0.2s ease, background 0.25s ease, transform 0.25s ease;
}

.journal-links a:hover { opacity: 1; transform: translateY(-1px); }

.journal-links .num {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: #9ec4de;
}

.journal-links a[aria-current="page"] {
  opacity: 1;
  color: #f7f4ee;
  background: rgb(255 255 255 / 0.1);
  box-shadow: none;
  animation: none;
}

.journal-links a[aria-current="page"] .num { color: #f4f0e6; }

.journal-tools {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.journal-toggle {
  border: 1px solid rgb(214 228 240 / 0.28);
  background: rgb(6 10 16 / 0.28);
  color: inherit;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.journal-toggle:hover { background: rgb(158 196 222 / 0.16); }

.journal-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.journal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ec4de;
  box-shadow: 0 0 8px #9ec4de;
  animation: journal-dot 2s ease-out infinite;
}

.glitter {
  position: fixed;
  inset: 0;
  z-index: 70;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body.light-mode .journal-nav { color: #1c2833; }
body.light-mode .journal-brand,
body.light-mode .journal-brand .path { color: #1c2833; }
body.light-mode .journal-brand .user,
body.light-mode .journal-links .num,
body.light-mode .journal-caret { color: #245a7a; }
body.light-mode .journal-links {
  background: rgb(255 255 255 / 0.55);
  border-color: rgb(36 70 96 / 0.16);
}
body.light-mode .journal-links a[aria-current="page"] {
  color: #f7f4ee;
  background: linear-gradient(135deg, rgb(47 111 150 / 0.95), rgb(28 62 86 / 0.95));
}
body.light-mode .journal-toggle {
  color: #1c2833;
  border-color: rgb(36 70 96 / 0.28);
  background: rgb(255 255 255 / 0.55);
}

@media (max-width: 860px) {
  .journal-brand .host,
  .journal-live .zone { display: none; }
}

@media (max-width: 640px) {
  .journal-nav { grid-template-columns: auto 1fr; height: 56px; }
  .journal-tools { display: none; }
  .journal-links { justify-self: end; }
  .journal-links a { padding: 0.32rem 0.55rem; }
  .journal-links .num { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .journal-nav,
  .journal-links a[aria-current="page"],
  .journal-caret,
  .journal-dot,
  .sidebar-links,
  .sidebar-content,
  .home-article-item { animation: none; }
  .sidebar-links .links:hover,
  .home-article-item:hover { transform: none; }
}

@keyframes journal-nav-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

@keyframes journal-caret { 50% { opacity: 0; } }

@keyframes journal-pill {
  0%, 100% { box-shadow: 0 0 12px rgb(150 196 220 / 0.18); }
  50% { box-shadow: 0 0 22px rgb(150 196 220 / 0.45); }
}

@keyframes journal-dot {
  0% { box-shadow: 0 0 0 0 rgb(158 196 222 / 0.65); }
  70% { box-shadow: 0 0 0 8px rgb(158 196 222 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(158 196 222 / 0); }
}

.page-template-container:has(.contact-grid) {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.page-template-container:has(.contact-grid) h1 {
  color: #f6f1e6;
  text-shadow: 0 10px 28px rgb(0 0 0 / 0.55);
}

.contact-grid {
  display: grid;
  gap: 1.25rem;
  align-items: start;
  margin-top: 28vh;
}

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1.05fr 0.95fr; }
}

.term,
.transmit {
  border-radius: 18px;
  background: rgb(6 10 16 / 0.34);
  border: 1px solid rgb(214 228 240 / 0.12);
  box-shadow: 0 24px 50px -28px rgb(0 0 0 / 0.7);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
  color: #f4f0e6;
}

.term { overflow: hidden; }

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background: rgb(255 255 255 / 0.04);
  border-bottom: 1px solid rgb(214 228 240 / 0.1);
}

.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-dot:nth-child(1) { background: #8fb8d4; }
.term-dot:nth-child(2) { background: #4d7ea3; }
.term-dot:nth-child(3) { background: #2a4d68; }

.term-title { margin-left: 0.55rem; font-size: 0.75rem; color: #b7c9d8; }

.term-body {
  padding: 1.2rem 1.25rem 1.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.7;
}

.term-body > * { margin: 0; }
.term.is-typing .term-body > * { visibility: hidden; }
.term.is-typing .term-body > .is-shown { visibility: visible; }

.cmd { color: #f7f4ee; }
.cmd .ps { margin-right: 0.6ch; color: #9ec4de; }
.cmd .cursor {
  color: #9ec4de;
  animation: journal-caret 1.05s steps(1) infinite;
}
.out { margin-bottom: 0.85rem !important; color: #c5d3df; }

.channels {
  display: grid;
  gap: 0.45rem;
  margin: 0.4rem 0 0.95rem !important;
  padding: 0;
  list-style: none;
}

.channels li { display: flex; align-items: center; gap: 0.5rem; }

.channels a {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: rgb(158 196 222 / 0.08);
  color: #f4f0e6;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.channels a:hover { background: rgb(158 196 222 / 0.18); transform: translateX(4px); }
.ch-key { min-width: 6ch; color: #9ec4de; }
.ch-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-go { margin-left: auto; opacity: 0.55; }

.copy {
  flex-shrink: 0;
  padding: 0.32rem 0.7rem;
  border: 1px solid rgb(158 196 222 / 0.35);
  border-radius: 999px;
  background: transparent;
  color: #e7f1f8;
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}
.copy:hover { background: rgb(158 196 222 / 0.16); }

.transmit { padding: clamp(1.2rem, 3vw, 1.7rem); }
.transmit h2 { margin: 0; font-size: 1.35rem; }
.transmit .hint { margin: 0.35rem 0 1.1rem; color: #c5d3df; font-size: 0.95rem; }
.transmit .trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.transmit[data-state="sending"] .send { opacity: 0.7; cursor: progress; }
.transmit[data-state="sent"] .fine { color: #8ee0b0; }
.transmit[data-state="error"] .fine { color: #ffb4c0; }

.field { display: grid; gap: 0.35rem; margin-bottom: 0.85rem; }
.field > span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9eb0c0;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgb(158 196 222 / 0.2);
  border-radius: 12px;
  background: rgb(4 8 14 / 0.45);
  color: #f4f0e6;
  font: inherit;
  font-size: 0.95rem;
}
.field textarea { min-height: 120px; resize: vertical; }
.field select { appearance: none; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgb(158 196 222 / 0.7);
  box-shadow: 0 0 0 3px rgb(80 130 170 / 0.2);
}
.send {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #6ea4c8, #2f5f82);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.send:hover { transform: translateY(-2px); }
.fine { margin: 0.7rem 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; color: #b7c9d8; }

@media (max-width: 640px) {
  .channels li { flex-wrap: wrap; }
  .channels a { width: 100%; }
}

html,
body.dark-mode,
body.light-mode {
  --primary-color: #7eafd0;
  --selection-color: #9ec4de;
  --copyright-info-color: #9ec4de;
}

.fa-heart { color: #9ec4de !important; }

html.dark .home-article-thumbnail img,
html.dark .article-content-container img,
img[src*="post-aws-paths-cover"],
img[src*="post-burp"] {
  filter: none !important;
  --tw-brightness: brightness(1);
  --tw-hue-rotate: hue-rotate(0deg);
  --tw-sepia: sepia(0);
  --tw-saturate: saturate(1);
}

.page-template-container:has(.tag-list),
.page-template-container:has(.tag-post-list),
.page-template-container:has(.category-list-content) {
  background: rgb(6 10 16 / 0.34) !important;
  border: 1px solid rgb(214 228 240 / 0.12) !important;
  box-shadow: 0 24px 50px -28px rgb(0 0 0 / 0.7);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.page-template-container:has(.tag-list) .page-title-header,
.page-template-container:has(.tag-post-list) .tag-name,
.page-template-container:has(.category-list-content) .page-title-header {
  color: #f6f1e6;
  text-shadow: 0 10px 28px rgb(0 0 0 / 0.45);
}

.tag-list a {
  filter: none !important;
  background: rgb(255 255 255 / 0.06) !important;
  color: #e7f1f8 !important;
  border: 1px solid rgb(214 228 240 / 0.16);
  box-shadow: none !important;
  font-size: 0.82rem !important;
  padding: 0.38rem 0.7rem !important;
}

.tag-list a::after {
  background: rgb(158 196 222 / 0.16) !important;
  color: #d5e6f2 !important;
}

.tag-list a:hover {
  filter: none !important;
  background: rgb(255 255 255 / 0.12) !important;
  color: #fff !important;
}

.markdown-body,
.article-content-container,
.article-title,
.home-article-title,
button {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif !important;
}

.article-content-container .markdown-body {
  font-size: 16px !important;
  line-height: 1.65 !important;
}

.article-content-container .markdown-body h1,
.article-content-container .article-title {
  font-size: 1.85rem !important;
  line-height: 1.25 !important;
}

.article-content-container .markdown-body h2 {
  font-size: 1.3rem !important;
}

.markdown-body img,
.article-content-container img {
  cursor: default;
}

.home-article-thumbnail img { cursor: pointer; }

.shot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 4vh 4vw;
  background: rgb(4 8 14 / 0.82);
  backdrop-filter: blur(8px);
}

.shot[hidden] { display: none; }

.shot img {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.55);
  animation: shot-in 0.22s ease;
}

.shot-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  border: 1px solid rgb(214 228 240 / 0.2);
  border-radius: 999px;
  background: rgb(6 10 16 / 0.55);
  color: #e7f1f8;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

@keyframes shot-in {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
