@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

:root {
  --bg: #0a0a0a;
  --green: #39ff14;
  --dim: #1a3a0a;
  --muted: #4a7a2a;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--green);
  font-family: 'Press Start 2P', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

/* CRT scanlines */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
  text-align: center;
  padding: 2rem;
}

/* Header */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.subtitle {
  font-size: 0.5rem;
  letter-spacing: 0.4em;
  color: var(--muted);
}

.title {
  font-size: clamp(1.4rem, 5vw, 2.8rem);
  letter-spacing: 0.15em;
  text-shadow:
    0 0 10px var(--green),
    0 0 30px var(--green),
    0 0 60px rgba(57, 255, 20, 0.3);
  animation: flicker 6s infinite;
}

/* Menu */
.menu {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: flex-start;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.1s;
  position: relative;
}

.menu-item .cursor {
  opacity: 0;
  color: var(--green);
  font-size: 0.6rem;
  transition: opacity 0.1s;
}

.menu-item:hover {
  color: var(--green);
  text-shadow:
    0 0 8px var(--green),
    0 0 20px rgba(57, 255, 20, 0.4);
}

.menu-item:hover .cursor {
  opacity: 1;
  animation: blink 0.8s step-end infinite;
}

/* Footer */
footer p {
  font-size: 0.4rem;
  letter-spacing: 0.3em;
  color: var(--dim);
}

/* Animations */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes flicker {
  0%, 95%, 97%, 100% { opacity: 1; }
  96%                { opacity: 0.85; }
  96.5%              { opacity: 1; }
  98%                { opacity: 0.9; }
}

/* ── Inner pages ─────────────────────────────── */

.page {
  max-width: 680px;
  width: 100%;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  overflow-y: auto;
  min-height: 100vh;
  justify-content: flex-start;
  align-items: flex-start;
}

body.inner {
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}

.back-link {
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.back-link:hover {
  color: var(--green);
}

.page-title {
  font-size: clamp(0.9rem, 3vw, 1.4rem);
  letter-spacing: 0.15em;
  text-shadow: 0 0 10px var(--green), 0 0 30px rgba(57,255,20,0.3);
  border-bottom: 1px solid var(--dim);
  padding-bottom: 1.5rem;
  width: 100%;
}

.page-body {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 2;
  color: #a0c890;
  font-weight: normal;
}

.page-body p + p {
  margin-top: 1.2rem;
}

/* Writings list */
.writings-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.writing-item a {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.writing-item a:hover {
  color: var(--green);
  text-shadow: 0 0 8px var(--green);
}

.writing-date {
  font-size: 0.4rem;
  color: var(--dim);
  letter-spacing: 0.2em;
}
