@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");

/* --- CSS VARIABLES --- */
:root {
  --bg: #ece4d2; /* sun-bleached paper / panel base */
  --panel: #ddd3b8; /* recessed panel surface */
  --panel-edge: #c6b994; /* panel trim / hairline */
  --primary: #2b3022; /* deep olive-black ink */
  --dim: #93886a; /* faded brass / dust */
  --amber: #e8742a; /* burnt-orange indicator */
  --red: #b8432f; /* rust warning */
  --cyan: #4d7a6e; /* oxidised copper-teal */
  --sun: #ecb949; /* solar-cell yellow */
  --shadow: #c7bb9c; /* flat offset shadow */
  --font-mono: "Space Mono", "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

/* --- GLOBAL & PANEL EFFECTS --- */
body,
html {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1.55;
  height: 100%;
  overflow-x: hidden;
}

/* Sun-glow corner + halftone grain, sitting over the content */
body::before {
  content: " ";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-image:
    radial-gradient(circle at 90% 4%, rgba(236, 185, 73, 0.3), transparent 38%),
    radial-gradient(rgba(43, 48, 34, 0.05) 1px, transparent 1px),
    repeating-linear-gradient(
      135deg,
      rgba(232, 116, 42, 0.04) 0px,
      rgba(232, 116, 42, 0.04) 2px,
      transparent 2px,
      transparent 14px
    );
  background-size:
    auto,
    6px 6px,
    auto;
  z-index: 999;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* The whole page is one console housing */
.terminal {
  padding: 28px 32px 24px;
  max-width: 940px;
  margin: 40px auto;
  background: var(--panel);
  border: 3px solid var(--primary);
  border-radius: 10px;
  box-shadow: 10px 10px 0 var(--shadow);
  text-shadow: none;
  animation: flicker 6s ease-in-out infinite;
}

@keyframes flicker {
  0% {
    box-shadow: 10px 10px 0 var(--shadow);
  }
  50% {
    box-shadow: 8px 8px 0 var(--shadow);
  }
  100% {
    box-shadow: 10px 10px 0 var(--shadow);
  }
}

/* --- MASTHEAD --- */
.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 3px solid var(--primary);
  padding-bottom: 18px;
  margin-bottom: 6px;
}

.masthead-id {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Reactor / solar-cell emblem — the page's signature mark */
.emblem {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  background: radial-gradient(
    circle at 35% 35%,
    var(--sun) 0%,
    var(--amber) 55%,
    var(--primary) 100%
  );
  box-shadow:
    0 0 0 3px var(--panel),
    0 0 0 6px var(--primary);
}

.emblem::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px dashed var(--dim);
  border-radius: 50%;
}

.masthead-title {
  font-size: 1.4em;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: 0;
}

.masthead-tagline {
  margin: 4px 0 0;
  font-size: 0.75em;
  letter-spacing: 2px;
  color: var(--dim);
  text-transform: uppercase;
}

.masthead-meta {
  text-align: right;
  font-size: 0.75em;
  letter-spacing: 2px;
  color: var(--dim);
  text-transform: uppercase;
  line-height: 1.8;
}

.masthead-meta .accent-amber {
  font-weight: 700;
}

/* --- NAV MENU (toggle-switch row) --- */
.nav-menu {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 28px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  cursor: pointer;
  padding: 6px 14px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  background: var(--bg);
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-item::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 10px;
  background: var(--dim);
}

.nav-item:hover {
  background-color: var(--amber);
  color: var(--bg);
  text-shadow: none;
}

.nav-item:hover::before {
  background: var(--bg);
  box-shadow: 0 0 6px var(--bg);
}

/* --- UTILITY CLASSES --- */
.prompt {
  color: var(--amber);
  font-weight: bold;
  margin-right: 8px;
}

.prompt-user {
  color: var(--primary);
  font-weight: bold;
}

.prompt-dir {
  color: var(--cyan);
}

/* Indicator-light cursor */
.cursor {
  display: inline-block;
  width: 9px;
  height: 16px;
  background-color: var(--amber);
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(232, 116, 42, 0.6);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
}

.accent-amber {
  color: var(--amber);
}
.accent-red {
  color: var(--red);
}
.accent-cyan {
  color: var(--cyan);
}
.dim-text {
  color: var(--dim);
}

a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted var(--cyan);
}

