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

:root {
  --background-image: url("images/galaxy.png");
  --bg_h: #f9f5d7;
  --bg: #fbf1c7;
  --bg_s: #f2e5bc;
  --bg1: #ebdbb2;
  --bg2: #d5c4a1;
  --bg3: #bdae93;
  --bg4: #a89984;

  --fg: #282828;
  --fg1: #3c3836;
  --fg2: #504945;
  --fg3: #665c54;
  --fg4: #7c6f64;

  --red: #9d0006;
  --green: #79740e;
  --yellow: #b57614;
  --blue: #076678;
  --purple: #8f3f71;
  --aqua: #427b58;
  --orange: #af3a03;
  --gray: #928374;

  --red-dim: #cc2412;
  --green-dim: #98971a;
  --yellow-dim: #d79921;
  --blue-dim: #458598;
  --purple-dim: #b16286;
  --aqua-dim: #689d6a;
  --orange-dim: #d65d0e;
  --gray-dim: #7c6f64;
}

/* Gruvbox (dark) */
[data-theme="gruvbox-dark"] {
  --bg_h: #1d2021;
  --bg: #282828;
  --bg_s: #32302f;
  --bg1: #3c3836;
  --bg2: #504945;
  --bg3: #665c54;
  --bg4: #7c6f64;

  --fg: #fbf1c7;
  --fg1: #ebdbb2;
  --fg2: #d5c4a1;
  --fg3: #bdae93;
  --fg4: #a89984;

  --red: #fb4934;
  --green: #b8bb26;
  --yellow: #fabd2f;
  --blue: #83a598;
  --purple: #d3869b;
  --aqua: #8ec07c;
  --gray: #928374;
  --orange: #fe8019;

  --red-dim: #cc2412;
  --green-dim: #98971a;
  --yellow-dim: #d79921;
  --blue-dim: #458588;
  --purple-dim: #b16286;
  --aqua-dim: #689d6a;
  --gray-dim: #a89984;
  --orange-dim: #d65d0e;
}

/* Gruvbox (light) */
[data-theme="gruvbox-light"] {
  --background-image: url("images/paper.png");
  --bg_h: #f9f5d7;
  --bg: #fbf1c7;
  --bg_s: #f2e5bc;
  --bg1: #ebdbb2;
  --bg2: #d5c4a1;
  --bg3: #bdae93;
  --bg4: #a89984;

  --fg: #282828;
  --fg1: #3c3836;
  --fg2: #504945;
  --fg3: #665c54;
  --fg4: #7c6f64;

  --red: #9d0006;
  --green: #79740e;
  --yellow: #b57614;
  --blue: #076678;
  --purple: #8f3f71;
  --aqua: #427b58;
  --orange: #af3a03;
  --gray: #928374;

  --red-dim: #cc2412;
  --green-dim: #98971a;
  --yellow-dim: #d79921;
  --blue-dim: #458598;
  --purple-dim: #b16286;
  --aqua-dim: #689d6a;
  --orange-dim: #d65d0e;
  --gray-dim: #7c6f64;
}

/* Normal Colors */
.red {
  color: var(--red);
}
.green {
  color: var(--green);
}
.yellow {
  color: var(--yellow);
}
.blue {
  color: var(--blue);
}
.purple {
  color: var(--purple);
}
.aqua {
  color: var(--aqua);
}
.gray {
  color: var(--gray);
}
.orange {
  color: var(--orange);
}
/* Dim Colors */

.red-dim {
  color: var(--red-dim);
}
.green-dim {
  color: var(--green-dim);
}
.yellow-dim {
  color: var(--yellow-dim);
}
.blue-dim {
  color: var(--blue-dim);
}
.purple-dim {
  color: var(--purple-dim);
}
.aqua-dim {
  color: var(--aqua-dim);
}
.gray-dim {
  color: var(--gray-dim);
}
.orange-dim {
  color: var(--orange-dim);
}
/* Foreground Colors */

.fg {
  color: var(--fg);
}
.fg1 {
  color: var(--fg1);
}
.fg2 {
  color: var(--fg2);
}
.fg3 {
  color: var(--fg3);
}
.fg4 {
  color: var(--fg4);
}
/* Background Colors */

