/* =========================================================================
   FONTS
   Put your .ttf files inside a folder named "font" right next to this
   CSS file, e.g.:
     /diary.css
     /diary.html
     /font/Relationship of mélodrame.ttf
     /font/VCR.ttf
     /font/CaviarDreams.ttf
========================================================================= */
/* End www.Cursors-4U.com Code */
::selection {
  background: #0000FF;
  color: #ffffff; /* optional: makes highlighted text white */
}

@font-face {
  font-family: "Melodrame";
  src: url("font/Relationship of mélodrame.ttf") format("truetype");
}

@font-face {
  font-family: "VCR";
  src: url("font/VCR.ttf");
}

@font-face {
  font-family: "CaviarDreams";
  src: url("font/CaviarDreams.ttf");
}

@font-face {
  font-family: "StarryType[1]";
  src: url("font/StarryType[1].ttf");
}

@font-face {
  font-family: "junipy";
  src: url("font/junipy.ttf");
}

@font-face {
  font-family: "PixelOperator";
  src: url("font/PixelOperator.ttf");
}

/* =========================================================================
   RESET / BASE
========================================================================= */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #1a1a1a; /* fallback color while the video loads */
  color: #d8d6d2;
  font-family: "VCR", monospace;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Everything is left-aligned now: content hugs the left edge of the
   screen and text reads left-to-right as normal. */
body {
  display: flex;
  justify-content: flex-start;
  text-align: left;
}

a {
  color: #cfd3d6;
  text-decoration: none;
  border-bottom: 1px dotted rgba(207, 211, 214, 0.4);
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover,
a:focus-visible {
  color: #ffffff;
  border-color: #ffffff;
}

/* =========================================================================
   BACKGROUND GIF
   Fixed behind everything. Slightly softened + warmed so it doesn't
   compete with the lighter, rounder widgets on top of it.
========================================================================= */

:root {
  --tile-size: 260px;
}
#bg-gif {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
    filter: saturate(0.85) brightness(0.92) contrast(1.05);
}

.dark-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2;
    pointer-events: none;
}

.page {
    position: relative;
    z-index: 10;
}
/* =========================================================================
   CRT EFFECT
========================================================================= */

.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
}

/* subtle screen flicker */
.crt::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(0,0,0,0) 50%,
      rgba(0,0,0,0.18) 50%
    ),
    linear-gradient(
      180deg,
      rgba(255,0,0,0.05),
      rgba(0,255,0,0.02),
      rgba(0,0,255,0.05)
    );
  background-size:
    2px 100%,
    100% 3px;
  opacity: .60;
  mix-blend-mode: screen;
  pointer-events: none;
}

.crt::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(18,16,16,0.08);
  opacity: 0;
  pointer-events: none;
  animation: flicker .16s infinite;
}

@keyframes flicker {
  0%   { opacity: 0.12; }
  5%   { opacity: 0.18; }
  10%  { opacity: 0.09; }
  15%  { opacity: 0.22; }
  20%  { opacity: 0.11; }
  25%  { opacity: 0.16; }
  30%  { opacity: 0.08; }
  35%  { opacity: 0.19; }
  40%  { opacity: 0.13; }
  45%  { opacity: 0.05; }
  50%  { opacity: 0.17; }
  55%  { opacity: 0.09; }
  60%  { opacity: 0.21; }
  65%  { opacity: 0.14; }
  70%  { opacity: 0.07; }
  75%  { opacity: 0.16; }
  80%  { opacity: 0.11; }
  85%  { opacity: 0.20; }
  90%  { opacity: 0.09; }
  95%  { opacity: 0.15; }
  100% { opacity: 0.12; }
}

@media (prefers-reduced-motion: reduce) {
  .crt::after { animation: none; }
  #bg-video { display: none; }
  html, body { background: #1a1a1a; }
}

/* =========================================================================
   PAGE LAYOUT
========================================================================= */

.page {
  position: relative;
  z-index: 10;

  width: 100%;
  max-width: 620px;
  margin: 0 0 0 6vw;
  padding: 6vh 0 8vh;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
}
/* =========================================================================
   WIDGET / GLASSMORPHISM BASE
   Every "window" on the page shares this look: a light, rounded frosted
   glass card with a soft border and a titlebar strip up top like a
   little desktop app — mac-style traffic-light dots included.
========================================================================= */

.widget {
    position: relative;
    z-index: 20;
  width: 100%;
  background: rgba(60, 60, 66, 0.33);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.widget:hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-family: "VCR", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: rgba(216, 214, 210, 0.75);
}

.titlebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* mac-style traffic light dots, sat before the titlebar label */
.traffic-lights {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.widget-body {
  padding: 24px 28px;
}

/* =========================================================================
   HEADER WIDGET
========================================================================= */

.site-title {
  font-family: "StarryType[1]", "CaviarDreams", serif;
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
  color: #f0efec;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
}

.site-tagline {
  font-family: "CaviarDreams", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: rgba(216, 214, 210, 0.6);
  margin: 0 0 18px;
}

.site-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-family: "VCR", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.site-nav a {
  border: none;
}

.site-nav a::before {
  content: "› ";
  opacity: 0.6;
}

/* =========================================================================
   ENTRY WIDGET (single-entry viewer with prev/next)
========================================================================= */

.entry-meta {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  font-family: "VCR", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: rgba(200, 200, 205, 0.7);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.entry-title {
  font-family: "CaviarDreams", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: #f0efec;
}

.entry-body p {
  margin: 0 0 14px;
  color: rgba(216, 214, 210, 0.9);
  font-size: 0.8rem;
  line-height: 1.7;
}

.entry-body p:last-child {
  margin-bottom: 0;
}

/* only the current entry is shown; the pagination script toggles this */
.entry-page {
  display: none;
}

.entry-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.entry-nav-btn {
  font-family: "VCR", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: rgba(216, 214, 210, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.entry-nav-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.entry-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ---- images inside entries ---- */

.entry-img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: block;
  margin: 14px 0;
  filter: grayscale(20%);
}

.entry-img-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 14px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  float: left;
  clear: both;
  max-width: 100%;
}

.entry-img-caption {
  font-family: "VCR", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: rgba(216, 214, 210, 0.55);
}

/* =========================================================================
   FOOTER
   Plain text, no glass container.
========================================================================= */

.site-footer-text {
  width: 100%;
  padding: 4px 6px 0;
  font-family: "VCR", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: rgba(216, 214, 210, 0.5);
  text-transform: uppercase;
}

.site-footer-text p {
  margin: 0;
}

/* =========================================================================
   RESPONSIVE
========================================================================= */

@media (max-width: 700px) {
  .page {
    max-width: 92vw;
    margin-left: 4vw;
    padding: 5vh 0 6vh;
  }

  .site-title {
    font-size: 2rem;
  }

  .entry-img-wrap {
    float: none;
  }
}