a:hover {
  background-color: var(--amber);
  color: var(--bg);
  border-color: var(--amber);
  text-shadow: none;
}

/* --- LAYOUT SECTIONS --- */
/* Every module is a recessed panel with a stencilled unit tag */
.section {
  position: relative;
  margin: 0 0 30px;
  padding: 20px 18px 18px;
  background: rgba(236, 228, 210, 0.45);
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
}

.section[data-unit]::before {
  content: attr(data-unit);
  position: absolute;
  top: -11px;
  left: 14px;
  background: var(--primary);
  color: var(--bg);
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 3px;
}

.ascii-line {
  color: var(--dim);
  margin: 10px 0;
  letter-spacing: 2px;
}

/* Boot log readout */
#boot-log {
  border: 1px dashed var(--dim);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 30px;
  font-size: 0.85em;
  color: var(--dim);
  min-height: 22px;
  background: rgba(43, 48, 34, 0.04);
}

#boot-log:empty {
  display: none;
}

/* Social Links / project listing rows */
.social-link {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 5px 0;
  padding: 4px 6px;
  border-radius: 3px;
}

.social-link:hover {
  background: rgba(147, 136, 106, 0.12);
}

.social-link .key {
  width: 100px;
  color: var(--cyan);
  text-transform: uppercase;
  font-weight: bold;
}

/* Discord status readout */
#discord-status.key {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid var(--dim);
  border-radius: 4px;
  background: var(--bg);
  color: var(--primary);
}

#discord-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

/* Ricing Showcase — equipment modules */
.rice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.rice-card {
  border: 2px solid var(--primary);
  background-color: var(--bg);
  padding: 14px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
}

.rice-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    45deg,
    var(--amber) 0 6px,
    var(--sun) 6px 12px
  );
}

.rice-card > * {
  margin-top: 8px;
}

.rice-card:hover {
  border-color: var(--amber);
  box-shadow: 6px 6px 0 var(--amber);
  transform: translate(-3px, -3px);
}

.rice-img-container {
  width: auto;
  height: auto;
  min-height: 150px;
  border: 1px dashed var(--dim);
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  background: rgba(147, 136, 106, 0.08);
  position: relative;
}

/* cassette reel holes in the preview frame's corners */
.rice-img-container::before,
.rice-img-container::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--dim);
  border-radius: 50%;
  background: var(--bg);
}

.rice-img-container::before {
  left: 8px;
}
.rice-img-container::after {
  right: 8px;
}

/* Anime archive — file listing */
.anime-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 15px;
  margin: 0;
  padding: 5px 6px;
  border-radius: 3px;
}

.anime-item:nth-child(even) {
  background: rgba(147, 136, 106, 0.1);
}

.anime-item:hover {
  background: var(--sun);
  color: var(--primary);
  text-shadow: none;
}

.anime-item:hover a {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.anime-item .key {
  width: 150px;
  color: var(--cyan);
  text-transform: uppercase;
  font-weight: bold;
}

/* Footer — manufacturer nameplate */
#footer {
  border-top: 3px solid var(--primary);
  padding-top: 14px;
  margin-top: 40px;
  font-size: 12px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
  .terminal {
    margin: 16px;
    padding: 18px 16px;
    box-shadow: 6px 6px 0 var(--shadow);
  }

  .masthead {
    flex-direction: column;
  }

  .masthead-meta {
    text-align: left;
  }

  .anime-item .key,
  .social-link .key {
    width: auto;
  }

  .nav-item {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
}

/* --- ACCESSIBILITY --- */
a:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .terminal,
  .cursor,
  .masthead-id .emblem {
    animation: none !important;
  }
}