.bg-hard {
  color: var(--bg_h);
}
.bg {
  color: var(--bg);
}
.bg-soft {
  color: var(--bg_s);
}
.bg1 {
  color: var(--bg1);
}
.bg2 {
  color: var(--bg2);
}
.bg3 {
  color: var(--bg3);
}
.bg4 {
  color: var(--bg4);
}

@font-face {
  font-family: "JetBrainsMono Nerd";
  src: url("https://cdn.jsdelivr.net/gh/ryanoasis/nerd-fonts/patched-fonts/JetBrainsMono/Regular/complete/JetBrainsMono%20Nerd%20Font%20Complete%20Regular.woff2")
    format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body {
  background-color: var(--bg);
  background-image: var(--background-image);
  font-family: "JetBrainsMono Nerd", monospace;
  background-size: cover;

  /* the background image will be pixel art */
  image-rendering: pixelated;

  font-size: 100%;

  text-align: left;
}
/* ---------- Header & grid share the same centered container ---------- */
.site-header,
.layout {
  width: 95%;
  max-width: 1600px;
  margin: 0 auto;
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 20px; /* spacing between icons */
}

.site-header {
  position: relative;
  background-color: var(--bg);
  border: 3px solid var(--bg4);
  padding: 20px;
  opacity: 0.95;
  border-radius: 8px;
  margin-bottom: 20px;
  color: var(--fg1);
}
.site-header a {
  text-decoration: none;
}

/* ---------- page grid (left - main - right) ---------- */
.layout {
  display: grid;
  /* left / main / right */
  grid-template-columns:
    clamp(140px, 12vw, 260px)
    minmax(600px, 1fr)
    clamp(140px, 12vw, 260px);
  gap: 16px;
  align-items: start;
}

/* ---------- columns stack their child asides ---------- */
.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- box/shared aside styling ---------- */
.box,
aside {
  /* IMPORTANT: don't offset with margins here */
  width: 100%; /* fill the column */
  background-color: var(--bg);
  border: 3px solid var(--bg4);
  border-radius: 8px;
  padding: min(18px, 4%);
  color: var(--fg1);
  text-align: center;
  opacity: 0.95;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr; /* stack everything vertically */
  }
  .left-column,
  .right-column {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .box,
  aside {
    width: clamp(140px, 45%, 320px);
  } /* allow two per row on narrow screens */
}

/* example: keep social grid inside box */
.social_aside {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.social_aside h3 {
  grid-column: span 2;
}

footer {
  background: var(--bg);
  opacity: 0.9;
  color: var(--fg1);

  border: 3px solid;
  border-color: var(--bg4);

  margin-left: 5%;
  margin-right: 5%;
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 10px 20px 10px 20px;

  border-radius: 8px;
}

.gif-grid {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 15px;
  justify-content: center;
}
.gif-grid img {
  width: 60px;
  height: 30px;
  object-fit: stretch;
}

.site-header {
  background-color: var(--bg);
  border: 3px solid var(--bg4);
  padding: 20px;
  opacity: 0.9;
  border-radius: 8px;

  width: 95%;
  max-width: 1600px;
  margin: 0 auto 20px auto;

  position: relative;
}

.site-header,
.layout {
  width: 95%;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}
/* position the clickable anchor at the bottom-right of the header */
.hk-link {
  position: absolute;
  left: 50%;

  transform: translateX(-50%);
  bottom: -10px; /* vertical offset from bottom of header (tweak as needed) */
  display: block;
  width: 60px; /* control size of the anchor */
  height: auto;
  text-decoration: none; /* optional */
}

/* let the image fill the anchor - no absolute positioning here */
.hk-sit {
  display: block;
  width: 100%;
  height: auto; /* preserves aspect ratio */
  pointer-events: none; /* optional: if you want clicks to land on the anchor rather than the image */
  outline: none; /* remove debug outline when done */
}

/* responsive tweak: smaller on small screens */
@media (max-width: 600px) {
  .hk-link {
    width: 56px;
    right: 12px;
    bottom: 4px;
  }
}

.theme-btn {
  width: 100%;
  max-width: 64px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    opacity 0.2s ease;
  user-select: none;
}

a img {
  display: block; /* prevents inline baseline weirdness */
}

/* Press animation */
.theme-btn:active {
  transform: scale(0.85);
}

/* Optional hover effect */
.theme-btn:hover {
  opacity: 0.8;
  text-decoration: none;
}

.cnctn-btn {
  width: 100%;
  max-width: 64px;
  aspect-ratio: 1/1;
  display: inline-block;
  object-fit: contain;
  user-select: none;
  cursor: pointer;
}

.game-container {
  background-color: var(--bg);
  border: 3px solid;
  border-color: var(--bg4);
  color: var(--fg1);
  padding: 0px 20px 20px 20px;
  height: auto;
  width: 80%;
  margin-left: 10%;
  margin-right: 10%;
  margin-bottom: 20px;
  font-family: "JetBrainsMono Nerd", monospace;
  opacity: 0.95;
  border-radius: 8px;
}

.diary-container {
  position: relative; /* important for absolute child (info box) */
  background-color: var(--bg);
  border: 3px solid var(--bg4);
  color: var(--fg1);
  padding: 20px;
  width: 80%;
  margin: 0 auto 20px;
  font-family: "JetBrainsMono Nerd", monospace;
  opacity: 0.95;
  border-radius: 8px;
  box-sizing: border-box;
  overflow: visible;
}

/* Info box top-right */
.info-box {
  position: absolute;
  top: 14px;
  right: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(0, 0, 0, 0.03)
  );
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  border-radius: 8px;
  min-width: 168px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(10, 14, 24, 0.45);
  font-size: 13px;
  color: var(--fg1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}

/* each row inside info box */
.info-box .info-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

/* label (left side) */
.info-box .label {
  font-weight: 600;
  color: var(--fg4);
  opacity: 0.9;
  margin-right: 8px;
  flex: 0 0 auto;
}

/* value (right side) */
.info-box .value {
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* small visual accent (optional) */
.info-box::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(127, 195, 255, 0.02) inset;
}

/* Responsive: on small screens move info box inline above content */
@media (max-width: 700px) {
  .info-box {
    position: static;
    margin-bottom: 12px;
    width: auto;
    align-self: stretch;
    flex-direction: row;
    gap: 12px;
    padding: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .info-box .info-row {
    flex-direction: column;
    align-items: flex-end;
    min-width: 90px;
  }
  .diary-container {
    padding-top: 16px;
  }
}

.permalink {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  word-break: break-all;
}

.permalink a {
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.permalink a:hover {
  opacity: 1;
  text-decoration: underline;
}

.main {
  width: 100%; /* fill grid column */
  background-color: var(--bg);
  border: 3px solid var(--bg4);
  padding: 18px;
  border-radius: 8px;
  color: var(--fg1);
}

h1 {
  color: var(--red-dim);
  text-decoration: underline;
  font-size: 300%;
}
h2 {
  color: var(--yellow-dim);
  text-decoration: underline;
}

h3 {
  color: var(--green-dim);
  text-decoration: underline;
}
h4 {
  color: var(--aqua-dim);
  text-decoration: underline;
}
h5 {
  color: var(--blue-dim);
  text-decoration: underline;
}
h6 {
  color: var(--purple-dim);
  text-decoration: underline;
}
a:link {
  color: var(--blue-dim);
  background-color: transparent;
  text-decoration: none;
}

a:visited {
  color: var(--purple);
  background-color: transparent;
  text-decoration: none;
}

a:hover {
  color: var(--red);
  background-color: transparent;
  text-decoration: underline;
}

a:active {
  color: va(--yellow);
  background-color: transparent;
  text-decoration: underline;
}

.masonry {
  column-count: 4; /* adjust for desktop */
  column-gap: 16px;
}
@media (max-width: 1100px) {
  .masonry {
    column-count: 3;
  }
}
@media (max-width: 700px) {
  .masonry {
    column-count: 2;
  }
}
@media (max-width: 420px) {
  .masonry {
    column-count: 1;
  }
}

.card {
  border: 2px solid;
  border-color: var(--fg4);
  break-inside: avoid;
  margin-bottom: 16px;
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(20, 20, 50, 0.06);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.card img {
  width: 100%;
  height: auto;
  display: block;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(20, 20, 50, 0.09);
}
.meta {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--fg);
  background-color: var(--bg);
}

.multi-column-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px; /* space between columns */
  width: 95%;
  max-width: 1600px;
  margin: 0 auto; /* center the whole grid */
}

.column-box {
  background-color: var(--bg);
  border: 3px solid var(--bg4);
  border-radius: 8px;
  padding: 8px;
  /* text-align: left; */
  color: var(--fg1);
}
