@font-face {
  font-family: 'VCR OSD Mono';
  src: url('VCR_OSD_MONO_1.001.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

/* ── Global settings ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'VCR OSD Mono', Arial, Helvetica, sans-serif;
  background-color: hsla(240, 97%, 43%, 0.913);
  color: #f8f4e3;
  min-height: 100vh;
  padding: 2rem 1.25rem;
  text-transform: uppercase;
}

/* Article page specific styles */
.page-shell.has-absolute-back .article-content {
  font-family: Arial, Helvetica, sans-serif;
  text-transform: none;
  color: #333;
}

.article-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  line-height: 1.7;
  background-color: white;
  padding: 1.5rem;
  margin: 1rem auto 0;
  width: 70%;
  max-width: 1000px;
  min-width: 580px;
  color: #333;
}

.article-content h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
  color: #333;
  font-family: 'VCR OSD Mono', Georgia, serif;
  text-transform: uppercase;
}

@media (max-width: 1200px) {
  .article-content {
    width: 85%;
    min-width: 0;
  }
}

@media (max-width: 860px) {
  .article-content {
    width: 100%;
    padding: 1.5rem;
  }
}

.article-content .date {
  opacity: 0.7;
  margin-bottom: 1rem;
  color: #666;
}

.article-content p {
  max-width: 70ch;
  color: #333;
}

.article-content .references-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1.5rem;
  margin: 1rem 0;
  align-items: center;
}

.article-content .reference-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  font-style: italic;
  align-items: baseline;
}

.article-content .reference-pair span,
.article-content .reference-single {
  color: #333;
  font-style: italic;
}

.article-content .reference-single {
  justify-self: center;
}

.article-content .reference-full {
  grid-column: 1 / -1;
  justify-self: start;
}

.article-figure {
  margin: 1.5rem 0;
  padding: 0;
}

.article-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

.page-shell.has-absolute-back {
  padding-top: 4rem;
}

.contents-list {
  margin-top: 2rem;
  list-style: none;
  display: grid;
  gap: 1rem;
}

.contents-list a {
  color: #f8f4e3;
  text-decoration: none;
  font-size: 1.2rem;
}

.contents-list a:hover {
  color: #ffd02a;
}

.writing-note {
  margin-top: auto;
  color: #4d7eff;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Article page writing note override */
.page-shell.has-absolute-back .writing-note {
  color: #666;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding-bottom: 4rem;
}

.page-shell .writing-note {
  position: absolute;
  bottom: 1.5rem;
  left: 2rem;
  right: 2rem;
  margin-top: 0;
}

.index-nav {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.page-shell.writing-page h1 {
  margin-top: 5rem;
}

.index-nav a {
  color: #f8f4e3;
  text-decoration: none;
  font-size: 1.4rem;
  letter-spacing: 0.12em;
}

.index-nav a:hover {
  text-decoration: none;
  color: #ffd02a;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #f8f4e3;
  text-decoration: none;
  border: 1px solid #f8f4e3;
  padding: 0.6rem 0.9rem;
  max-width: fit-content;
  margin-bottom: 2rem;
}

.back-link:hover {
  background: #f8f4e3;
  color: #050505;
}

/* Article page back button override */
.page-shell.has-absolute-back .back-link {
  color: white;
  border-color: white;
}

.page-shell.has-absolute-back .back-link:hover {
  background: white;
  color: hsla(240, 97%, 43%, 0.913);
}

/* Place the back button in the top-left for error/about pages */
.error-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  margin-bottom: 0; /* override default */
  z-index: 30;
}

.error-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4.5rem 2rem 3rem;
  gap: 4rem;
  position: relative;
  overflow: hidden;
}

.error-sticker {
  position: absolute;
  left: 2rem;
  bottom: 1.5rem;
  width: clamp(220px, 28vw, 360px);
  opacity: 0.95;
  pointer-events: none;
  transform: translateY(10%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 35%, rgba(0,0,0,1) 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 35%, rgba(0,0,0,1) 100%);
}


.error-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
}

.error-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
}

.error-group.center {
  text-align: center;
  flex: 1;
}

.error-label {
  opacity: 0.7;
  font-size: 0.75rem;
}

.error-value {
  font-size: 1rem;
}

.error-time {
  font-size: 0.85rem;
  opacity: 0.8;  position: relative;
  z-index: 20;}

.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: clamp(2rem, 6vw, 5rem);
  letter-spacing: 0.2em;
  line-height: 0.95;
}

.error-message p {
  margin: 0;
}

.error-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  letter-spacing: 0.18em;
  opacity: 0.8;
  font-size: 0.85rem;
}

.page-shell.has-absolute-back {
  padding-top: 4rem;
}

@media (max-width: 650px) {
  .error-header,
  .error-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .error-screen {
    padding: 2rem 1rem;
  }
}
